CSS Typed OM: Proper types for custom props during iteration.
Currently, you get CSSUnparsedValues when iterating entries on the .computedStyleMap(), even for properties which are registered with a type. However, if you do .computedStyleMap().get(...) with a registered property, you _do_ get the correct type. This is because ComputedStyleCSSValueMapping::Get properly looks up the typed values on the ComputedStyle, but ::GetVariables does not; instead it directly returns the CSSVariableData for everything, regardless of registrations. This patch changes the behavior of iteration to use the same code path as .get(). This ensures that we either create a CSSCustomProperty- Declaration on the fly for unregistered properties, or we re-use the existing (and typed) CSSValue for registered properties. Note: I initially wanted to do a nested iterator thing here, but dropped it because we would anyway need a temp HashSet to avoid potential duplicates from the StyleInheritedVariables-root. Note: One caller of GetVariables() just wants the size. It's possibly a little overkill to create entire HashMap just to count something, but I don't want to resolve that here in the same patch. R=futhark@chromium.org, haraken@chromium.org Bug: 850072 Change-Id: I64bfb3cc22a377cf956420a9e64d47ca3daac1e2 Reviewed-on: https://chromium-review.googlesource.com/1090848Reviewed-by:Rune Lillesveen <futhark@chromium.org> Commit-Queue: Anders Ruud <andruud@chromium.org> Cr-Commit-Position: refs/heads/master@{#565605}
Showing
Please register or sign in to comment