transform-origin incorrectly calculated for fill boxes that have zero width or height
Categories
(Core :: Layout, defect, P2)
Tracking
()
People
(Reporter: paul.lebeau, Assigned: mikokm)
References
(Regression)
Details
(Keywords: regression, Whiteboard: [layout:backlog:quality])
Attachments
(3 files)
User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0
Steps to reproduce:
If an element's bounding box has zero width or height, then the transform origin is incorrect for transform-box: fill-box.
Try this test case: https://jsfiddle.net/17ym4zev/
<svg width="500" height="500">
<g class="small">
<path d="M 0,250 L 500,250" style="stroke: red"/>
</g>
<g class="small">
<path d="M 0,250 L 500,250.1" style="stroke: green"/>
</g>
<g class="small">
<path d="M 250,0 L 250,500" style="stroke: red"/>
</g>
<g class="small">
<path d="M 250,0 L 250.1,500" style="stroke: green"/>
</g>
</svg>
path {
stroke: black;
stroke-width: 8;
}
.small {
transform: scale(0.25, 0.25);
transform-origin: 50% 50%;
transform-box: fill-box;
}
Actual results:
The red lines show the incorrect behaviour. The green lines have been given a tiny width (or height) of 0.1 to show where they out to be.
It's as if the origin is being calculated as (width/2) instead of (x + width/2).
Expected results:
The red lines should be centred in the SVG. They should be where the green lines are.
Tested as working correctly on Chrome and Safari.
| Reporter | ||
Comment 1•6 years ago
|
||
Added screenshot.
Comment 2•6 years ago
|
||
Regression window:
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=a675c5d7eb76887a3e4b24548d621c9cc05a1545&tochange=22caf5b03354b71c909e67ec6bc71133494d3137
Suspect: e7732e4cb0c9abe6823f4f02313b0557ed33feab Matt Woodrow — Bug 1456111 - Make sure an empty pixel rectangle gets converted to an empty app unit rectangle, regardless of scale factor. r=tnikkel
Matt, Your patch seems to cause the problem. Can you please look into this?
Comment 3•6 years ago
|
||
Hey Sean, Can we get a priority on this one? (regression triage)
Comment 4•6 years ago
|
||
Looks like we run into this since aRect.IsEmpty() will be true for 0 width OR height ... I'll mark as P2, but unsure how common the use case is to have 0 width or height bounding box with a transform. I suppose we mostly see this for SVG.
Matt, thoughts here?
| Reporter | ||
Comment 5•6 years ago
|
||
It's a significant problem for SVG, because vertical or horizontal lines are common. And they have zero-width or height bounding boxes. Even if the stroke width is large.
Updated•6 years ago
|
| Reporter | ||
Comment 6•6 years ago
|
||
Is it possible to get a reason why this is a "won't fix" please? The current behaviour is counterintuitive and deviates from the behaviour of other browsers.
Comment 7•6 years ago
|
||
It's wontfix for Firefox 69 only which is going to ship on Tuesday, there is no reasonable path to fixing this on a release coming out in 6 days. It's just a way for release drivers to track bugs.
| Reporter | ||
Comment 8•6 years ago
|
||
Thanks. Sorry I didn't realise how the flags worked. I do now.
Comment 9•6 years ago
|
||
Following up in email with Sean and Matt since this missed the 70 train as well.
We could still take a patch for 71/72.
Comment 10•6 years ago
|
||
Marking as fix-optional for 71 in case a patch materializes before RC week.
Updated•6 years ago
|
Comment 11•6 years ago
|
||
Likely too late for 72 at this point but we could still get a fix in for 73.
Comment 12•6 years ago
|
||
Following up in email, this clearly slipped into the backlog.
Comment 13•6 years ago
|
||
Yes, this slipped. Getting it into our quality backlog.
Hey Jessie — Might we be able to get help from your team on this? (I think MattW is swamped at the moment.) The regressing patch is related to a web painting optimization where an empty gfx rect gets converted to an empty app rect, but looks like we can't always do that.
Comment 14•6 years ago
|
||
Miko - would you be able to take a look?
| Assignee | ||
Comment 15•6 years ago
|
||
Simplified testcase, with an additional path that Chrome and Safari render differently.
| Assignee | ||
Comment 16•6 years ago
|
||
Updated•6 years ago
|
Comment 17•6 years ago
|
||
Comment 18•6 years ago
|
||
| bugherder | ||
Updated•6 years ago
|
Updated•4 years ago
|
Description
•