[webkit-changes] [WebKit/WebKit] e3554c: [Image-Set]: Support Resolution and Type as option...

Ryan Reno noreply at github.com
Fri Feb 24 09:20:52 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e3554c53fff0e1d9ed207af749cd1dbaf7853300
      https://github.com/WebKit/WebKit/commit/e3554c53fff0e1d9ed207af749cd1dbaf7853300
  Author: Ryan Reno <rreno at apple.com>
  Date:   2023-02-24 (Fri, 24 Feb 2023)

  Changed paths:
    M LayoutTests/TestExpectations
    M LayoutTests/imported/w3c/web-platform-tests/css/css-images/image-set/image-set-computed.sub-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-images/image-set/image-set-parsing-expected.txt
    M LayoutTests/platform/glib/imported/w3c/web-platform-tests/css/css-images/image-set/image-set-computed.sub-expected.txt
    M Source/WebCore/css/CSSImageSetOptionValue.cpp
    M Source/WebCore/css/CSSImageSetOptionValue.h
    M Source/WebCore/css/CSSImageSetValue.cpp
    M Source/WebCore/css/CSSValueKeywords.in
    M Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp
    M Source/WebCore/rendering/style/StyleCursorImage.cpp
    M Source/WebCore/rendering/style/StyleImageSet.cpp
    M Source/WebCore/rendering/style/StyleMultiImage.cpp
    M Source/WebCore/rendering/style/StyleMultiImage.h

  Log Message:
  -----------
  [Image-Set]: Support Resolution and Type as optional arguments
https://bugs.webkit.org/show_bug.cgi?id=225185
rdar://77598590

Reviewed by Tim Nguyen.

Make resolution an optional argument to image-set. Also add support for
the type optional argument.

`type` is a hint that the author can provide to help us filter
unsupported image types from the set. We won't consider an unsupported
MIME type if it is specified.

http://w3c.github.io/csswg-drafts/css-images-4/#image-set-notation

* LayoutTests/TestExpectations:
* LayoutTests/imported/w3c/web-platform-tests/css/css-images/image-set/image-set-computed.sub-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-images/image-set/image-set-parsing-expected.txt:
* LayoutTests/platform/glib/imported/w3c/web-platform-tests/css/css-images/image-set/image-set-computed.sub-expected.txt:

* Source/WebCore/css/CSSImageSetOptionValue.cpp:
(WebCore::CSSImageSetOptionValue::Type::cssText const):
(WebCore::CSSImageSetOptionValue::CSSImageSetOptionValue):
(WebCore::CSSImageSetOptionValue::create):
(WebCore::CSSImageSetOptionValue::setType):
* Source/WebCore/css/CSSImageSetOptionValue.h:

* Source/WebCore/css/CSSImageSetValue.cpp:
(WebCore::CSSImageSetValue::createStyleImage const):

* Source/WebCore/css/CSSValueKeywords.in:

* Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::ImageSetTypeCSSPrimitiveValueKnownTokenTypeFunctionConsumer::consume):
(WebCore::CSSPropertyParserHelpers::consumeImageSetOption):
(WebCore::CSSPropertyParserHelpers::consumeImageSet):

* Source/WebCore/rendering/style/StyleCursorImage.cpp:
(WebCore::StyleCursorImage::selectBestFitImage):

* Source/WebCore/rendering/style/StyleImageSet.cpp:
(WebCore::StyleImageSet::computedStyleValue const):

* Source/WebCore/rendering/style/StyleMultiImage.cpp:
(WebCore::StyleMultiImage::load):
    Early return if the image set was empty due to no supported image
    types being specified. We still ASSERT if the image set is non-empty
    and the image isn't actually a StyleImage type.
* Source/WebCore/rendering/style/StyleMultiImage.h:
    Augumet ImageWithScale to also carry a MIME type string if one was
    specified by the author so we can accurately report the computed
    value.

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




More information about the webkit-changes mailing list