Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-typed-om] Make StylePropertyMap.set work with calcs. #9535

Merged
merged 1 commit into from Feb 16, 2018

Conversation

Projects
None yet
4 participants
@chromium-wpt-export-bot
Copy link
Collaborator

chromium-wpt-export-bot commented Feb 15, 2018

Currently StylePropertyMap.set doesn't actually work with calcs.
The current way to check if something is, say, a 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}

@wpt-pr-bot
Copy link
Collaborator

wpt-pr-bot left a comment

Already reviewed downstream.

@w3c-bots

This comment has been minimized.

Copy link

w3c-bots commented Feb 15, 2018

Build PASSED

Started: 2018-02-16 05:35:29
Finished: 2018-02-16 05:56:18

Failing Jobs

  • chrome:dev
  • safari:11.0
  • MicrosoftEdge:16.16299

View more information about this build on:

@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-901002 branch from e3a74fa to 33bdfea Feb 16, 2018

[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}

@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-901002 branch from 33bdfea to aeb9bbd Feb 16, 2018

@chromium-wpt-export-bot chromium-wpt-export-bot merged commit b52a7a2 into master Feb 16, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@chromium-wpt-export-bot chromium-wpt-export-bot deleted the chromium-export-cl-901002 branch Feb 16, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.