style not applied for id containing dot
Categories
(Core :: CSS Parsing and Computation, defect)
Tracking
()
People
(Reporter: u20230201, Unassigned)
Details
Steps to reproduce:
Defined HTML "<span id="hs.order" />" and style "span#hs.order { break-before: page }"
Actual results:
The style was not applied, and no warning was output.
It seems that IDs containing a dot are not handled correctly, because when replacing "." with "-", it worked.
Expected results:
Either the style should have been applied, or some warning should have been output.
See also https://stackoverflow.com/a/79022/6607497
| Reporter | ||
Comment 1•2 years ago
|
||
Sorry, maybe not a bug, but lack of wisdom: See https://stackoverflow.com/a/12310128/6607497
Comment 2•2 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::CSS Parsing and Computation' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 3•2 years ago
|
||
Per https://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
In CSS, identifiers (including element names, classes, and IDs in selectors) can contain only the characters [a-zA-Z0-9] and ISO 10646 characters U+00A0 and higher, plus the hyphen (-) and the underscore (_); they cannot start with a digit, two hyphens, or a hyphen followed by a digit. Identifiers can also contain escaped characters and any ISO 10646 character as a numeric code (see next item). For instance, the identifier "B&W?" may be written as "B&W?" or "B\26 W\3F".
Description
•