Don't traverse text nodes during styling.

MozReview-Commit-ID: 6CtQMxbcLnF
This commit is contained in:
Bobby Holley 2016-10-25 19:50:31 -07:00
parent 1cfd5e8172
commit 1090abae87
7 changed files with 72 additions and 31 deletions

View file

@ -323,6 +323,7 @@ pub trait ThreadSafeLayoutNode: Clone + Copy + NodeInfo + PartialEq + Sized {
/// element style is precomputed, not from general layout itself.
#[inline]
fn resolved_style(&self) -> Arc<ServoComputedValues> {
// FIXME(bholley): This should move to Element and lose the text node check.
if self.is_text_node() {
return self.style_for_text_node();
}
@ -338,6 +339,7 @@ pub trait ThreadSafeLayoutNode: Clone + Copy + NodeInfo + PartialEq + Sized {
#[inline]
fn selected_style(&self, _context: &SharedStyleContext) -> Arc<ServoComputedValues> {
// FIXME(bholley): This should move to Element and lose the text node check.
if self.is_text_node() {
return self.style_for_text_node();
}