diff --git a/layout/style/nsLayoutStylesheetCache.cpp b/layout/style/nsLayoutStylesheetCache.cpp index 1cf5f6c4e96e..af7c2bd1507c 100644 --- a/layout/style/nsLayoutStylesheetCache.cpp +++ b/layout/style/nsLayoutStylesheetCache.cpp @@ -134,6 +134,11 @@ nsLayoutStylesheetCache::UASheet() StyleSheetHandle nsLayoutStylesheetCache::HTMLSheet() { + if (!mHTMLSheet) { + LoadSheetURL("resource://gre-resources/html.css", + mHTMLSheet, eAgentSheetFeatures); + } + return mHTMLSheet; } @@ -319,8 +324,6 @@ nsLayoutStylesheetCache::nsLayoutStylesheetCache(StyleBackendType aType) // per-profile, since they're profile-invariant. LoadSheetURL("resource://gre-resources/counterstyles.css", mCounterStylesSheet, eAgentSheetFeatures); - LoadSheetURL("resource://gre-resources/html.css", - mHTMLSheet, eAgentSheetFeatures); LoadSheetURL("chrome://global/content/minimal-xul.css", mMinimalXULSheet, eAgentSheetFeatures); LoadSheetURL("resource://gre-resources/quirk.css", @@ -375,6 +378,8 @@ nsLayoutStylesheetCache::For(StyleBackendType aType) // "layout.css.example-pref.enabled"); Preferences::RegisterCallback(&DependentPrefChanged, "layout.css.grid.enabled"); + Preferences::RegisterCallback(&DependentPrefChanged, + "dom.details_element.enabled"); } return cache; @@ -818,6 +823,7 @@ nsLayoutStylesheetCache::DependentPrefChanged(const char* aPref, void* aData) gStyleCache_Servo ? &gStyleCache_Servo->sheet_ : nullptr); INVALIDATE(mUASheet); // for layout.css.grid.enabled + INVALIDATE(mHTMLSheet); // for dom.details_element.enabled #undef INVALIDATE } diff --git a/layout/style/res/html.css b/layout/style/res/html.css index b0a9196de031..b69116f81a70 100644 --- a/layout/style/res/html.css +++ b/layout/style/res/html.css @@ -771,13 +771,15 @@ video > .caption-box { } /* details & summary */ +/* Need to revert Bug 1259889 Part 2 when removing details preference. */ +@supports -moz-bool-pref("dom.details_element.enabled") { + details > summary::-moz-list-bullet { + list-style-type: disclosure-closed; + } -details > summary::-moz-list-bullet { - list-style-type: disclosure-closed; -} - -details[open] > summary::-moz-list-bullet { - list-style-type: disclosure-open; + details[open] > summary::-moz-list-bullet { + list-style-type: disclosure-open; + } } /* emulation of non-standard HTML tag */