New issue
Advanced search Search tips

Issue 820905 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

[css-typed-om] DCHECK fail when creating CSSUnitValue with empty units

Project Member Reported by shend@chromium.org, Mar 12 2018

Issue description

When we do `new CSSUnitValue(0, '')`, we DCHECK fail in the trie code.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Mar 13 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/072aa3160b98cf57fc8e1be82655f6a3b47b54e9

commit 072aa3160b98cf57fc8e1be82655f6a3b47b54e9
Author: Darren Shen <shend@chromium.org>
Date: Tue Mar 13 02:06:36 2018

[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}
[modify] https://crrev.com/072aa3160b98cf57fc8e1be82655f6a3b47b54e9/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/numeric-objects/cssUnitValue.tentative.html
[modify] https://crrev.com/072aa3160b98cf57fc8e1be82655f6a3b47b54e9/third_party/WebKit/Source/core/css/cssom/CSSNumericValue.cpp

Comment 2 by shend@chromium.org, Mar 13 2018

Status: Fixed (was: Started)

Sign in to add a comment