Closed Bug 1840746 Opened 3 months ago Closed 3 months ago

SVG patternTransform translate uses wrong units

Categories

(Core :: SVG, defect)

Firefox 114
defect

Tracking

()

RESOLVED FIXED
117 Branch
Tracking Status
firefox-esr102 --- unaffected
firefox-esr115 --- fixed
firefox114 --- wontfix
firefox115 + fixed
firefox116 --- fixed
firefox117 --- fixed

People

(Reporter: timwi, Assigned: longsonr)

References

(Regression)

Details

(Keywords: nightly-community, regression)

Attachments

(4 files)

Attached image actual_rendering.png

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/114.0

Steps to reproduce:

Consider the following SVG code:

	<svg viewBox='0 0 2 2' xmlns='http://www.w3.org/2000/svg'>
		<defs>
			<pattern id="r" patternTransform="translate(.5 .5)" patternUnits="userSpaceOnUse" width="2" height="2">
				<path d="M0 0h1v1H0zM1 1h1v1H1z" />
			</pattern>
		</defs>
		<rect x='0' y='0' width='2' height='2' fill='url(#r)' />
	</svg>

Actual results:

See attached screenshot actual_rendering.png. Firefox appears to interpret the “.5” in the patternTransform as a miniscule unit that amounts to just one pixel offset (see the thin black line along the top and left edge).

Expected results:

See attached screenshot expected_rendering.png. Firefox is supposed to interpret the “.5” as a unit relative to the size of the pattern. This expected rendering is produced by both Chrome and Inkscape.

Attached image expected_rendering.png
Attached image test_case.svg

Test case SVG code.

Component: Untriaged → SVG
Product: Firefox → Core
Status: UNCONFIRMED → NEW
Ever confirmed: true

:longsonr, since you are the author of the regressor, bug 1193586, could you take a look?

For more information, please visit BugBot documentation.

Flags: needinfo?(longsonr)
Severity: -- → S2
Assignee: nobody → longsonr
Status: NEW → ASSIGNED

Looks like a good candidate for the planned dot release, tracking for 115.

Pushed by longsonr@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/24fa74f3ab1c
SVG patternTransform translate uses wrong units r=emilio
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/40874 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 117 Branch

Comment on attachment 9342019 [details]
Bug 1840746 - SVG patternTransform translate uses wrong units r=emilio

Beta/Release Uplift Approval Request

  • User impact if declined: incorrect patterns when patternTransform is used
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): reverts one line of code to what it was in Firefox 114
  • String changes made/needed:
  • Is Android affected?: Yes
Attachment #9342019 - Flags: approval-mozilla-release?
Attachment #9342019 - Flags: approval-mozilla-beta?
Upstream PR merged by moz-wptsync-bot
Flags: in-testsuite+

Comment on attachment 9342019 [details]
Bug 1840746 - SVG patternTransform translate uses wrong units r=emilio

Approved for 116.0b2

Attachment #9342019 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

Comment on attachment 9342019 [details]
Bug 1840746 - SVG patternTransform translate uses wrong units r=emilio

Approved for 115.0.2
Approved for 115.0.2esr

Attachment #9342019 - Flags: approval-mozilla-release?
Attachment #9342019 - Flags: approval-mozilla-release+
Attachment #9342019 - Flags: approval-mozilla-esr115+
You need to log in before you can comment on or make changes to this bug.