SVG Image in border-image zooms horribly |
|||||||||||||
Issue descriptionVersion: ToT OS: All? Open the attached file and zoom. The 4th div is the one to watch. As it zooms the border messes up badly. This bug was originally reported as https://bugs.chromium.org/p/chromium/issues/detail?id=367491 but 2 issues were conflated and this was broken out.
,
Mar 21 2016
And for the record, to actually address this bug https://codereview.chromium.org/1477433004/ would be necessary as a follow-up to the failed fix in https://codereview.chromium.org/1477393003/
,
Mar 23 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/5375a43082553e259159d42ef83f727ed9fe5463 commit 5375a43082553e259159d42ef83f727ed9fe5463 Author: davve <davve@opera.com> Date: Wed Mar 23 13:26:47 2016 Straighten out zoom and border-image The border-image-slice property determines how the image is sliced into the nine piece pattern. Since border-image-slice are not lengths, they are not automatically zoomed in computed style. Thus the zoom factor hasn't been applied to the image size either. For border-image the image size has no impact on the destination area anyway, so this part is fine. However, the default object size is in zoomed coordinates and unless the default object size is unzoomed, there will be a mix of zoomed and unzoomed coordinates when calculating the final image size for image sizes that depend on the default object size, e.g. SVG with no intrinsic size. For this reason, unzoom the default object size before using it to compute the image size. Since the zoom passed to StyleImage::image() should represent the zoom applied to the image size, it follows from this that the zoom should be one. BUG=596075, 561519 Review URL: https://codereview.chromium.org/1819083004 Cr-Commit-Position: refs/heads/master@{#382842} [add] https://crrev.com/5375a43082553e259159d42ef83f727ed9fe5463/third_party/WebKit/LayoutTests/svg/css/border-image-zoomed-expected.html [add] https://crrev.com/5375a43082553e259159d42ef83f727ed9fe5463/third_party/WebKit/LayoutTests/svg/css/border-image-zoomed.html [modify] https://crrev.com/5375a43082553e259159d42ef83f727ed9fe5463/third_party/WebKit/Source/core/paint/NinePieceImagePainter.cpp
,
Mar 23 2016
,
May 2 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/6529aa5b970ab274de1ff4c0475f223930babff7 commit 6529aa5b970ab274de1ff4c0475f223930babff7 Author: davve <davve@opera.com> Date: Mon May 02 11:57:49 2016 Revert "Straighten out zoom and border-image" This patch reverts https://codereview.chromium.org/1819083004 patchset #3. Fixing SVG zoom in border-image unfortunatly broke gradients instead. There is a difference in how scale it applied for zooming. For SVG a source rect (unzoomed) <-> destination rect (zoomed) scale factor is computed and used for scaling. For gradients, the source and destination rect are always the same (both zoomed). The individual gradients stops are zoomed instead. BUG= 607414 , 596075, 561519 Review-Url: https://codereview.chromium.org/1934953002 Cr-Commit-Position: refs/heads/master@{#390920} [modify] https://crrev.com/6529aa5b970ab274de1ff4c0475f223930babff7/third_party/WebKit/LayoutTests/TestExpectations [delete] https://crrev.com/5bed693d2607cf9bb51183909bc2f01be934a610/third_party/WebKit/LayoutTests/svg/css/border-image-zoomed-expected.html [delete] https://crrev.com/5bed693d2607cf9bb51183909bc2f01be934a610/third_party/WebKit/LayoutTests/svg/css/border-image-zoomed.html [modify] https://crrev.com/6529aa5b970ab274de1ff4c0475f223930babff7/third_party/WebKit/Source/core/paint/NinePieceImagePainter.cpp
,
May 2 2016
Fix broke gradients. See https://bugs.chromium.org/p/chromium/issues/detail?id=607414
,
May 3 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/96c436224c8f8c681c6b441f130c3839784d746c commit 96c436224c8f8c681c6b441f130c3839784d746c Author: David Vest <davve@opera.com> Date: Tue May 03 13:04:44 2016 Revert "Straighten out zoom and border-image" This patch reverts https://codereview.chromium.org/1819083004 patchset Fixing SVG zoom in border-image unfortunatly broke gradients instead. There is a difference in how scale it applied for zooming. For SVG a source rect (unzoomed) <-> destination rect (zoomed) scale factor is computed and used for scaling. For gradients, the source and destination rect are always the same (both zoomed). The individual gradients stops are zoomed instead. BUG= 607414 , 596075, 561519 Review-Url: https://codereview.chromium.org/1934953002 Cr-Commit-Position: refs/heads/master@{#390920} (cherry picked from commit 6529aa5b970ab274de1ff4c0475f223930babff7) Review URL: https://codereview.chromium.org/1946543002 . Cr-Commit-Position: refs/branch-heads/2704@{#351} Cr-Branched-From: 6e53600def8f60d8c632fadc70d7c1939ccea347-refs/heads/master@{#386251} [modify] https://crrev.com/96c436224c8f8c681c6b441f130c3839784d746c/third_party/WebKit/LayoutTests/TestExpectations [delete] https://crrev.com/a8de7f8d6820d42bf0a476fd3029dd0cf0ae9c36/third_party/WebKit/LayoutTests/svg/css/border-image-zoomed-expected.html [delete] https://crrev.com/a8de7f8d6820d42bf0a476fd3029dd0cf0ae9c36/third_party/WebKit/LayoutTests/svg/css/border-image-zoomed.html [modify] https://crrev.com/96c436224c8f8c681c6b441f130c3839784d746c/third_party/WebKit/Source/core/paint/NinePieceImagePainter.cpp
,
May 4 2016
Observed the attached behavior on Windows 7, MAC (10.11.4) & Ubuntu Trusty (14.04) for Google Chrome Beta Version - 51.0.2704.36 @davve: Could you please have a look and let us know if this is the expected behavior? Thank you.
,
May 6 2016
Yes, that looks about what I would expect without the fix. Sadly the fix had to reverted due to breaking gradients. In general, if behavior in M51 differs from M50 or M49 in this regard (zoomed SVG in border-image), I'd be interested to know about it.
,
May 6 2016
,
Jun 14 2016
,
Mar 28 2017
,
Mar 29 2017
,
Mar 31 2017
,
Apr 16 2018
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue. Sorry for the inconvenience if the bug really should have been left as Available. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Apr 16 2018
,
Apr 16 2018
I really aught to fix this. Next after background snapping. |
|||||||||||||
►
Sign in to add a comment |
|||||||||||||
Comment 1 by davve@opera.com
, Mar 21 2016