Closed Bug 1340715 Opened 7 years ago Closed 2 years ago

{inc}nsSVGOuterSVGFrame::GetPrefISize depends on results of previous layout

Categories

(Core :: SVG, defect, P3)

defect

Tracking

()

RESOLVED FIXED
106 Branch
Tracking Status
firefox54 --- wontfix
firefox106 --- fixed

People

(Reporter: dbaron, Assigned: TYLin)

References

(Regressed 1 open bug)

Details

Attachments

(2 files, 2 obsolete files)

Bug 1162418 made nsSVGOuterSVGFrame::GetPrefISize call GetLogicalSize on ancestors going up the frame tree.  It's incorrect to do this, because it can depend on the results in a *previous* layout rather than the current one.


What led me to this code was trying to explain to fantasai the Firefox behavior in:
http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%0A%3Cdiv%20style%3D%22width%3A%20500px%3B%20border%3A%20magenta%20solid%20thick%22%3E%0A%3Cdiv%20style%3D%22float%3A%20left%3B%20border%3A%20orange%20solid%20thick%3B%22%3E%0A%3Csvg%20viewbox%3D%220%200%2010%2010%22%20style%3D%22display%3A%20block%22%3E%0A%20%3Crect%20fill%3Dblue%20width%3D100%25%20height%3D100%25%20%2F%3E%0A%3C%2Fsvg%3E%0A%3C%2Fdiv%3E
which is actually reasonable, and could probably be obtained by returning nscoord_MAX as the pref ISize, but I think this code is incorrect.

I'll try to write a testcase showing the bad results later.
Note that this nearly led the spec authors to specify ... it's not clear what ... but it might not have been implementable:
https://github.com/w3c/csswg-drafts/issues/951
Component: Layout → SVG
Priority: -- → P3
Summary: nsSVGOuterSVGFrame::GetPrefISize depends on results of previous layout → {inc}nsSVGOuterSVGFrame::GetPrefISize depends on results of previous layout
See Also: → 1521882
Assignee: nobody → emilio

This corrects bug 1162418 to make intrinsic size not depend on an
arbitrary container. We fall back to the default replaced object size to
avoid regressing bug 1162418.

This is unlike for images, but we've had compat reports to this regard,
and this is what Chromium does effectively, so seems somewhat
reasonable.

Attachment #9292318 - Attachment description: WIP: Bug 1340715 - When computing replace element's max-content inline-size, use the same logic as computing auto. → Bug 1340715 - Change SVG max-content size for webcompat.
Attachment #9292251 - Attachment is obsolete: true
Pushed by aethanyc@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/76c1fb5130dc
Change SVG max-content size for webcompat. r=emilio

Steal the bug from emilio ;)

Assignee: emilio → aethanyc
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 106 Branch
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/35755 for changes under testing/web-platform/tests
Upstream PR merged by moz-wptsync-bot
Regressions: 1790167
Blocks: 1791458
QA Whiteboard: [qa-106b-p2]

Hello Ting-Yu, wonder if it's possible to uplift this patch to ESR?
(coming from https://github.com/webcompat/web-bugs/issues/114165 where a user is still facing the issue on esr)

Flags: needinfo?(aethanyc)

That doesn't sound like a good idea given the regression of bug 1801581

I agree with Robert. This bug has two regressions -- bug 1790167 and bug 1801581. I don't feel confident to uplift my patch to ESR.

Flags: needinfo?(aethanyc)

Good point, thanks!

Regressions: 1807877
Regressions: 1811683
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: