Closed Bug 1945793 Opened 20 days ago Closed 17 days ago

[wpt-sync] Sync PR 50485 - Fix natural size for SVG images

Categories

(Core :: DOM: Core & HTML, task, P4)

task

Tracking

()

RESOLVED FIXED
137 Branch
Tracking Status
firefox137 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

Fredrik Söderquist <fs@opera.com> wrote:

Fix natural size for SVG images

As natural size for HTMLImageElement.naturalWidth/Height[1] (also
.width/height) and HTMLInputElement.width/height[2] we were computing
the concrete object size resolved using a default object size of
300x150. We should now just return the actual natural width and height.
This will affect cases where a natural width/height is not specified
(yielding zero instead of whatever value the concrete object size
algorithm produces).

Guarded by runtime enabled feature: HTMLImageElementActualNaturalSize
Set to "test" for now to collect some data from the use counter.

Any resulting difference in the returned value is counted by the
HTMLImageElementNaturalSizeDiffersForSvgImage use counter.

[1]
https://html.spec.whatwg.org/multipage/embedded-content.html#dom-img-naturalwidth
[2] https://html.spec.whatwg.org/multipage/input.html#dom-input-width

Bug: 41357911
Change-Id: I158f5f373eee19c6ad586cf31ea1f0ac5d865205
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6084998
Reviewed-by: Noam Rosenthal \<nrosenthal@chromium.org>
Commit-Queue: Fredrik Söderquist \<fs@opera.com>
Cr-Commit-Position: refs/heads/main@{#1415496}

Component: web-platform-tests → DOM: Core & HTML
Product: Testing → Core

CI Results

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

Total 1 tests and 17 subtests

Status Summary

Firefox

OK : 1
PASS: 12
FAIL: 2

Chrome

OK : 1
PASS: 12
FAIL: 2

Safari

OK : 1
PASS: 12
FAIL: 2

Links

GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4dc05db64565 [wpt PR 50485] - Fix natural size for SVG images, a=testonly https://hg.mozilla.org/integration/autoland/rev/e156d060432a [wpt PR 50485] - Update wpt metadata, a=testonly
Status: NEW → RESOLVED
Closed: 17 days ago
Resolution: --- → FIXED
Target Milestone: --- → 137 Branch
You need to log in before you can comment on or make changes to this bug.