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:
,
Apr 1 2018
,
Apr 1 2018
,
Apr 3 2018
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...!!
,
Apr 3 2018
Yes, that’s right! attributeStyleMap is part of CSS Typed OM and available only Chrome 66+.
,
Apr 3 2018
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
,
Apr 4 2018
,
Apr 4 2018
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.
,
Apr 4 2018
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 |
||||||||
Comment 1 by woxxom@gmail.com
, Mar 31 2018Note, 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}