Closed Bug 1717877 Opened 3 years ago Closed 3 years ago

[css-images] Behaviour of SVG degenerate aspect-ratios

Categories

(Core :: Layout: Images, Video, and HTML Frames, defect)

defect

Tracking

()

RESOLVED FIXED
91 Branch
Tracking Status
firefox91 --- fixed

People

(Reporter: mozilla-apprentice, Assigned: boris)

References

Details

Attachments

(2 files, 1 obsolete file)

A resolution was made for csswg-drafts/#6286.

[css-images] Behaviour of SVG degenerate aspect-ratios

  • RESOLVED: degenerate aspect ratios derived from SVG width/height attributes fall back to viewbox aspect ratio (whether due to negative values or zero values)

Discussion.

This probably requires us to adjust SVGOuterSVGFrame::GetIntrinsicRatio().

https://searchfox.org/mozilla-central/rev/9975889f5c0d5c59bd22121a454beba774cbae71/layout/svg/SVGOuterSVGFrame.cpp#249

(note, iank [from the Chromium team] mentioned there are a few grid WPT tests that depend on our existing behavior, which will need an adjustment [and I think he'll be changing them]. We might continue to pass them, since he'll probably be changing them to remove the viewBox, which is the thing that we weren't falling back to & that the spec now says we should fall back to.)

boris, maybe you'd be interested in taking this, given that it's in the neighborhood of the aspect-ratio work you've been doing?

(This isn't strictly about the aspect-ratio property, but it's a relatively self-contained aspect ratio related change.)

Flags: needinfo?(boris.chiou)
Attachment #9228641 - Attachment is obsolete: true
Attached file test

Both cases should be 100x100 green squares.

Assignee: nobody → boris.chiou
Flags: needinfo?(boris.chiou)

Based on github.com/w3c/csswg-drafts/issues/6286, we fall back to the
viewport rect if

  1. width/height is a degenerate ratio, or
  2. width or height is a negative number.
Pushed by bchiou@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/bed7b4b9ff74
Handle degenerate ratio and negative size attributes for intrinsic size calculation of SVG outer frames. r=emilio
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/29487 for changes under testing/web-platform/tests
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 91 Branch
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: