Closed Bug 1897110 Opened 1 year ago Closed 1 year ago

[wpt-sync] Sync PR 46303 - Use ConsumeRestrictedPropertyValue() when testing variable-using property validity.

Categories

(Core :: CSS Parsing and Computation, task, P4)

task

Tracking

()

RESOLVED FIXED
128 Branch
Tracking Status
firefox128 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 46303 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/46303
Details from upstream follow.

Steinar H. Gunderson <sesse@chromium.org> wrote:

Use ConsumeRestrictedPropertyValue() when testing variable-using property validity.

Earlier, the property parser would only receive values that were checked
using ConsumeRestrictedPropertyValue(), which has a fail-fast whenever
it sees a left brace. However, with the streaming parser being used for
value parsing, we just consumed until the end of the semicolon instead,
which is correct but misses the fail-fast, causing potential O(n²)
behavior with nested rules. Reintroduce it.

This also fixes an issue where, if we failed to parse the last token,
we could have stream_.Offset() at the end of the parse never advancing
past the initial lookahead offset, causing an integer overflow.

Fixed: 340702955
Fixed: 340919085
Change-Id: I5d9814f87536e8cc7dc6742a39f22abd83c40d85

Reviewed-on: https://chromium-review.googlesource.com/5543881
WPT-Export-Revision: 386c1d9bf3d8e5a9b175b77a8e0ad9a49d1d6ab5

Component: web-platform-tests → CSS Parsing and Computation
Product: Testing → Core

CI Results

Ran 0 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 1 tests

Status Summary

Firefox

PASS: 1

Chrome

PASS: 1

Safari

PASS: 1

Links

GitHub PR Head
GitHub PR Base

Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2026ce213261 [wpt PR 46303] - Use ConsumeRestrictedPropertyValue() when testing variable-using property validity., a=testonly
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 128 Branch
You need to log in before you can comment on or make changes to this bug.