Bug 1329854 - Avoid propagating the dirty descendants bit when appending items to display:none subtrees. r=heycam
authorBobby Holley <bobbyholley@gmail.com>
Wed, 11 Jan 2017 16:44:49 -0800
changeset 374241 15d1f9b75794d17578d8b22a6fa5065458e9bf2b
parent 374240 accbd8ed10d5032db2fbd4f689fd0324774df828
child 374242 0734dcc4e4bf7d7d785f8ffaa49e56655c6dd035
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1329854
milestone53.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1329854 - Avoid propagating the dirty descendants bit when appending items to display:none subtrees. r=heycam
dom/base/ElementInlines.h
--- a/dom/base/ElementInlines.h
+++ b/dom/base/ElementInlines.h
@@ -53,16 +53,21 @@ inline bool
 Element::ShouldTraverseForServo()
 {
   return HasDirtyDescendantsForServo() || Servo_Element_ShouldTraverse(this);
 }
 
 inline void
 Element::NoteDirtyDescendantsForServo()
 {
+  if (!HasServoData()) {
+    // The dirty descendants bit only applies to styled elements.
+    return;
+  }
+
   Element* curr = this;
   while (curr && !curr->HasDirtyDescendantsForServo()) {
     curr->SetHasDirtyDescendantsForServo();
     curr = curr->GetFlattenedTreeParentElementForStyle();
   }
 
   MOZ_ASSERT(DirtyDescendantsBitIsPropagatedForServo());
 }