Summary: | CSS logical longhands are not enumerated in the computed style. | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Emilio Cobos Álvarez (:emilio) <emilio> | ||||||||
Component: | CSS | Assignee: | Emilio Cobos Álvarez (:emilio) <emilio> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | esprehn+autocc, ews-watchlist, glenn, gyuyoung.kim, koivisto, macpherson, menard, obrufau, simon.fraser, webkit-bug-importer | ||||||||
Priority: | P2 | Keywords: | InRadar, WebExposed | ||||||||
Version: | WebKit Nightly Build | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=239910 | ||||||||||
Bug Depends on: | |||||||||||
Bug Blocks: | 210707 | ||||||||||
Attachments: |
|
The relevant spec is https://drafts.csswg.org/cssom/#supported-css-property: > The term supported CSS property refers to a CSS property that the user agent implements, including any vendor-prefixed properties, but excluding custom properties. A supported CSS property must be in its lowercase form for the purpose of comparisons in this specification. And https://drafts.csswg.org/cssom/#dom-window-getcomputedstyle: > set decls to a list of all longhand properties that are supported CSS properties, in lexicographical order, with the value being the resolved value computed for obj using the style rules associated with doc. So I guess enumerating shorthands altogether is a bit bogus. Ah, so I think I know where this goes wrong. This is indeed a bug, the intention is that shorthands are not emitted looking at makeprop.pl I think I can write the fix for this, just having some issues running tests locally :) Dang, I think I checked `Reflect.ownKeys(computedStyle)` but forgot about `[...computedStyle]`. Created attachment 396878 [details]
Patch
Created attachment 396879 [details]
Patch
Comment on attachment 396879 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=396879&action=review > LayoutTests/ChangeLog:8 > + Add a test enumerating all entries in the style. This is a bit I tried to do the same when I added the option to hide a CSS property behind a runtime flag. But the problem is that the boots run the test in multiple platforms (windows, linux, and multiple mac versions). Each platform has its own default compile flags which can show or hide CSS properties. So you need lots of different expectations, which seemed too annoying. What about just omitting the platform-dependent properties? Seems it'd get most of the benefit and none of the pain. Comment on attachment 396879 [details]
Patch
It would probably be good to keep these enumeration tests to minimum due to maintenance needs. There appears to be LayoutTests/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml.html already.
Created attachment 396902 [details]
Patch for landing
(In reply to Antti Koivisto from comment #10) > It would probably be good to keep these enumeration tests to minimum due to > maintenance needs. There appears to be > LayoutTests/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial- > xml.html already. Yes, I updated that test instead and removed the one I added. Thank you for the review! Committed r260335: <https://trac.webkit.org/changeset/260335> All reviewed patches have been landed. Closing bug and clearing flags on attachment 396902 [details]. |
It contains only the shorthands, e.g.: > [...getComputedStyle(document.body)].filter(prop => prop.includes("block")) ["border-block", "border-block-color", "border-block-end", "border-block-start", "border-block-style", "border-block-width", "inset-block", "margin-block", "padding-block"] Per spec it should contain logical longhands as well.