New issue
Advanced search Search tips

Issue 596075 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

SVG Image in border-image zooms horribly

Project Member Reported by schenney@chromium.org, Mar 18 2016

Issue description

Version: 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.

 
cr532304.html
2.0 KB View Download

Comment 1 by davve@opera.com, Mar 21 2016

From a glance I suspect this is the same issue as in 561519: subpixel positioning the nine piece grid.

I started a fix in https://codereview.chromium.org/1477393003/ but ran into trouble with gaps.

Comment 2 by davve@opera.com, 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/
Project Member

Comment 3 by bugdroid1@chromium.org, 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

Comment 4 by davve@opera.com, Mar 23 2016

Owner: davve@opera.com
Status: Fixed (was: Available)
Project Member

Comment 5 by bugdroid1@chromium.org, 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

Comment 6 by davve@opera.com, May 2 2016

Status: Available (was: Fixed)
Fix broke gradients. See https://bugs.chromium.org/p/chromium/issues/detail?id=607414
Project Member

Comment 7 by bugdroid1@chromium.org, May 3 2016

Labels: merge-merged-2704
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

Cc: rnimmagadda@chromium.org
Labels: Needs-Feedback
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.
596075.png
2.9 KB View Download

Comment 9 by davve@opera.com, 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.

Comment 10 by davve@opera.com, May 6 2016

Labels: -Needs-Feedback
Components: -Blink>Layout>BackgroundBorder Blink>Layout

Comment 12 by davve@opera.com, Mar 28 2017

Owner: davve@chromium.org
Cc: -rnimmagadda@chromium.org
Labels: PaintTeamTriaged-20170329 BugSource-Team

Comment 14 by davve@chromium.org, Mar 31 2017

Owner: ----
Project Member

Comment 15 by sheriffbot@chromium.org, Apr 16 2018

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
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

Comment 16 by f...@opera.com, Apr 16 2018

Status: Available (was: Untriaged)
Owner: schenney@chromium.org
Status: Assigned (was: Available)
I really aught to fix this. Next after background snapping.

Sign in to add a comment