Inline stylesheet caching is not aware of background-image relative URLs
Categories
(Core :: CSS Parsing and Computation, defect, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox-esr115 | --- | unaffected |
| firefox-esr128 | --- | unaffected |
| firefox-esr140 | 142+ | verified |
| firefox140 | --- | wontfix |
| firefox141 | --- | wontfix |
| firefox142 | + | verified |
| firefox143 | --- | verified |
People
(Reporter: ntrrgc, Assigned: emilio)
References
(Regression)
Details
(Keywords: regression)
Attachments
(5 files)
|
1.77 KB,
application/zip
|
Details | |
|
48 bytes,
text/x-phabricator-request
|
diannaS
:
approval-mozilla-beta+
diannaS
:
approval-mozilla-esr140+
|
Details | Review |
|
48 bytes,
text/x-phabricator-request
|
diannaS
:
approval-mozilla-beta+
diannaS
:
approval-mozilla-esr140+
|
Details | Review |
|
48 bytes,
text/x-phabricator-request
|
diannaS
:
approval-mozilla-beta+
diannaS
:
approval-mozilla-esr140+
|
Details | Review |
|
48 bytes,
text/x-phabricator-request
|
diannaS
:
approval-mozilla-beta+
diannaS
:
approval-mozilla-esr140+
|
Details | Review |
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:140.0) Gecko/20100101 Firefox/140.0
Steps to reproduce:
I produced two HTMLs in different directories with the same inline stylesheet referencing an image with the same relative URL.
The relative URL only pointed to an existing file in one of the directories.
Actual results:
When navigating from the first document to the second, the image from the first document still showed, even though it should have been a 404 in the second document.
Expected results:
The image should not have loaded.
Furthermore, I have made a minimal repro where instead of a 404, both directories have an image with the same name. Firefox still pulls whichever image was loaded first during navigation.
The issue does not reproduce on file:/// URIs. To use the repro, serve it in localhost, navigate to index.html and click the link. If the image has the same color on navigation, the image is wrongly cached.
Comment 1•6 months ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::DOM: Navigation' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
| Assignee | ||
Updated•6 months ago
|
Comment 2•6 months ago
|
||
Set release status flags based on info from the regressing bug 1956486
:emilio, since you are the author of the regressor, bug 1956486, could you take a look?
For more information, please visit BugBot documentation.
Updated•6 months ago
|
Comment 3•6 months ago
|
||
Set release status flags based on info from the regressing bug 1956486
Updated•6 months ago
|
| Assignee | ||
Comment 5•6 months ago
|
||
No behavior change, but this is simpler. I want to reuse the use
counters mechanism to fix this bug because it's a very trivial way of
asking questions about the parsed data and we need to plumb it through
the same places.
Updated•6 months ago
|
| Assignee | ||
Comment 6•6 months ago
|
||
In the future if we need to we can hook these up to telemetry (in fact it's not
hard, we just need to do that in Document::ReportUseCounters).
For now I want to start using them to record whether we might have a data URI.
| Assignee | ||
Comment 7•6 months ago
|
||
Track whether an inline sheet might have uris that depend on the base, and
avoid caching them if appropriate.
| Assignee | ||
Comment 8•6 months ago
|
||
This tests both @import and regular declarations. Without this fix, the test
page renders blue, rather than a blue background with a purple square inside
and a smaller lime square inside.
| Assignee | ||
Updated•6 months ago
|
Comment 11•6 months ago
|
||
[Tracking Requested - why for this release]: The page style sheet sometimes would not load.
Comment 12•6 months ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/a91bf9bf3237
https://hg.mozilla.org/mozilla-central/rev/fd51678da995
https://hg.mozilla.org/mozilla-central/rev/76a354cd17e5
https://hg.mozilla.org/mozilla-central/rev/dc1a3742906a
https://hg.mozilla.org/mozilla-central/rev/65febe193cb0
Comment 15•6 months ago
|
||
The patch landed in nightly and beta is affected.
:emilio, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- See https://wiki.mozilla.org/Release_Management/Requesting_an_Uplift for documentation on how to request an uplift.
- If no, please set
status-firefox142towontfix.
For more information, please visit BugBot documentation.
| Assignee | ||
Comment 16•6 months ago
|
||
Comment on attachment 9502234 [details]
Bug 1978217 - Record use counter data inline in StylesheetContents. r=#style,#layout
Beta/Release Uplift Approval Request
- User impact if declined/Reason for urgency: Fixes correctness issue that breaks some sites in the wild, see bug 1978555
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: Yes
- Needs manual test from QE?: Yes
- If yes, steps to reproduce: comment 0, bug 1978555
- List of other uplifts needed: none
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): While the changeset is big, it's not particularly complex, and it reuses well-tested infrastructure for CSS use counters.
- String changes made/needed: none
- Is Android affected?: Yes
ESR Uplift Approval Request
- If this is not a sec:{high,crit} bug, please state case for ESR consideration: see above
- User impact if declined: see above
- Fix Landed on Version: 143
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): See above. An alternative would be to disable the caching in this "different base URI" situation, but that's a bit unfortunate because the regressing bug did bring performance and memory usage improvements.
| Assignee | ||
Updated•6 months ago
|
| Assignee | ||
Updated•6 months ago
|
| Assignee | ||
Updated•6 months ago
|
| Assignee | ||
Updated•6 months ago
|
Updated•6 months ago
|
Comment 17•6 months ago
|
||
Comment on attachment 9502234 [details]
Bug 1978217 - Record use counter data inline in StylesheetContents. r=#style,#layout
Approved for 142.0b3
Updated•6 months ago
|
Updated•6 months ago
|
Updated•6 months ago
|
Comment 18•6 months ago
|
||
| uplift | ||
Updated•6 months ago
|
Updated•6 months ago
|
Updated•6 months ago
|
Comment 19•6 months ago
|
||
I've reproduced this issue with steps from comment 0 and the ones from bug 1978555 using an affected Nightly build (2025-07-19).
The issue is verified as fixed on Beta 142.0b3 (treeherder build) and latest Nightly 143.0a1 under Win 11, macOS 15 and Ubuntu 24.
Comment 20•6 months ago
|
||
Comment on attachment 9502234 [details]
Bug 1978217 - Record use counter data inline in StylesheetContents. r=#style,#layout
Approved for 140.2.0esr
Updated•6 months ago
|
Updated•6 months ago
|
Updated•6 months ago
|
Comment 21•6 months ago
|
||
| uplift | ||
Updated•6 months ago
|
Updated•6 months ago
|
Comment 23•6 months ago
|
||
This issue is also verified as fixed on Esr 140.2.0 (treeherder build) using Win 11, macOS 15 and Ubuntu 24.04.
Description
•