Closed Bug 2095781 Opened 8 days ago Closed 5 days ago

CSS errors aren't reported for style sheets that come from the shared style sheet cache

Categories

(Core :: CSS Parsing and Computation, defect)

defect

Tracking

()

RESOLVED FIXED
163 Branch
Tracking Status
firefox163 --- fixed

People

(Reporter: florian, Assigned: florian)

References

Details

Attachments

(1 external file)

The shared style sheet cache reuses sheets across documents: inline <style> sheets since bug 1956486, linked sheets since bug 1599160. A cached sheet isn't parsed again, so its CSS errors are never reported, even when the docShell has cssErrorReportingEnabled. For example, with the DevTools console open, reloading a page drops the CSS warnings of its sheets.

This also makes test_bug413958.html fail every time in the new mochitest-plain-repeat jobs: the second run gets 0 of the 3 expected CSS error messages.

The patch makes documents that report CSS errors skip the cache: the inline sheet cache, and complete entries for linked sheets through Loader::ShouldBypassCache. Pages with the DevTools console open therefore parse all their sheets. It also adds a test for both kinds of sheets.

Blocks: 2095794

A sheet taken from the shared style sheet cache, inline (bug 1956486) or linked (bug 1599160), isn't parsed again, so its CSS errors were never reported, e.g. to the DevTools console after a reload. This made test_bug413958.html fail on its second run in mochitest-plain-repeat.

Documents with CSS error reporting on (pages with the DevTools console open, mainly) now parse all their sheets instead of reusing cached ones. A load coalesced into another document's in-flight load still reports no errors.

The new test is a mochitest rather than a WPT because it needs privileged APIs (docShell.cssErrorReportingEnabled, SimpleTest.monitorConsole).

Attachment #9687674 - Attachment description: Bug 2095781 - Don't use cached style sheets in documents that report CSS errors, r=#firefox-style-system-reviewers. → Bug 2095781 - Clear the style sheet cache in tests that expect CSS errors, r=#firefox-style-system-reviewers.
Pushed by fqueze@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/f3468d5361e7 https://hg.mozilla.org/integration/autoland/rev/e60c1e0183bc Clear the style sheet cache in tests that expect CSS errors, r=firefox-style-system-reviewers,emilio.
Status: ASSIGNED → RESOLVED
Closed: 5 days ago
Resolution: --- → FIXED
Target Milestone: --- → 163 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: