diff options
author | Bobby Holley <bobbyholley@gmail.com> | 2015-10-15 15:35:33 -0700 |
---|---|---|
committer | Bobby Holley <bobbyholley@gmail.com> | 2015-10-21 09:56:07 -0700 |
commit | 228eff7272e4eb401a160e8470948d7bf5c74e48 (patch) | |
tree | 58d27809ee7c6b260c17771b233a7c991d9159b7 | |
parent | 2de5407cdabef67ed03b2ad4edf4a22541d77875 (diff) | |
download | servo-228eff7272e4eb401a160e8470948d7bf5c74e48.tar.gz servo-228eff7272e4eb401a160e8470948d7bf5c74e48.zip |
Remove HAS_DIRTY_SIBLINGS.
This isn't doing anything right now, and we're not even setting it properly
in dirty_impl the |dirty_subtree(self)| was causing us to hit the skip case
for step 3.
-rw-r--r-- | components/layout/layout_task.rs | 1 | ||||
-rw-r--r-- | components/layout/traversal.rs | 1 | ||||
-rw-r--r-- | components/layout/wrapper.rs | 6 | ||||
-rw-r--r-- | components/script/dom/node.rs | 37 |
4 files changed, 6 insertions, 39 deletions
diff --git a/components/layout/layout_task.rs b/components/layout/layout_task.rs index a0ffd5d9549..505676e126b 100644 --- a/components/layout/layout_task.rs +++ b/components/layout/layout_task.rs @@ -1491,7 +1491,6 @@ impl LayoutTask { // "changed": // > node.set_changed(true); node.set_dirty(true); - node.set_dirty_siblings(true); node.set_dirty_descendants(true); } } diff --git a/components/layout/traversal.rs b/components/layout/traversal.rs index 67e480e0726..0ed6a2cd32f 100644 --- a/components/layout/traversal.rs +++ b/components/layout/traversal.rs @@ -269,7 +269,6 @@ impl<'a> PostorderDomTraversal for ConstructFlows<'a> { unsafe { node.set_changed(false); node.set_dirty(false); - node.set_dirty_siblings(false); node.set_dirty_descendants(false); } diff --git a/components/layout/wrapper.rs b/components/layout/wrapper.rs index e23a53f6616..2be8382ee4c 100644 --- a/components/layout/wrapper.rs +++ b/components/layout/wrapper.rs @@ -52,7 +52,7 @@ use script::dom::htmliframeelement::HTMLIFrameElement; use script::dom::htmlimageelement::LayoutHTMLImageElementHelpers; use script::dom::htmlinputelement::{HTMLInputElement, LayoutHTMLInputElementHelpers}; use script::dom::htmltextareaelement::{HTMLTextAreaElement, LayoutHTMLTextAreaElementHelpers}; -use script::dom::node::{HAS_CHANGED, HAS_DIRTY_DESCENDANTS, HAS_DIRTY_SIBLINGS, IS_DIRTY}; +use script::dom::node::{HAS_CHANGED, HAS_DIRTY_DESCENDANTS, IS_DIRTY}; use script::dom::node::{LayoutNodeHelpers, Node, SharedLayoutData}; use script::dom::text::Text; use selectors::matching::DeclarationBlock; @@ -258,10 +258,6 @@ impl<'ln> LayoutNode<'ln> { self.node.set_flag(IS_DIRTY, value) } - pub unsafe fn set_dirty_siblings(&self, value: bool) { - self.node.set_flag(HAS_DIRTY_SIBLINGS, value); - } - pub fn has_dirty_descendants(&self) -> bool { unsafe { self.node.get_flag(HAS_DIRTY_DESCENDANTS) } } diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index 1eb4240f307..8aa54aafd2a 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -129,27 +129,24 @@ bitflags! { const HAS_CHANGED = 0x02, #[doc = "Specifies whether this node needs style recalc on next reflow."] const IS_DIRTY = 0x04, - #[doc = "Specifies whether this node has siblings (inclusive of itself) which \ - changed since the last reflow."] - const HAS_DIRTY_SIBLINGS = 0x08, #[doc = "Specifies whether this node has descendants (inclusive of itself) which \ have changed since the last reflow."] - const HAS_DIRTY_DESCENDANTS = 0x10, + const HAS_DIRTY_DESCENDANTS = 0x08, // TODO: find a better place to keep this (#4105) // https://critic.hoppipolla.co.uk/showcomment?chain=8873 // Perhaps using a Set in Document? #[doc = "Specifies whether or not there is an authentic click in progress on \ this element."] - const CLICK_IN_PROGRESS = 0x20, + const CLICK_IN_PROGRESS = 0x10, #[doc = "Specifies whether this node is focusable and whether it is supposed \ to be reachable with using sequential focus navigation."] - const SEQUENTIALLY_FOCUSABLE = 0x40, + const SEQUENTIALLY_FOCUSABLE = 0x20, } } impl NodeFlags { pub fn new() -> NodeFlags { - HAS_CHANGED | IS_DIRTY | HAS_DIRTY_SIBLINGS | HAS_DIRTY_DESCENDANTS + HAS_CHANGED | IS_DIRTY | HAS_DIRTY_DESCENDANTS } } @@ -474,14 +471,6 @@ impl Node { self.set_flag(IS_DIRTY, state) } - pub fn get_has_dirty_siblings(&self) -> bool { - self.get_flag(HAS_DIRTY_SIBLINGS) - } - - pub fn set_has_dirty_siblings(&self, state: bool) { - self.set_flag(HAS_DIRTY_SIBLINGS, state) - } - pub fn get_has_dirty_descendants(&self) -> bool { self.get_flag(HAS_DIRTY_DESCENDANTS) } @@ -514,7 +503,7 @@ impl Node { // Stop if this subtree is already dirty. if node.get_is_dirty() { return } - node.set_flag(IS_DIRTY | HAS_DIRTY_SIBLINGS | HAS_DIRTY_DESCENDANTS, true); + node.set_flag(IS_DIRTY | HAS_DIRTY_DESCENDANTS, true); for kid in node.children() { dirty_subtree(kid.r()); @@ -523,22 +512,6 @@ impl Node { dirty_subtree(self); - // 3. Dirty siblings. - // - // TODO(cgaebel): This is a very conservative way to account for sibling - // selectors. Maybe we can do something smarter in the future. - if !self.get_has_dirty_siblings() { - let parent = - match self.parent_node.get() { - None => return, - Some(parent) => parent, - }; - - for sibling in parent.r().children() { - sibling.r().set_has_dirty_siblings(true); - } - } - // 4. Dirty ancestors. for ancestor in self.ancestors() { if !force_ancestors && ancestor.r().get_has_dirty_descendants() { break } |