Closed Bug 2091118 Opened 20 days ago Closed 8 days ago

[wpt-sync] Sync PR 64263 - layout: Fix negative viewbox in svg

Categories

(Core :: SVG, task, P4)

task

Tracking

()

RESOLVED FIXED
163 Branch
Tracking Status
firefox163 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 64263 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/64263
Details from upstream follow.

Narfinger <Narfinger@users.noreply.github.com> wrote:

layout: Fix negative viewbox in svg

This fixes an assertion being hit when viewbox is negative such as in this example
<svg viewBox="0 0 -1 1" style="object-fit: cover; width: 100px; height: 50px"></svg>.

The spec says https://www.w3.org/TR/SVG11/coords.html#ViewBoxAttribute that zero skips the viewbox (which I assume is done by returning None) while negative values for width or height should have error.

We solve this by storing the viewbox ratio inside the svg element, checking it on attribute parsing. The attribute ratio can be in 3 separate states, Normal, empty and invalid.

Testing: This was tested on the above fragment which was also added as a crashtest.

Reviewed in servo/servo#49317

Component: web-platform-tests → SVG
Product: Testing → Core

CI Results

Ran 0 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 2 tests

Status Summary

Firefox

PASS: 2

Chrome

PASS: 2

Safari

PASS: 2

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Status: NEW → RESOLVED
Closed: 8 days ago
Resolution: --- → FIXED
Target Milestone: --- → 163 Branch
You need to log in before you can comment on or make changes to this bug.