Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: cbff2f8974c2aed86b46477a4d257d9fb80b0308
https://github.com/WebKit/WebKit/commit/cbff2f8974c2aed86b46477a4d257d9fb80b0308
Author: Sam Weinig <[email protected]>
Date: 2026-10-02 (Fri, 02 Oct 2026)
Changed paths:
M LayoutTests/TestExpectations
M
LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/natural-size-orientation-expected.txt
M Source/WebCore/WebCore.xcodeproj/project.pbxproj
A Source/WebCore/html/HTMLImageDensityCorrectedSizing.h
M Source/WebCore/html/HTMLImageElement.cpp
M Source/WebCore/html/HTMLImageElement.h
M Source/WebCore/html/ImageInputType.cpp
A Source/WebCore/html/ImageInputTypeSizing.h
M Source/WebCore/platform/graphics/DefaultSizing.h
M Source/WebCore/rendering/ReplacedElementIntrinsicSizing.h
Log Message:
-----------
[Image Redux] HTMLImageElement's natural size accessors should not depend on
its renderer
https://bugs.webkit.org/show_bug.cgi?id=325880
Reviewed by Anne van Kesteren.
Changes HTMLImageElement's naturalWidth and naturalHeight getters to return the
"density-corrected natural
width and height"
(https://html.spec.whatwg.org/multipage/images.html#density-corrected-intrinsic-width-and-height)
as the HTML spec requires, removing any use of the images renderer.
To make it clear which sizing algorithm is being used, two new sizing types,
`HTMLImageDensityCorrectedSizing`
for HTMLImageElement's naturalWidth/naturalHeight and `ImageInputTypeSizing`
for ImageInputType's width and
height were added, each with the relevant spec links. As each of these are
variants of the default sizing
algorithm, the DefaultSizing type was made non-final so that these new types
could utilize it without additional
duplication.
The change in HTMLImageElement to use the actual natural width and height
allows the previously skipped
html/semantics/embedded-content/the-img-element/natural-size-orientation.html
to start passing.
* LayoutTests/TestExpectations:
*
LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/natural-size-orientation-expected.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/html/HTMLImageDensityCorrectedSizing.h: Added.
* Source/WebCore/html/HTMLImageElement.cpp:
* Source/WebCore/html/HTMLImageElement.h:
* Source/WebCore/html/ImageInputType.cpp:
* Source/WebCore/html/ImageInputTypeSizing.h: Added.
* Source/WebCore/platform/graphics/DefaultSizing.h:
* Source/WebCore/rendering/ReplacedElementIntrinsicSizing.h:
Canonical link: https://commits.webkit.org/322534@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications