SVG getScreenCTM ignores padding, border

RESOLVED FIXED in Firefox 68

Status

()

defect
RESOLVED FIXED
5 years ago
3 months ago

People

(Reporter: AnSeki.aff, Assigned: violet.bugreport)

Tracking

32 Branch
mozilla68
Points:
---

Firefox Tracking Flags

(firefox68 fixed)

Details

Attachments

(1 attachment)

User Agent: Mozilla/5.0 (Windows NT 5.1; rv:32.0) Gecko/20100101 Firefox/32.0
Build ID: 20140923175406

Steps to reproduce:

Got values by getScreenCTM in the SVG element that was styled CSS transform, padding and border.
http://jsfiddle.net/gRTcF/8/
http://jsfiddle.net/3v4e0Lnx/
http://jsfiddle.net/ehy1zkL6/


Actual results:

The returned values (x, y) are not computed offsets by those CSS properties.


Expected results:

For example, length of CSS border-width added to position is returned.
These may be related, getScreenCTM seems to ignore some CSS properties that changes position.
https://bugzilla.mozilla.org/show_bug.cgi?id=972041
https://bugzilla.mozilla.org/show_bug.cgi?id=850733

CSS properties below didn't make this problem:
- `margin`
- `position: absolute`, `left` and `top`
- `overflow: auto` (or `hidden`) of parent and scrolled SVG element
- negative margin
- `padding` of parent
OS: Windows XP → All
Hardware: x86 → All
Component: Untriaged → SVG
Product: Firefox → Core
Summary: SVG getScreenCTM ignores the length of offsets by CSS transform, padding, border → SVG getScreenCTM ignores the length of offsets by CSS padding, border
Not limited to `translate`. The `rotate`, `scale`, `skewX/Y` of SVG element also seems to make this problem occur.
http://jsfiddle.net/nsnwanLn/
http://jsfiddle.net/791o0xhq/
http://jsfiddle.net/0kef2rnm/
I don't check 3D properties yet. (e.g. perspective)

These are `transform` of SVG element. Not parent element.
Summary: SVG getScreenCTM ignores the length of offsets by CSS padding, border → SVG getScreenCTM ignores CSS transform (translate, rotate, scale, skewX/Y etc.), padding, border
Summary: SVG getScreenCTM ignores CSS transform (translate, rotate, scale, skewX/Y etc.), padding, border → SVG getScreenCTM ignores padding, border
Assignee: nobody → violet.bugreport
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
See Also: → 972041
Pushed by violet.bugreport@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/0ebd471a1242
getScreenCTM should account for padding and border for outer svg r=longsonr
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
You need to log in before you can comment on or make changes to this bug.