[webkit-changes] [WebKit/WebKit] b52fa7: Add Style types for generated image derived classe...

Sam Weinig noreply at github.com
Tue Oct 11 10:21:20 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b52fa7afcb2f7b8ade135c53f40309339f9491c7
      https://github.com/WebKit/WebKit/commit/b52fa7afcb2f7b8ade135c53f40309339f9491c7
  Author: Sam Weinig <weinig at apple.com>
  Date:   2022-10-11 (Tue, 11 Oct 2022)

  Changed paths:
    M Source/WebCore/Sources.txt
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebCore/animation/CSSPropertyAnimation.cpp
    M Source/WebCore/css/CSSCanvasValue.h
    M Source/WebCore/css/CSSCrossfadeValue.h
    M Source/WebCore/css/CSSNamedImageValue.h
    M Source/WebCore/css/CSSPaintImageValue.h
    M Source/WebCore/html/HTMLInputElement.cpp
    M Source/WebCore/rendering/style/StyleCachedImage.cpp
    A Source/WebCore/rendering/style/StyleCanvasImage.cpp
    A Source/WebCore/rendering/style/StyleCanvasImage.h
    A Source/WebCore/rendering/style/StyleCrossfadeImage.cpp
    A Source/WebCore/rendering/style/StyleCrossfadeImage.h
    M Source/WebCore/rendering/style/StyleCursorImage.cpp
    M Source/WebCore/rendering/style/StyleCursorImage.h
    A Source/WebCore/rendering/style/StyleFilterImage.cpp
    A Source/WebCore/rendering/style/StyleFilterImage.h
    M Source/WebCore/rendering/style/StyleGeneratedImage.cpp
    M Source/WebCore/rendering/style/StyleGeneratedImage.h
    A Source/WebCore/rendering/style/StyleGradientImage.cpp
    A Source/WebCore/rendering/style/StyleGradientImage.h
    M Source/WebCore/rendering/style/StyleImage.h
    M Source/WebCore/rendering/style/StyleImageSet.cpp
    M Source/WebCore/rendering/style/StyleImageSet.h
    M Source/WebCore/rendering/style/StyleMultiImage.cpp
    M Source/WebCore/rendering/style/StyleMultiImage.h
    A Source/WebCore/rendering/style/StyleNamedImage.cpp
    A Source/WebCore/rendering/style/StyleNamedImage.h
    A Source/WebCore/rendering/style/StylePaintImage.cpp
    A Source/WebCore/rendering/style/StylePaintImage.h
    M Source/WebCore/style/StyleBuilderCustom.h
    M Source/WebCore/style/StyleBuilderState.cpp

  Log Message:
  -----------
  Add Style types for generated image derived classes in preparation of moving functionality
https://bugs.webkit.org/show_bug.cgi?id=246315
rdar://101011710

Reviewed by Antti Koivisto.

As a first step toward making the image CSSValue derived types into
simple value types, this adds Style types for all the generated image
CSSValue types that didn't have one. In this initial step, there is a
bit of duplication due to the implementation of StyleGeneratedImage
getting spread over its descendants, but these will go away in follow
on changes.

* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
Add new files.

* Source/WebCore/animation/CSSPropertyAnimation.cpp:
(WebCore::blendFilter):
(WebCore::crossfadeBlend):
(WebCore::blendFunc):
* Source/WebCore/html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::createInnerTextStyle):
Use the new more specific types.

* Source/WebCore/css/CSSCanvasValue.h:
* Source/WebCore/css/CSSCrossfadeValue.h:
* Source/WebCore/css/CSSNamedImageValue.h:
* Source/WebCore/css/CSSPaintImageValue.h:
Adds pass through valueWithStylesResolved function to make the
style builder code identical for all images types. This will be
especially helpful in coming changes.

* Source/WebCore/rendering/style/StyleCachedImage.cpp:
(WebCore::StyleCachedImage::StyleCachedImage):
* Source/WebCore/rendering/style/StyleCursorImage.cpp:
(WebCore::StyleCursorImage::StyleCursorImage):
* Source/WebCore/rendering/style/StyleCursorImage.h:
* Source/WebCore/rendering/style/StyleImageSet.cpp:
* Source/WebCore/rendering/style/StyleImageSet.h:
Adopt new enum based tagging, rather than the old set of bools.

* Source/WebCore/rendering/style/StyleCanvasImage.cpp: Added.
* Source/WebCore/rendering/style/StyleCanvasImage.h: Copied from Source/WebCore/css/CSSPaintImageValue.h.
* Source/WebCore/rendering/style/StyleCrossfadeImage.cpp: Added.
* Source/WebCore/rendering/style/StyleCrossfadeImage.h: Copied from Source/WebCore/css/CSSPaintImageValue.h.
* Source/WebCore/rendering/style/StyleFilterImage.cpp: Added.
* Source/WebCore/rendering/style/StyleFilterImage.h: Copied from Source/WebCore/css/CSSPaintImageValue.h.
* Source/WebCore/rendering/style/StyleGradientImage.cpp: Added.
* Source/WebCore/rendering/style/StyleGradientImage.h: Copied from Source/WebCore/css/CSSPaintImageValue.h.
* Source/WebCore/rendering/style/StyleNamedImage.cpp: Added.
* Source/WebCore/rendering/style/StyleNamedImage.h: Copied from Source/WebCore/css/CSSPaintImageValue.h.
* Source/WebCore/rendering/style/StylePaintImage.cpp: Added.
* Source/WebCore/rendering/style/StylePaintImage.h: Copied from Source/WebCore/css/CSSPaintImageValue.h.
Add new derived types.

* Source/WebCore/rendering/style/StyleGeneratedImage.cpp:
* Source/WebCore/rendering/style/StyleGeneratedImage.h:
Remove all but the few functions that can be shared, copying
the old ones to the new derived types. Adds a new fixedSize()
virtual function for the derived types to implement so that the
imageSize function can at least be shared.

* Source/WebCore/rendering/style/StyleImage.h:
Categorize the virtual functions a bit to bring a bit of order. Replace
bool based tagging of the derived types with an enum, and add values for
the newly added derived types.

* Source/WebCore/rendering/style/StyleMultiImage.cpp:
(WebCore::StyleMultiImage::StyleMultiImage):
(WebCore::StyleMultiImage::load):
* Source/WebCore/rendering/style/StyleMultiImage.h:
Add dispatching to all the new derived types.

* Source/WebCore/style/StyleBuilderCustom.h:
(WebCore::Style::BuilderCustom::applyValueContent):
Simplify down to a single call to createStyleImage which will do the
right thing for all the image types now.

* Source/WebCore/style/StyleBuilderState.cpp:
(WebCore::Style::BuilderState::resolveImageStyles):
(WebCore::Style::BuilderState::createStyleImage):
Consistently dispatch to all the image types. Once the image CSSValue
types are simplified to be value types, we will be able to remove the
resolve step all together.

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




More information about the webkit-changes mailing list