HTML: correct naturalWidth and naturalHeight for SVG#59304
Merged
Conversation
Merged
6 tasks
fsoder
approved these changes
Apr 20, 2026
dholbert
approved these changes
Apr 20, 2026
Contributor
dholbert
left a comment
There was a problem hiding this comment.
This looks good to me - thank you! I included one inline suggestion to validate the new that the data-density attribute is set to something that we recognize. LGTM either way.
dholbert
previously requested changes
Apr 20, 2026
Contributor
dholbert
left a comment
There was a problem hiding this comment.
one request-change thing, actually, to help screen for incorrect implementations of the new rule that we're adding here...
The change from the tentative version is that image density does not impact the 300 x 150 fallback so when intrinsic dimensions are missing we use the same values in the API and rendering. This complements whatwg/html#12382.
844b538 to
368925a
Compare
annevk
added a commit
to whatwg/html
that referenced
this pull request
Apr 22, 2026
… dimension Unfortunately the more correct behavior was never implemented widely enough and web content started to depend on these properties being non-0. We take special care that dimensions that are missing do not get divided by density so we return the same values for them as CSS (300 by 150). Tests: web-platform-tests/wpt#59304. Fixes #11287.
noamr
pushed a commit
to whatwg/html
that referenced
this pull request
May 13, 2026
… dimension Unfortunately the more correct behavior was never implemented widely enough and web content started to depend on these properties being non-0. We take special care that dimensions that are missing do not get divided by density so we return the same values for them as CSS (300 by 150). Tests: web-platform-tests/wpt#59304. Fixes #11287.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The change from the tentative version is that image density does not impact the 300 x 150 fallback so when intrinsic dimensions are missing we use the same values in the API and rendering.
This complements whatwg/html#12382.