mirror of
https://github.com/servo/servo.git
synced 2025-09-03 03:28:20 +01:00
Auto merge of #11754 - Ms2ger:wrapper-traits-prep2, r=nox
Move ServoLayoutNode and related structs to script. <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11754) <!-- Reviewable:end -->
This commit is contained in:
commit
ee8c5c5a67
51 changed files with 2215 additions and 1840 deletions
|
@ -3,7 +3,6 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use layout::Fragment;
|
||||
use layout::ServoThreadSafeLayoutNode;
|
||||
use std::mem::size_of;
|
||||
|
||||
#[test]
|
||||
|
@ -25,23 +24,3 @@ fn test_size_of_fragment() {
|
|||
expected, actual);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_size_of_layout_node() {
|
||||
let expected = 16;
|
||||
let actual = size_of::<ServoThreadSafeLayoutNode>();
|
||||
|
||||
if actual < expected {
|
||||
panic!("Your changes have decreased the stack size of layout::wrapper::ServoThreadSafeLayoutNode \
|
||||
from {} to {}. Good work! Please update the size in tests/layout/unit/size_of.rs",
|
||||
expected, actual);
|
||||
}
|
||||
|
||||
if actual > expected {
|
||||
panic!("Your changes have increased the stack size of layout::wrapper::ServoThreadSafeLayoutNode \
|
||||
from {} to {}. Please consider choosing a design which avoids this increase. \
|
||||
If you feel that the increase is necessary, update the size in \
|
||||
tests/unit/layout/size_of.rs.",
|
||||
expected, actual);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ use script::dom::htmlelement::HTMLElement;
|
|||
use script::dom::htmlspanelement::HTMLSpanElement;
|
||||
use script::dom::node::Node;
|
||||
use script::dom::text::Text;
|
||||
use script::layout_wrapper::ServoThreadSafeLayoutNode;
|
||||
use std::mem::size_of;
|
||||
|
||||
// Macro so that we can stringify type names
|
||||
|
@ -45,3 +46,4 @@ sizeof_checker!(size_div, HTMLDivElement, 328);
|
|||
sizeof_checker!(size_span, HTMLSpanElement, 328);
|
||||
sizeof_checker!(size_text, Text, 192);
|
||||
sizeof_checker!(size_characterdata, CharacterData, 192);
|
||||
sizeof_checker!(size_servothreadsafelayoutnode, ServoThreadSafeLayoutNode, 16);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue