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;
7pub use crate::dom::bindings::refcounted::TrustedPromise;
8// pub use crate::dom::bindings::root::Dom;
9pub use crate::dom::bindings::str::{ByteString, DOMString};
10// pub use crate::dom::node::Node;
11
12pub mod area {
13    pub use crate::dom::html::htmlareaelement::{Area, Shape};
14}
15
16#[expect(non_snake_case)]
17pub mod size_of {
18    use std::mem::size_of;
19
20    use crate::dom::characterdata::CharacterData;
21    use crate::dom::element::Element;
22    use crate::dom::element::storage::ContentAttributeData;
23    use crate::dom::eventtarget::EventTarget;
24    use crate::dom::html::htmldivelement::HTMLDivElement;
25    use crate::dom::html::htmlelement::HTMLElement;
26    use crate::dom::html::htmlspanelement::HTMLSpanElement;
27    use crate::dom::node::Node;
28    use crate::dom::text::Text;
29
30    pub fn CharacterData() -> usize {
31        size_of::<CharacterData>()
32    }
33
34    pub fn Element() -> usize {
35        size_of::<Element>()
36    }
37
38    pub fn EventTarget() -> usize {
39        size_of::<EventTarget>()
40    }
41
42    pub fn HTMLDivElement() -> usize {
43        size_of::<HTMLDivElement>()
44    }
45
46    pub fn HTMLElement() -> usize {
47        size_of::<HTMLElement>()
48    }
49
50    pub fn HTMLSpanElement() -> usize {
51        size_of::<HTMLSpanElement>()
52    }
53
54    pub fn Node() -> usize {
55        size_of::<Node>()
56    }
57
58    pub fn Text() -> usize {
59        size_of::<Text>()
60    }
61
62    pub fn ContentAttributeData() -> usize {
63        size_of::<ContentAttributeData>()
64    }
65}
66
67pub mod srcset {
68    pub use crate::dom::srcset::{Descriptor, ImageSource, parse_a_srcset_attribute};
69}
70
71pub mod timeranges {
72    pub use crate::dom::timeranges::TimeRangesContainer;
73}
74
75pub mod text_input {
76    pub use crate::dom::html::form_controls::text_input::{
77        ClipboardProvider, Direction, Lines, SelectionDirection, TextInput,
78    };
79}
80
81pub mod encoding_detection {
82    pub use crate::dom::servoparser::encoding::{
83        get_xml_encoding, prescan_the_byte_stream_to_determine_the_encoding,
84    };
85}
86
87pub mod unminify {
88    pub use crate::dom::html::htmlscriptelement::substitute_with_local_script;
89    pub use crate::unminify::create_output_file;
90}