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] Fix DCHECK when creating a CSSUnitValue an empty unit. #9965

Merged
merged 1 commit into from Mar 13, 2018

Conversation

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

chromium-wpt-export-bot commented Mar 12, 2018

When we create a CSSUnitValue with '' as the unit, we hit a DCHECK
in the unit trie code because the length is 0. This is because we don't
correctly reject the empty string as an invalid unit.

In this patch we fix this. Interestingly, we already have a test to
assert that using an empty unit throws type error. However the test used
an incorrect variable name, causing it to throw a TypeError anyway,
so our tests would've passed no matter what.

Bug: 820905
Change-Id: I72ab5e4010d892042b2cfddf1014ab79d04a846d
Reviewed-on: https://chromium-review.googlesource.com/958624
Reviewed-by: nainar nainar@chromium.org
Commit-Queue: Darren Shen shend@chromium.org
Cr-Commit-Position: refs/heads/master@{#542693}

@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 Mar 12, 2018

Build PASSED

Started: 2018-03-13 02:19:36
Finished: 2018-03-13 02:23:28

View more information about this build on:

[css-typed-om] Fix DCHECK when creating a CSSUnitValue an empty unit.
When we create a CSSUnitValue with '' as the unit, we hit a DCHECK
in the unit trie code because the length is 0. This is because we don't
correctly reject the empty string as an invalid unit.

In this patch we fix this. Interestingly, we already have a test to
assert that using an empty unit throws type error. However the test used
an incorrect variable name, causing it to throw a TypeError anyway,
so our tests would've passed no matter what.

Bug: 820905
Change-Id: I72ab5e4010d892042b2cfddf1014ab79d04a846d
Reviewed-on: https://chromium-review.googlesource.com/958624
Reviewed-by: nainar <nainar@chromium.org>
Commit-Queue: Darren Shen <shend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#542693}

@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-958624 branch from 47dd004 to b6c48f3 Mar 13, 2018

@chromium-wpt-export-bot chromium-wpt-export-bot merged commit 592bb79 into master Mar 13, 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-958624 branch Mar 13, 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.