[css-typed-om] Make StylePropertyMap.set work with calcs.
Currently StylePropertyMap.set doesn't actually work with calcs. The current way to check if something is, say, a <length> is to check its CSSStyleValue::Type. However, this doesn't return the right value for CSSMathValues, whose types may be quite complicated. The correct way is to use the CSSNumericValue matching algorthms: CSSNumericValue::MatchesLength, which also takes into account CSSMathValues and percent hints. This patch changes the following to make this work: - Removed base types from CSSStyleValue::StyleValueType. A base type like "length" is not really a CSSStyleValue type. - Removed unused StyleValueTypeToString. - Changed "Percent" to "Percentage" in CSSProperties.json5 as that's the correct term. - Changed make_cssom_types to use the matching algorithms from CSSNumericValue. Bug: 545318 Change-Id: I16aa71a4873e9992749f0f52ba641671d109170e Reviewed-on: https://chromium-review.googlesource.com/901002 Commit-Queue: Darren Shen <shend@chromium.org> Reviewed-by:nainar <nainar@chromium.org> Cr-Commit-Position: refs/heads/master@{#537206}
Showing
Please register or sign in to comment