Closed Bug 1906749 Opened 1 year ago Closed 1 year ago

CSS Page rules incorrectly parse a single empty page name and pseudo-class list for page rules with no selectors

Categories

(Core :: CSS Parsing and Computation, defect)

defect

Tracking

()

RESOLVED FIXED
130 Branch
Tracking Status
firefox130 --- fixed

People

(Reporter: alaskanemily, Assigned: alaskanemily)

Details

Attachments

(1 file)

This can be seen with the serialization of @page{}, which serializes as @page {} with two spaces after the rule name. It seems like the WPT should have caught that, so we should also check if either a test related to that are disabled, or if such tests exist at all.

Before this change, @page {} was parsed as though the rule had a single
selector with an empty atom as the name. We would generally accept things like
@page a, {} to include an empty selector too, since no matching tokens ended
up representing an empty page-name (as is the case with just pseudo-classes
and no page-name), and an empty pseudo-class list (as is the case with just a
page-name and no pseudo-classes).
We shouldn't be accepting both of those at the same time.

This also fixes serialization of empty page-rule selector list.

It seems there are no WPT that check how page-rules are specifically
serialized. This adds a few basic ones to catch at least this issue.

Pushed by emcdonough@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7b5724d9db7b Do not parse an empty page-rule selector list as a single empty selector. r=emilio,firefox-style-system-reviewers
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/47061 for changes under testing/web-platform/tests

Backed out for causing wp failures in page-size-004-print.html

Flags: needinfo?(emcdonough)
Upstream PR was closed without merging
Pushed by emcdonough@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ade9faeeeb76 Do not parse an empty page-rule selector list as a single empty selector. r=emilio,firefox-style-system-reviewers
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 130 Branch
Upstream PR merged by moz-wptsync-bot
Flags: needinfo?(emcdonough)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: