diff options
author | Patrick Walton <pcwalton@mimiga.net> | 2014-10-28 15:38:18 -0700 |
---|---|---|
committer | Patrick Walton <pcwalton@mimiga.net> | 2014-10-28 19:38:22 -0700 |
commit | 587cf98209e4f0f86f3be5fad61e0a3c338673af (patch) | |
tree | 93e8a8bb79d6a910cf6972b0c869d07739d0899e /components/layout/construct.rs | |
parent | c20bb66aef28e922c46aa69c9faaa94d83269e73 (diff) | |
download | servo-587cf98209e4f0f86f3be5fad61e0a3c338673af.tar.gz servo-587cf98209e4f0f86f3be5fad61e0a3c338673af.zip |
layout: Promote absolute positioning, floatedness, and clearance into
flags to avoid virtual calls.
These were showing up really high in the maze solver profile.
Diffstat (limited to 'components/layout/construct.rs')
-rw-r--r-- | components/layout/construct.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/components/layout/construct.rs b/components/layout/construct.rs index 28666be03bb..4910a9c01b5 100644 --- a/components/layout/construct.rs +++ b/components/layout/construct.rs @@ -336,9 +336,8 @@ impl<'a> FlowConstructor<'a> { // remain. In that case the inline flow will compute its ascent and descent to be zero. let fragments = TextRunScanner::new().scan_for_runs(self.layout_context.font_context(), fragments); - - let mut inline_flow_ref = FlowRef::new(box InlineFlow::from_fragments((*node).clone(), - fragments)); + let mut inline_flow_ref = + FlowRef::new(box InlineFlow::from_fragments(fragments, node.style().writing_mode)); // Add all the inline-block fragments as children of the inline flow. for inline_block_flow in inline_block_flows.iter() { @@ -530,7 +529,7 @@ impl<'a> FlowConstructor<'a> { // Set up the absolute descendants. let is_positioned = flow.as_block().is_positioned(); - let is_absolutely_positioned = flow.as_block().is_absolutely_positioned(); + let is_absolutely_positioned = flow::base(&*flow).flags.is_absolutely_positioned(); if is_positioned { // This is the containing block for all the absolute descendants. flow.set_absolute_descendants(abs_descendants); @@ -845,7 +844,7 @@ impl<'a> FlowConstructor<'a> { wrapper_flow.finish(); let is_positioned = wrapper_flow.as_block().is_positioned(); let is_fixed_positioned = wrapper_flow.as_block().is_fixed(); - let is_absolutely_positioned = wrapper_flow.as_block().is_absolutely_positioned(); + let is_absolutely_positioned = flow::base(&*wrapper_flow).flags.is_absolutely_positioned(); if is_positioned { // This is the containing block for all the absolute descendants. wrapper_flow.set_absolute_descendants(abs_descendants); |