зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1259889 Part 2 - Load html.css lazily for pref changes. r=heycam
We need to re-evaluate html.css whenever "dom.details_element.enabled" is changed to make the disclosure triangle for summary elements show up. Reftests for details and summary will need the a live pref to work. MozReview-Commit-ID: 9SN1fQBuwA7 --HG-- extra : rebase_source : c8eafde9d3a97908c44099219603f76087d484b9
This commit is contained in:
Родитель
219e330768
Коммит
7b794c38a3
|
@ -134,6 +134,11 @@ nsLayoutStylesheetCache::UASheet()
|
||||||
StyleSheetHandle
|
StyleSheetHandle
|
||||||
nsLayoutStylesheetCache::HTMLSheet()
|
nsLayoutStylesheetCache::HTMLSheet()
|
||||||
{
|
{
|
||||||
|
if (!mHTMLSheet) {
|
||||||
|
LoadSheetURL("resource://gre-resources/html.css",
|
||||||
|
mHTMLSheet, eAgentSheetFeatures);
|
||||||
|
}
|
||||||
|
|
||||||
return mHTMLSheet;
|
return mHTMLSheet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -319,8 +324,6 @@ nsLayoutStylesheetCache::nsLayoutStylesheetCache(StyleBackendType aType)
|
||||||
// per-profile, since they're profile-invariant.
|
// per-profile, since they're profile-invariant.
|
||||||
LoadSheetURL("resource://gre-resources/counterstyles.css",
|
LoadSheetURL("resource://gre-resources/counterstyles.css",
|
||||||
mCounterStylesSheet, eAgentSheetFeatures);
|
mCounterStylesSheet, eAgentSheetFeatures);
|
||||||
LoadSheetURL("resource://gre-resources/html.css",
|
|
||||||
mHTMLSheet, eAgentSheetFeatures);
|
|
||||||
LoadSheetURL("chrome://global/content/minimal-xul.css",
|
LoadSheetURL("chrome://global/content/minimal-xul.css",
|
||||||
mMinimalXULSheet, eAgentSheetFeatures);
|
mMinimalXULSheet, eAgentSheetFeatures);
|
||||||
LoadSheetURL("resource://gre-resources/quirk.css",
|
LoadSheetURL("resource://gre-resources/quirk.css",
|
||||||
|
@ -375,6 +378,8 @@ nsLayoutStylesheetCache::For(StyleBackendType aType)
|
||||||
// "layout.css.example-pref.enabled");
|
// "layout.css.example-pref.enabled");
|
||||||
Preferences::RegisterCallback(&DependentPrefChanged,
|
Preferences::RegisterCallback(&DependentPrefChanged,
|
||||||
"layout.css.grid.enabled");
|
"layout.css.grid.enabled");
|
||||||
|
Preferences::RegisterCallback(&DependentPrefChanged,
|
||||||
|
"dom.details_element.enabled");
|
||||||
}
|
}
|
||||||
|
|
||||||
return cache;
|
return cache;
|
||||||
|
@ -818,6 +823,7 @@ nsLayoutStylesheetCache::DependentPrefChanged(const char* aPref, void* aData)
|
||||||
gStyleCache_Servo ? &gStyleCache_Servo->sheet_ : nullptr);
|
gStyleCache_Servo ? &gStyleCache_Servo->sheet_ : nullptr);
|
||||||
|
|
||||||
INVALIDATE(mUASheet); // for layout.css.grid.enabled
|
INVALIDATE(mUASheet); // for layout.css.grid.enabled
|
||||||
|
INVALIDATE(mHTMLSheet); // for dom.details_element.enabled
|
||||||
|
|
||||||
#undef INVALIDATE
|
#undef INVALIDATE
|
||||||
}
|
}
|
||||||
|
|
|
@ -771,13 +771,15 @@ video > .caption-box {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* details & summary */
|
/* 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 {
|
details[open] > summary::-moz-list-bullet {
|
||||||
list-style-type: disclosure-closed;
|
list-style-type: disclosure-open;
|
||||||
}
|
}
|
||||||
|
|
||||||
details[open] > summary::-moz-list-bullet {
|
|
||||||
list-style-type: disclosure-open;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* emulation of non-standard HTML <marquee> tag */
|
/* emulation of non-standard HTML <marquee> tag */
|
||||||
|
|
Загрузка…
Ссылка в новой задаче