| Summary: | [cssom] Computed styles shouldn't index shorthands with 1 longhand | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Oriol Brufau <obrufau> | ||||||
| Component: | CSS | Assignee: | Oriol Brufau <obrufau> | ||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Normal | CC: | darin, esprehn+autocc, ews-watchlist, glenn, gyuyoung.kim, macpherson, menard, ntim, webkit-bug-importer | ||||||
| Priority: | P2 | Keywords: | InRadar | ||||||
| Version: | WebKit Nightly Build | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| Attachments: |
|
||||||||
Created attachment 459681 [details]
Patch
Comment on attachment 459681 [details]
Patch
r=me
No reviewer information in commit message, blocking PR #None Created attachment 459754 [details]
Patch
Committed r294799 (250955@main): <https://commits.webkit.org/250955@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 459754 [details]. |
A computed style shouldn't index shorthands: var props = new Set(getComputedStyle(document.documentElement)); props.has("margin-left"); // true props.has("margin"); // false However, shorthands that have a single longhand are indexed: https://webkit-search.igalia.com/webkit/rev/0d5437dbaa7bdb52f60b64bc7dd5a39adee14e81/Source/WebCore/css/makeprop.pl#215 var props = new Set(getComputedStyle(document.documentElement)); props.has("-webkit-text-orientation"); // true This is wrong. Being a shorthand of a single property typically happens with legacy shorthands (https://www.w3.org/TR/css-cascade-5/#legacy-shorthand) In this case, -webkit-text-orientation is the legacy name of text-orientation, but it can't be an alias because they have different syntax. But aliases are not indexed, so it doesn't make sense that if an alias is turned into a shorthand, it becomes indexed in the computed style. The list of affected properties can be obtained with var el = document.documentElement; [...getComputedStyle(el)].filter(prop => { el.style.cssText = prop + ": initial"; return el.style.length === 1 && el.style[0] !== prop; }); * page-break-after (legacy shorthand of break-after) * page-break-before (legacy shorthand of break-before) * page-break-inside (legacy shorthand of break-inside) * text-decoration (shorthand of text-decoration-line, it should have more longhands, see bug 230083) * text-decoration-skip (shorthand of text-decoration-skip-ink, no other longhand has been implemented) * -webkit-column-break-after (legacy shorthand of break-after) * -webkit-column-break-before (legacy shorthand of break-before) * -webkit-column-break-inside (legacy shorthand of break-inside) * -webkit-text-orientation (legacy shorthand of text-orientation) Bug 104805 is also turning -webkit-perspective into a legacy shorthand of perspective