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

Issue 1544673003: Refactor propagation of parsing errors for SVG attributes (Closed)

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

Description

Refactor propagation of parsing errors for SVG attributes Use the return value of SVG{...}::setValueAsString to signal errors rather than an out parameter and the (mostly faux) ExceptionState object (for setBaseValueAsString). In the few cases where the latter is not using an TrackExceptionState - in tear-offs for SVGAngle and SVGLength - it's easy enough to handle the exception-throwing there and then. This makes SVG{...} objects mostly independent of ExceptionState, saving on footprint from string-construction and argument passing as a side-effect. Also remove some unnecessary virtuals on SVGInteger and SVGPreserveAspectRatio. BUG=231612 Committed: https://crrev.com/bf2f7bc27f6baa44286fea07e39540c3ac8db77d Cr-Commit-Position: refs/heads/master@{#366715}

Patch Set 1 #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+229 lines, -260 lines) Patch
M third_party/WebKit/Source/core/svg/LinearGradientAttributes.h View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/svg/RadialGradientAttributes.h View 1 chunk +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGAngle.h View 2 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/svg/SVGAngle.cpp View 3 chunks +7 lines, -11 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGAngleTearOff.cpp View 1 chunk +6 lines, -3 lines 3 comments Download
M third_party/WebKit/Source/core/svg/SVGAnimatedLength.h View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/svg/SVGAnimatedLength.cpp View 1 chunk +8 lines, -11 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGAnimatedTypeAnimator.cpp View 1 chunk +4 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGBoolean.h View 2 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/svg/SVGBoolean.cpp View 2 chunks +6 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGElement.cpp View 2 chunks +2 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGEnumeration.h View 2 chunks +2 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGEnumeration.cpp View 4 chunks +4 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGFEConvolveMatrixElement.cpp View 2 chunks +5 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGFitToViewBox.cpp View 2 chunks +6 lines, -12 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGInteger.h View 2 chunks +2 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGInteger.cpp View 2 chunks +5 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGIntegerOptionalInteger.h View 2 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/svg/SVGIntegerOptionalInteger.cpp View 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGLength.h View 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGLength.cpp View 3 chunks +10 lines, -20 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGLengthList.h View 3 chunks +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGLengthList.cpp View 4 chunks +16 lines, -13 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGLengthTearOff.cpp View 2 chunks +11 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGMarkerElement.h View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/svg/SVGNumber.h View 3 chunks +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGNumber.cpp View 3 chunks +9 lines, -9 lines 2 comments Download
M third_party/WebKit/Source/core/svg/SVGNumberList.h View 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGNumberList.cpp View 2 chunks +4 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGNumberOptionalNumber.h View 2 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/svg/SVGNumberOptionalNumber.cpp View 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGPath.h View 2 chunks +2 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGPath.cpp View 2 chunks +4 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGPathElement.cpp View 1 chunk +4 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGPoint.h View 3 chunks +3 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGPoint.cpp View 3 chunks +16 lines, -21 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGPointList.h View 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGPointList.cpp View 2 chunks +3 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGPreserveAspectRatio.h View 2 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/svg/SVGPreserveAspectRatio.cpp View 3 chunks +3 lines, -9 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGRect.h View 3 chunks +3 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGRect.cpp View 3 chunks +21 lines, -27 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGStaticStringList.h View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/svg/SVGStaticStringList.cpp View 1 chunk +2 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGString.h View 2 chunks +6 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGStringList.h View 2 chunks +3 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGStringList.cpp View 2 chunks +5 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGTransformList.h View 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGTransformList.cpp View 2 chunks +5 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/svg/properties/SVGAnimatedProperty.h View 2 chunks +3 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/core/svg/properties/SVGPropertyHelper.h View 2 chunks +1 line, -2 lines 0 comments Download

Messages

Total messages: 11 (4 generated)
fs
5 years ago (2015-12-22 15:21:11 UTC) #2
pdr.
lgtm LGTM https://codereview.chromium.org/1544673003/diff/1/third_party/WebKit/Source/core/svg/SVGAngleTearOff.cpp File third_party/WebKit/Source/core/svg/SVGAngleTearOff.cpp (left): https://codereview.chromium.org/1544673003/diff/1/third_party/WebKit/Source/core/svg/SVGAngleTearOff.cpp#oldcode120 third_party/WebKit/Source/core/svg/SVGAngleTearOff.cpp:120: target()->setValueAsString(oldValue, ASSERT_NO_EXCEPTION); // rollback to old value ...
5 years ago (2015-12-23 04:00:08 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1544673003/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1544673003/1
5 years ago (2015-12-23 04:00:17 UTC) #6
commit-bot: I haz the power
Committed patchset #1 (id:1)
5 years ago (2015-12-23 06:25:42 UTC) #7
commit-bot: I haz the power
Patchset 1 (id:??) landed as https://crrev.com/bf2f7bc27f6baa44286fea07e39540c3ac8db77d Cr-Commit-Position: refs/heads/master@{#366715}
5 years ago (2015-12-23 06:27:09 UTC) #9
fs
https://codereview.chromium.org/1544673003/diff/1/third_party/WebKit/Source/core/svg/SVGAngleTearOff.cpp File third_party/WebKit/Source/core/svg/SVGAngleTearOff.cpp (left): https://codereview.chromium.org/1544673003/diff/1/third_party/WebKit/Source/core/svg/SVGAngleTearOff.cpp#oldcode120 third_party/WebKit/Source/core/svg/SVGAngleTearOff.cpp:120: target()->setValueAsString(oldValue, ASSERT_NO_EXCEPTION); // rollback to old value On 2015/12/23 ...
5 years ago (2015-12-23 10:04:17 UTC) #10
fs
5 years ago (2015-12-23 12:54:47 UTC) #11
Message was sent while issue was closed.
https://codereview.chromium.org/1544673003/diff/1/third_party/WebKit/Source/c...
File third_party/WebKit/Source/core/svg/SVGAngleTearOff.cpp (left):

https://codereview.chromium.org/1544673003/diff/1/third_party/WebKit/Source/c...
third_party/WebKit/Source/core/svg/SVGAngleTearOff.cpp:120:
target()->setValueAsString(oldValue, ASSERT_NO_EXCEPTION); // rollback to old
value
On 2015/12/23 at 10:04:17, fs wrote:
> On 2015/12/23 at 04:00:08, pdr-slow reviews thru new year wrote:
> > Is this rollback behavior spec'd? Not a big deal either way, just curious
because I don't see it in 1.1.
> 
> As I recall this was subject of discussion in the WG [1] and only applies to
the cases where "new" units are used (as is the case here). I'll see if I can
dig up something.
> 
> [1] citation needed...

After some mild digging I found:

http://www.w3.org/2014/06/12-svg-minutes.html#item01
https://svgwg.org/svg2-draft/types.html#InterfaceSVGLength (or SVGAngle; the
note after the list of unit enums)

The former refers to a previous resolution which I haven't dug up. As for the
spec bits I don't see that this behavior ended up as specified. (I only see it
being handled for unitType.)

Powered by Google App Engine
This is Rietveld 408576698