Skip to main content

script/
test.rs

1/* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
5// For compile-fail tests only.
6// pub use script_bindings::cell::DomRefCell;
7// pub use crate::dom::bindings::root::Dom;
8pub use crate::dom::bindings::str::{ByteString, DOMString};
9// pub use crate::dom::node::Node;
10
11pub mod area {
12    pub use crate::dom::html::htmlareaelement::{Area, Shape};
13}
14
15#[expect(non_snake_case)]
16pub mod size_of {
17    use std::mem::size_of;
18
19    use crate::dom::characterdata::CharacterData;
20    use crate::dom::element::Element;
21    use crate::dom::element::storage::ContentAttributeData;
22    use crate::dom::eventtarget::EventTarget;
23    use crate::dom::html::htmldivelement::HTMLDivElement;
24    use crate::dom::html::htmlelement::HTMLElement;
25    use crate::dom::html::htmlimageelement::HTMLImageElement;
26    use crate::dom::html::htmlscriptelement::HTMLScriptElement;
27    use crate::dom::html::htmlspanelement::HTMLSpanElement;
28    use crate::dom::html::htmlvideoelement::HTMLVideoElement;
29    use crate::dom::node::Node;
30    use crate::dom::text::Text;
31
32    pub fn CharacterData() -> usize {
33        size_of::<CharacterData>()
34    }
35
36    pub fn Element() -> usize {
37        size_of::<Element>()
38    }
39
40    pub fn EventTarget() -> usize {
41        size_of::<EventTarget>()
42    }
43
44    pub fn HTMLDivElement() -> usize {
45        size_of::<HTMLDivElement>()
46    }
47
48    pub fn HTMLElement() -> usize {
49        size_of::<HTMLElement>()
50    }
51
52    pub fn HTMLImageElement() -> usize {
53        size_of::<HTMLImageElement>()
54    }
55
56    pub fn HTMLScriptElement() -> usize {
57        size_of::<HTMLScriptElement>()
58    }
59
60    pub fn HTMLSpanElement() -> usize {
61        size_of::<HTMLSpanElement>()
62    }
63
64    pub fn HTMLVideoElement() -> usize {
65        size_of::<HTMLVideoElement>()
66    }
67
68    pub fn Node() -> usize {
69        size_of::<Node>()
70    }
71
72    pub fn Text() -> usize {
73        size_of::<Text>()
74    }
75
76    pub fn ContentAttributeData() -> usize {
77        size_of::<ContentAttributeData>()
78    }
79}
80
81pub mod srcset {
82    pub use crate::dom::srcset::{Descriptor, ImageSource, parse_a_srcset_attribute};
83}
84
85pub mod timeranges {
86    pub use crate::dom::timeranges::TimeRangesContainer;
87}
88
89pub mod text_input {
90    pub use embedder_traits::EditingDirection;
91
92    pub use crate::dom::html::form_controls::text_input::{
93        ClipboardProvider, Lines, SelectionDirection, TextInput,
94    };
95}
96
97pub mod encoding_detection {
98    pub use crate::dom::servoparser::encoding::{
99        get_xml_encoding, prescan_the_byte_stream_to_determine_the_encoding,
100    };
101}
102
103pub mod unminify {
104    pub use crate::dom::html::htmlscriptelement::substitute_with_local_script;
105    pub use crate::unminify::create_output_file;
106}