Closed Bug 1438416 Opened 4 years ago Closed 4 years ago

[wpt-sync] PR 9535 - [css-typed-om] Make StylePropertyMap.set work with calcs.

Categories

(Testing :: web-platform-tests, enhancement)

enhancement
Not set
normal

Tracking

(firefox61 fixed)

RESOLVED FIXED
mozilla61
Tracking Status
firefox61 --- fixed

People

(Reporter: mozilla.org, Unassigned)

Details

(Whiteboard: [wptsync downstream error])

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
WPT-Export-Revision: 07699e1a28a9572b82c54adc8c5ca2569cb6394f
Whiteboard: [wptsync downstream] → [wptsync downstream error]
Pushed by james@hoppipolla.co.uk:
https://hg.mozilla.org/integration/mozilla-inbound/rev/44e5006d2987
[wpt PR 9535] - [css-typed-om] Make StylePropertyMap.set work with calcs., a=testonly
https://hg.mozilla.org/mozilla-central/rev/44e5006d2987
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
You need to log in before you can comment on or make changes to this bug.