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

Issue 1314793010: Support fragment URLs for all kinds of SVG images (Closed)

Created:
5 years, 3 months ago by davve
Modified:
5 years, 1 month ago
Reviewers:
pdr., Nate Chapin, f(malita), fs
CC:
blink-reviews, blink-reviews-html_chromium.org, eae+blinkwatch, eric.carlson_apple.com, apavlov+blink_chromium.org, kinuko+watch, kouhei+svg_chromium.org, rwlbuis, Yoav Weiss, krit, blink-reviews-css, szager+layoutwatch_chromium.org, dglazkov+blink, gavinp+loader_chromium.org, jchaffraix+rendering, gyuyoung2, pdr+svgwatchlist_chromium.org, blink-reviews-style_chromium.org, zoltan1, philipj_slow, feature-media-reviews_chromium.org, darktears, Nate Chapin, tyoshino+watch_chromium.org, blink-reviews-rendering, mlamouri+watch-blink_chromium.org, pdr+renderingwatchlist_chromium.org, leviw+renderwatch, Stephen Chennney
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Support fragment URLs for all kinds of SVG images Add support for SVG fragment URLs in CSS backgrounds, video poster images, image inputs and svg:image scenarios. This patch does so by storing fragment URLs for each SVGImageForContainer. Previous to this patch the URL was stored in the SVGImage. This is non-optimal since the same SVGImage represents all URLs where only the fragment string differ. This required us to update the URL for each different draw for different containers. This patch removes the hack in ImageResource::svgImageForLayoutObject which made this work previously and instead stores the fragment URL in the SVGImageForContainer. But just storing the URL in SVGImageForContainer is not enough since those objects are recreated all the time. See ImageResource::setContainerParametersForLayoutObject (prior to this patch named ImageResource::setContainerSizeForLayoutObject). Thus we also need to store the fragment URLs one level up the ownership hierarchy from ImageResource: in StyleFetchedImage, StyleFetchedImageSet and LayoutImageResource. These are the long-living objects that'll hold the URL fragment over the life-time of their respective DOM counterparts.

Patch Set 1 #

Patch Set 2 : Rebase #

Total comments: 4

Patch Set 3 : Add doctype to some tests and remove a now unnecessary include #

Patch Set 4 : Update DEPS to match #

Total comments: 9
Unified diffs Side-by-side diffs Delta from patch set Stats (+172 lines, -61 lines) Patch
A LayoutTests/svg/css/svg-resource-fragment-identifier-background.html View 1 2 1 chunk +10 lines, -0 lines 0 comments Download
A LayoutTests/svg/css/svg-resource-fragment-identifier-background-expected.html View 1 2 1 chunk +10 lines, -0 lines 0 comments Download
A LayoutTests/svg/css/svg-resource-fragment-identifier-background-srcset.html View 1 2 1 chunk +13 lines, -0 lines 0 comments Download
A LayoutTests/svg/css/svg-resource-fragment-identifier-background-srcset-expected.html View 1 chunk +15 lines, -0 lines 0 comments Download
M LayoutTests/svg/css/svg-resource-fragment-identifier-img-src.html View 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/svg/css/svg-resource-fragment-identifier-img-src-expected.html View 1 1 chunk +1 line, -1 line 0 comments Download
A LayoutTests/svg/css/svg-resource-fragment-identifier-input.html View 1 chunk +11 lines, -0 lines 0 comments Download
A LayoutTests/svg/css/svg-resource-fragment-identifier-input-expected.html View 1 chunk +10 lines, -0 lines 0 comments Download
A LayoutTests/svg/css/svg-resource-fragment-identifier-svg-image.html View 1 chunk +6 lines, -0 lines 0 comments Download
A LayoutTests/svg/css/svg-resource-fragment-identifier-svg-image-expected.html View 1 chunk +6 lines, -0 lines 0 comments Download
A LayoutTests/svg/css/svg-resource-fragment-identifier-video-poster.html View 1 chunk +11 lines, -0 lines 0 comments Download
A LayoutTests/svg/css/svg-resource-fragment-identifier-video-poster-expected.html View 1 chunk +10 lines, -0 lines 0 comments Download
M Source/core/css/CSSImageSetValue.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/css/CSSImageValue.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/fetch/DEPS View 1 2 3 1 chunk +0 lines, -1 line 0 comments Download
M Source/core/fetch/ImageResource.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/fetch/ImageResource.cpp View 1 2 4 chunks +2 lines, -10 lines 4 comments Download
M Source/core/html/HTMLImageElement.cpp View 1 chunk +3 lines, -2 lines 0 comments Download
M Source/core/html/HTMLVideoElement.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/html/forms/ImageInputType.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/layout/LayoutImageResource.h View 2 chunks +2 lines, -1 line 0 comments Download
M Source/core/layout/LayoutImageResource.cpp View 3 chunks +6 lines, -3 lines 0 comments Download
M Source/core/loader/ImageLoader.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/loader/ImageLoader.cpp View 1 4 chunks +4 lines, -4 lines 0 comments Download
M Source/core/style/StyleFetchedImage.h View 2 chunks +4 lines, -3 lines 0 comments Download
M Source/core/style/StyleFetchedImage.cpp View 2 chunks +3 lines, -2 lines 0 comments Download
M Source/core/style/StyleFetchedImageSet.h View 2 chunks +4 lines, -3 lines 4 comments Download
M Source/core/style/StyleFetchedImageSet.cpp View 2 chunks +3 lines, -2 lines 0 comments Download
M Source/core/svg/SVGImageElement.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/svg/graphics/SVGImage.h View 1 2 chunks +3 lines, -4 lines 0 comments Download
M Source/core/svg/graphics/SVGImage.cpp View 1 6 chunks +18 lines, -10 lines 0 comments Download
M Source/core/svg/graphics/SVGImageForContainer.h View 3 chunks +6 lines, -4 lines 1 comment Download
M Source/core/svg/graphics/SVGImageForContainer.cpp View 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 37 (8 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1314793010/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1314793010/1
5 years, 3 months ago (2015-09-07 12:13:07 UTC) #2
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: ios_dbg_simulator_ninja on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios_dbg_simulator_ninja/builds/66356) mac_chromium_compile_dbg_ng on ...
5 years, 3 months ago (2015-09-07 12:14:30 UTC) #4
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1314793010/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1314793010/20001
5 years, 3 months ago (2015-09-07 12:58:00 UTC) #6
davve
Rather different (and slightly more complex) than the WebKit fix: http://trac.webkit.org/changeset/185395 and I'm not sure ...
5 years, 3 months ago (2015-09-07 14:15:00 UTC) #8
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 3 months ago (2015-09-07 14:50:08 UTC) #10
fs
On 2015/09/07 14:15:00, David Vest wrote: > Rather different (and slightly more complex) than the ...
5 years, 3 months ago (2015-09-07 16:07:30 UTC) #11
fs
https://codereview.chromium.org/1314793010/diff/20001/LayoutTests/svg/css/svg-resource-fragment-identifier-background.html File LayoutTests/svg/css/svg-resource-fragment-identifier-background.html (right): https://codereview.chromium.org/1314793010/diff/20001/LayoutTests/svg/css/svg-resource-fragment-identifier-background.html#newcode1 LayoutTests/svg/css/svg-resource-fragment-identifier-background.html:1: <style> Missing doctype here and in a few more ...
5 years, 3 months ago (2015-09-07 16:07:44 UTC) #12
fs
On 2015/09/07 16:07:44, fs wrote: > https://codereview.chromium.org/1314793010/diff/20001/LayoutTests/svg/css/svg-resource-fragment-identifier-background.html > File LayoutTests/svg/css/svg-resource-fragment-identifier-background.html > (right): > > https://codereview.chromium.org/1314793010/diff/20001/LayoutTests/svg/css/svg-resource-fragment-identifier-background.html#newcode1 ...
5 years, 3 months ago (2015-09-07 16:10:28 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/1314793010/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1314793010/60001
5 years, 3 months ago (2015-09-08 06:54:22 UTC) #15
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 3 months ago (2015-09-08 08:23:28 UTC) #17
davve
Thanks for review, fs! https://codereview.chromium.org/1314793010/diff/20001/LayoutTests/svg/css/svg-resource-fragment-identifier-background.html File LayoutTests/svg/css/svg-resource-fragment-identifier-background.html (right): https://codereview.chromium.org/1314793010/diff/20001/LayoutTests/svg/css/svg-resource-fragment-identifier-background.html#newcode1 LayoutTests/svg/css/svg-resource-fragment-identifier-background.html:1: <style> On 2015/09/07 16:07:44, fs ...
5 years, 3 months ago (2015-09-08 09:46:45 UTC) #18
f(malita)
I think having per-SVGImageForContainer url fragments makes sense, but plumbing all that info through SVG-unrelated ...
5 years, 3 months ago (2015-09-08 18:41:19 UTC) #20
davve
https://codereview.chromium.org/1314793010/diff/60001/Source/core/fetch/ImageResource.cpp File Source/core/fetch/ImageResource.cpp (right): https://codereview.chromium.org/1314793010/diff/60001/Source/core/fetch/ImageResource.cpp#newcode214 Source/core/fetch/ImageResource.cpp:214: void ImageResource::setContainerParametersForLayoutObject(const ImageResourceClient* layoutObject, const IntSize& containerSize, float containerZoom, ...
5 years, 3 months ago (2015-09-08 19:12:25 UTC) #21
pdr.
Very nice. I think this is a reasonable approach.
5 years, 3 months ago (2015-09-08 19:59:27 UTC) #22
f(malita)
https://codereview.chromium.org/1314793010/diff/60001/Source/core/fetch/ImageResource.cpp File Source/core/fetch/ImageResource.cpp (right): https://codereview.chromium.org/1314793010/diff/60001/Source/core/fetch/ImageResource.cpp#newcode214 Source/core/fetch/ImageResource.cpp:214: void ImageResource::setContainerParametersForLayoutObject(const ImageResourceClient* layoutObject, const IntSize& containerSize, float containerZoom, ...
5 years, 3 months ago (2015-09-08 20:45:51 UTC) #23
davve
https://codereview.chromium.org/1314793010/diff/60001/Source/core/fetch/ImageResource.cpp File Source/core/fetch/ImageResource.cpp (right): https://codereview.chromium.org/1314793010/diff/60001/Source/core/fetch/ImageResource.cpp#newcode214 Source/core/fetch/ImageResource.cpp:214: void ImageResource::setContainerParametersForLayoutObject(const ImageResourceClient* layoutObject, const IntSize& containerSize, float containerZoom, ...
5 years, 3 months ago (2015-09-09 14:22:54 UTC) #24
fs
On 2015/09/09 14:22:54, David Vest wrote: ... > https://codereview.chromium.org/1314793010/diff/60001/Source/core/svg/graphics/SVGImageForContainer.h > File Source/core/svg/graphics/SVGImageForContainer.h (right): > > ...
5 years, 3 months ago (2015-09-09 22:19:22 UTC) #25
f(malita)
On 2015/09/09 14:22:54, David Vest wrote: > Since SVGImageForContainer is associated per layout object, this ...
5 years, 3 months ago (2015-09-09 23:55:41 UTC) #26
fs
On 2015/09/09 23:55:41, f(malita) wrote: > On 2015/09/09 14:22:54, David Vest wrote: > > Since ...
5 years, 3 months ago (2015-09-10 07:45:47 UTC) #27
davve
On 2015/09/10 07:45:47, fs wrote: > On 2015/09/09 23:55:41, f(malita) wrote: > > On 2015/09/09 ...
5 years, 3 months ago (2015-09-10 13:09:18 UTC) #28
f(malita)
On 2015/09/10 13:09:18, David Vest wrote: > On 2015/09/10 07:45:47, fs wrote: > > On ...
5 years, 3 months ago (2015-09-10 13:37:40 UTC) #29
davve
On 2015/09/10 13:37:40, f(malita) wrote: > One idea to reduce intrusiveness: instead of making the ...
5 years, 3 months ago (2015-09-11 07:22:56 UTC) #30
davve
On 2015/09/10 13:37:40, f(malita) wrote: > On 2015/09/10 13:09:18, David Vest wrote: > > On ...
5 years, 3 months ago (2015-09-15 08:59:41 UTC) #31
fs
On 2015/09/15 08:59:41, David Vest wrote: > On 2015/09/10 13:37:40, f(malita) wrote: > > On ...
5 years, 3 months ago (2015-09-15 09:12:35 UTC) #32
f(malita)
On 2015/09/15 09:12:35, fs wrote: > On 2015/09/15 08:59:41, David Vest wrote: > > On ...
5 years, 3 months ago (2015-09-17 09:48:15 UTC) #33
davve
On 2015/09/17 09:48:15, f(malita) wrote: > On 2015/09/15 09:12:35, fs wrote: > > On 2015/09/15 ...
5 years, 3 months ago (2015-09-17 13:21:30 UTC) #34
davve
On 2015/09/17 13:21:30, David Vest wrote: > Thanks for the feedback. I'll update this CL ...
5 years, 2 months ago (2015-09-25 15:18:51 UTC) #35
fs
On 2015/09/25 at 15:18:51, davve wrote: > On 2015/09/17 13:21:30, David Vest wrote: > > ...
5 years, 2 months ago (2015-09-25 15:34:19 UTC) #36
davve
5 years, 1 month ago (2015-10-28 17:07:59 UTC) #37
Message was sent while issue was closed.
Closing this one since this is probably not in the direction we want to go. I
currently experiment with other strategies in
https://codereview.chromium.org/1367193003/

Powered by Google App Engine
This is Rietveld 408576698