Closed Bug 1470163 Opened 7 years ago Closed 7 years ago

Consider removing EnsureOnDemandBuiltinUASheet.

Categories

(Core :: CSS Parsing and Computation, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: emilio, Assigned: emilio)

References

Details

Attachments

(3 files)

It's not relevant for memory usage anymore, and perf of UA sheets in content should be good. The on demand stuff has caused pain, for example, when the frontend people try loading <svg>s from NAC (since that triggers sheet loading from frame construction, which is not good). I'm not concerned about loading mathml.css and svg.css everywhere, though xul.css may not be as doable since it adds a bunch of attribute-dependent selectors. Though on the other hand I asserted in the xul.css code and we don't load it in content with <video> / <input type="date/time/etc"> and such, afaict, so maybe now that legacy addons are gone we can remove that sheet from content processes altogether.
Flags: needinfo?(emilio)
Assignee: nobody → emilio
Flags: needinfo?(emilio)
Turns out that xul.css is no longer loaded if not upfront. Horray!
On top of the two depending bugs. Funny how there's a comment referencing bug 77999.
Attachment #8986781 - Flags: review?(cam)
Comment on attachment 8986781 [details] Bug 1470163: Load mathml.css upfront, and remove the concept of on-demand builtin UA sheets. r=heycam Cameron McCormack (:heycam) has approved the revision. https://phabricator.services.mozilla.com/D1750
Attachment #8986781 - Flags: review+
Attachment #8986781 - Flags: review?(cam)
Priority: -- → P3
This fixes a MathML-disabled reftest with the previous patch. The reftest assumes the sheet is not loaded, so let's just preserve that behavior.
Attachment #8987025 - Flags: review?(cam)
Comment on attachment 8987025 [details] [diff] [review] Don't load mathml/svg.css if MathML/SVG is disabled. Review of attachment 8987025 [details] [diff] [review]: ----------------------------------------------------------------- ::: layout/base/nsDocumentViewer.cpp @@ +2519,4 @@ > styleSet->PrependStyleSheet(SheetType::Agent, sheet); > } > > sheet = cache->MathMLSheet(); Since we lazily load the MathML sheet, maybe wrap this in the MathMLEnabled() check? (And maybe do it for the SVG sheet too just so the code looks symmetrical, even though we eagerly load that one.)
Attachment #8987025 - Flags: review?(cam) → review+
Pushed by emilio@crisal.io: https://hg.mozilla.org/integration/mozilla-inbound/rev/e2e97e7a605f Load mathml.css upfront, and remove the concept of on-demand builtin UA sheets. r=heycam https://hg.mozilla.org/integration/mozilla-inbound/rev/e34a6bdac37a Don't load mathml/svg.css if MathML/SVG is disabled. r=heycam
Depends on: 1374017
These tests rely on tweaking the pref before storing in the document whether it's actually enabled or not. The previous patch does check it early in the document's lifetime, so those pref toggles are ineffective. Move the actual test to an iframe so that it sees the pref change.
Flags: needinfo?(emilio)
Attachment #8987310 - Flags: review?(cam)
Comment on attachment 8987310 [details] [diff] [review] Move test_disabled.html tests to an iframe. Review of attachment 8987310 [details] [diff] [review]: ----------------------------------------------------------------- r=me but let's rename the test_disabled_iframe.html files to file_disabled_iframe.html.
Attachment #8987310 - Flags: review?(cam) → review+
Pushed by emilio@crisal.io: https://hg.mozilla.org/integration/mozilla-inbound/rev/de319cd7dd2b Load mathml.css upfront, and remove the concept of on-demand builtin UA sheets. r=heycam https://hg.mozilla.org/integration/mozilla-inbound/rev/edf707347ab7 Don't load mathml/svg.css if MathML/SVG is disabled. r=heycam https://hg.mozilla.org/integration/mozilla-inbound/rev/25b9f13ddee9 Move test_disabled to an iframe. r=heycam
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: