[wpt-sync] Sync PR 50485 - Fix natural size for SVG images
Categories
(Core :: DOM: Core & HTML, task, P4)
Tracking
()
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-widthBug: 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}
Assignee | ||
Updated•20 days ago
|
Assignee | ||
Comment 1•20 days ago
|
||
Assignee | ||
Comment 2•20 days ago
|
||
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
Details
New Tests That Don't Pass
- /html/semantics/embedded-content/the-img-element/current-pixel-density/basic.html [wpt.fyi]
- <img srcset="data:image/svg+xml,<svg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='-1%20-1%202%202'%20width='20'><circle%20r='1'/></svg> 2x" data-expect="10" data-expect-natural-height="0">:
FAIL
(Safari:FAIL
) - <img srcset="data:image/svg+xml,<svg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='-1%20-1%202%202'%20height='20'><circle%20r='1'/></svg> 2x" data-expect="10" data-expect-natural-width="0">:
FAIL
(Safari:FAIL
)
- <img srcset="data:image/svg+xml,<svg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='-1%20-1%202%202'%20width='20'><circle%20r='1'/></svg> 2x" data-expect="10" data-expect-natural-height="0">:
Comment 4•17 days ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/4dc05db64565
https://hg.mozilla.org/mozilla-central/rev/e156d060432a
Description
•