Auto merge of #14907 - bholley:eliminate_consume, r=emilio

Give up on hoisting ElementData into the frame and eliminate the concept of consuming styles

Servo PR for the work in https://bugzilla.mozilla.org/show_bug.cgi?id=1325734

<!-- 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/14907)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-01-09 17:26:50 -08:00 committed by GitHub
commit 2a2a89b7e4
20 changed files with 405 additions and 440 deletions

View file

@ -67,7 +67,7 @@ use style::dom::{LayoutIterator, NodeInfo, OpaqueNode, PresentationalHintsSynthe
use style::dom::UnsafeNode;
use style::element_state::*;
use style::properties::{ComputedValues, PropertyDeclarationBlock};
use style::selector_parser::{NonTSPseudoClass, PseudoElement, RestyleDamage, SelectorImpl};
use style::selector_parser::{NonTSPseudoClass, PseudoElement, SelectorImpl};
use style::sink::Push;
use style::str::is_whitespace;
use style::stylist::ApplicableDeclarationBlock;
@ -740,6 +740,7 @@ impl<'ln> NodeInfo for ServoThreadSafeLayoutNode<'ln> {
}
impl<'ln> ThreadSafeLayoutNode for ServoThreadSafeLayoutNode<'ln> {
type ConcreteNode = ServoLayoutNode<'ln>;
type ConcreteThreadSafeLayoutElement = ServoThreadSafeLayoutElement<'ln>;
type ChildrenIterator = ThreadSafeLayoutNodeChildrenIterator<Self>;
@ -815,15 +816,8 @@ impl<'ln> ThreadSafeLayoutNode for ServoThreadSafeLayoutNode<'ln> {
}
}
fn restyle_damage(self) -> RestyleDamage {
let element = if self.is_text_node() {
self.node.parent_node().unwrap().as_element().unwrap()
} else {
self.node.as_element().unwrap()
};
let damage = element.borrow_data().unwrap().damage();
damage
unsafe fn unsafe_get(self) -> Self::ConcreteNode {
self.node
}
fn can_be_fragmented(&self) -> bool {