auto merge of #2388 : zwarich/servo/cssom, r=jdm

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:
bors-servo 2014-05-12 16:46:10 -04:00
commit fbcfe78bf6
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: *(),
}