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

Issue 1019813002: Use viewBox for SVG image as intrinsic size when all else fails (Closed)

Created:
5 years, 9 months ago by davve
Modified:
5 years, 8 months ago
Reviewers:
pdr., fs
CC:
blink-reviews, krit, kouhei+svg_chromium.org, ed+blinkwatch_opera.com, f(malita), gyuyoung.kim_webkit.org, Stephen Chennney, pdr+svgwatchlist_chromium.org, rwlbuis
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Use viewBox for SVG as intrinsic size when all else fails In http://crrev.com/308643002 the use of viewBox for intrinsicSize was removed (which means this is a partial revert of that change). The reason for the removal was that there wasn't a known cases where it would be useful. But then crbug.com/441862 surfaced and showed that using the viewBox for intrinsic size can indeed be useful and necessary for SVG inside an image through a relatively complex chain. What in the end happens is that the intrinsic size is used not as a size but as a ratio when doing scaling to accommodate for object-fit:cover (see LayoutReplaced::replacedContentRect). Ideally, we should only allow use of the ratio from the viewBox, but we currently have no way of expressing just the ratio for an Image. So there is potential for the viewBox being misused as size. Putting the code back should be relatively safe though, since we've had it before. BUG=441862 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=193030

Patch Set 1 #

Patch Set 2 : Rebase #

Patch Set 3 : Updated test expectations and added TODOs #

Unified diffs Side-by-side diffs Delta from patch set Stats (+82 lines, -1 line) Patch
M LayoutTests/fast/dom/HTMLImageElement/image-natural-width-height-svg-expected.txt View 1 2 1 chunk +1 line, -1 line 0 comments Download
A LayoutTests/svg/as-image/svg-as-image-object-fit-contain.html View 1 2 1 chunk +18 lines, -0 lines 0 comments Download
A LayoutTests/svg/as-image/svg-as-image-object-fit-contain-expected.html View 1 2 1 chunk +16 lines, -0 lines 0 comments Download
A LayoutTests/svg/as-image/svg-as-image-object-fit-cover.html View 1 chunk +19 lines, -0 lines 0 comments Download
A LayoutTests/svg/as-image/svg-as-image-object-fit-cover-expected.html View 1 chunk +17 lines, -0 lines 0 comments Download
M Source/core/layout/LayoutReplaced.cpp View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M Source/core/svg/graphics/SVGImage.cpp View 1 2 1 chunk +7 lines, -0 lines 0 comments Download

Messages

Total messages: 13 (4 generated)
davve
So now I got to know at least one case where the code I removed ...
5 years, 9 months ago (2015-03-19 12:20:25 UTC) #2
pdr.
On 2015/03/19 at 12:20:25, davve wrote: > So now I got to know at least ...
5 years, 9 months ago (2015-03-20 06:23:01 UTC) #3
davve
On 2015/03/20 06:23:01, pdr wrote: > On 2015/03/19 at 12:20:25, davve wrote: > > So ...
5 years, 9 months ago (2015-03-24 12:48:00 UTC) #5
fs
On 2015/03/24 12:48:00, David Vest wrote: > On 2015/03/20 06:23:01, pdr wrote: > > On ...
5 years, 9 months ago (2015-03-24 13:56:45 UTC) #6
davve
On 2015/03/24 13:56:45, fs wrote: > On 2015/03/24 12:48:00, David Vest wrote: > > Anyone ...
5 years, 9 months ago (2015-03-25 08:31:16 UTC) #7
davve
PTAL. No code changes, only added TODOs and updated the FAIL -> FAIL test expectation. ...
5 years, 8 months ago (2015-04-02 10:58:58 UTC) #8
fs
lgtm
5 years, 8 months ago (2015-04-02 11:03:37 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1019813002/40001
5 years, 8 months ago (2015-04-02 11:04:46 UTC) #12
commit-bot: I haz the power
5 years, 8 months ago (2015-04-02 12:17:47 UTC) #13
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=193030

Powered by Google App Engine
This is Rietveld 408576698