Bug 1423832: Make sure to handle gracefully rule notifications when the styleset has been detached already. r?heycam draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Thu, 07 Dec 2017 18:53:13 +0100
changeset 709164 23cf3a3c16220dbe005c7fbea9ee7ad0f73882dd
parent 709163 634f6b38e17a25a5127c1b747fdbff254835d67e
child 743346 dba33842d1808b3ef102363ae26e68fd38fa33c4
push id92559
push userbmo:emilio@crisal.io
push dateThu, 07 Dec 2017 17:54:53 +0000
reviewersheycam
bugs1423832
milestone59.0a1
Bug 1423832: Make sure to handle gracefully rule notifications when the styleset has been detached already. r?heycam MozReview-Commit-ID: xA8dYJX2P6
layout/style/ServoStyleSet.cpp
--- a/layout/style/ServoStyleSet.cpp
+++ b/layout/style/ServoStyleSet.cpp
@@ -1031,16 +1031,20 @@ ServoStyleSet::StyleNewSubtree(Element* 
                             ServoTraversalFlags::ClearAnimationOnlyDirtyDescendants);
     MOZ_ASSERT(!postTraversalRequired);
   }
 }
 
 void
 ServoStyleSet::MarkOriginsDirty(OriginFlags aChangedOrigins)
 {
+  if (MOZ_UNLIKELY(!mRawSet)) {
+    return;
+  }
+
   SetStylistStyleSheetsDirty();
   Servo_StyleSet_NoteStyleSheetsChanged(mRawSet.get(),
                                         mAuthorStyleDisabled,
                                         aChangedOrigins);
 }
 
 void
 ServoStyleSet::SetStylistStyleSheetsDirty()