mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
Simplify TNode a bit.
A couple of changes here: * Remove the option to unset with the dirty bit setters. * Add an explicit API for setting text node style. * Hoist has_changed handling into the restyle damage setter and text node style setter. * Make set_style take a non-Option.
This commit is contained in:
parent
ee713bc7d9
commit
cc96b292c2
8 changed files with 70 additions and 81 deletions
|
@ -1135,12 +1135,12 @@ impl LayoutThread {
|
|||
while let Some(node) = next {
|
||||
if node.needs_dirty_on_viewport_size_changed() {
|
||||
// NB: The dirty bit is propagated down the tree.
|
||||
unsafe { node.set_dirty(true); }
|
||||
unsafe { node.set_dirty(); }
|
||||
|
||||
let mut current = node.parent_node();
|
||||
while let Some(node) = current {
|
||||
if node.has_dirty_descendants() { break; }
|
||||
unsafe { node.set_dirty_descendants(true); }
|
||||
unsafe { node.set_dirty_descendants(); }
|
||||
current = node.parent_node();
|
||||
}
|
||||
|
||||
|
@ -1161,7 +1161,7 @@ impl LayoutThread {
|
|||
if needs_dirtying {
|
||||
// NB: The dirty flag is propagated down during the restyle
|
||||
// process.
|
||||
node.set_dirty(true);
|
||||
node.set_dirty();
|
||||
}
|
||||
}
|
||||
if needs_reflow {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue