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

Issue 1421533006: Make SVGLength wrap a CSSPrimitiveValue. (Closed)

Created:
5 years, 1 month ago by Stephen Chennney
Modified:
5 years, 1 month ago
Reviewers:
pdr., fs, Timothy Loh
CC:
darktears, apavlov+blink_chromium.org, blink-reviews, blink-reviews-animation_chromium.org, blink-reviews-css, blink-reviews-style_chromium.org, chromium-reviews, dglazkov+blink, krit, Eric Willigers, f(malita), gyuyoung2, kouhei+svg_chromium.org, pdr+svgwatchlist_chromium.org, rjwright, rwlbuis, shans
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Make SVGLength wrap a CSSPrimitiveValue. This patch is needed to facilitate improvements to SVG attribute parsing, in turn demanded by the reconciliation of CSS and SVG attributes and properties from the SVG 2.0 spec. One parser to rule them all is a better approach than writing SVG specific parsers for what are essentially the same types as CSS. The only significant difference between the primitive types in CSS and SVG are related to dimensionless lengths, those for which the user defines no units, just a number. In CSS these are disallowed except when in quirks mode, while for SVG a pure number is considered in "user units" (see http://www.w3.org/TR/SVG/types.html#InterfaceSVGLength). Basically, the user could be using their own dimensioning system and rather than defining some kind of customization method, the spec just assumes things without units are the user's responsibility. This works because the SVG viewport defines the mapping from SVG user units into document units. To address this difference, we add a new CSSPrimitive UnitType for SVG user units and assign it to lengths created in SVG parsing mode that have no other unit. R=fs@opera.com,pdr@chromium.org,timloh@chromium.org BUG=467464 Committed: https://crrev.com/13b78a5ac7b5c84c3cc12e7b1a1b07620f0a3f98 Cr-Commit-Position: refs/heads/master@{#358153}

Patch Set 1 #

Total comments: 2

Patch Set 2 : SVG Only Unitless length parsing #

Patch Set 3 : Reviewable version #

Total comments: 5

Patch Set 4 : Review comments addressed #

Total comments: 9

Patch Set 5 : Fixed the initial types on properties #

Total comments: 29

Patch Set 6 : Review comments and tests addressed #

Total comments: 4

Patch Set 7 : Rebased TestExpectations #

Patch Set 8 : Fix crashes. #

Patch Set 9 : Error on calc and invalid types #

Patch Set 10 : Added expectation #

Unified diffs Side-by-side diffs Delta from patch set Stats (+250 lines, -265 lines) Patch
M third_party/WebKit/LayoutTests/TestExpectations View 1 2 3 4 5 6 7 8 9 1 chunk +5 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/svg/dom/SVGLength-expected.txt View 3 4 5 1 chunk +4 lines, -4 lines 0 comments Download
M third_party/WebKit/LayoutTests/svg/dom/script-tests/SVGLength.js View 3 4 5 1 chunk +6 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/animation/LengthSVGInterpolation.cpp View 1 2 3 4 5 5 chunks +30 lines, -22 lines 0 comments Download
M third_party/WebKit/Source/core/css/CSSCalculationValue.cpp View 1 2 3 4 2 chunks +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/css/CSSPrimitiveValue.h View 1 2 3 2 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/css/CSSPrimitiveValue.cpp View 1 2 3 4 5 7 chunks +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/css/CSSToLengthConversionData.cpp View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/css/MediaValues.cpp View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/css/MediaValuesTest.cpp View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.cpp View 1 2 3 4 5 1 chunk +6 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +5 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGAnimatedLength.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/svg/SVGLength.h View 1 2 3 4 5 4 chunks +21 lines, -25 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGLength.cpp View 1 2 3 4 5 6 7 8 6 chunks +69 lines, -155 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGLengthContext.h View 2 chunks +3 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGLengthContext.cpp View 1 2 3 4 5 3 chunks +30 lines, -31 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGLengthList.cpp View 1 2 3 4 5 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGLengthTearOff.h View 1 2 3 2 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/svg/SVGLengthTearOff.cpp View 1 2 3 4 4 chunks +46 lines, -9 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGSVGElement.cpp View 1 2 chunks +4 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGTextContentElement.cpp View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 72 (26 generated)
Stephen Chennney
This is an update of https://codereview.chromium.org/1162453002 after 6 months or so of inactivity. In response ...
5 years, 1 month ago (2015-10-23 19:15:51 UTC) #1
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1421533006/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1421533006/1
5 years, 1 month ago (2015-10-23 19:16:44 UTC) #3
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: mac_chromium_rel_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/130676)
5 years, 1 month ago (2015-10-23 19:23:08 UTC) #5
fs
On 2015/10/23 at 19:15:51, schenney wrote: > This is an update of https://codereview.chromium.org/1162453002 after 6 ...
5 years, 1 month ago (2015-10-23 20:28:59 UTC) #6
Stephen Chennney
I forgot to address one of the nits. This patch is to see if my ...
5 years, 1 month ago (2015-10-27 21:28:32 UTC) #8
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1421533006/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1421533006/20001
5 years, 1 month ago (2015-10-27 21:28:32 UTC) #9
Stephen Chennney
On 2015/10/27 21:28:32, Stephen Chenney wrote: > I forgot to address one of the nits. ...
5 years, 1 month ago (2015-10-27 21:33:28 UTC) #10
fs
On 2015/10/27 at 21:33:28, schenney wrote: > On 2015/10/27 21:28:32, Stephen Chenney wrote: > > ...
5 years, 1 month ago (2015-10-27 22:44:15 UTC) #11
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: mac_chromium_rel_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/132032)
5 years, 1 month ago (2015-10-27 22:54:25 UTC) #13
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1421533006/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1421533006/40001
5 years, 1 month ago (2015-10-28 17:07:09 UTC) #15
Stephen Chennney
The latest version of the patch only significantly modifies the behavior of one existing test. ...
5 years, 1 month ago (2015-10-28 17:08:31 UTC) #16
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: win_chromium_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/126978)
5 years, 1 month ago (2015-10-28 18:16:39 UTC) #18
fs
On 2015/10/28 at 17:08:31, schenney wrote: ... > I went with a special unit type ...
5 years, 1 month ago (2015-10-28 20:14:34 UTC) #19
Timothy Loh
On 2015/10/28 20:14:34, fs wrote: > On 2015/10/28 at 17:08:31, schenney wrote: > ... > ...
5 years, 1 month ago (2015-10-29 00:49:31 UTC) #20
Stephen Chennney
https://codereview.chromium.org/1421533006/diff/40001/third_party/WebKit/Source/core/css/CSSPrimitiveValue.cpp File third_party/WebKit/Source/core/css/CSSPrimitiveValue.cpp (left): https://codereview.chromium.org/1421533006/diff/40001/third_party/WebKit/Source/core/css/CSSPrimitiveValue.cpp#oldcode513 third_party/WebKit/Source/core/css/CSSPrimitiveValue.cpp:513: ASSERT(isCalculated()); On 2015/10/28 20:14:34, fs wrote: > I guess ...
5 years, 1 month ago (2015-10-30 18:00:55 UTC) #22
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1421533006/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1421533006/60001
5 years, 1 month ago (2015-10-30 18:06:52 UTC) #24
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/133935) win_chromium_rel_ng on ...
5 years, 1 month ago (2015-10-30 19:04:28 UTC) #26
fs
https://codereview.chromium.org/1421533006/diff/60001/third_party/WebKit/Source/core/animation/LengthSVGInterpolation.cpp File third_party/WebKit/Source/core/animation/LengthSVGInterpolation.cpp (right): https://codereview.chromium.org/1421533006/diff/60001/third_party/WebKit/Source/core/animation/LengthSVGInterpolation.cpp#newcode69 third_party/WebKit/Source/core/animation/LengthSVGInterpolation.cpp:69: CSSPrimitiveValue::UnitType::Chs }; Nit: }; on next line https://codereview.chromium.org/1421533006/diff/60001/third_party/WebKit/Source/core/svg/SVGAnimatedLength.cpp File ...
5 years, 1 month ago (2015-10-30 19:50:00 UTC) #27
Stephen Chennney
I think I've fixed the test cases, but maybe not all. Here's another round for ...
5 years, 1 month ago (2015-11-03 21:59:41 UTC) #28
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1421533006/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1421533006/80001
5 years, 1 month ago (2015-11-03 22:00:37 UTC) #30
fs
Looks good, but something with clip/scroll layers seems to be having a bad day =/ ...
5 years, 1 month ago (2015-11-03 22:40:14 UTC) #31
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: win_chromium_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/129799)
5 years, 1 month ago (2015-11-03 23:37:05 UTC) #33
Timothy Loh
Seems like this will add calc() support to (the web-exposed) SVGLength. Is this intentional / ...
5 years, 1 month ago (2015-11-04 00:33:44 UTC) #34
fs
On 2015/11/04 at 00:33:44, timloh wrote: > Seems like this will add calc() support to ...
5 years, 1 month ago (2015-11-04 08:41:12 UTC) #35
Stephen Chennney
I'm not sure about the calc() thing, so I need advice. We're also now parsing ...
5 years, 1 month ago (2015-11-04 18:04:47 UTC) #36
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1421533006/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1421533006/100001
5 years, 1 month ago (2015-11-04 18:05:54 UTC) #38
Stephen Chennney
https://codereview.chromium.org/1421533006/diff/100001/third_party/WebKit/Source/core/svg/SVGLength.cpp File third_party/WebKit/Source/core/svg/SVGLength.cpp (right): https://codereview.chromium.org/1421533006/diff/100001/third_party/WebKit/Source/core/svg/SVGLength.cpp#newcode97 third_party/WebKit/Source/core/svg/SVGLength.cpp:97: m_value->typeWithCalcResolved()); Is a check for calc() needed here? https://codereview.chromium.org/1421533006/diff/100001/third_party/WebKit/Source/core/svg/SVGLength.cpp#newcode148 ...
5 years, 1 month ago (2015-11-04 18:06:48 UTC) #39
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: mac_chromium_compile_dbg_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_compile_dbg_ng/builds/118813) mac_chromium_gn_rel on ...
5 years, 1 month ago (2015-11-04 18:08:06 UTC) #41
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1421533006/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1421533006/120001
5 years, 1 month ago (2015-11-04 18:33:39 UTC) #43
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: win_chromium_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/130324)
5 years, 1 month ago (2015-11-04 19:50:01 UTC) #45
fs
On 2015/11/04 at 18:04:47, schenney wrote: > I'm not sure about the calc() thing, so ...
5 years, 1 month ago (2015-11-04 21:12:18 UTC) #46
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1421533006/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1421533006/160001
5 years, 1 month ago (2015-11-04 22:06:25 UTC) #48
Stephen Chennney
timloh, over to you for the final word. Hit the CQ if you think it's ...
5 years, 1 month ago (2015-11-04 22:06:52 UTC) #49
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: win_chromium_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/130527)
5 years, 1 month ago (2015-11-05 00:12:13 UTC) #51
Timothy Loh
On 2015/11/04 22:06:52, Stephen Chenney (on leave) wrote: > timloh, over to you for the ...
5 years, 1 month ago (2015-11-05 02:36:24 UTC) #52
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1421533006/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1421533006/160001
5 years, 1 month ago (2015-11-05 02:39:02 UTC) #55
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/130671)
5 years, 1 month ago (2015-11-05 03:18:21 UTC) #57
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1421533006/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1421533006/160001
5 years, 1 month ago (2015-11-05 08:36:34 UTC) #59
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/130759)
5 years, 1 month ago (2015-11-05 10:53:44 UTC) #61
fs
On 2015/11/05 at 10:53:44, commit-bot wrote: > Try jobs failed on following builders: > win_chromium_rel_ng ...
5 years, 1 month ago (2015-11-05 11:16:39 UTC) #62
Stephen Chennney
On 2015/11/05 11:16:39, fs wrote: > On 2015/11/05 at 10:53:44, commit-bot wrote: > > Try ...
5 years, 1 month ago (2015-11-05 18:03:58 UTC) #63
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1421533006/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1421533006/180001
5 years, 1 month ago (2015-11-05 19:29:18 UTC) #66
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/136690)
5 years, 1 month ago (2015-11-05 20:40:36 UTC) #68
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1421533006/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1421533006/180001
5 years, 1 month ago (2015-11-05 22:09:15 UTC) #70
commit-bot: I haz the power
Committed patchset #10 (id:180001)
5 years, 1 month ago (2015-11-05 22:48:31 UTC) #71
commit-bot: I haz the power
5 years, 1 month ago (2015-11-05 22:49:11 UTC) #72
Message was sent while issue was closed.
Patchset 10 (id:??) landed as
https://crrev.com/13b78a5ac7b5c84c3cc12e7b1a1b07620f0a3f98
Cr-Commit-Position: refs/heads/master@{#358153}

Powered by Google App Engine
This is Rietveld 408576698