New issue
Advanced search Search tips

Issue 782103 link

Starred by 1 user

Issue metadata

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

Blocking:
issue 545318



Sign in to add a comment

[css-typed-om] Implement serialization for CSSStyleValues

Project Member Reported by shend@chromium.org, Nov 7 2017

Issue description

We currently just convert the style values into CSSValues and serialize that, which may not be what the spec requires.

Spec: https://drafts.css-houdini.org/css-typed-om-1/#stylevalue-serialization
 
Project Member

Comment 1 by bugdroid1@chromium.org, Nov 10 2017

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

commit bb0e4d778c32f40aaee2d29c9ca9b4223ed0d552
Author: Darren Shen <shend@chromium.org>
Date: Fri Nov 10 03:18:17 2017

[css-typed-om] Add tests for serialization from IDL constructed values.

This patch adds some tests for serialization of style values constructed
from the IDL. Tests for the following classes were added:
 - CSSKeywordValue
 - CSSUnitValue
 - CSSPositionValue

There's currently three types of serialization [1]. We are testing the
second case ("the value was constructed using an IDL constructor").
Along with testing the IDL constructor, we also test what happens when
we obtain a CSSStyleValue from a DOMString or CSSOM (case 1 and 3) and
modify it using IDL setters. Currently our code will trivially pass
this test, but it'll be harder when we implement all three
serialization types, as the style value needs to remember whether which
case it belongs to.

There's a failing test due to the fact that we haven't implemented
normalization of <position> values.

Bug:  782103 ,  774887 
Change-Id: I4a379dcb51ea718642e6889f9c0b63bf0bc7d60c
Reviewed-on: https://chromium-review.googlesource.com/759407
Reviewed-by: nainar <nainar@chromium.org>
Commit-Queue: Darren Shen <shend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#515438}
[delete] https://crrev.com/f15ede50a29d9d4bf0d3aeb2ddc67188a0188b83/third_party/WebKit/LayoutTests/typedcssom/cssKeywordValue.html
[modify] https://crrev.com/bb0e4d778c32f40aaee2d29c9ca9b4223ed0d552/third_party/WebKit/LayoutTests/typedcssom/cssUnitValue.html
[add] https://crrev.com/bb0e4d778c32f40aaee2d29c9ca9b4223ed0d552/third_party/WebKit/LayoutTests/typedcssom/stylevalue-serialization/cssKeywordValue.html
[add] https://crrev.com/bb0e4d778c32f40aaee2d29c9ca9b4223ed0d552/third_party/WebKit/LayoutTests/typedcssom/stylevalue-serialization/cssPositionValue-expected.txt
[add] https://crrev.com/bb0e4d778c32f40aaee2d29c9ca9b4223ed0d552/third_party/WebKit/LayoutTests/typedcssom/stylevalue-serialization/cssPositionValue.html
[add] https://crrev.com/bb0e4d778c32f40aaee2d29c9ca9b4223ed0d552/third_party/WebKit/LayoutTests/typedcssom/stylevalue-serialization/cssUnitValue.html

Project Member

Comment 2 by bugdroid1@chromium.org, Nov 17 2017

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

commit 2a8f2e7a405af42c98496c6eb826d5a0ae36451b
Author: Darren Shen <shend@chromium.org>
Date: Fri Nov 17 03:08:51 2017

[css-typed-om] Add test for serializing CSSUrlImageValue.

This patch adds a test for serializing CSSUrlImageValue. Note that we
serialize with quotes surrounding the URL, something which is not
explicitly stated in the spec. We've asked clarification about this [1].

Spec: https://drafts.css-houdini.org/css-typed-om-1/#urlimagevalue-serialization

[1] https://github.com/w3c/css-houdini-drafts/issues/519

Bug:  782103 
Change-Id: I46b5669eb7cbf030eacc6aaa60be0649c9b11e24
Reviewed-on: https://chromium-review.googlesource.com/770601
Reviewed-by: Bugs Nash <bugsnash@chromium.org>
Commit-Queue: Darren Shen <shend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#517266}
[add] https://crrev.com/2a8f2e7a405af42c98496c6eb826d5a0ae36451b/third_party/WebKit/LayoutTests/typedcssom/stylevalue-serialization/cssUrlImageValue.html

Comment 3 by shend@chromium.org, Nov 27 2017

Labels: -Hotlist-Interop
Labels: -Update-Monthly
Project Member

Comment 5 by bugdroid1@chromium.org, Dec 6 2017

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

commit 4a14b70514c2be8df7adcc0b9af05472bbada279
Author: Darren Shen <shend@chromium.org>
Date: Wed Dec 06 08:03:10 2017

[css-typed-om] Implement CSSUnparsedValue serialization.

This patch implements serialization of CSSUnparsedValue correctly.
There was a previous implementation, but stuff like 'var(--A)'
serialized to '--A', not 'var(--A)'.

Spec: https://drafts.css-houdini.org/css-typed-om-1/#unparsedvalue-serialization

Bug:  782103 
Change-Id: Ieaecddb2f1a271b023e4fb7a720077e5ffcfc01f
Reviewed-on: https://chromium-review.googlesource.com/805176
Commit-Queue: Darren Shen <shend@chromium.org>
Reviewed-by: nainar <nainar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#522040}
[modify] https://crrev.com/4a14b70514c2be8df7adcc0b9af05472bbada279/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/inlineStylePropertyMap_iteration.html
[add] https://crrev.com/4a14b70514c2be8df7adcc0b9af05472bbada279/third_party/WebKit/LayoutTests/typedcssom/stylevalue-serialization/cssUnparsedValue.html
[modify] https://crrev.com/4a14b70514c2be8df7adcc0b9af05472bbada279/third_party/WebKit/Source/core/css/cssom/CSSStyleVariableReferenceValue.h
[modify] https://crrev.com/4a14b70514c2be8df7adcc0b9af05472bbada279/third_party/WebKit/Source/core/css/cssom/CSSUnparsedValue.cpp
[modify] https://crrev.com/4a14b70514c2be8df7adcc0b9af05472bbada279/third_party/WebKit/Source/core/css/cssom/CSSUnparsedValue.h

Project Member

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

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

commit 0238df86acf04677be92279b8b8f78f6f046afca
Author: Darren Shen <shend@chromium.org>
Date: Mon Jan 01 23:35:06 2018

[css-typed-om] Add basic serialization for CSSMathValues.

Currently serialization of CSSMathValues is not spec'd. However, it's
needed for serialization of other things like CSSTransformValue.
So we just implement basic serialization of CSSMathValues, returning
"" for any case that we're not sure what the behaviour should be.

"spec": https://drafts.css-houdini.org/css-typed-om-1/#calc-serialization

Bug:  782103 
Change-Id: I29a685ec2276f1fca314d885a4c5cd563546864b
Reviewed-on: https://chromium-review.googlesource.com/844273
Reviewed-by: nainar <nainar@chromium.org>
Commit-Queue: Darren Shen <shend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#526430}
[add] https://crrev.com/0238df86acf04677be92279b8b8f78f6f046afca/third_party/WebKit/LayoutTests/typedcssom/stylevalue-serialization/cssMathValue.html
[modify] https://crrev.com/0238df86acf04677be92279b8b8f78f6f046afca/third_party/WebKit/Source/core/css/BUILD.gn
[modify] https://crrev.com/0238df86acf04677be92279b8b8f78f6f046afca/third_party/WebKit/Source/core/css/cssom/CSSMathInvert.h
[modify] https://crrev.com/0238df86acf04677be92279b8b8f78f6f046afca/third_party/WebKit/Source/core/css/cssom/CSSMathMax.h
[modify] https://crrev.com/0238df86acf04677be92279b8b8f78f6f046afca/third_party/WebKit/Source/core/css/cssom/CSSMathMin.h
[modify] https://crrev.com/0238df86acf04677be92279b8b8f78f6f046afca/third_party/WebKit/Source/core/css/cssom/CSSMathNegate.h
[modify] https://crrev.com/0238df86acf04677be92279b8b8f78f6f046afca/third_party/WebKit/Source/core/css/cssom/CSSMathProduct.cpp
[modify] https://crrev.com/0238df86acf04677be92279b8b8f78f6f046afca/third_party/WebKit/Source/core/css/cssom/CSSMathProduct.h
[modify] https://crrev.com/0238df86acf04677be92279b8b8f78f6f046afca/third_party/WebKit/Source/core/css/cssom/CSSMathSum.cpp
[modify] https://crrev.com/0238df86acf04677be92279b8b8f78f6f046afca/third_party/WebKit/Source/core/css/cssom/CSSMathSum.h
[add] https://crrev.com/0238df86acf04677be92279b8b8f78f6f046afca/third_party/WebKit/Source/core/css/cssom/CSSMathValue.cpp
[modify] https://crrev.com/0238df86acf04677be92279b8b8f78f6f046afca/third_party/WebKit/Source/core/css/cssom/CSSMathValue.h
[modify] https://crrev.com/0238df86acf04677be92279b8b8f78f6f046afca/third_party/WebKit/Source/core/css/cssom/CSSNumericValue.h
[modify] https://crrev.com/0238df86acf04677be92279b8b8f78f6f046afca/third_party/WebKit/Source/core/css/cssom/CSSPerspective.cpp
[modify] https://crrev.com/0238df86acf04677be92279b8b8f78f6f046afca/third_party/WebKit/Source/core/css/cssom/CSSPositionValue.cpp
[modify] https://crrev.com/0238df86acf04677be92279b8b8f78f6f046afca/third_party/WebKit/Source/core/css/cssom/CSSRotation.cpp
[modify] https://crrev.com/0238df86acf04677be92279b8b8f78f6f046afca/third_party/WebKit/Source/core/css/cssom/CSSScale.cpp
[modify] https://crrev.com/0238df86acf04677be92279b8b8f78f6f046afca/third_party/WebKit/Source/core/css/cssom/CSSStyleValue.cpp
[modify] https://crrev.com/0238df86acf04677be92279b8b8f78f6f046afca/third_party/WebKit/Source/core/css/cssom/CSSTranslation.cpp
[modify] https://crrev.com/0238df86acf04677be92279b8b8f78f6f046afca/third_party/WebKit/Source/core/css/cssom/CSSUnitValue.cpp
[modify] https://crrev.com/0238df86acf04677be92279b8b8f78f6f046afca/third_party/WebKit/Source/core/css/cssom/CSSUnitValue.h

Project Member

Comment 7 by bugdroid1@chromium.org, Jan 3 2018

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

commit f4649f3a002823b9e3b9cdac5ec9ba7286fa81f1
Author: Darren Shen <shend@chromium.org>
Date: Wed Jan 03 20:50:51 2018

[css-typed-om] Implement transform value serialization.

This patch implements transform value serialization.

Also fixes CSSRotation and CSSSKew serialization.

Spec: https://drafts.css-houdini.org/css-typed-om-1/#transformvalue-serialization

Bug:  782103 
Change-Id: I4d714ab245073fd2ffd236a308836ad8575b56e4
Reviewed-on: https://chromium-review.googlesource.com/844435
Commit-Queue: Darren Shen <shend@chromium.org>
Reviewed-by: meade_UTC10 <meade@chromium.org>
Cr-Commit-Position: refs/heads/master@{#526796}
[modify] https://crrev.com/f4649f3a002823b9e3b9cdac5ec9ba7286fa81f1/third_party/WebKit/LayoutTests/typedcssom/cssMatrixComponent.html
[modify] https://crrev.com/f4649f3a002823b9e3b9cdac5ec9ba7286fa81f1/third_party/WebKit/LayoutTests/typedcssom/cssPerspective.html
[modify] https://crrev.com/f4649f3a002823b9e3b9cdac5ec9ba7286fa81f1/third_party/WebKit/LayoutTests/typedcssom/cssRotation.html
[modify] https://crrev.com/f4649f3a002823b9e3b9cdac5ec9ba7286fa81f1/third_party/WebKit/LayoutTests/typedcssom/cssScale.html
[delete] https://crrev.com/8b08db3af3baa38986d4bfa1e3bc1b4060130d6f/third_party/WebKit/LayoutTests/typedcssom/cssSkew.html
[modify] https://crrev.com/f4649f3a002823b9e3b9cdac5ec9ba7286fa81f1/third_party/WebKit/LayoutTests/typedcssom/cssTranslation.html
[add] https://crrev.com/f4649f3a002823b9e3b9cdac5ec9ba7286fa81f1/third_party/WebKit/LayoutTests/typedcssom/stylevalue-serialization/cssTransformValue.html
[modify] https://crrev.com/f4649f3a002823b9e3b9cdac5ec9ba7286fa81f1/third_party/WebKit/Source/core/css/cssom/CSSRotation.cpp
[modify] https://crrev.com/f4649f3a002823b9e3b9cdac5ec9ba7286fa81f1/third_party/WebKit/Source/core/css/cssom/CSSSkew.cpp

Comment 8 by shend@chromium.org, Jan 15 2018

Status: Fixed (was: Assigned)
Most of this is done. Will close this and file separate issues for any interop bugs we encounter.

Sign in to add a comment