mirror of
https://github.com/servo/servo.git
synced 2025-08-04 05:00:08 +01:00
Move the computed style to a new SharedLayoutData struct.
Implementing the CSSOM requires giving the script task access to the computed style for a node. Moving it into a new SharedLayoutData struct member of LayoutDataRef seems to be the best way to achieve this. This is the first step towards #1721.
This commit is contained in:
parent
d56a308524
commit
0e67202bc2
7 changed files with 23 additions and 14 deletions
|
@ -44,6 +44,8 @@ use std::cast;
|
|||
use std::cell::{RefCell, Ref, RefMut};
|
||||
use std::iter::{Map, Filter};
|
||||
use std::mem;
|
||||
use style::ComputedValues;
|
||||
use sync::Arc;
|
||||
|
||||
use serialize::{Encoder, Encodable};
|
||||
|
||||
|
@ -143,9 +145,16 @@ enum SuppressObserver {
|
|||
Unsuppressed
|
||||
}
|
||||
|
||||
/// Layout data that is shared between the script and layout tasks.
|
||||
pub struct SharedLayoutData {
|
||||
/// The results of CSS styling for this node.
|
||||
pub style: Option<Arc<ComputedValues>>,
|
||||
}
|
||||
|
||||
/// Encapsulates the abstract layout data.
|
||||
pub struct LayoutData {
|
||||
chan: Option<LayoutChan>,
|
||||
shared_data: SharedLayoutData,
|
||||
data: *(),
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue