CSS Properties & Values API: Repeated registered properties show up as CSSStyleValue in typed OM |
|||
Issue descriptionFor instance, for a property registered with <length>+ syntax, values on computedStyleMap should show up as CSSUnitValues.
,
Jul 12
,
Jul 14
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/c80ecf5d3c1a8bc59a3f0c6bd9bfe226c316cc02 commit c80ecf5d3c1a8bc59a3f0c6bd9bfe226c316cc02 Author: Anders Hartvoll Ruud <andruud@chromium.org> Date: Sat Jul 14 23:02:53 2018 [css-properties-values-api] Support repeated values in Typed OM. This patch fixes two similar problems: 1. Computed list-valued properties show up as a CSSStyleValue when calling computedStyleMap().get(name). 2. Computed list-valued properties show up as a CSSStyleValue when calling computedStyleMap().getAll(name). The fixes are also similar: 1. StylePropertyMapReadOnly::get only checked property.IsRepeated() when determining whether it should look inside a possible list. However, CSSPropertyVariable is never repeated. This is because CSSPropertyVariable does not represent a single, specific custom property, but rather _all_ custom properties. For CSSPropertyVariable, if we have a CSSValueList, it means that it is registered with either '<foo>+', or '<foo>#', and that makes it a "list valued property" [1]. 2. Similar to (1), the value would be treated as unsupported if property. IsRepeated() was false. Again, a situation of CSSPropertyVariable+ CSSValueList means that the property is registered as a list. Note1: The value for a custom property can only be a CSSValueList if the runtime enabled feature CSSVariables2 is enabled. In all other cases, it's a CSSCustomPropertyDeclaration. See ComputedStyleCSSValueMapping::Get ('registry' is nullptr without the feature). Note2: It might make more sense to ignore the repeatability of the property, and instead just look at whether we actually have a CSSValueList, but such a change would require a change of the css-typed-om spec. [1] https://drafts.css-houdini.org/css-typed-om-1/#list-valued-properties https://drafts.css-houdini.org/css-typed-om-1/#reify-stylevalue R=chrishtr@chromium.org Bug: 862152 Change-Id: Ic854f54f14313b6b683601d0677dcc1dd4205ccd Reviewed-on: https://chromium-review.googlesource.com/1136295 Reviewed-by: Chris Harrelson <chrishtr@chromium.org> Commit-Queue: Anders Ruud <andruud@chromium.org> Cr-Commit-Position: refs/heads/master@{#575166} [modify] https://crrev.com/c80ecf5d3c1a8bc59a3f0c6bd9bfe226c316cc02/third_party/WebKit/LayoutTests/external/wpt/css/css-properties-values-api/typedom.tentative.html [modify] https://crrev.com/c80ecf5d3c1a8bc59a3f0c6bd9bfe226c316cc02/third_party/blink/renderer/core/css/cssom/style_property_map_read_only.cc [modify] https://crrev.com/c80ecf5d3c1a8bc59a3f0c6bd9bfe226c316cc02/third_party/blink/renderer/core/css/cssom/style_value_factory.cc
,
Aug 13
|
|||
►
Sign in to add a comment |
|||
Comment 1 by andruud@chromium.org
, Jul 12