Firefox crashes with the following CSS ::marker {:has(&){}}
Categories
(Core :: CSS Parsing and Computation, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr115 | --- | unaffected |
firefox-esr128 | --- | wontfix |
firefox134 | --- | wontfix |
firefox135 | --- | fixed |
firefox136 | --- | fixed |
People
(Reporter: xiaozj, Assigned: dshin)
References
(Regression)
Details
(Keywords: regression)
Crash Data
Attachments
(5 files)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:133.0) Gecko/20100101 Firefox/133.0
Steps to reproduce:
I can crash Firefox with a single line of CSS:
::marker {:has(&){}}
I realize :has() cannot contain pseudo-element so the above is invalid anyways, but the issue is it should just silent fail, not crash the entire browser.
https://codepen.io/Miragecraft/pen/YPKYeKo
Actual results:
Browser crashes.
Expected results:
Invalid CSS should silently fail.
Comment 1•26 days ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::Layout' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Updated•26 days ago
|
Updated•26 days ago
|
Updated•26 days ago
|
Updated•25 days ago
|
Comment 2•25 days ago
•
|
||
Crashes with my regular profile, but not in a new profile.
Doing some testing.
Edit: It crashes with the Ruffle - flash emulator addon installed.
Edit:
Bisection:
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=fada0a57f99d5b5fc87e6e746df5d5b55781f57d&tochange=6453cd78e4f187bc198e83900dd9937c3cc6d0fc
Suspects: Bug 1852965 / Bug 1854757
Comment 3•25 days ago
|
||
Hi Shaw,
Can you type "about:support" in your Firefox browser and copy-paste its contents here?
Comment 4•25 days ago
|
||
Updated•25 days ago
|
Update: I double checked and my desktop Firefox crashes on this CSS too.
I just noticed your "Reporters_standalone_testcase.html" file.
I tried it and it did not trigger the crash, however when I moved the style element into the <head> Firefox crashes immediately.
<!DOCTYPE html>
<html lang="en"><head>
<meta http-equiv="content-type" content="text/html; charset=windows-1252">
<style>
::marker {:has(&){}}
</style>
</head>
<body><p>Firefox crashes on this page with a single line of CSS:</p>
<code>::marker {:has(&){}}</code>
</body></html>
Comment 9•25 days ago
|
||
Updated•25 days ago
|
Updated•25 days ago
|
Comment 10•25 days ago
|
||
Comment 11•25 days ago
|
||
Set release status flags based on info from the regressing bug 1852965
Assignee | ||
Comment 12•25 days ago
•
|
||
Regression window simply points to when :has
selector's inner selector invalidation is implemented.
Crash also happens with ::part()
and ::slotted()
, and suspect with other pseudo-elements as well.
Assignee | ||
Updated•25 days ago
|
Assignee | ||
Comment 13•25 days ago
|
||
Updated•25 days ago
|
Comment 14•25 days ago
|
||
Assignee | ||
Updated•25 days ago
|
Comment 16•24 days ago
|
||
bugherder |
Comment 18•24 days ago
|
||
The patch landed in nightly and beta is affected.
:dshin, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- If no, please set
status-firefox135
towontfix
.
For more information, please visit BugBot documentation.
Assignee | ||
Comment 19•24 days ago
|
||
Comment on attachment 9446337 [details]
Bug 1940212: Avoid crashing trying to invalidate from pseudo-element in :has introduced through nesting. r=#style
Beta/Release Uplift Approval Request
- User impact if declined/Reason for urgency: Potential crash for given selector
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: Yes
- Needs manual test from QE?: No
- If yes, steps to reproduce:
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): Small change that removes an assert, no invalidation added downstream.
Covered by WPTshas-nested-pseudo-*-crash.html
. Regression coverage robust through other WPTs under/css/selectors/invalidation/has*
, etc
Verified onmozregression --launch 2024-01-09
- String changes made/needed: None
- Is Android affected?: Yes
Updated•24 days ago
|
Comment 20•24 days ago
|
||
Comment on attachment 9446337 [details]
Bug 1940212: Avoid crashing trying to invalidate from pseudo-element in :has introduced through nesting. r=#style
Approved for 135.0b3.
Comment 21•24 days ago
|
||
uplift |
Updated•24 days ago
|
Updated•13 days ago
|
Updated•11 days ago
|
Description
•