mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
try to reset flows which need reflow, since reflow isn't yet idempotent
This commit is contained in:
parent
d168501555
commit
f552e2f750
13 changed files with 310 additions and 82 deletions
|
@ -13,6 +13,7 @@ use sync::Arc;
|
|||
pub trait NodeUtil {
|
||||
fn get_css_select_results<'a>(&'a self) -> &'a Arc<ComputedValues>;
|
||||
fn have_css_select_results(&self) -> bool;
|
||||
fn remove_css_select_results(self);
|
||||
|
||||
fn get_restyle_damage(self) -> RestyleDamage;
|
||||
fn set_restyle_damage(self, damage: RestyleDamage);
|
||||
|
@ -60,6 +61,20 @@ impl<'ln> NodeUtil for ThreadSafeLayoutNode<'ln> {
|
|||
layout_data_ref.as_ref().unwrap().shared_data.style.is_some()
|
||||
}
|
||||
|
||||
fn remove_css_select_results(self) {
|
||||
let mut layout_data_ref = self.mutate_layout_data();
|
||||
let layout_data = layout_data_ref.as_mut().expect("no layout data");
|
||||
|
||||
let style =
|
||||
match self.get_pseudo_element_type() {
|
||||
Before(_) => &mut layout_data.data.before_style,
|
||||
After (_) => &mut layout_data.data.after_style,
|
||||
Normal => &mut layout_data.shared_data.style,
|
||||
};
|
||||
|
||||
*style = None;
|
||||
}
|
||||
|
||||
/// Get the description of how to account for recent style changes.
|
||||
/// This is a simple bitfield and fine to copy by value.
|
||||
fn get_restyle_damage(self) -> RestyleDamage {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue