mirror of
https://github.com/servo/servo.git
synced 2025-07-31 03:00:29 +01:00
layout: Stop mutating the style data from layout.
This is part of #16982. Right now we have some code that tries to cache stuff in the style data during layout. This code is extremely rarely executed, only for `<details>` and `<summary>`. I think if we really really want to cache these, we should find a place in the layout data for it. For now, let's move it away (and all the other layout code) from mutating the style data from layout.
This commit is contained in:
parent
3d40b516c8
commit
a8fe5d65d4
2 changed files with 32 additions and 47 deletions
|
@ -30,7 +30,7 @@
|
|||
|
||||
#![allow(unsafe_code)]
|
||||
|
||||
use atomic_refcell::AtomicRefCell;
|
||||
use atomic_refcell::{AtomicRef, AtomicRefCell};
|
||||
use dom::bindings::inheritance::{CharacterDataTypeId, ElementTypeId};
|
||||
use dom::bindings::inheritance::{HTMLElementTypeId, NodeTypeId};
|
||||
use dom::bindings::js::LayoutJS;
|
||||
|
@ -1092,8 +1092,10 @@ impl<'le> ThreadSafeLayoutElement for ServoThreadSafeLayoutElement<'le> {
|
|||
self.element.get_attr(namespace, name)
|
||||
}
|
||||
|
||||
fn get_style_data(&self) -> Option<&AtomicRefCell<ElementData>> {
|
||||
fn style_data(&self) -> AtomicRef<ElementData> {
|
||||
self.element.get_data()
|
||||
.expect("Unstyled layout node?")
|
||||
.borrow()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue