Bug 1299396: Don't style content that is not an element or a text node in ServoStyleSet::StyleNewSubtree. r?bholley draft
authorEmilio Cobos Álvarez <ecoal95@gmail.com>
Wed, 31 Aug 2016 14:33:46 -0700
changeset 408203 6e3fc50aa25718f54d4ac8db0267c8c99c70676a
parent 407897 edd0eaf6178377bcc38c26b4e1363b26d361aa08
child 530068 8650149fe8ea319706b0344943053d40525a1e6b
push id28171
push userbmo:ecoal95@gmail.com
push dateWed, 31 Aug 2016 21:36:05 +0000
reviewersbholley
bugs1299396
milestone51.0a1
Bug 1299396: Don't style content that is not an element or a text node in ServoStyleSet::StyleNewSubtree. r?bholley MozReview-Commit-ID: KmcYPFqt48W
layout/style/ServoStyleSet.cpp
--- a/layout/style/ServoStyleSet.cpp
+++ b/layout/style/ServoStyleSet.cpp
@@ -501,17 +501,19 @@ ServoStyleSet::StyleDocument(bool aLeave
     ClearDirtyBits(root);
   }
 }
 
 void
 ServoStyleSet::StyleNewSubtree(nsIContent* aContent)
 {
   MOZ_ASSERT(aContent->IsDirtyForServo());
-  Servo_RestyleSubtree(aContent, mRawSet.get());
+  if (aContent->IsElement() || aContent->IsNodeOfType(nsINode::eTEXT)) {
+    Servo_RestyleSubtree(aContent, mRawSet.get());
+  }
   ClearDirtyBits(aContent);
 }
 
 void
 ServoStyleSet::StyleNewChildren(nsIContent* aParent)
 {
   MOZ_ASSERT(aParent->HasDirtyDescendantsForServo());
   Servo_RestyleSubtree(aParent, mRawSet.get());