New issue
Advanced search Search tips

Issue 729067 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 230599
Owner: ----
Closed: Jun 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

SVG objectBoundingBox units incorrectly include path control points

Reported by amelia.b...@gmail.com, Jun 2 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36

Example URL:
https://codepen.io/AmeliaBR/pen/dRyPJE/?editors=1111

Steps to reproduce the problem:
1. Create an SVG path where the control points of Bezier curves extend outside the bounding box (the tight rectangle that encloses all points on the path itself).
2. Apply a gradient or pattern that is scaled to use `objectBoundingBox` units to this path

What is the expected behavior?
The graphical effect that is scaled to use `objectBoundingBox` units should be scaled to the fill-region bounding box; it should not be affected by control points.

In the linked demo, this means that all the gradients should have the same scale.

What went wrong?
The gradient is scaled too large (based on a rectangle that includes the control points).

The bounding box returned by the getBBox() DOM method is correct.

Does it occur on multiple sites: Yes

Is it a problem with a plugin? N/A 

Did this work before? N/A 

Does this work in other browsers? Yes

Chrome version: 58.0.3029.110  Channel: stable
OS Version: 10.0
Flash Version: 

The linked CodePen demo uses clipping paths to trim the underlying shapes to the same outline, so the scale is easier to compare.  Remove the clip-path property to see the actual paths used to scale each copy of the gradient.

I haven't tested with other objectBoundingBox graphical effects yet (clipPath, mask, filter).  I'm expecting to find the same problem.
 
PS. Works as spec'd in Firefox and Edge/IE.

Safari has the same issue (along with another issue specific to this demo and clipping paths not being applied), so this is likely not a new regression in Blink.
Correction: works as spec'd in Edge/IE and in Firefox on Windows or Linux.

Firefox on MacOS and Android uses the same too-big scale as WebKit and Blink.
Components: -Blink Blink>SVG
Labels: -OS-Windows OS-All
Status: Untriaged (was: Unconfirmed)

Comment 4 by f...@opera.com, Jun 2 2017

Mergedinto: 230599
Status: Duplicate (was: Untriaged)
I believe we've kept  issue 230599  open for cases like this one, so duping to that.
Should the title of that issue be changed, then? The getBBox() results are correct, it's the graphical effects that are using the wrong dimensions.

Sign in to add a comment