[wpt-sync] Sync PR 64263 - layout: Fix negative viewbox in svg
Categories
(Core :: SVG, task, P4)
Tracking
()
| 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
| Assignee | ||
Updated•20 days ago
|
| Assignee | ||
Comment 1•10 days ago
|
||
Pushed to try (stability) https://treeherder.mozilla.org/jobs?repo=try&landoInstance=lando-prod-2025&landoCommitID=123198
| Assignee | ||
Comment 2•9 days ago
|
||
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
Comment 4•8 days ago
|
||
| bugherder | ||
Description
•