diff options
author | Patrick Walton <pcwalton@mimiga.net> | 2015-08-03 16:15:11 -0700 |
---|---|---|
committer | Patrick Walton <pcwalton@mimiga.net> | 2015-08-04 09:02:41 -0700 |
commit | 0a589d413d03b11198033e34b28cb24bed99c0fb (patch) | |
tree | 152dabe90fe2c20ab36c37ab6ddfdd3f452f7787 /components/layout/fragment.rs | |
parent | 0565df859684560b525b0361476d334f79db8474 (diff) | |
download | servo-0a589d413d03b11198033e34b28cb24bed99c0fb.tar.gz servo-0a589d413d03b11198033e34b28cb24bed99c0fb.zip |
layout: When repairing styles for incremental reflow, only repair
styles of nodes that represent the dirty node, *including its
pseudo-element*.
Fixes lots more jumpiness.
A manual test, `inline-pseudo-repair-jumpiness.html`, has been added. I
was unable to automate it, so I will file a followup issue on that.
Diffstat (limited to 'components/layout/fragment.rs')
-rw-r--r-- | components/layout/fragment.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/components/layout/fragment.rs b/components/layout/fragment.rs index 61a6042b6df..1f7ecce5fe9 100644 --- a/components/layout/fragment.rs +++ b/components/layout/fragment.rs @@ -17,7 +17,7 @@ use inline::{InlineFragmentContext, InlineFragmentNodeInfo, InlineMetrics}; use layout_debug; use model::{self, IntrinsicISizes, IntrinsicISizesContribution, MaybeAuto, specified}; use text; -use wrapper::ThreadSafeLayoutNode; +use wrapper::{PseudoElementType, ThreadSafeLayoutNode}; use euclid::{Point2D, Rect, Size2D}; use gfx::display_list::{BLUR_INFLATION_FACTOR, OpaqueNode}; @@ -107,6 +107,9 @@ pub struct Fragment { /// How damaged this fragment is since last reflow. pub restyle_damage: RestyleDamage, + /// The pseudo-element that this fragment represents. + pub pseudo: PseudoElementType<()>, + /// A debug ID that is consistent for the life of this fragment (via transform etc). pub debug_id: u16, } @@ -752,6 +755,7 @@ impl Fragment { margin: LogicalMargin::zero(writing_mode), specific: specific, inline_context: None, + pseudo: node.get_pseudo_element_type().strip(), debug_id: layout_debug::generate_unique_debug_id(), } } @@ -782,12 +786,14 @@ impl Fragment { margin: LogicalMargin::zero(writing_mode), specific: specific, inline_context: None, + pseudo: node.get_pseudo_element_type().strip(), debug_id: layout_debug::generate_unique_debug_id(), } } /// Constructs a new `Fragment` instance from an opaque node. pub fn from_opaque_node_and_style(node: OpaqueNode, + pseudo: PseudoElementType<()>, style: Arc<ComputedValues>, restyle_damage: RestyleDamage, specific: SpecificFragmentInfo) @@ -802,6 +808,7 @@ impl Fragment { margin: LogicalMargin::zero(writing_mode), specific: specific, inline_context: None, + pseudo: pseudo, debug_id: layout_debug::generate_unique_debug_id(), } } @@ -834,6 +841,7 @@ impl Fragment { margin: self.margin, specific: info, inline_context: self.inline_context.clone(), + pseudo: self.pseudo.clone(), debug_id: self.debug_id, } } |