Bug 1545842 - Downgrade RestyleManager assertions to DIAGNOSTIC_ASSERT in beta. r=tnikkel a=pascalc
authorEmilio Cobos Álvarez <emilio@crisal.io>
Sun, 21 Apr 2019 02:54:50 +0300
changeset 523262 bdd03a2c4e54d9bd9f6822ab5bef134d11d67f90
parent 523261 4dd5a57324894245168590868b807ceedba2af6b
child 523263 a3857b3191a4c9b4676ab5ff603e09c39546c23a
push id11121
push usernbeleuzu@mozilla.com
push dateSun, 21 Apr 2019 00:24:44 +0000
treeherdermozilla-beta@05d12183776b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstnikkel, pascalc
Bug 1545842 - Downgrade RestyleManager assertions to DIAGNOSTIC_ASSERT in beta. r=tnikkel a=pascalc Summary: The only case where we know that this assert breaks right now is in nsIconChannel. nsIconChannel is used for moz-icon://, which is not exposed to content. So it doesn't seem to be easy to potentially get into a broken state that content could exploit, and thus crashes in release may be a bit excessive. Downgrade the assertion for now. Reviewers: tnikkel Reviewed By: tnikkel Bug #: 1545842 Differential Revision: https://phabricator.services.mozilla.com/D28248
--- a/layout/base/RestyleManager.cpp
+++ b/layout/base/RestyleManager.cpp
@@ -2947,17 +2947,17 @@ bool RestyleManager::ProcessPostTraversa
 void RestyleManager::ClearSnapshots() {
   for (auto iter = mSnapshots.Iter(); !iter.Done(); iter.Next()) {
 ServoElementSnapshot& RestyleManager::SnapshotFor(Element& aElement) {
-  MOZ_RELEASE_ASSERT(!mInStyleRefresh);
   // NOTE(emilio): We can handle snapshots from a one-off restyle of those that
   // we do to restyle stuff for reconstruction, for example.
   // It seems to be the case that we always flush in between that happens and
   // the next attribute change, so we can assert that we haven't handled the
   // snapshot here yet. If this assertion didn't hold, we'd need to unset that
   // flag from here too.
@@ -2984,17 +2984,17 @@ void RestyleManager::DoProcessPendingRes
   // recascade animation styles running on the compositor, so we shouldn't care
   // about other styles, or new rules that apply to the page...
   // However, that's not true as of right now, see bug 1388031 and bug 1388692.
   MOZ_ASSERT((aFlags & ServoTraversalFlags::FlushThrottledAnimations) ||
              "Someone forgot to update media queries?");
   MOZ_ASSERT(!nsContentUtils::IsSafeToRunScript(), "Missing a script blocker!");
-  MOZ_RELEASE_ASSERT(!mInStyleRefresh, "Reentrant call?");
   if (MOZ_UNLIKELY(!shell->DidInitialize())) {
     // PresShell::FlushPendingNotifications doesn't early-return in the case
     // where the PresShell hasn't yet been initialized (and therefore we haven't
     // yet done the initial style traversal of the DOM tree). We should arguably
     // fix up the callers and assert against this case, but we just detect and
     // handle it for now.
@@ -3163,17 +3163,17 @@ void RestyleManager::UpdateOnlyAnimation
 void RestyleManager::ContentStateChanged(nsIContent* aContent,
                                          EventStates aChangedBits) {
-  MOZ_RELEASE_ASSERT(!mInStyleRefresh);
   if (!aContent->IsElement()) {
   Element& element = *aContent->AsElement();
   if (!element.HasServoData()) {
@@ -3274,17 +3274,17 @@ void RestyleManager::AttributeWillChange
 void RestyleManager::ClassAttributeWillBeChangedBySMIL(Element* aElement) {
   TakeSnapshotForAttributeChange(*aElement, kNameSpaceID_None,
 void RestyleManager::TakeSnapshotForAttributeChange(Element& aElement,
                                                     int32_t aNameSpaceID,
                                                     nsAtom* aAttribute) {
-  MOZ_RELEASE_ASSERT(!mInStyleRefresh);
   if (!aElement.HasServoData()) {
   bool influencesOtherPseudoClassState;
   if (!NeedToRecordAttrChange(*StyleSet(), aElement, aNameSpaceID, aAttribute,
                               &influencesOtherPseudoClassState)) {