New issue
Advanced search Search tips

Issue 776173 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Dec 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 545318



Sign in to add a comment

[css-typed-om] Implement CSSMathValue and its subclasses

Project Member Reported by shend@chromium.org, Oct 18 2017

Issue description

Project Member

Comment 1 by bugdroid1@chromium.org, Oct 27 2017

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

commit d59a8f8f819d2e7c8614290249494eac297ef458
Author: Darren Shen <shend@chromium.org>
Date: Fri Oct 27 01:04:26 2017

[css-typed-om] Add IDLs for CSSMathValue and friends.

Spec: https://drafts.css-houdini.org/css-typed-om-1/#complex-numeric

This patch adds (incomplete) IDLs for:
- CSSMathValue
- CSSMathSum
- CSSMathProduct
- CSSMathMin
- CSSMathMax

(Note we will implement Negate and Invert later because they are not
 variadic).

We also:
- Define CSSNumberish as a typedef.
- Implement the "operator" attribute on CSSMathValue.
- Define the constructors for each subclass.

All tests pass.

Bug:  776173 
Change-Id: Ic026693eadbb3730156f9f8b0bad9f309798adf5
Reviewed-on: https://chromium-review.googlesource.com/727391
Commit-Queue: Darren Shen <shend@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: meade_UTC10 <meade@chromium.org>
Cr-Commit-Position: refs/heads/master@{#512048}
[modify] https://crrev.com/d59a8f8f819d2e7c8614290249494eac297ef458/third_party/WebKit/LayoutTests/http/tests/worklet/webexposed/global-interface-listing-paint-worklet-expected.txt
[add] https://crrev.com/d59a8f8f819d2e7c8614290249494eac297ef458/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/cssMathValue.html
[modify] https://crrev.com/d59a8f8f819d2e7c8614290249494eac297ef458/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/d59a8f8f819d2e7c8614290249494eac297ef458/third_party/WebKit/Source/bindings/core/v8/BUILD.gn
[modify] https://crrev.com/d59a8f8f819d2e7c8614290249494eac297ef458/third_party/WebKit/Source/core/core_idl_files.gni
[modify] https://crrev.com/d59a8f8f819d2e7c8614290249494eac297ef458/third_party/WebKit/Source/core/css/BUILD.gn
[add] https://crrev.com/d59a8f8f819d2e7c8614290249494eac297ef458/third_party/WebKit/Source/core/css/cssom/CSSMathMax.h
[add] https://crrev.com/d59a8f8f819d2e7c8614290249494eac297ef458/third_party/WebKit/Source/core/css/cssom/CSSMathMax.idl
[add] https://crrev.com/d59a8f8f819d2e7c8614290249494eac297ef458/third_party/WebKit/Source/core/css/cssom/CSSMathMin.h
[add] https://crrev.com/d59a8f8f819d2e7c8614290249494eac297ef458/third_party/WebKit/Source/core/css/cssom/CSSMathMin.idl
[add] https://crrev.com/d59a8f8f819d2e7c8614290249494eac297ef458/third_party/WebKit/Source/core/css/cssom/CSSMathProduct.h
[add] https://crrev.com/d59a8f8f819d2e7c8614290249494eac297ef458/third_party/WebKit/Source/core/css/cssom/CSSMathProduct.idl
[add] https://crrev.com/d59a8f8f819d2e7c8614290249494eac297ef458/third_party/WebKit/Source/core/css/cssom/CSSMathSum.h
[add] https://crrev.com/d59a8f8f819d2e7c8614290249494eac297ef458/third_party/WebKit/Source/core/css/cssom/CSSMathSum.idl
[add] https://crrev.com/d59a8f8f819d2e7c8614290249494eac297ef458/third_party/WebKit/Source/core/css/cssom/CSSMathValue.h
[add] https://crrev.com/d59a8f8f819d2e7c8614290249494eac297ef458/third_party/WebKit/Source/core/css/cssom/CSSMathValue.idl
[modify] https://crrev.com/d59a8f8f819d2e7c8614290249494eac297ef458/third_party/WebKit/Source/core/css/cssom/CSSNumericValue.h
[modify] https://crrev.com/d59a8f8f819d2e7c8614290249494eac297ef458/third_party/WebKit/Source/core/css/cssom/CSSNumericValue.idl
[modify] https://crrev.com/d59a8f8f819d2e7c8614290249494eac297ef458/third_party/WebKit/Source/core/css/cssom/CSSStyleValue.h

Project Member

Comment 2 by bugdroid1@chromium.org, Oct 30 2017

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

commit 774c7751456b8ebbc434f6bf7e4cb73e6ef6c3fb
Author: Darren Shen <shend@chromium.org>
Date: Mon Oct 30 06:55:31 2017

[css-typed-om] Add IDLs CSSMathNegate and CSSMathInvert.

This patch adds the new CSSMathValue subclasses CSSMathNegate and
CSSMathInvert. Note that we only implement the constructor and
attributes. More complicated things like typing or arithmetic will
be done in a later patch.

Spec: https://drafts.css-houdini.org/css-typed-om-1/#complex-numeric

Bug:  776173 
Change-Id: I7183df9c269db6eb799f93d39c0d8b1e541f7991
Reviewed-on: https://chromium-review.googlesource.com/743201
Commit-Queue: Darren Shen <shend@chromium.org>
Reviewed-by: meade_UTC10 <meade@chromium.org>
Cr-Commit-Position: refs/heads/master@{#512448}
[modify] https://crrev.com/774c7751456b8ebbc434f6bf7e4cb73e6ef6c3fb/third_party/WebKit/LayoutTests/http/tests/worklet/webexposed/global-interface-listing-paint-worklet-expected.txt
[modify] https://crrev.com/774c7751456b8ebbc434f6bf7e4cb73e6ef6c3fb/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/cssMathValue.html
[modify] https://crrev.com/774c7751456b8ebbc434f6bf7e4cb73e6ef6c3fb/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/774c7751456b8ebbc434f6bf7e4cb73e6ef6c3fb/third_party/WebKit/Source/core/core_idl_files.gni
[add] https://crrev.com/774c7751456b8ebbc434f6bf7e4cb73e6ef6c3fb/third_party/WebKit/Source/core/css/cssom/CSSMathInvert.h
[add] https://crrev.com/774c7751456b8ebbc434f6bf7e4cb73e6ef6c3fb/third_party/WebKit/Source/core/css/cssom/CSSMathInvert.idl
[add] https://crrev.com/774c7751456b8ebbc434f6bf7e4cb73e6ef6c3fb/third_party/WebKit/Source/core/css/cssom/CSSMathNegate.h
[add] https://crrev.com/774c7751456b8ebbc434f6bf7e4cb73e6ef6c3fb/third_party/WebKit/Source/core/css/cssom/CSSMathNegate.idl
[modify] https://crrev.com/774c7751456b8ebbc434f6bf7e4cb73e6ef6c3fb/third_party/WebKit/Source/core/css/cssom/CSSNumericValue.cpp
[modify] https://crrev.com/774c7751456b8ebbc434f6bf7e4cb73e6ef6c3fb/third_party/WebKit/Source/core/css/cssom/CSSNumericValue.h
[modify] https://crrev.com/774c7751456b8ebbc434f6bf7e4cb73e6ef6c3fb/third_party/WebKit/Source/core/css/cssom/CSSStyleValue.h

Project Member

Comment 3 by bugdroid1@chromium.org, Nov 9 2017

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

commit 1c059bf7ff0dee02361965805348e1addf1dd846
Author: Darren Shen <shend@chromium.org>
Date: Thu Nov 09 22:21:26 2017

[css-typed-om] Add types for CSSNumericValues.

This patch adds the concept of a numeric type for all CSSNumericValues
and implement it for CSSUnitValues. A type is defined as a map of
"base types" to integers, with an optional "percent hint".

Spec: https://drafts.css-houdini.org/css-typed-om-1/#numeric-typing
      https://drafts.css-houdini.org/css-typed-om-1/#create-a-type

Bug:  776173 
Change-Id: I38dafaafeba2858335eb92edb3e6647b8ff57b28
Reviewed-on: https://chromium-review.googlesource.com/755943
Commit-Queue: Darren Shen <shend@chromium.org>
Reviewed-by: meade_UTC10 <meade@chromium.org>
Cr-Commit-Position: refs/heads/master@{#515318}
[modify] https://crrev.com/1c059bf7ff0dee02361965805348e1addf1dd846/third_party/WebKit/Source/core/css/BUILD.gn
[modify] https://crrev.com/1c059bf7ff0dee02361965805348e1addf1dd846/third_party/WebKit/Source/core/css/cssom/CSSMathInvert.h
[modify] https://crrev.com/1c059bf7ff0dee02361965805348e1addf1dd846/third_party/WebKit/Source/core/css/cssom/CSSMathMax.h
[modify] https://crrev.com/1c059bf7ff0dee02361965805348e1addf1dd846/third_party/WebKit/Source/core/css/cssom/CSSMathMin.h
[modify] https://crrev.com/1c059bf7ff0dee02361965805348e1addf1dd846/third_party/WebKit/Source/core/css/cssom/CSSMathNegate.h
[modify] https://crrev.com/1c059bf7ff0dee02361965805348e1addf1dd846/third_party/WebKit/Source/core/css/cssom/CSSMathProduct.h
[modify] https://crrev.com/1c059bf7ff0dee02361965805348e1addf1dd846/third_party/WebKit/Source/core/css/cssom/CSSMathSum.h
[modify] https://crrev.com/1c059bf7ff0dee02361965805348e1addf1dd846/third_party/WebKit/Source/core/css/cssom/CSSMathValue.h
[modify] https://crrev.com/1c059bf7ff0dee02361965805348e1addf1dd846/third_party/WebKit/Source/core/css/cssom/CSSNumericValue.h
[add] https://crrev.com/1c059bf7ff0dee02361965805348e1addf1dd846/third_party/WebKit/Source/core/css/cssom/CSSNumericValueType.cpp
[add] https://crrev.com/1c059bf7ff0dee02361965805348e1addf1dd846/third_party/WebKit/Source/core/css/cssom/CSSNumericValueType.h
[modify] https://crrev.com/1c059bf7ff0dee02361965805348e1addf1dd846/third_party/WebKit/Source/core/css/cssom/CSSUnitValue.h
[modify] https://crrev.com/1c059bf7ff0dee02361965805348e1addf1dd846/third_party/WebKit/Source/core/css/cssom/CSSUnitValueTest.cpp

Project Member

Comment 4 by bugdroid1@chromium.org, Nov 14 2017

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

commit f89fd267ddcbedb488af79a43fc779437d44b790
Author: Darren Shen <shend@chromium.org>
Date: Tue Nov 14 02:54:09 2017

[css-typed-om] Implement types for CSSMathNegate and CSSMathInvert.

This patch implements numeric typing for CSSMathNegate/Invert.
The numeric type of Negate/Invert is simply the negation (negative) of
the type of the Negate/Invert value.

Spec: https://drafts.css-houdini.org/css-typed-om-1/#type-of-a-cssmathvalue

Bug:  776173 
Change-Id: I76efc54192b41faa2b0725ba9ec969df058441a8
Reviewed-on: https://chromium-review.googlesource.com/756013
Reviewed-by: meade_UTC10 <meade@chromium.org>
Reviewed-by: Renée Wright <rjwright@chromium.org>
Commit-Queue: Darren Shen <shend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#516157}
[modify] https://crrev.com/f89fd267ddcbedb488af79a43fc779437d44b790/third_party/WebKit/Source/core/BUILD.gn
[modify] https://crrev.com/f89fd267ddcbedb488af79a43fc779437d44b790/third_party/WebKit/Source/core/css/BUILD.gn
[modify] https://crrev.com/f89fd267ddcbedb488af79a43fc779437d44b790/third_party/WebKit/Source/core/css/cssom/CSSMathInvert.h
[add] https://crrev.com/f89fd267ddcbedb488af79a43fc779437d44b790/third_party/WebKit/Source/core/css/cssom/CSSMathInvertTest.cpp
[modify] https://crrev.com/f89fd267ddcbedb488af79a43fc779437d44b790/third_party/WebKit/Source/core/css/cssom/CSSMathNegate.h
[add] https://crrev.com/f89fd267ddcbedb488af79a43fc779437d44b790/third_party/WebKit/Source/core/css/cssom/CSSMathNegateTest.cpp
[modify] https://crrev.com/f89fd267ddcbedb488af79a43fc779437d44b790/third_party/WebKit/Source/core/css/cssom/CSSNumericValueType.cpp
[modify] https://crrev.com/f89fd267ddcbedb488af79a43fc779437d44b790/third_party/WebKit/Source/core/css/cssom/CSSNumericValueType.h

Project Member

Comment 5 by bugdroid1@chromium.org, Nov 14 2017

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

commit 41116935b01577b29c878a219e59e0c1b0c1efa6
Author: Darren Shen <shend@chromium.org>
Date: Tue Nov 14 07:29:21 2017

[css-typed-om] Add a 'values' attribute to all variadic CSSMathValues.

This patch adds the 'values' attribute to CSSMathSum/Product/Min/Max.
'values' is a CSSNumericArray, which is an array of CSSNumericValues
representing the arguments to the CSSMathValue. We make the variadic
CSSMathValues inherit from a new class CSSMathVariadic so that all the
boilerplate with working with multiple arguments are in one place.

Note that CSSNumericArray is not spec'd, but we based the implementation
off https://github.com/w3c/css-houdini-drafts/issues/486

Spec: https://drafts.css-houdini.org/css-typed-om-1/#complex-numeric

Bug:  776173 
Change-Id: I1079b31993ecb02f31c2fe93ebf31c548fa6025c
Reviewed-on: https://chromium-review.googlesource.com/762887
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Renée Wright <rjwright@chromium.org>
Commit-Queue: Darren Shen <shend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#516223}
[modify] https://crrev.com/41116935b01577b29c878a219e59e0c1b0c1efa6/third_party/WebKit/LayoutTests/http/tests/worklet/webexposed/global-interface-listing-paint-worklet-expected.txt
[modify] https://crrev.com/41116935b01577b29c878a219e59e0c1b0c1efa6/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/cssMathValue.html
[modify] https://crrev.com/41116935b01577b29c878a219e59e0c1b0c1efa6/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/41116935b01577b29c878a219e59e0c1b0c1efa6/third_party/WebKit/Source/core/core_idl_files.gni
[modify] https://crrev.com/41116935b01577b29c878a219e59e0c1b0c1efa6/third_party/WebKit/Source/core/css/cssom/CSSMathMax.h
[modify] https://crrev.com/41116935b01577b29c878a219e59e0c1b0c1efa6/third_party/WebKit/Source/core/css/cssom/CSSMathMax.idl
[modify] https://crrev.com/41116935b01577b29c878a219e59e0c1b0c1efa6/third_party/WebKit/Source/core/css/cssom/CSSMathMin.h
[modify] https://crrev.com/41116935b01577b29c878a219e59e0c1b0c1efa6/third_party/WebKit/Source/core/css/cssom/CSSMathMin.idl
[modify] https://crrev.com/41116935b01577b29c878a219e59e0c1b0c1efa6/third_party/WebKit/Source/core/css/cssom/CSSMathProduct.h
[modify] https://crrev.com/41116935b01577b29c878a219e59e0c1b0c1efa6/third_party/WebKit/Source/core/css/cssom/CSSMathProduct.idl
[modify] https://crrev.com/41116935b01577b29c878a219e59e0c1b0c1efa6/third_party/WebKit/Source/core/css/cssom/CSSMathSum.h
[modify] https://crrev.com/41116935b01577b29c878a219e59e0c1b0c1efa6/third_party/WebKit/Source/core/css/cssom/CSSMathSum.idl
[add] https://crrev.com/41116935b01577b29c878a219e59e0c1b0c1efa6/third_party/WebKit/Source/core/css/cssom/CSSMathVariadic.h
[add] https://crrev.com/41116935b01577b29c878a219e59e0c1b0c1efa6/third_party/WebKit/Source/core/css/cssom/CSSNumericArray.h
[add] https://crrev.com/41116935b01577b29c878a219e59e0c1b0c1efa6/third_party/WebKit/Source/core/css/cssom/CSSNumericArray.idl
[modify] https://crrev.com/41116935b01577b29c878a219e59e0c1b0c1efa6/third_party/WebKit/Source/core/css/cssom/CSSNumericValue.h

Project Member

Comment 6 by bugdroid1@chromium.org, Nov 15 2017

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

commit 58986c160a619dc9117e45966047c7812c7c8888
Author: Darren Shen <shend@chromium.org>
Date: Wed Nov 15 00:53:01 2017

[css-typed-om] Implement addition of numeric types.

When adding two CSSMathValues, we need to check if they are compatible
in terms of their type. For example, it's fine to add 1px and 1cm,
because they both have base type 'length'. However, we can't add 1px and
1s, because one has type 'length' and the other 'time'. Furthermore, we
can't add 1px with (1px * 1px), because one is 'length' and the other
'length^2'. Hence, both the base types and their corresponding powers
must match.

The spec also has a special case for percentages: e.g. 1px + 1%. To make
this addition work, the 1% must be a percentage of 'length'. Thus, in
the presence of percentages, we can also convert them into another base
type if that will make the addition work.

Spec: https://drafts.css-houdini.org/css-typed-om-1/#add-two-types

Bug:  776173 
Change-Id: I4fe0bbb920b3b1ccf94f1c9c49b4d31e09c095e5
Reviewed-on: https://chromium-review.googlesource.com/765548
Commit-Queue: Darren Shen <shend@chromium.org>
Reviewed-by: meade_UTC10 <meade@chromium.org>
Cr-Commit-Position: refs/heads/master@{#516529}
[add] https://crrev.com/58986c160a619dc9117e45966047c7812c7c8888/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/numeric-typing.html
[modify] https://crrev.com/58986c160a619dc9117e45966047c7812c7c8888/third_party/WebKit/Source/core/BUILD.gn
[modify] https://crrev.com/58986c160a619dc9117e45966047c7812c7c8888/third_party/WebKit/Source/core/css/BUILD.gn
[add] https://crrev.com/58986c160a619dc9117e45966047c7812c7c8888/third_party/WebKit/Source/core/css/cssom/CSSMathMax.cpp
[modify] https://crrev.com/58986c160a619dc9117e45966047c7812c7c8888/third_party/WebKit/Source/core/css/cssom/CSSMathMax.h
[add] https://crrev.com/58986c160a619dc9117e45966047c7812c7c8888/third_party/WebKit/Source/core/css/cssom/CSSMathMin.cpp
[modify] https://crrev.com/58986c160a619dc9117e45966047c7812c7c8888/third_party/WebKit/Source/core/css/cssom/CSSMathMin.h
[add] https://crrev.com/58986c160a619dc9117e45966047c7812c7c8888/third_party/WebKit/Source/core/css/cssom/CSSMathSum.cpp
[modify] https://crrev.com/58986c160a619dc9117e45966047c7812c7c8888/third_party/WebKit/Source/core/css/cssom/CSSMathSum.h
[modify] https://crrev.com/58986c160a619dc9117e45966047c7812c7c8888/third_party/WebKit/Source/core/css/cssom/CSSMathVariadic.h
[modify] https://crrev.com/58986c160a619dc9117e45966047c7812c7c8888/third_party/WebKit/Source/core/css/cssom/CSSNumericArray.h
[modify] https://crrev.com/58986c160a619dc9117e45966047c7812c7c8888/third_party/WebKit/Source/core/css/cssom/CSSNumericValue.cpp
[modify] https://crrev.com/58986c160a619dc9117e45966047c7812c7c8888/third_party/WebKit/Source/core/css/cssom/CSSNumericValue.h
[modify] https://crrev.com/58986c160a619dc9117e45966047c7812c7c8888/third_party/WebKit/Source/core/css/cssom/CSSNumericValueType.cpp
[modify] https://crrev.com/58986c160a619dc9117e45966047c7812c7c8888/third_party/WebKit/Source/core/css/cssom/CSSNumericValueType.h
[add] https://crrev.com/58986c160a619dc9117e45966047c7812c7c8888/third_party/WebKit/Source/core/css/cssom/CSSNumericValueTypeTest.cpp

Project Member

Comment 7 by bugdroid1@chromium.org, Nov 15 2017

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

commit 0254d21dc41d8ec25b49356ec1e55f7e8ccf3c66
Author: Darren Shen <shend@chromium.org>
Date: Wed Nov 15 07:26:45 2017

[css-typed-om] Implement multiplication of numeric types.

When multiplying two CSSMathValues, we need to check if they are
compatible in terms of their type. Unlike addition, there's only one
case where two types are incompatible: if both types are different non-
null percent hints e.g. (1px + 1%) * (1s + 1%). If the types are
compatible, we just need to add the corresponding exponents for each
base type.

Spec: https://drafts.css-houdini.org/css-typed-om-1/#cssnumericvalue-multiply-two-types

Bug:  776173 
Change-Id: I818b258cac93bcc8b5d6105113bff9e6117d955a
Reviewed-on: https://chromium-review.googlesource.com/767467
Commit-Queue: Darren Shen <shend@chromium.org>
Reviewed-by: meade_UTC10 <meade@chromium.org>
Cr-Commit-Position: refs/heads/master@{#516625}
[modify] https://crrev.com/0254d21dc41d8ec25b49356ec1e55f7e8ccf3c66/third_party/WebKit/Source/core/css/BUILD.gn
[modify] https://crrev.com/0254d21dc41d8ec25b49356ec1e55f7e8ccf3c66/third_party/WebKit/Source/core/css/cssom/CSSMathInvert.h
[modify] https://crrev.com/0254d21dc41d8ec25b49356ec1e55f7e8ccf3c66/third_party/WebKit/Source/core/css/cssom/CSSMathInvertTest.cpp
[modify] https://crrev.com/0254d21dc41d8ec25b49356ec1e55f7e8ccf3c66/third_party/WebKit/Source/core/css/cssom/CSSMathNegate.h
[modify] https://crrev.com/0254d21dc41d8ec25b49356ec1e55f7e8ccf3c66/third_party/WebKit/Source/core/css/cssom/CSSMathNegateTest.cpp
[add] https://crrev.com/0254d21dc41d8ec25b49356ec1e55f7e8ccf3c66/third_party/WebKit/Source/core/css/cssom/CSSMathProduct.cpp
[modify] https://crrev.com/0254d21dc41d8ec25b49356ec1e55f7e8ccf3c66/third_party/WebKit/Source/core/css/cssom/CSSMathProduct.h
[modify] https://crrev.com/0254d21dc41d8ec25b49356ec1e55f7e8ccf3c66/third_party/WebKit/Source/core/css/cssom/CSSNumericValueType.cpp
[modify] https://crrev.com/0254d21dc41d8ec25b49356ec1e55f7e8ccf3c66/third_party/WebKit/Source/core/css/cssom/CSSNumericValueType.h
[modify] https://crrev.com/0254d21dc41d8ec25b49356ec1e55f7e8ccf3c66/third_party/WebKit/Source/core/css/cssom/CSSNumericValueTypeTest.cpp
[modify] https://crrev.com/0254d21dc41d8ec25b49356ec1e55f7e8ccf3c66/third_party/WebKit/Source/core/css/cssom/CSSUnitValueTest.cpp

Project Member

Comment 8 by bugdroid1@chromium.org, Nov 15 2017

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

commit 83929013818468e61fc4c144739e73119cc145fe
Author: Darren Shen <shend@chromium.org>
Date: Wed Nov 15 12:56:05 2017

[css-typed-om] Implement arithmetic operations on CSSNumericValue.

We implement all the arithmetic operations on CSSNumericValue.
In most cases, an arithmetic operation just constructs an object
corresponding to the operation. For example,

    CSS.px(1).add(CSS.percent(1))

just returns a CSSMathSum containing the 1px and 1% objects.

However, there are two special cases:

1) When all the arguments are CSSUnitValues with the same type,
   we can simplify them into a single CSSUnitValue:

       CSS.px(1).add(CSS.px(1))

   becomes CSS.px(2).

2) When the object is a CSSMathValue that corresponds to the operation,
   we 'pull out' its values:

       new CSSMathSum(CSS.px(1), CSS.px(1)).add(CSS.percent(1))

   becomes new CSSMathSum(CSS.px(1), CSS.px(1), CSS.percent(1))
   instead of two nested CSSMathSums.

We chose to not implement add etc. as virtual functions as the special
cases make a proper-OOP solution ugly.

We also rename IsCalculated to IsUnitValue since the term 'calculated'
is not really used in the new typed OM spec. There are only unit values
and math values.

Spec: https://drafts.css-houdini.org/css-typed-om-1/#numeric-value

Bug:  776173 
Change-Id: Iba6b53dea29f048780aa0966de57e63dfa140a9e
Reviewed-on: https://chromium-review.googlesource.com/767894
Commit-Queue: Darren Shen <shend@chromium.org>
Reviewed-by: nainar <nainar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#516677}
[modify] https://crrev.com/83929013818468e61fc4c144739e73119cc145fe/third_party/WebKit/LayoutTests/http/tests/worklet/webexposed/global-interface-listing-paint-worklet-expected.txt
[modify] https://crrev.com/83929013818468e61fc4c144739e73119cc145fe/third_party/WebKit/LayoutTests/typedcssom/resources/testhelper.js
[add] https://crrev.com/83929013818468e61fc4c144739e73119cc145fe/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/arithmetic.html
[modify] https://crrev.com/83929013818468e61fc4c144739e73119cc145fe/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/83929013818468e61fc4c144739e73119cc145fe/third_party/WebKit/Source/core/css/cssom/CSSMathInvert.h
[modify] https://crrev.com/83929013818468e61fc4c144739e73119cc145fe/third_party/WebKit/Source/core/css/cssom/CSSMathNegate.h
[modify] https://crrev.com/83929013818468e61fc4c144739e73119cc145fe/third_party/WebKit/Source/core/css/cssom/CSSMathNegateTest.cpp
[modify] https://crrev.com/83929013818468e61fc4c144739e73119cc145fe/third_party/WebKit/Source/core/css/cssom/CSSMathValue.h
[modify] https://crrev.com/83929013818468e61fc4c144739e73119cc145fe/third_party/WebKit/Source/core/css/cssom/CSSMathVariadic.h
[modify] https://crrev.com/83929013818468e61fc4c144739e73119cc145fe/third_party/WebKit/Source/core/css/cssom/CSSNumericArray.h
[modify] https://crrev.com/83929013818468e61fc4c144739e73119cc145fe/third_party/WebKit/Source/core/css/cssom/CSSNumericValue.cpp
[modify] https://crrev.com/83929013818468e61fc4c144739e73119cc145fe/third_party/WebKit/Source/core/css/cssom/CSSNumericValue.h
[modify] https://crrev.com/83929013818468e61fc4c144739e73119cc145fe/third_party/WebKit/Source/core/css/cssom/CSSNumericValue.idl
[modify] https://crrev.com/83929013818468e61fc4c144739e73119cc145fe/third_party/WebKit/Source/core/css/cssom/CSSPerspective.cpp
[modify] https://crrev.com/83929013818468e61fc4c144739e73119cc145fe/third_party/WebKit/Source/core/css/cssom/CSSRotation.cpp
[modify] https://crrev.com/83929013818468e61fc4c144739e73119cc145fe/third_party/WebKit/Source/core/css/cssom/CSSSkew.cpp
[modify] https://crrev.com/83929013818468e61fc4c144739e73119cc145fe/third_party/WebKit/Source/core/css/cssom/CSSUnitValue.cpp
[modify] https://crrev.com/83929013818468e61fc4c144739e73119cc145fe/third_party/WebKit/Source/core/css/cssom/CSSUnitValue.h

Project Member

Comment 9 by bugdroid1@chromium.org, Nov 16 2017

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

commit 4bb7df981adb7e5e6f52363b9411dc38d6829f88
Author: Darren Shen <shend@chromium.org>
Date: Thu Nov 16 04:25:01 2017

[css-typed-om] Implement CSSNumericValue.equals

This patch implements CSSNumericValue.equals, which compares if two or
more CSSNumericValues are equal.

Spec: https://drafts.css-houdini.org/css-typed-om-1/#dom-cssnumericvalue-equals

Bug:  776173 
Change-Id: I1ea3d16e9e872ad7856e67312e5f2586c9dbb750
Reviewed-on: https://chromium-review.googlesource.com/768167
Commit-Queue: Darren Shen <shend@chromium.org>
Reviewed-by: Renée Wright <rjwright@chromium.org>
Cr-Commit-Position: refs/heads/master@{#516983}
[modify] https://crrev.com/4bb7df981adb7e5e6f52363b9411dc38d6829f88/third_party/WebKit/LayoutTests/http/tests/worklet/webexposed/global-interface-listing-paint-worklet-expected.txt
[add] https://crrev.com/4bb7df981adb7e5e6f52363b9411dc38d6829f88/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/equals.html
[modify] https://crrev.com/4bb7df981adb7e5e6f52363b9411dc38d6829f88/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/4bb7df981adb7e5e6f52363b9411dc38d6829f88/third_party/WebKit/Source/core/css/cssom/CSSMathInvert.h
[modify] https://crrev.com/4bb7df981adb7e5e6f52363b9411dc38d6829f88/third_party/WebKit/Source/core/css/cssom/CSSMathNegate.h
[modify] https://crrev.com/4bb7df981adb7e5e6f52363b9411dc38d6829f88/third_party/WebKit/Source/core/css/cssom/CSSMathVariadic.h
[modify] https://crrev.com/4bb7df981adb7e5e6f52363b9411dc38d6829f88/third_party/WebKit/Source/core/css/cssom/CSSNumericValue.cpp
[modify] https://crrev.com/4bb7df981adb7e5e6f52363b9411dc38d6829f88/third_party/WebKit/Source/core/css/cssom/CSSNumericValue.h
[modify] https://crrev.com/4bb7df981adb7e5e6f52363b9411dc38d6829f88/third_party/WebKit/Source/core/css/cssom/CSSNumericValue.idl
[modify] https://crrev.com/4bb7df981adb7e5e6f52363b9411dc38d6829f88/third_party/WebKit/Source/core/css/cssom/CSSUnitValue.cpp
[modify] https://crrev.com/4bb7df981adb7e5e6f52363b9411dc38d6829f88/third_party/WebKit/Source/core/css/cssom/CSSUnitValue.h

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

Labels: -Hotlist-Interop
Project Member

Comment 11 by bugdroid1@chromium.org, Nov 29 2017

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

commit 88444780302ebf811e223c5c329988e840147b42
Author: Darren Shen <shend@chromium.org>
Date: Wed Nov 29 02:04:11 2017

[css-typed-om] Implement CSSNumericValue matching.

The spec defines what it means for a type to 'match' something. This
patch implements this concept and tests it on CSSPositionValue, which
only accept CSSNumericValues that 'match' a <length-percentage>.

https://drafts.css-houdini.org/css-typed-om-1/#cssnumericvalue-match

Bug:  776173 
Change-Id: I4f893fa879da1221b37851a593c20d018794d566
Reviewed-on: https://chromium-review.googlesource.com/788482
Commit-Queue: Darren Shen <shend@chromium.org>
Reviewed-by: Renée Wright <rjwright@chromium.org>
Cr-Commit-Position: refs/heads/master@{#519956}
[delete] https://crrev.com/a1270f5866803eee25abdc54a24ce22bdea00c38/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssPositionValue-expected.txt
[modify] https://crrev.com/88444780302ebf811e223c5c329988e840147b42/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssPositionValue.html
[modify] https://crrev.com/88444780302ebf811e223c5c329988e840147b42/third_party/WebKit/Source/core/css/cssom/CSSNumericValueType.cpp
[modify] https://crrev.com/88444780302ebf811e223c5c329988e840147b42/third_party/WebKit/Source/core/css/cssom/CSSNumericValueType.h
[modify] https://crrev.com/88444780302ebf811e223c5c329988e840147b42/third_party/WebKit/Source/core/css/cssom/CSSNumericValueTypeTest.cpp
[modify] https://crrev.com/88444780302ebf811e223c5c329988e840147b42/third_party/WebKit/Source/core/css/cssom/CSSPositionValue.cpp

Project Member

Comment 12 by bugdroid1@chromium.org, Nov 30 2017

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

commit 6202663a909c3a55e771829e596ce52c42f3a491
Author: Darren Shen <shend@chromium.org>
Date: Thu Nov 30 00:06:33 2017

[css-typed-om] Implement CSSNumericValue.to.

CSSNumericValue.to allows us to convert a mathematical expression to
a particular unit. We previously have code to do this for CSSUnitValues,
but this patch expands it to all CSSNumericValues, which requires
implementing the concept of sum values.

We also change the testhelper to compare approximately.

Spec: https://drafts.css-houdini.org/css-typed-om-1/#dom-cssnumericvalue-to
Sum values: https://drafts.css-houdini.org/css-typed-om-1/#create-a-sum-value

Bug:  776173 
Change-Id: I0b7fee4839b6de08137c8205a9738321c21e70af
Reviewed-on: https://chromium-review.googlesource.com/790190
Commit-Queue: Darren Shen <shend@chromium.org>
Reviewed-by: meade_UTC10 <meade@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520315}
[modify] https://crrev.com/6202663a909c3a55e771829e596ce52c42f3a491/third_party/WebKit/LayoutTests/typedcssom/resources/testhelper.js
[add] https://crrev.com/6202663a909c3a55e771829e596ce52c42f3a491/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/to.html
[modify] https://crrev.com/6202663a909c3a55e771829e596ce52c42f3a491/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/update-expected.txt
[modify] https://crrev.com/6202663a909c3a55e771829e596ce52c42f3a491/third_party/WebKit/Source/core/css/BUILD.gn
[add] https://crrev.com/6202663a909c3a55e771829e596ce52c42f3a491/third_party/WebKit/Source/core/css/cssom/CSSMathInvert.cpp
[modify] https://crrev.com/6202663a909c3a55e771829e596ce52c42f3a491/third_party/WebKit/Source/core/css/cssom/CSSMathInvert.h
[modify] https://crrev.com/6202663a909c3a55e771829e596ce52c42f3a491/third_party/WebKit/Source/core/css/cssom/CSSMathMax.cpp
[modify] https://crrev.com/6202663a909c3a55e771829e596ce52c42f3a491/third_party/WebKit/Source/core/css/cssom/CSSMathMax.h
[modify] https://crrev.com/6202663a909c3a55e771829e596ce52c42f3a491/third_party/WebKit/Source/core/css/cssom/CSSMathMin.cpp
[modify] https://crrev.com/6202663a909c3a55e771829e596ce52c42f3a491/third_party/WebKit/Source/core/css/cssom/CSSMathMin.h
[add] https://crrev.com/6202663a909c3a55e771829e596ce52c42f3a491/third_party/WebKit/Source/core/css/cssom/CSSMathNegate.cpp
[modify] https://crrev.com/6202663a909c3a55e771829e596ce52c42f3a491/third_party/WebKit/Source/core/css/cssom/CSSMathNegate.h
[modify] https://crrev.com/6202663a909c3a55e771829e596ce52c42f3a491/third_party/WebKit/Source/core/css/cssom/CSSMathProduct.cpp
[modify] https://crrev.com/6202663a909c3a55e771829e596ce52c42f3a491/third_party/WebKit/Source/core/css/cssom/CSSMathProduct.h
[modify] https://crrev.com/6202663a909c3a55e771829e596ce52c42f3a491/third_party/WebKit/Source/core/css/cssom/CSSMathSum.cpp
[modify] https://crrev.com/6202663a909c3a55e771829e596ce52c42f3a491/third_party/WebKit/Source/core/css/cssom/CSSMathSum.h
[modify] https://crrev.com/6202663a909c3a55e771829e596ce52c42f3a491/third_party/WebKit/Source/core/css/cssom/CSSMathValue.h
[add] https://crrev.com/6202663a909c3a55e771829e596ce52c42f3a491/third_party/WebKit/Source/core/css/cssom/CSSNumericSumValue.h
[modify] https://crrev.com/6202663a909c3a55e771829e596ce52c42f3a491/third_party/WebKit/Source/core/css/cssom/CSSNumericValue.cpp
[modify] https://crrev.com/6202663a909c3a55e771829e596ce52c42f3a491/third_party/WebKit/Source/core/css/cssom/CSSNumericValue.h
[modify] https://crrev.com/6202663a909c3a55e771829e596ce52c42f3a491/third_party/WebKit/Source/core/css/cssom/CSSNumericValueType.cpp
[modify] https://crrev.com/6202663a909c3a55e771829e596ce52c42f3a491/third_party/WebKit/Source/core/css/cssom/CSSNumericValueType.h
[modify] https://crrev.com/6202663a909c3a55e771829e596ce52c42f3a491/third_party/WebKit/Source/core/css/cssom/CSSUnitValue.cpp
[modify] https://crrev.com/6202663a909c3a55e771829e596ce52c42f3a491/third_party/WebKit/Source/core/css/cssom/CSSUnitValue.h

Project Member

Comment 13 by bugdroid1@chromium.org, Nov 30 2017

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

commit 86e5b818d7f465e9b368e50de28d7eb2abce22d7
Author: Darren Shen <shend@chromium.org>
Date: Thu Nov 30 01:07:55 2017

[css-typed-om] Implement CSSNumericValue.parse.

This patch implements CSSNumericValue.parse. We reuse the existing
calc() parser, modifying it to keep bracket information since the result
of CSSNumericValue.parse is sensitive to brackets. We also have to
merge certain nodes in the parsed calc tree (e.g. calc(1 + 2 + 3) gets
merged into one sum node).

Spec: https://drafts.css-houdini.org/css-typed-om-1/#dom-cssnumericvalue-parse

Bug:  776173 ,  788570 
Change-Id: Ia4bef7c3a2eb580d11a5e51d3921ed52e1f17bf3
Reviewed-on: https://chromium-review.googlesource.com/792670
Reviewed-by: nainar <nainar@chromium.org>
Commit-Queue: Darren Shen <shend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520361}
[add] https://crrev.com/86e5b818d7f465e9b368e50de28d7eb2abce22d7/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/parse.html
[modify] https://crrev.com/86e5b818d7f465e9b368e50de28d7eb2abce22d7/third_party/WebKit/Source/core/css/CSSCalculationValue.cpp
[modify] https://crrev.com/86e5b818d7f465e9b368e50de28d7eb2abce22d7/third_party/WebKit/Source/core/css/CSSCalculationValue.h
[modify] https://crrev.com/86e5b818d7f465e9b368e50de28d7eb2abce22d7/third_party/WebKit/Source/core/css/cssom/CSSNumericValue.cpp
[modify] https://crrev.com/86e5b818d7f465e9b368e50de28d7eb2abce22d7/third_party/WebKit/Source/core/css/cssom/CSSNumericValue.h
[modify] https://crrev.com/86e5b818d7f465e9b368e50de28d7eb2abce22d7/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp

Project Member

Comment 14 by bugdroid1@chromium.org, Nov 30 2017

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

commit 19f5db9f5d50249fe5ce8b06cbf2dc1a7c9a645d
Author: Timothy Loh <timloh@chromium.org>
Date: Thu Nov 30 03:47:49 2017

Revert "[css-typed-om] Implement CSSNumericValue.parse."

This reverts commit 86e5b818d7f465e9b368e50de28d7eb2abce22d7.

Reason for revert: Added test is failing on Mac, e.g.
https://storage.googleapis.com/chromium-layout-test-archives/Mac10_11_Tests/20861/layout-test-results/results.html

FAIL Parsing a calc with mixed compatible units returns correct CSSMathValue assert_equals: expected "px" but got "number"

Original change's description:
> [css-typed-om] Implement CSSNumericValue.parse.
> 
> This patch implements CSSNumericValue.parse. We reuse the existing
> calc() parser, modifying it to keep bracket information since the result
> of CSSNumericValue.parse is sensitive to brackets. We also have to
> merge certain nodes in the parsed calc tree (e.g. calc(1 + 2 + 3) gets
> merged into one sum node).
> 
> Spec: https://drafts.css-houdini.org/css-typed-om-1/#dom-cssnumericvalue-parse
> 
> Bug:  776173 ,  788570 
> Change-Id: Ia4bef7c3a2eb580d11a5e51d3921ed52e1f17bf3
> Reviewed-on: https://chromium-review.googlesource.com/792670
> Reviewed-by: nainar <nainar@chromium.org>
> Commit-Queue: Darren Shen <shend@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#520361}

TBR=nainar@chromium.org,shend@chromium.org

Change-Id: Ib2acc1f4fc07390c75ecdda9991f984a55009a81
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug:  776173 ,  788570 
Reviewed-on: https://chromium-review.googlesource.com/798991
Reviewed-by: Timothy Loh <timloh@chromium.org>
Commit-Queue: Timothy Loh <timloh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520421}
[delete] https://crrev.com/19ff5882db85e869c446f7c5218bbcda35bf45bd/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/parse.html
[modify] https://crrev.com/19f5db9f5d50249fe5ce8b06cbf2dc1a7c9a645d/third_party/WebKit/Source/core/css/CSSCalculationValue.cpp
[modify] https://crrev.com/19f5db9f5d50249fe5ce8b06cbf2dc1a7c9a645d/third_party/WebKit/Source/core/css/CSSCalculationValue.h
[modify] https://crrev.com/19f5db9f5d50249fe5ce8b06cbf2dc1a7c9a645d/third_party/WebKit/Source/core/css/cssom/CSSNumericValue.cpp
[modify] https://crrev.com/19f5db9f5d50249fe5ce8b06cbf2dc1a7c9a645d/third_party/WebKit/Source/core/css/cssom/CSSNumericValue.h
[modify] https://crrev.com/19f5db9f5d50249fe5ce8b06cbf2dc1a7c9a645d/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp

Project Member

Comment 15 by bugdroid1@chromium.org, Dec 1 2017

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

commit 2e87ecb8603b10fdbd2baa8f0c9d7048a9d9828f
Author: Darren Shen <shend@chromium.org>
Date: Fri Dec 01 01:12:52 2017

Revert "Revert "[css-typed-om] Implement CSSNumericValue.parse.""

This reverts commit 19f5db9f5d50249fe5ce8b06cbf2dc1a7c9a645d.

Reason for revert: Trying to reland

Original change's description:
> Revert "[css-typed-om] Implement CSSNumericValue.parse."
>
> This reverts commit 86e5b818d7f465e9b368e50de28d7eb2abce22d7.
>
> Reason for revert: Added test is failing on Mac, e.g.
> https://storage.googleapis.com/chromium-layout-test-archives/Mac10_11_Tests/20861/layout-test-results/results.html
>
> FAIL Parsing a calc with mixed compatible units returns correct CSSMathValue assert_equals: expected "px" but got "number"
>
> Original change's description:
> > [css-typed-om] Implement CSSNumericValue.parse.
> >
> > This patch implements CSSNumericValue.parse. We reuse the existing
> > calc() parser, modifying it to keep bracket information since the result
> > of CSSNumericValue.parse is sensitive to brackets. We also have to
> > merge certain nodes in the parsed calc tree (e.g. calc(1 + 2 + 3) gets
> > merged into one sum node).
> >
> > Spec: https://drafts.css-houdini.org/css-typed-om-1/#dom-cssnumericvalue-parse
> >
> > Bug:  776173 ,  788570 
> > Change-Id: Ia4bef7c3a2eb580d11a5e51d3921ed52e1f17bf3
> > Reviewed-on: https://chromium-review.googlesource.com/792670
> > Reviewed-by: nainar <nainar@chromium.org>
> > Commit-Queue: Darren Shen <shend@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#520361}
>
> TBR=nainar@chromium.org,shend@chromium.org
>
> Change-Id: Ib2acc1f4fc07390c75ecdda9991f984a55009a81
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug:  776173 ,  788570 
> Reviewed-on: https://chromium-review.googlesource.com/798991
> Reviewed-by: Timothy Loh <timloh@chromium.org>
> Commit-Queue: Timothy Loh <timloh@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#520421}

Change-Id: I204827390b8de101f7868aeb4c384ed8fa649fd9
Bug:  776173 ,  788570 
Reviewed-on: https://chromium-review.googlesource.com/798992
Reviewed-by: nainar <nainar@chromium.org>
Reviewed-by: Darren Shen <shend@chromium.org>
Commit-Queue: Darren Shen <shend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520782}
[add] https://crrev.com/2e87ecb8603b10fdbd2baa8f0c9d7048a9d9828f/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/parse.html
[modify] https://crrev.com/2e87ecb8603b10fdbd2baa8f0c9d7048a9d9828f/third_party/WebKit/Source/core/css/CSSCalculationValue.cpp
[modify] https://crrev.com/2e87ecb8603b10fdbd2baa8f0c9d7048a9d9828f/third_party/WebKit/Source/core/css/CSSCalculationValue.h
[modify] https://crrev.com/2e87ecb8603b10fdbd2baa8f0c9d7048a9d9828f/third_party/WebKit/Source/core/css/cssom/CSSNumericValue.cpp
[modify] https://crrev.com/2e87ecb8603b10fdbd2baa8f0c9d7048a9d9828f/third_party/WebKit/Source/core/css/cssom/CSSNumericValue.h
[modify] https://crrev.com/2e87ecb8603b10fdbd2baa8f0c9d7048a9d9828f/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp

Project Member

Comment 16 by bugdroid1@chromium.org, Dec 1 2017

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

commit 0800969a551bd982a11a8b668c6c0fe0b99e7260
Author: Darren Shen <shend@chromium.org>
Date: Fri Dec 01 04:10:15 2017

[css-typed-om] Simplify CSSUnitValue conversion.

Currently, when we convert a CSSUnitValue to a different unit, we
essentially consult a NxN table to figure out the scale factor, where
N is the number of units.

An easier way is to first convert to the canonical unit, then convert
from the canonical unit to the target unit. This only requires a lookup
table of size N instead of NxN, greatly simplifying the code.

Bug:  776173 
Change-Id: Icb28386938f9cb7de4d917c72426154b8f45d6e6
Reviewed-on: https://chromium-review.googlesource.com/798930
Reviewed-by: nainar <nainar@chromium.org>
Commit-Queue: Darren Shen <shend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520848}
[modify] https://crrev.com/0800969a551bd982a11a8b668c6c0fe0b99e7260/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/to.html
[modify] https://crrev.com/0800969a551bd982a11a8b668c6c0fe0b99e7260/third_party/WebKit/Source/core/css/cssom/CSSUnitValue.cpp

Project Member

Comment 17 by bugdroid1@chromium.org, Dec 4 2017

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

commit ab911df34fadeee053e65e201d99bdb674f79870
Author: Darren Shen <shend@chromium.org>
Date: Mon Dec 04 07:15:56 2017

[css-typed-om] Implement CSSNumericValue.toSum.

CSSNumericValue.toSum converts a CSSNumericValue into the sum of terms
with different units. For example,

   new CSSMathSum(CSS.em(1), CSS.cm(1)).toSum('mm', 'em')

returns

   new CSSMathSum(CSS.mm(10), CSS.em(1))

Spec: https://drafts.css-houdini.org/css-typed-om-1/#dom-cssnumericvalue-tosum

Bug:  776173 
Change-Id: I073c9c6d0b3246ff2a085092547ba6dfb2b5a873
Reviewed-on: https://chromium-review.googlesource.com/798932
Commit-Queue: Darren Shen <shend@chromium.org>
Reviewed-by: meade_UTC10 <meade@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521280}
[modify] https://crrev.com/ab911df34fadeee053e65e201d99bdb674f79870/third_party/WebKit/LayoutTests/http/tests/worklet/webexposed/global-interface-listing-paint-worklet-expected.txt
[add] https://crrev.com/ab911df34fadeee053e65e201d99bdb674f79870/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/toSum.html
[modify] https://crrev.com/ab911df34fadeee053e65e201d99bdb674f79870/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/ab911df34fadeee053e65e201d99bdb674f79870/third_party/WebKit/Source/core/css/cssom/CSSNumericValue.cpp
[modify] https://crrev.com/ab911df34fadeee053e65e201d99bdb674f79870/third_party/WebKit/Source/core/css/cssom/CSSNumericValue.h
[modify] https://crrev.com/ab911df34fadeee053e65e201d99bdb674f79870/third_party/WebKit/Source/core/css/cssom/CSSNumericValue.idl

Labels: -Update-Monthly
Status: Fixed (was: Started)
Pretty much done apart from a few interop bugs which are in separate issues.

Sign in to add a comment