mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
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.
This commit is contained in:
parent
2de5407cda
commit
228eff7272
4 changed files with 6 additions and 39 deletions
|
@ -1491,7 +1491,6 @@ impl LayoutTask {
|
||||||
// "changed":
|
// "changed":
|
||||||
// > node.set_changed(true);
|
// > node.set_changed(true);
|
||||||
node.set_dirty(true);
|
node.set_dirty(true);
|
||||||
node.set_dirty_siblings(true);
|
|
||||||
node.set_dirty_descendants(true);
|
node.set_dirty_descendants(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -269,7 +269,6 @@ impl<'a> PostorderDomTraversal for ConstructFlows<'a> {
|
||||||
unsafe {
|
unsafe {
|
||||||
node.set_changed(false);
|
node.set_changed(false);
|
||||||
node.set_dirty(false);
|
node.set_dirty(false);
|
||||||
node.set_dirty_siblings(false);
|
|
||||||
node.set_dirty_descendants(false);
|
node.set_dirty_descendants(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ use script::dom::htmliframeelement::HTMLIFrameElement;
|
||||||
use script::dom::htmlimageelement::LayoutHTMLImageElementHelpers;
|
use script::dom::htmlimageelement::LayoutHTMLImageElementHelpers;
|
||||||
use script::dom::htmlinputelement::{HTMLInputElement, LayoutHTMLInputElementHelpers};
|
use script::dom::htmlinputelement::{HTMLInputElement, LayoutHTMLInputElementHelpers};
|
||||||
use script::dom::htmltextareaelement::{HTMLTextAreaElement, LayoutHTMLTextAreaElementHelpers};
|
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::node::{LayoutNodeHelpers, Node, SharedLayoutData};
|
||||||
use script::dom::text::Text;
|
use script::dom::text::Text;
|
||||||
use selectors::matching::DeclarationBlock;
|
use selectors::matching::DeclarationBlock;
|
||||||
|
@ -258,10 +258,6 @@ impl<'ln> LayoutNode<'ln> {
|
||||||
self.node.set_flag(IS_DIRTY, value)
|
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 {
|
pub fn has_dirty_descendants(&self) -> bool {
|
||||||
unsafe { self.node.get_flag(HAS_DIRTY_DESCENDANTS) }
|
unsafe { self.node.get_flag(HAS_DIRTY_DESCENDANTS) }
|
||||||
}
|
}
|
||||||
|
|
|
@ -129,27 +129,24 @@ bitflags! {
|
||||||
const HAS_CHANGED = 0x02,
|
const HAS_CHANGED = 0x02,
|
||||||
#[doc = "Specifies whether this node needs style recalc on next reflow."]
|
#[doc = "Specifies whether this node needs style recalc on next reflow."]
|
||||||
const IS_DIRTY = 0x04,
|
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 \
|
#[doc = "Specifies whether this node has descendants (inclusive of itself) which \
|
||||||
have changed since the last reflow."]
|
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)
|
// TODO: find a better place to keep this (#4105)
|
||||||
// https://critic.hoppipolla.co.uk/showcomment?chain=8873
|
// https://critic.hoppipolla.co.uk/showcomment?chain=8873
|
||||||
// Perhaps using a Set in Document?
|
// Perhaps using a Set in Document?
|
||||||
#[doc = "Specifies whether or not there is an authentic click in progress on \
|
#[doc = "Specifies whether or not there is an authentic click in progress on \
|
||||||
this element."]
|
this element."]
|
||||||
const CLICK_IN_PROGRESS = 0x20,
|
const CLICK_IN_PROGRESS = 0x10,
|
||||||
#[doc = "Specifies whether this node is focusable and whether it is supposed \
|
#[doc = "Specifies whether this node is focusable and whether it is supposed \
|
||||||
to be reachable with using sequential focus navigation."]
|
to be reachable with using sequential focus navigation."]
|
||||||
const SEQUENTIALLY_FOCUSABLE = 0x40,
|
const SEQUENTIALLY_FOCUSABLE = 0x20,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl NodeFlags {
|
impl NodeFlags {
|
||||||
pub fn new() -> 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)
|
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 {
|
pub fn get_has_dirty_descendants(&self) -> bool {
|
||||||
self.get_flag(HAS_DIRTY_DESCENDANTS)
|
self.get_flag(HAS_DIRTY_DESCENDANTS)
|
||||||
}
|
}
|
||||||
|
@ -514,7 +503,7 @@ impl Node {
|
||||||
// Stop if this subtree is already dirty.
|
// Stop if this subtree is already dirty.
|
||||||
if node.get_is_dirty() { return }
|
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() {
|
for kid in node.children() {
|
||||||
dirty_subtree(kid.r());
|
dirty_subtree(kid.r());
|
||||||
|
@ -523,22 +512,6 @@ impl Node {
|
||||||
|
|
||||||
dirty_subtree(self);
|
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.
|
// 4. Dirty ancestors.
|
||||||
for ancestor in self.ancestors() {
|
for ancestor in self.ancestors() {
|
||||||
if !force_ancestors && ancestor.r().get_has_dirty_descendants() { break }
|
if !force_ancestors && ancestor.r().get_has_dirty_descendants() { break }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue