New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 827521 link

Starred by 2 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug

Blocked on:
issue 661854



Sign in to add a comment

CSSStyleDeclaration.setProperty() and StylePropertyMap.set() fails parsing values

Reported by vinc...@iamvdo.me, Mar 30 2018

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36

Steps to reproduce the problem:
1. Set new custom properties with CSSStyleDeclaration.setProperty()
eg: document.body.style.setProperty('--a', 'a.1')
2. Value is parsed as "a0.1"

Same problem with new Typed OM
1. Use document.body.attributeStyleMap.set('--a', 'a.1')
2. Value is parsed as "a00.1"

What is the expected behavior?

What went wrong?
Value should be "a.1" 

Did this work before? N/A 

Does this work in other browsers? Yes

Chrome version: 65.0.3325.181  Channel: stable
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version:
 

Comment 1 by woxxom@gmail.com, Mar 31 2018

Note, the result is incorrect even if we use CSSUnparsedValue explicitly:

  document.body.attributeStyleMap.set('--a', new CSSUnparsedValue(['a.1']))
  document.body.attributeStyleMap.get('--a')

Produces:

  CSSUnparsedValue {0: "a0.1", length: 1}

Expected:

  CSSUnparsedValue {0: "a.1", length: 1}
Labels: Needs-Triage-M65
Components: Blink>CSS
Cc: krajshree@chromium.org
Labels: Triaged-ET Needs-Feedback
Able to reproduce the issue on Win-7, mac 10.13.3 and ubuntu 17.10 using latest canary #67.0.3386.1 and latest beta #66.0.3359.66 i.e On pasting document.body.attributeStyleMap.set('--a', new CSSUnparsedValue(['a.1']))
  document.body.attributeStyleMap.get('--a') in console got CSSUnparsedValue {0: "a0.1", length: 1}. But using chrome stable version #65.0.3325.181 and chrome version #60.0.3100.0 got an uncaught TypeError: Cannot read property 'set' of undefined at <anonymous>:1.33.

Attached a screen cast for reference.

vincent@ - Could you please check the attached screen cast and please provide your inputs for further triaging of the issue.

Thanks...!!
827521.mp4
892 KB View Download

Comment 5 by vinc...@iamvdo.me, Apr 3 2018

Yes, that’s right! attributeStyleMap is part of CSS Typed OM and available only Chrome 66+.
Project Member

Comment 6 by sheriffbot@chromium.org, Apr 3 2018

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding the requester to the cc list.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 7 by e...@chromium.org, Apr 4 2018

Cc: shend@chromium.org
Status: Available (was: Unconfirmed)

Comment 8 by shend@chromium.org, Apr 4 2018

Labels: -OS-Windows
Sounds like something weird in the custom property parser (removing Windows only label). My random guess: we are parsing .1 as a decimal number token and automatically prepending the '0' as a result of serialization.

Comment 9 by shend@chromium.org, Apr 4 2018

Blockedon: 661854
I think custom property input preservation would fix this on the CSSOM side, and maybe also the Typed OM side (depending on how it's fixed).

Sign in to add a comment