Bug 1486536 - Make nsPresContext::CompatibilityModeChanged() properly call PresShell::ApplicableStylesChanged. r=heycam
authorEmilio Cobos Álvarez <emilio@crisal.io>
Mon, 27 Aug 2018 20:59:11 +0200
changeset 488740 15e5faa7e1d9a290118f9c05c1480d1f6f3b9a6b
parent 488739 20a43066e367897769f5c155b1daba955cfaeea7
child 488741 15d80c644e1e8e07c5196d58f6707611c8fac4b0
push id9734
push usershindli@mozilla.com
push dateThu, 30 Aug 2018 12:18:07 +0000
treeherdermozilla-beta@71c71ab3afae [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1486536
milestone63.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 1486536 - Make nsPresContext::CompatibilityModeChanged() properly call PresShell::ApplicableStylesChanged. r=heycam We usually rely on this call happening soon enough that it doesn't matter, but from document.write it can matter actually. This is the call that makes this work the same way as other sheet addition / removals. This would fix cases where counter styles / @font-face rules in quirk.css wouldn't get properly updated in some cases. Hopefully we don't have any of those. Differential Revision: https://phabricator.services.mozilla.com/D4360
layout/base/nsPresContext.cpp
--- a/layout/base/nsPresContext.cpp
+++ b/layout/base/nsPresContext.cpp
@@ -1126,16 +1126,17 @@ nsPresContext::CompatibilityModeChanged(
     NS_WARNING_ASSERTION(NS_SUCCEEDED(rv), "failed to insert quirk.css");
   } else {
     DebugOnly<nsresult> rv =
       styleSet->RemoveStyleSheet(SheetType::Agent, sheet);
     NS_WARNING_ASSERTION(NS_SUCCEEDED(rv), "failed to remove quirk.css");
   }
 
   mQuirkSheetAdded = needsQuirkSheet;
+  mShell->ApplicableStylesChanged();
 }
 
 // Helper function for setting Anim Mode on image
 static void SetImgAnimModeOnImgReq(imgIRequest* aImgReq, uint16_t aMode)
 {
   if (aImgReq) {
     nsCOMPtr<imgIContainer> imgCon;
     aImgReq->GetImage(getter_AddRefs(imgCon));