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

Issue 1681553002: Add support for 'href' (w/o XLink NS) for various SVG elements (Closed)

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

Description

Add support for 'href' (w/o XLink NS) for various SVG elements This CL adds a new wrapper type SVGAnimatedHref that wraps 'href' (the new, null/default NS version) and '(xlink:)href' (the XLink NS version). This wrapper type is used by SVGURIReference and thus most uses of 'href' is covered by this part. SVGAnimatedHref is intended as a wrapper for accessing the underlying value of either 'href' or 'xlink:href'. Any updates due to setAttribute or will go directly to the underlying values which means that synchronization etc. does not apply to the wrapper. This is one of the "pro"s of this approach - it does not require any modification to synching between the SVGString object and the attribute in certain cases (like when the "active" attribute is removed). A "con" would be that there's a lot of dead space in the object since the wrapper itself still needs to implement the SVGAnimatedString interface even if just forwards to the actual SVGString. The UseCounter for href.baseVal/animVal are moved to the new wrapper. For cases where SVGURIReference is not used, new code-paths are added to select the right attribute. Animation code is updated to target the 'href' in the null/default NS. BUG=584142 Committed: https://crrev.com/2f0b655515af2df03d41d4f894e0dd59d5cb6411 Cr-Commit-Position: refs/heads/master@{#375192}

Patch Set 1 #

Patch Set 2 : Remove invalid assert. #

Total comments: 7

Patch Set 3 : Rebase. #

Total comments: 5

Patch Set 4 : Attempt at hiding 'href' vs. 'xlink:href' a bit more #

Patch Set 5 : Tweaks #

Total comments: 3

Patch Set 6 : Rebase; update comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+544 lines, -52 lines) Patch
A + third_party/WebKit/LayoutTests/http/tests/security/xssAuditor/svg-animate-href.html View 1 chunk +1 line, -1 line 0 comments Download
A + third_party/WebKit/LayoutTests/http/tests/security/xssAuditor/svg-animate-href-expected.txt View 2 chunks +2 lines, -2 lines 0 comments Download
A + third_party/WebKit/LayoutTests/http/tests/security/xssAuditor/svg-script-tag-href.html View 1 chunk +1 line, -1 line 0 comments Download
A + third_party/WebKit/LayoutTests/http/tests/security/xssAuditor/svg-script-tag-href-expected.txt View 1 chunk +1 line, -1 line 0 comments Download
A third_party/WebKit/LayoutTests/svg/custom/image-href.html View 1 chunk +4 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/svg/custom/image-href-expected.html View 1 chunk +4 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/svg/custom/use-href-null-ns.html View 1 chunk +7 lines, -0 lines 0 comments Download
A + third_party/WebKit/LayoutTests/svg/custom/use-href-null-ns-expected.html View 0 chunks +-1 lines, --1 lines 0 comments Download
A third_party/WebKit/LayoutTests/svg/custom/use-href-null-ns-precedence.html View 1 chunk +8 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/svg/custom/use-href-null-ns-precedence-dynamic.html View 1 chunk +17 lines, -0 lines 0 comments Download
A + third_party/WebKit/LayoutTests/svg/custom/use-href-null-ns-precedence-dynamic-expected.html View 1 chunk +1 line, -0 lines 0 comments Download
A + third_party/WebKit/LayoutTests/svg/custom/use-href-null-ns-precedence-expected.html View 0 chunks +-1 lines, --1 lines 0 comments Download
A third_party/WebKit/LayoutTests/svg/dom/href-semantics.html View 1 chunk +137 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/animation/AnimationInputHelpers.cpp View 4 chunks +1 line, -6 lines 0 comments Download
M third_party/WebKit/Source/core/animation/PropertyInterpolationTypesMapping.cpp View 1 2 3 chunks +2 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/core.gypi View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Element.cpp View 1 2 3 3 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/dom/VisitedLinkState.cpp View 1 2 3 4 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/html/parser/XSSAuditor.cpp View 1 chunk +1 line, -0 lines 0 comments Download
A third_party/WebKit/Source/core/svg/SVGAnimatedHref.h View 1 chunk +60 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/core/svg/SVGAnimatedHref.cpp View 1 1 chunk +123 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGAnimatedString.h View 2 chunks +4 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGAnimatedString.cpp View 1 chunk +1 line, -11 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGAttributeNames.in View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGElement.cpp View 1 2 3 4 4 chunks +2 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGURIReference.h View 1 2 3 4 4 chunks +12 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGURIReference.cpp View 1 2 3 2 chunks +16 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGUseElement.cpp View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/svg/UnsafeSVGAttributeSanitizationTest.cpp View 8 chunks +117 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/svg/animation/SVGSMILElement.cpp View 1 2 3 4 5 3 chunks +16 lines, -9 lines 0 comments Download

Messages

Total messages: 24 (7 generated)
fs
alancutter: A minor, hopefully uncontroversial, change to SVG (Web) Animations. Maybe mostly FYI. pdr: Could ...
4 years, 10 months ago (2016-02-08 18:19:10 UTC) #4
alancutter (OOO until 2018)
On 2016/02/08 at 18:19:10, fs wrote: > alancutter: A minor, hopefully uncontroversial, change to SVG ...
4 years, 10 months ago (2016-02-08 23:35:56 UTC) #5
pdr.
+cc davve for more reviewer eyes. https://codereview.chromium.org/1681553002/diff/20001/third_party/WebKit/LayoutTests/svg/dom/href-semantics.html File third_party/WebKit/LayoutTests/svg/dom/href-semantics.html (right): https://codereview.chromium.org/1681553002/diff/20001/third_party/WebKit/LayoutTests/svg/dom/href-semantics.html#newcode1 third_party/WebKit/LayoutTests/svg/dom/href-semantics.html:1: <!DOCTYPE html> These ...
4 years, 10 months ago (2016-02-09 23:17:07 UTC) #7
fs
https://codereview.chromium.org/1681553002/diff/20001/third_party/WebKit/LayoutTests/svg/dom/href-semantics.html File third_party/WebKit/LayoutTests/svg/dom/href-semantics.html (right): https://codereview.chromium.org/1681553002/diff/20001/third_party/WebKit/LayoutTests/svg/dom/href-semantics.html#newcode1 third_party/WebKit/LayoutTests/svg/dom/href-semantics.html:1: <!DOCTYPE html> On 2016/02/09 at 23:17:07, pdr wrote: > ...
4 years, 10 months ago (2016-02-10 14:44:46 UTC) #8
davve
Reading through makes me share some of pdr's complexity concerns, especially about multiple call sites ...
4 years, 10 months ago (2016-02-10 17:47:40 UTC) #9
fs
On 2016/02/10 at 17:47:40, davve wrote: > Reading through makes me share some of pdr's ...
4 years, 10 months ago (2016-02-10 19:31:15 UTC) #10
davve
https://codereview.chromium.org/1681553002/diff/40001/third_party/WebKit/Source/core/svg/SVGAnimatedString.h File third_party/WebKit/Source/core/svg/SVGAnimatedString.h (right): https://codereview.chromium.org/1681553002/diff/40001/third_party/WebKit/Source/core/svg/SVGAnimatedString.h#newcode47 third_party/WebKit/Source/core/svg/SVGAnimatedString.h:47: virtual String baseVal(); On 2016/02/10 19:31:14, fs wrote: > ...
4 years, 10 months ago (2016-02-11 07:37:09 UTC) #11
fs
https://codereview.chromium.org/1681553002/diff/40001/third_party/WebKit/Source/core/svg/SVGAnimatedString.h File third_party/WebKit/Source/core/svg/SVGAnimatedString.h (right): https://codereview.chromium.org/1681553002/diff/40001/third_party/WebKit/Source/core/svg/SVGAnimatedString.h#newcode47 third_party/WebKit/Source/core/svg/SVGAnimatedString.h:47: virtual String baseVal(); On 2016/02/11 at 07:37:08, David Vest ...
4 years, 10 months ago (2016-02-11 09:48:19 UTC) #12
davve
Reading through this closer I'm starting to feel confident this is more or less as ...
4 years, 10 months ago (2016-02-11 10:12:21 UTC) #13
fs
https://codereview.chromium.org/1681553002/diff/20001/third_party/WebKit/Source/core/svg/animation/SVGSMILElement.cpp File third_party/WebKit/Source/core/svg/animation/SVGSMILElement.cpp (right): https://codereview.chromium.org/1681553002/diff/20001/third_party/WebKit/Source/core/svg/animation/SVGSMILElement.cpp#newcode242 third_party/WebKit/Source/core/svg/animation/SVGSMILElement.cpp:242: AtomicString href = getAttribute(SVGNames::hrefAttr); On 2016/02/10 at 14:44:46, fs ...
4 years, 10 months ago (2016-02-11 13:35:12 UTC) #14
pdr.
LGTM here too. Somewhat unfortunate constraints but I couldn't find a better approach. https://codereview.chromium.org/1681553002/diff/80001/third_party/WebKit/Source/core/svg/animation/SVGSMILElement.cpp File ...
4 years, 10 months ago (2016-02-12 03:03:36 UTC) #15
davve
https://codereview.chromium.org/1681553002/diff/80001/third_party/WebKit/Source/core/svg/animation/SVGSMILElement.cpp File third_party/WebKit/Source/core/svg/animation/SVGSMILElement.cpp (right): https://codereview.chromium.org/1681553002/diff/80001/third_party/WebKit/Source/core/svg/animation/SVGSMILElement.cpp#newcode291 third_party/WebKit/Source/core/svg/animation/SVGSMILElement.cpp:291: // 'xlink:href' should map to 'href' for animation purposes. ...
4 years, 10 months ago (2016-02-12 07:26:14 UTC) #16
fs
https://codereview.chromium.org/1681553002/diff/80001/third_party/WebKit/Source/core/svg/animation/SVGSMILElement.cpp File third_party/WebKit/Source/core/svg/animation/SVGSMILElement.cpp (right): https://codereview.chromium.org/1681553002/diff/80001/third_party/WebKit/Source/core/svg/animation/SVGSMILElement.cpp#newcode291 third_party/WebKit/Source/core/svg/animation/SVGSMILElement.cpp:291: // 'xlink:href' should map to 'href' for animation purposes. ...
4 years, 10 months ago (2016-02-12 11:49:58 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1681553002/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1681553002/100001
4 years, 10 months ago (2016-02-12 16:09:15 UTC) #20
commit-bot: I haz the power
Committed patchset #6 (id:100001)
4 years, 10 months ago (2016-02-12 16:15:18 UTC) #21
carlosk
A revert of this CL (patchset #6 id:100001) has been created in https://codereview.chromium.org/1692673004/ by carlosk@chromium.org. ...
4 years, 10 months ago (2016-02-12 16:47:14 UTC) #22
commit-bot: I haz the power
4 years, 10 months ago (2016-02-16 22:43:29 UTC) #24
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/2f0b655515af2df03d41d4f894e0dd59d5cb6411
Cr-Commit-Position: refs/heads/master@{#375192}

Powered by Google App Engine
This is Rietveld 408576698