mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Check modified event state from layout and dirty it there.
This adds some overhead, but also provides the small performance benefit of avoiding dirtying in the case where an event state is toggled an even number of times between reflows. The main benefit here though is that it sets us up to be smarter about what we mark as dirty using restyle hints.
This commit is contained in:
parent
441c84d75d
commit
069c40f788
6 changed files with 102 additions and 13 deletions
|
@ -94,6 +94,13 @@ impl<T> DOMRefCell<T> {
|
|||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
/// Version of the above that we use during restyle while the script task
|
||||
/// is blocked.
|
||||
pub fn borrow_mut_for_layout(&self) -> RefMut<T> {
|
||||
debug_assert!(task_state::get().is_layout());
|
||||
self.value.borrow_mut()
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: JSTraceable> JSTraceable for DOMRefCell<T> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue