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:
Cameron Zwarich 2014-05-09 12:45:12 -07:00
parent d56a308524
commit 0e67202bc2
7 changed files with 23 additions and 14 deletions

View file

@ -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: *(),
}