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

Issue 2290173005: Synthesize preserveAspectRatio='none' for non-viewBoxed <img> (Closed)

Created:
4 years, 3 months ago by fs
Modified:
4 years, 3 months ago
Reviewers:
davve, pdr.
CC:
blink-reviews, chromium-reviews, krit, f(malita), gyuyoung2, kouhei+svg_chromium.org, pdr+svgwatchlist_chromium.org, rwlbuis, Stephen Chennney
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Synthesize preserveAspectRatio='none' for non-viewBoxed <img> For SVGs embedded in an image context, we will synthesize a viewBox that matches the intrinsic dimensions of the SVGs, if no viewBox is specified. This would result in an image where the aspect ratio expressed by the intrinsic dimensions would be preserved. This does not appear to match author expectations - they rather see that the behavior in these cases match that of a "regular" raster-based image. To achieve this, also synthesize a preserveAspectRatio-value of "none" in these cases. This will result in the original image being stretched in the most common cases. Any percentage dimensions will be resolved against the computed dimensions (replaced size), and can hence also produce a useful viewBox. The implemented behavior is not currently specced (neither was the old synthesizing of a viewBox), but matches Gecko. BUG=110195 Committed: https://crrev.com/2d9c498abd13af52fc331ff516b5826ec354801e Cr-Commit-Position: refs/heads/master@{#416059}

Patch Set 1 #

Patch Set 2 : New baselines #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+136 lines, -6 lines) Patch
M third_party/WebKit/LayoutTests/platform/linux/css3/masking/mask-repeat-space-content-expected.png View 1 Binary file 0 comments Download
M third_party/WebKit/LayoutTests/platform/linux/svg/as-background-image/background-image-preserveaspectRatio-support-expected.png View 1 Binary file 0 comments Download
M third_party/WebKit/LayoutTests/platform/linux/svg/as-image/img-preserveAspectRatio-support-1-expected.png View 1 Binary file 0 comments Download
M third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.png View 1 Binary file 0 comments Download
M third_party/WebKit/LayoutTests/platform/mac-mac10.9/css3/masking/mask-repeat-space-content-expected.png View 1 Binary file 0 comments Download
M third_party/WebKit/LayoutTests/platform/mac/css3/masking/mask-repeat-space-content-expected.png View 1 Binary file 0 comments Download
M third_party/WebKit/LayoutTests/platform/mac/svg/as-background-image/background-image-preserveaspectRatio-support-expected.png View 1 Binary file 0 comments Download
M third_party/WebKit/LayoutTests/platform/mac/svg/as-image/img-preserveAspectRatio-support-1-expected.png View 1 Binary file 0 comments Download
M third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-background-images-expected.png View 1 Binary file 0 comments Download
M third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.png View 1 Binary file 0 comments Download
M third_party/WebKit/LayoutTests/platform/win/css3/masking/mask-repeat-space-content-expected.png View 1 Binary file 0 comments Download
M third_party/WebKit/LayoutTests/platform/win/svg/as-background-image/background-image-preserveaspectRatio-support-expected.png View 1 Binary file 0 comments Download
M third_party/WebKit/LayoutTests/platform/win/svg/as-image/img-preserveAspectRatio-support-1-expected.png View 1 Binary file 0 comments Download
M third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-background-images-expected.png View 1 Binary file 0 comments Download
M third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.png View 1 Binary file 0 comments Download
A third_party/WebKit/LayoutTests/svg/as-image/resources/synthesized-viewbox-par-helper.js View 1 chunk +34 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/svg/as-image/same-image-two-instances-expected.png View 1 Binary file 0 comments Download
A third_party/WebKit/LayoutTests/svg/as-image/synthesized-viewbox-par-width-percent.html View 1 chunk +17 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/svg/as-image/synthesized-viewbox-par-width-percent-expected.html View 1 chunk +17 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/svg/as-image/synthesized-viewbox-par-width-px.html View 1 chunk +17 lines, -0 lines 2 comments Download
A third_party/WebKit/LayoutTests/svg/as-image/synthesized-viewbox-par-width-px-expected.html View 1 chunk +17 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGSVGElement.h View 2 chunks +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGSVGElement.cpp View 3 chunks +32 lines, -6 lines 4 comments Download

Messages

Total messages: 17 (9 generated)
fs
4 years, 3 months ago (2016-08-31 17:19:31 UTC) #8
pdr.
On 2016/08/31 at 17:19:31, fs wrote: > LGTM I checked Safari and found they do ...
4 years, 3 months ago (2016-09-01 17:17:19 UTC) #9
fs
On 2016/09/01 at 17:17:19, pdr wrote: > On 2016/08/31 at 17:19:31, fs wrote: > > ...
4 years, 3 months ago (2016-09-01 17:24:02 UTC) #10
davve
lgtm https://codereview.chromium.org/2290173005/diff/20001/third_party/WebKit/LayoutTests/svg/as-image/synthesized-viewbox-par-width-px.html File third_party/WebKit/LayoutTests/svg/as-image/synthesized-viewbox-par-width-px.html (right): https://codereview.chromium.org/2290173005/diff/20001/third_party/WebKit/LayoutTests/svg/as-image/synthesized-viewbox-par-width-px.html#newcode9 third_party/WebKit/LayoutTests/svg/as-image/synthesized-viewbox-par-width-px.html:9: doCombinationTest( Creative use of that function... :) https://codereview.chromium.org/2290173005/diff/20001/third_party/WebKit/Source/core/svg/SVGSVGElement.cpp ...
4 years, 3 months ago (2016-09-01 17:46:42 UTC) #11
fs
https://codereview.chromium.org/2290173005/diff/20001/third_party/WebKit/LayoutTests/svg/as-image/synthesized-viewbox-par-width-px.html File third_party/WebKit/LayoutTests/svg/as-image/synthesized-viewbox-par-width-px.html (right): https://codereview.chromium.org/2290173005/diff/20001/third_party/WebKit/LayoutTests/svg/as-image/synthesized-viewbox-par-width-px.html#newcode9 third_party/WebKit/LayoutTests/svg/as-image/synthesized-viewbox-par-width-px.html:9: doCombinationTest( On 2016/09/01 at 17:46:42, davve wrote: > Creative ...
4 years, 3 months ago (2016-09-01 17:57:24 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2290173005/20001
4 years, 3 months ago (2016-09-01 19:19:30 UTC) #14
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 3 months ago (2016-09-01 21:26:53 UTC) #15
commit-bot: I haz the power
4 years, 3 months ago (2016-09-01 21:29:55 UTC) #17
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/2d9c498abd13af52fc331ff516b5826ec354801e
Cr-Commit-Position: refs/heads/master@{#416059}

Powered by Google App Engine
This is Rietveld 408576698