Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 36c5187810799dcf2845d56538d695790d5bc771
      
https://github.com/WebKit/WebKit/commit/36c5187810799dcf2845d56538d695790d5bc771
  Author: Sam Weinig <[email protected]>
  Date:   2026-01-09 (Fri, 09 Jan 2026)

  Changed paths:
    M 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-display-none-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-quirks-mode-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-standards-mode-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-width-1000px-expected.txt
    R 
LayoutTests/platform/glib/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-display-none-expected.txt
    R 
LayoutTests/platform/glib/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-quirks-mode-expected.txt
    R 
LayoutTests/platform/glib/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-standards-mode-expected.txt
    R 
LayoutTests/platform/glib/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-width-1000px-expected.txt
    M Source/WebCore/SaferCPPExpectations/UncheckedLocalVarsCheckerExpectations
    M Source/WebCore/Sources.txt
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebCore/css/parser/SizesAttributeParser.cpp
    M Source/WebCore/css/parser/SizesAttributeParser.h
    R Source/WebCore/css/parser/SizesCalcParser.cpp
    R Source/WebCore/css/parser/SizesCalcParser.h
    M Source/WebCore/html/HTMLImageElement.cpp
    M Source/WebCore/html/parser/HTMLPreloadScanner.cpp
    M Source/WebCore/loader/LinkLoader.cpp

  Log Message:
  -----------
  Use CSS calc() parser in SizesAttributeParser rather than rolling a bespoke 
one
https://bugs.webkit.org/show_bug.cgi?id=305059

Reviewed by Darin Adler.

Replaces the bespoke calc() parser only used by SizesAttributeParser for HTML
`sizes` attribute parsing with the one used by the CSS parser, allowing us to
remove the duplicate functionality.

Also does some cleanup of SizesAttributeParser, removing some unnecessary
member variables. m_lengthWasSet and m_isValid always had the same value
and they could also be merged with m_length by making m_length an
std::optional<float>. Also removed SizesAttributeParser::length() and
exposed SizesAttributeParser::effectiveSize(), as that is a more clear
name for the parsed value.

* 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-display-none-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-quirks-mode-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-standards-mode-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-width-1000px-expected.txt:
* 
LayoutTests/platform/glib/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-display-none-expected.txt:
 Removed.
* 
LayoutTests/platform/glib/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-quirks-mode-expected.txt:
 Removed.
* 
LayoutTests/platform/glib/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-standards-mode-expected.txt:
 Removed.
* 
LayoutTests/platform/glib/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-width-1000px-expected.txt:
 Removed.
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/css/parser/SizesAttributeParser.cpp:
* Source/WebCore/css/parser/SizesAttributeParser.h:
* Source/WebCore/css/parser/SizesCalcParser.cpp: Removed.
* Source/WebCore/css/parser/SizesCalcParser.h: Removed.
* Source/WebCore/html/HTMLImageElement.cpp:
* Source/WebCore/html/parser/HTMLPreloadScanner.cpp:
* Source/WebCore/loader/LinkLoader.cpp:

Canonical link: https://commits.webkit.org/305392@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to