Auto merge of #13656 - bholley:existing_style, r=emilio

Refactor style logic to avoid direct access to the node data during the cascade

The new restyle architecture doesn't store these things in consistent places, so we need a more abstract API.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13656)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-10-10 23:22:05 -05:00 committed by GitHub
commit abcc4aeaf2
9 changed files with 189 additions and 157 deletions

View file

@ -627,7 +627,7 @@ pub fn process_node_scroll_area_request< N: LayoutNode>(requested_node: N, layou
fn ensure_node_data_initialized<N: LayoutNode>(node: &N) {
let mut cur = Some(node.clone());
while let Some(current) = cur {
if current.borrow_data().is_some() {
if current.borrow_layout_data().is_some() {
break;
}

View file

@ -68,7 +68,7 @@ impl<T: LayoutNode> LayoutNodeLayoutData for T {
}
fn initialize_data(self) {
if self.borrow_data().is_none() {
if self.borrow_layout_data().is_none() {
let ptr: NonOpaqueStyleAndLayoutData =
Box::into_raw(box AtomicRefCell::new(PersistentLayoutData::new()));
let opaque = OpaqueStyleAndLayoutData {