New issue
Advanced search Search tips

Issue 819098 link

Starred by 1 user

Issue metadata

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

Blocking:
issue 545318



Sign in to add a comment

[css-typed-om] CSSStyleValue.parse with empty string DCHECKs.

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

Issue description

When we parse a custom property with an empty string (e.g. CSSStyleValue.parse("--Foo", ""), we hit a DCHECK failure.
 
Project Member

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

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

commit ab5c06e68fe24e55572a69374b36b1d7fd83c4c5
Author: Darren Shen <shend@chromium.org>
Date: Tue Mar 06 19:30:33 2018

[css-typed-om] Fix crash when parsing an empty string.

When we parse a custom property with an empty string, we hit a DCHECK
that asserts that there's at least one token.

We now throw a TypeError when given an empty string, since a custom
property only matches one or more tokens [1].

[1] https://drafts.csswg.org/css-syntax-3/#typedef-declaration-value

Bug:  819098 
Change-Id: I2d5ef71fb36011d0e2efc5e1c3664cb3c8a69f6b
Reviewed-on: https://chromium-review.googlesource.com/950624
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Commit-Queue: nainar <nainar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#541172}
[modify] https://crrev.com/ab5c06e68fe24e55572a69374b36b1d7fd83c4c5/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-objects/parse-invalid.html
[modify] https://crrev.com/ab5c06e68fe24e55572a69374b36b1d7fd83c4c5/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-objects/parseAll-invalid.html
[modify] https://crrev.com/ab5c06e68fe24e55572a69374b36b1d7fd83c4c5/third_party/WebKit/Source/core/css/cssom/StyleValueFactory.cpp

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

Status: Fixed (was: Started)

Sign in to add a comment