mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Make DOM own the style and layout data, in an UnsafeCell
The previous Cell was a lie.
This commit is contained in:
parent
516e8e0aa6
commit
185a402d9c
17 changed files with 74 additions and 180 deletions
|
@ -80,7 +80,7 @@ impl PseudoElementType {
|
|||
|
||||
/// Trait to abstract access to layout data across various data structures.
|
||||
pub trait GetLayoutData<'dom> {
|
||||
fn get_style_and_layout_data(&self) -> Option<OpaqueStyleAndLayoutData>;
|
||||
fn get_style_and_layout_data(self) -> Option<&'dom OpaqueStyleAndLayoutData>;
|
||||
}
|
||||
|
||||
/// A wrapper so that layout can access only the methods that it should have access to. Layout must
|
||||
|
@ -224,7 +224,7 @@ pub trait ThreadSafeLayoutNode<'dom>:
|
|||
.map_or(PseudoElementType::Normal, |el| el.get_pseudo_element_type())
|
||||
}
|
||||
|
||||
fn get_style_and_layout_data(&self) -> Option<OpaqueStyleAndLayoutData>;
|
||||
fn get_style_and_layout_data(self) -> Option<&'dom OpaqueStyleAndLayoutData>;
|
||||
|
||||
fn style(&self, context: &SharedStyleContext) -> Arc<ComputedValues> {
|
||||
if let Some(el) = self.as_element() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue