Consistent crash from CSS with percentages in linear-gradient
Categories
(Core :: CSS Parsing and Computation, defect)
Tracking
()
People
(Reporter: danieldoesntcheckthis, Assigned: emilio)
Details
(Keywords: crash, testcase)
Crash Data
Attachments
(3 files)
96 bytes,
text/html
|
Details | |
48 bytes,
text/x-phabricator-request
|
pascalc
:
approval-mozilla-beta+
|
Details | Review |
48 bytes,
text/x-phabricator-request
|
pascalc
:
approval-mozilla-beta+
|
Details | Review |
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:85.0) Gecko/20100101 Firefox/85.0
Steps to reproduce:
- Load this one-liner html file:
<style> body { background: linear-gradient(black calc(0% * (1e39 - 1e39)), black 0%); } </style>
- The page crashes
Actual results:
I get sent to the Tab crash reporter on load
Expected results:
I should see a empty document with black background
Reporter | ||
Comment 1•4 years ago
|
||
I should add that I found this while playing with that CSS double truncating hack: https://stackoverflow.com/a/64921523
It really feels like an edge case in the CSS! It doesn't crash unless you multiply with a percent (0% * ...
) and it doesn't crash if the big number is any smaller, like 1e38 - 1e38
.
Reporter | ||
Comment 2•4 years ago
|
||
(In reply to Daniel Wang from comment #1)
I should add that I found this while playing with that CSS double truncating hack: https://stackoverflow.com/a/64921523
It really feels like an edge case in the CSS! It doesn't crash unless you multiply with a percent (
0% * ...
) and it doesn't crash if the big number is any smaller, like1e38 - 1e38
.
Comment 3•4 years ago
|
||
Comment 4•4 years ago
|
||
Updated•4 years ago
|
Comment 5•4 years ago
|
||
I get a crash with HW-WR, SW-WR, and Basic
With Direct3d11, I get a black tab, but no crash
Assignee | ||
Comment 6•4 years ago
|
||
1e39 - 1e39
ends up being std::f32::INFINITY + -1.0 * std::f32::INFINITY
, which is NaN
, and when we multiply 0%
times that is NaN
, so we end up passing that `NaN all the way down to rendering.
Assignee | ||
Comment 7•4 years ago
|
||
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 8•4 years ago
|
||
The only purpose of a crashtest is not crashing, there's no great spec
link for that.
Assignee | ||
Updated•4 years ago
|
Comment 11•4 years ago
|
||
bugherder |
Assignee | ||
Updated•4 years ago
|
Comment 12•4 years ago
|
||
Comment 13•4 years ago
|
||
bugherder |
Assignee | ||
Comment 14•4 years ago
|
||
Comment on attachment 9202117 [details]
Bug 1691652 - Normalize NaN to zero as a result of calc(). r=#style,#layout-reviewers
Beta/Release Uplift Approval Request
- User impact if declined: Crashes when large CSS values are used. Blocks bug 1682607 too.
- 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): Handle floating point edge cases earlier to avoid making WR sad.
- String changes made/needed: none
Assignee | ||
Updated•4 years ago
|
Comment 16•4 years ago
|
||
Comment on attachment 9202117 [details]
Bug 1691652 - Normalize NaN to zero as a result of calc(). r=#style,#layout-reviewers
Approved for our last beta, thanks.
Updated•4 years ago
|
Updated•4 years ago
|
Comment 17•4 years ago
|
||
bugherder uplift |
https://hg.mozilla.org/releases/mozilla-beta/rev/dc6b23c1b8b1
https://hg.mozilla.org/releases/mozilla-beta/rev/a9358e648e8f
Updated•4 years ago
|
Description
•