Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(944)

Issue 1689573002: CSS Typed OM: asMatrix for TransformComponent with LengthValue types (Closed)

Created:
4 years, 10 months ago by tridgell
Modified:
3 years, 9 months ago
Reviewers:
meade_UTC10
CC:
darktears, apavlov+blink_chromium.org, blink-reviews, blink-reviews-css, blink-reviews-style_chromium.org, chromium-reviews, dglazkov+blink, rwlbuis
Base URL:
https://chromium.googlesource.com/chromium/src.git@asMatrixMethod
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

CSS Typed OM: asMatrix for TransformComponent with LengthValue types Implement a naive isRelative() method in LengthValue subclasses. This is then used in LengthValue::computeLengthPx. As potentially a LengthValue might not be able to be resolved, make TransfromComponent::asMatrix a method that can throw an exception. This is behaviour is all tested using Perspective::asMatrix method. Unfortunately, behaviour with percent type cannot be tested in the Perspective class, so needs to be tested once Translation is implemented. LengthValue::computeLengthPx assumes that the viewport is not defined. This needs to later be updated and is a very naive implementation. BUG=545318

Patch Set 1 #

Total comments: 6

Patch Set 2 : Add in Translation and use exceptionState.hadException #

Unified diffs Side-by-side diffs Delta from patch set Stats (+197 lines, -14 lines) Patch
M third_party/WebKit/LayoutTests/typedcssom/perspectiveTransformComponent.html View 1 2 chunks +75 lines, -4 lines 0 comments Download
M third_party/WebKit/LayoutTests/typedcssom/translationTransformComponent.html View 1 2 chunks +44 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/css/cssom/LengthValue.h View 1 chunk +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/css/cssom/LengthValue.cpp View 1 2 chunks +20 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/css/cssom/MatrixTransformComponent.h View 2 chunks +3 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/css/cssom/PerspectiveTransformComponent.h View 1 chunk +1 line, -2 lines 0 comments Download
M third_party/WebKit/Source/core/css/cssom/PerspectiveTransformComponent.cpp View 1 2 chunks +9 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/css/cssom/RotationTransformComponent.h View 2 chunks +3 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/css/cssom/ScaleTransformComponent.h View 2 chunks +3 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/css/cssom/SimpleLength.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/css/cssom/SkewTransformComponent.h View 2 chunks +3 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/css/cssom/StyleCalcLength.h View 1 chunk +13 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/css/cssom/TransformComponent.h View 1 2 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/css/cssom/TransformComponent.idl View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/css/cssom/TranslationTransformComponent.h View 1 1 chunk +1 line, -2 lines 0 comments Download
M third_party/WebKit/Source/core/css/cssom/TranslationTransformComponent.cpp View 1 2 chunks +15 lines, -0 lines 0 comments Download

Depends on Patchset:

Dependent Patchsets:

Messages

Total messages: 9 (5 generated)
tridgell
4 years, 10 months ago (2016-02-10 05:24:22 UTC) #2
tridgell
4 years, 10 months ago (2016-02-10 05:24:42 UTC) #4
meade_UTC10
lgtm with a few nits Adding Tim - PTAL soon Tim! https://codereview.chromium.org/1689573002/diff/1/third_party/WebKit/Source/core/css/cssom/LengthValue.cpp File third_party/WebKit/Source/core/css/cssom/LengthValue.cpp (right): ...
4 years, 10 months ago (2016-02-11 00:56:30 UTC) #6
tridgell
4 years, 10 months ago (2016-02-12 04:22:28 UTC) #7
https://codereview.chromium.org/1689573002/diff/1/third_party/WebKit/Source/c...
File third_party/WebKit/Source/core/css/cssom/LengthValue.cpp (right):

https://codereview.chromium.org/1689573002/diff/1/third_party/WebKit/Source/c...
third_party/WebKit/Source/core/css/cssom/LengthValue.cpp:73:
exceptionState.throwTypeError("Cannot resolve a relative unit to a pixel
value.");
On 2016/02/11 at 00:56:30, Eddy wrote:
> Add a TODO to implement this?

Done.

https://codereview.chromium.org/1689573002/diff/1/third_party/WebKit/Source/c...
File third_party/WebKit/Source/core/css/cssom/PerspectiveTransformComponent.cpp
(right):

https://codereview.chromium.org/1689573002/diff/1/third_party/WebKit/Source/c...
third_party/WebKit/Source/core/css/cssom/PerspectiveTransformComponent.cpp:5: 
On 2016/02/11 at 00:56:30, Eddy wrote:
> Remove extra newline

Done.

https://codereview.chromium.org/1689573002/diff/1/third_party/WebKit/Source/c...
third_party/WebKit/Source/core/css/cssom/PerspectiveTransformComponent.cpp:24:
return
MatrixTransformComponent::perspective(m_length->computeLengthPx(exceptionState));
On 2016/02/11 at 00:56:30, Eddy wrote:
> Perhaps this should check for exceptionState.hadException before creating the
MatrixTransformComponent, and return nullptr if it had one.

Done.  Also similarly implemented for TranslationTransformComponent.  The later
(in TranslationTransformComponent.cpp) uses only a single
exceptionState.hadException.  Should I add one after each property is
initialised?

Powered by Google App Engine
This is Rietveld 408576698