Closed Bug 1915586 Opened 1 year ago Closed 1 year ago

SVG default stroke not respected with css zoom

Categories

(Core :: SVG, defect)

Firefox 129
defect

Tracking

()

RESOLVED DUPLICATE of bug 1911195

People

(Reporter: nezriffic, Unassigned)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Safari/605.1.15

Steps to reproduce:

Created SVG rect and circle with and without "stroke-width" property set.
According to spec, initial value for stroke-width is "1px".

Examples:
https://codepen.io/nezriffic/pen/JjQBBVo
Where:
#1 are rects without stroke-width defined
#2 are rects WITH stroke-width defined
#3 are circles without stroke-width defined
#4 are circles WITH stroke-width defined

Actual results:

When stroke-width prop not added to rect/circle, it is not respected while zooming with css zoom (keeps same stroke width no matter what zoom value is).
When stroke-width prop added (eg. stroke-width="1", which should actually by default), it is scaling correctly while using css zoom.

Expected results:

If no stroke-width is defined it should use the default (initial = 1).

I guess when there's nothing set we get https://searchfox.org/mozilla-central/source/layout/style/nsStyleStruct.cpp#767 and that isn't multiplied by any Zoom. I don't know how to tell the difference though. The style system returns either 1 or 2 here: https://searchfox.org/mozilla-central/source/dom/svg/SVGContentUtils.cpp#330

Also if strokeWidth isn't set on an element (or its ancestors) then will there be any refresh when zoom changes.

Flags: needinfo?(emilio)
Status: UNCONFIRMED → RESOLVED
Closed: 1 year ago
Duplicate of bug: 1887627
Flags: needinfo?(emilio)
Resolution: --- → DUPLICATE
See Also: → 1951003

[Similar to bug 1903363 comment 4]:
This bug's test-case (the attached one as well as the linked codepen) was fixed by the patch that recently landed in bug 1911195. Nightly renders the testcases the same way as Chrome does now.

Changing the dupe target to bug 1911195.

Duplicate of bug: 1911195
No longer duplicate of bug: 1887627
See Also: 1951003
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: