-webkit-image-set should support all the image functions WebKit supports, not just url()
https://bugs.webkit.org/show_bug.cgi?id=81941
Patch by Noam Rosenthal <noam@webkit.org> on 2020-01-21
Reviewed by Darin Adler.
Source/WebCore:
Separate StyleCachedImage to 4 classes:
- StyleCachedImage: for single images only
- StyleMultiImage: for values that can contain multiple images: like cursor/image-set
- StyleImageSet
- StyleCursorImage
The new classes only deal with their own value type. Before, ImageSet and cursor were resolved
as a StyleCachedImage, which is no longer a valid assumption if image-set can contain generated images.
Though cursors still can only contain cached images, it was cleaner to refactor it out as well.
Refactored best-fit image selection from loading. Now StyleCachedImage is in charge of loading
the actual image, and StyleImageSet/StyleCursorImage perform the source selection.
Also, added the necessary logic in the CSS parser to consume generated images inside image-sets, excluding
when the image-set is a cursor value.
Tests: fast/css/image-set-parsing-generated.html
fast/hidpi/image-set-cross-fade.html
fast/hidpi/image-set-gradient-multi.html
fast/hidpi/image-set-gradient-single.html
fast/hidpi/image-set-gradient.html
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
Added new files
* css/CSSCursorImageValue.cpp:
(WebCore::CSSCursorImageValue::selectBestFitImage):
(WebCore::CSSCursorImageValue::loadImage): Deleted.
* css/CSSCursorImageValue.h:
Instead of cursor loading the image, it selects an image CSS value
* css/CSSImageSetValue.cpp:
(WebCore::CSSImageSetValue::CSSImageSetValue):
(WebCore::CSSImageSetValue::fillImageSet):
(WebCore::CSSImageSetValue::cachedImage const):
(WebCore::CSSImageSetValue::selectBestFitImage):
(WebCore::CSSImageSetValue::updateDeviceScaleFactor):
(WebCore::CSSImageSetValue::imageSetWithStylesResolved):
(WebCore::CSSImageSetValue::traverseSubresources const):
(WebCore::CSSImageSetValue::loadBestFitImage): Deleted.
* css/CSSImageSetValue.h:
Refactor CSSImageSetValue to include non-cachedImage images
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeCursor):
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeImageSet):
(WebCore::CSSPropertyParserHelpers::consumeImage):
(WebCore::CSSPropertyParserHelpers::consumeUrlOrStringAsStringView): Deleted.
* css/parser/CSSPropertyParserHelpers.h:
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::blendFunc):
When blending two images, get the selected images in case it is an image-set
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
* rendering/RenderImageResourceStyleImage.cpp:
(WebCore::RenderImageResourceStyleImage::initialize):
* rendering/RenderLayerBacking.cpp:
(WebCore::canDirectlyCompositeBackgroundBackgroundImage):
* rendering/style/ShapeValue.cpp:
(WebCore::ShapeValue::isImageValid const):
Use hasCachedImage() instead of isCachedImage() as a StyleImageSet is no longer an isCachedImage()
* rendering/style/StyleCachedImage.cpp:
(WebCore::StyleCachedImage::StyleCachedImage):
(WebCore::StyleCachedImage::imageURL):
(WebCore::StyleCachedImage::load):
* rendering/style/StyleCachedImage.h:
* rendering/style/StyleCursorImage.h:
* rendering/style/StyleCursorImage.cpp:
* rendering/style/StyleMultiImage.h:
* rendering/style/StyleMultiImage.cpp:
* rendering/style/StyleImageSet.h:
* rendering/style/StyleImageSet.cpp:
* rendering/style/StyleImage.h:
(WebCore::StyleImage::selectedImage):
(WebCore::StyleImage::selectedImage const):
(WebCore::StyleImage::isCursorImage const):
(WebCore::StyleImage::isImageSet const):
(WebCore::StyleImage::hasCachedImage const):
(WebCore::StyleImage::StyleImage):
Separate cursor/image-set related stuff away from StyleCachedImage.
* style/StyleBuilderCustom.h:
(WebCore::Style::BuilderCustom::applyValueContent):
* style/StyleBuilderState.cpp:
(WebCore::Style::BuilderState::resolveImageStyles):
(WebCore::Style::BuilderState::createStyleImage):
* style/StyleBuilderState.h:
Match the CSS values with the correct Style class. Also, ensure image-sets resolve their
images' styles as they may contain gradients and other context-aware values.
LayoutTests:
* fast/css/cursor-parsing-expected.txt:
* fast/css/cursor-parsing.html:
Added parsing test to ensure arrow image-sets disable generated images
* fast/css/image-set-parsing-generated-expected.txt: Added.
* fast/css/image-set-parsing-generated.html: Added.
* fast/css/image-set-parsing-invalid-expected.txt:
* fast/css/image-set-parsing-invalid.html:
Added parsing tests for new generated-inside-image-set use cases
Test that image-set inside image-set is not supported
* fast/hidpi/image-set-cross-fade-expected.html: Added.
* fast/hidpi/image-set-cross-fade.html: Added.
* fast/hidpi/image-set-gradient-expected.html: Added.
* fast/hidpi/image-set-gradient-multi-expected.html: Added.
* fast/hidpi/image-set-gradient-multi.html: Added.
* fast/hidpi/image-set-gradient-single-expected.html: Added.
* fast/hidpi/image-set-gradient-single.html: Added.
* fast/hidpi/image-set-gradient.html: Added.
Added ref-tests for several generated-inside-image-set use-cases
Canonical link: https://commits.webkit.org/219598@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254861 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-01-21 18:28:17 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2000 Lars Knoll (knoll@kde.org)
|
|
|
|
* (C) 2000 Antti Koivisto (koivisto@kde.org)
|
|
|
|
* (C) 2000 Dirk Mueller (mueller@kde.org)
|
2021-02-02 22:00:32 +00:00
|
|
|
* Copyright (C) 2003-2021 Apple Inc. All rights reserved.
|
-webkit-image-set should support all the image functions WebKit supports, not just url()
https://bugs.webkit.org/show_bug.cgi?id=81941
Patch by Noam Rosenthal <noam@webkit.org> on 2020-01-21
Reviewed by Darin Adler.
Source/WebCore:
Separate StyleCachedImage to 4 classes:
- StyleCachedImage: for single images only
- StyleMultiImage: for values that can contain multiple images: like cursor/image-set
- StyleImageSet
- StyleCursorImage
The new classes only deal with their own value type. Before, ImageSet and cursor were resolved
as a StyleCachedImage, which is no longer a valid assumption if image-set can contain generated images.
Though cursors still can only contain cached images, it was cleaner to refactor it out as well.
Refactored best-fit image selection from loading. Now StyleCachedImage is in charge of loading
the actual image, and StyleImageSet/StyleCursorImage perform the source selection.
Also, added the necessary logic in the CSS parser to consume generated images inside image-sets, excluding
when the image-set is a cursor value.
Tests: fast/css/image-set-parsing-generated.html
fast/hidpi/image-set-cross-fade.html
fast/hidpi/image-set-gradient-multi.html
fast/hidpi/image-set-gradient-single.html
fast/hidpi/image-set-gradient.html
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
Added new files
* css/CSSCursorImageValue.cpp:
(WebCore::CSSCursorImageValue::selectBestFitImage):
(WebCore::CSSCursorImageValue::loadImage): Deleted.
* css/CSSCursorImageValue.h:
Instead of cursor loading the image, it selects an image CSS value
* css/CSSImageSetValue.cpp:
(WebCore::CSSImageSetValue::CSSImageSetValue):
(WebCore::CSSImageSetValue::fillImageSet):
(WebCore::CSSImageSetValue::cachedImage const):
(WebCore::CSSImageSetValue::selectBestFitImage):
(WebCore::CSSImageSetValue::updateDeviceScaleFactor):
(WebCore::CSSImageSetValue::imageSetWithStylesResolved):
(WebCore::CSSImageSetValue::traverseSubresources const):
(WebCore::CSSImageSetValue::loadBestFitImage): Deleted.
* css/CSSImageSetValue.h:
Refactor CSSImageSetValue to include non-cachedImage images
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeCursor):
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeImageSet):
(WebCore::CSSPropertyParserHelpers::consumeImage):
(WebCore::CSSPropertyParserHelpers::consumeUrlOrStringAsStringView): Deleted.
* css/parser/CSSPropertyParserHelpers.h:
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::blendFunc):
When blending two images, get the selected images in case it is an image-set
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
* rendering/RenderImageResourceStyleImage.cpp:
(WebCore::RenderImageResourceStyleImage::initialize):
* rendering/RenderLayerBacking.cpp:
(WebCore::canDirectlyCompositeBackgroundBackgroundImage):
* rendering/style/ShapeValue.cpp:
(WebCore::ShapeValue::isImageValid const):
Use hasCachedImage() instead of isCachedImage() as a StyleImageSet is no longer an isCachedImage()
* rendering/style/StyleCachedImage.cpp:
(WebCore::StyleCachedImage::StyleCachedImage):
(WebCore::StyleCachedImage::imageURL):
(WebCore::StyleCachedImage::load):
* rendering/style/StyleCachedImage.h:
* rendering/style/StyleCursorImage.h:
* rendering/style/StyleCursorImage.cpp:
* rendering/style/StyleMultiImage.h:
* rendering/style/StyleMultiImage.cpp:
* rendering/style/StyleImageSet.h:
* rendering/style/StyleImageSet.cpp:
* rendering/style/StyleImage.h:
(WebCore::StyleImage::selectedImage):
(WebCore::StyleImage::selectedImage const):
(WebCore::StyleImage::isCursorImage const):
(WebCore::StyleImage::isImageSet const):
(WebCore::StyleImage::hasCachedImage const):
(WebCore::StyleImage::StyleImage):
Separate cursor/image-set related stuff away from StyleCachedImage.
* style/StyleBuilderCustom.h:
(WebCore::Style::BuilderCustom::applyValueContent):
* style/StyleBuilderState.cpp:
(WebCore::Style::BuilderState::resolveImageStyles):
(WebCore::Style::BuilderState::createStyleImage):
* style/StyleBuilderState.h:
Match the CSS values with the correct Style class. Also, ensure image-sets resolve their
images' styles as they may contain gradients and other context-aware values.
LayoutTests:
* fast/css/cursor-parsing-expected.txt:
* fast/css/cursor-parsing.html:
Added parsing test to ensure arrow image-sets disable generated images
* fast/css/image-set-parsing-generated-expected.txt: Added.
* fast/css/image-set-parsing-generated.html: Added.
* fast/css/image-set-parsing-invalid-expected.txt:
* fast/css/image-set-parsing-invalid.html:
Added parsing tests for new generated-inside-image-set use cases
Test that image-set inside image-set is not supported
* fast/hidpi/image-set-cross-fade-expected.html: Added.
* fast/hidpi/image-set-cross-fade.html: Added.
* fast/hidpi/image-set-gradient-expected.html: Added.
* fast/hidpi/image-set-gradient-multi-expected.html: Added.
* fast/hidpi/image-set-gradient-multi.html: Added.
* fast/hidpi/image-set-gradient-single-expected.html: Added.
* fast/hidpi/image-set-gradient-single.html: Added.
* fast/hidpi/image-set-gradient.html: Added.
Added ref-tests for several generated-inside-image-set use-cases
Canonical link: https://commits.webkit.org/219598@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254861 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-01-21 18:28:17 +00:00
|
|
|
* Copyright (C) 2020 Noam Rosenthal (noam@webkit.org)
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public License
|
|
|
|
* along with this library; see the file COPYING.LIB. If not, write to
|
|
|
|
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "StyleImage.h"
|
|
|
|
|
|
|
|
namespace WebCore {
|
|
|
|
|
|
|
|
class Document;
|
|
|
|
|
|
|
|
struct ImageWithScale;
|
|
|
|
|
|
|
|
class StyleMultiImage : public StyleImage {
|
|
|
|
WTF_MAKE_FAST_ALLOCATED;
|
|
|
|
public:
|
|
|
|
virtual ~StyleMultiImage();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
StyleMultiImage();
|
|
|
|
bool equals(const StyleMultiImage& other) const;
|
|
|
|
virtual ImageWithScale selectBestFitImage(const Document&) const = 0;
|
|
|
|
CachedImage* cachedImage() const final;
|
|
|
|
|
|
|
|
private:
|
|
|
|
WrappedImagePtr data() const final;
|
|
|
|
|
|
|
|
bool canRender(const RenderElement*, float multiplier) const final;
|
|
|
|
bool isPending() const final;
|
|
|
|
void load(CachedResourceLoader&, const ResourceLoaderOptions&) final;
|
|
|
|
bool isLoaded() const final;
|
|
|
|
bool errorOccurred() const final;
|
|
|
|
FloatSize imageSize(const RenderElement*, float multiplier) const final;
|
|
|
|
bool imageHasRelativeWidth() const final;
|
|
|
|
bool imageHasRelativeHeight() const final;
|
|
|
|
void computeIntrinsicDimensions(const RenderElement*, Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio) final;
|
|
|
|
bool usesImageContainerSize() const final;
|
|
|
|
void setContainerContextForRenderer(const RenderElement&, const FloatSize&, float);
|
2021-02-02 22:00:32 +00:00
|
|
|
void addClient(RenderElement&) final;
|
|
|
|
void removeClient(RenderElement&) final;
|
2021-05-06 20:11:19 +00:00
|
|
|
bool hasClient(RenderElement&) const final;
|
-webkit-image-set should support all the image functions WebKit supports, not just url()
https://bugs.webkit.org/show_bug.cgi?id=81941
Patch by Noam Rosenthal <noam@webkit.org> on 2020-01-21
Reviewed by Darin Adler.
Source/WebCore:
Separate StyleCachedImage to 4 classes:
- StyleCachedImage: for single images only
- StyleMultiImage: for values that can contain multiple images: like cursor/image-set
- StyleImageSet
- StyleCursorImage
The new classes only deal with their own value type. Before, ImageSet and cursor were resolved
as a StyleCachedImage, which is no longer a valid assumption if image-set can contain generated images.
Though cursors still can only contain cached images, it was cleaner to refactor it out as well.
Refactored best-fit image selection from loading. Now StyleCachedImage is in charge of loading
the actual image, and StyleImageSet/StyleCursorImage perform the source selection.
Also, added the necessary logic in the CSS parser to consume generated images inside image-sets, excluding
when the image-set is a cursor value.
Tests: fast/css/image-set-parsing-generated.html
fast/hidpi/image-set-cross-fade.html
fast/hidpi/image-set-gradient-multi.html
fast/hidpi/image-set-gradient-single.html
fast/hidpi/image-set-gradient.html
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
Added new files
* css/CSSCursorImageValue.cpp:
(WebCore::CSSCursorImageValue::selectBestFitImage):
(WebCore::CSSCursorImageValue::loadImage): Deleted.
* css/CSSCursorImageValue.h:
Instead of cursor loading the image, it selects an image CSS value
* css/CSSImageSetValue.cpp:
(WebCore::CSSImageSetValue::CSSImageSetValue):
(WebCore::CSSImageSetValue::fillImageSet):
(WebCore::CSSImageSetValue::cachedImage const):
(WebCore::CSSImageSetValue::selectBestFitImage):
(WebCore::CSSImageSetValue::updateDeviceScaleFactor):
(WebCore::CSSImageSetValue::imageSetWithStylesResolved):
(WebCore::CSSImageSetValue::traverseSubresources const):
(WebCore::CSSImageSetValue::loadBestFitImage): Deleted.
* css/CSSImageSetValue.h:
Refactor CSSImageSetValue to include non-cachedImage images
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeCursor):
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeImageSet):
(WebCore::CSSPropertyParserHelpers::consumeImage):
(WebCore::CSSPropertyParserHelpers::consumeUrlOrStringAsStringView): Deleted.
* css/parser/CSSPropertyParserHelpers.h:
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::blendFunc):
When blending two images, get the selected images in case it is an image-set
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
* rendering/RenderImageResourceStyleImage.cpp:
(WebCore::RenderImageResourceStyleImage::initialize):
* rendering/RenderLayerBacking.cpp:
(WebCore::canDirectlyCompositeBackgroundBackgroundImage):
* rendering/style/ShapeValue.cpp:
(WebCore::ShapeValue::isImageValid const):
Use hasCachedImage() instead of isCachedImage() as a StyleImageSet is no longer an isCachedImage()
* rendering/style/StyleCachedImage.cpp:
(WebCore::StyleCachedImage::StyleCachedImage):
(WebCore::StyleCachedImage::imageURL):
(WebCore::StyleCachedImage::load):
* rendering/style/StyleCachedImage.h:
* rendering/style/StyleCursorImage.h:
* rendering/style/StyleCursorImage.cpp:
* rendering/style/StyleMultiImage.h:
* rendering/style/StyleMultiImage.cpp:
* rendering/style/StyleImageSet.h:
* rendering/style/StyleImageSet.cpp:
* rendering/style/StyleImage.h:
(WebCore::StyleImage::selectedImage):
(WebCore::StyleImage::selectedImage const):
(WebCore::StyleImage::isCursorImage const):
(WebCore::StyleImage::isImageSet const):
(WebCore::StyleImage::hasCachedImage const):
(WebCore::StyleImage::StyleImage):
Separate cursor/image-set related stuff away from StyleCachedImage.
* style/StyleBuilderCustom.h:
(WebCore::Style::BuilderCustom::applyValueContent):
* style/StyleBuilderState.cpp:
(WebCore::Style::BuilderState::resolveImageStyles):
(WebCore::Style::BuilderState::createStyleImage):
* style/StyleBuilderState.h:
Match the CSS values with the correct Style class. Also, ensure image-sets resolve their
images' styles as they may contain gradients and other context-aware values.
LayoutTests:
* fast/css/cursor-parsing-expected.txt:
* fast/css/cursor-parsing.html:
Added parsing test to ensure arrow image-sets disable generated images
* fast/css/image-set-parsing-generated-expected.txt: Added.
* fast/css/image-set-parsing-generated.html: Added.
* fast/css/image-set-parsing-invalid-expected.txt:
* fast/css/image-set-parsing-invalid.html:
Added parsing tests for new generated-inside-image-set use cases
Test that image-set inside image-set is not supported
* fast/hidpi/image-set-cross-fade-expected.html: Added.
* fast/hidpi/image-set-cross-fade.html: Added.
* fast/hidpi/image-set-gradient-expected.html: Added.
* fast/hidpi/image-set-gradient-multi-expected.html: Added.
* fast/hidpi/image-set-gradient-multi.html: Added.
* fast/hidpi/image-set-gradient-single-expected.html: Added.
* fast/hidpi/image-set-gradient-single.html: Added.
* fast/hidpi/image-set-gradient.html: Added.
Added ref-tests for several generated-inside-image-set use-cases
Canonical link: https://commits.webkit.org/219598@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254861 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-01-21 18:28:17 +00:00
|
|
|
RefPtr<Image> image(RenderElement*, const FloatSize&) const final;
|
|
|
|
float imageScaleFactor() const final;
|
2021-02-05 18:12:24 +00:00
|
|
|
bool knownToBeOpaque(const RenderElement&) const final;
|
-webkit-image-set should support all the image functions WebKit supports, not just url()
https://bugs.webkit.org/show_bug.cgi?id=81941
Patch by Noam Rosenthal <noam@webkit.org> on 2020-01-21
Reviewed by Darin Adler.
Source/WebCore:
Separate StyleCachedImage to 4 classes:
- StyleCachedImage: for single images only
- StyleMultiImage: for values that can contain multiple images: like cursor/image-set
- StyleImageSet
- StyleCursorImage
The new classes only deal with their own value type. Before, ImageSet and cursor were resolved
as a StyleCachedImage, which is no longer a valid assumption if image-set can contain generated images.
Though cursors still can only contain cached images, it was cleaner to refactor it out as well.
Refactored best-fit image selection from loading. Now StyleCachedImage is in charge of loading
the actual image, and StyleImageSet/StyleCursorImage perform the source selection.
Also, added the necessary logic in the CSS parser to consume generated images inside image-sets, excluding
when the image-set is a cursor value.
Tests: fast/css/image-set-parsing-generated.html
fast/hidpi/image-set-cross-fade.html
fast/hidpi/image-set-gradient-multi.html
fast/hidpi/image-set-gradient-single.html
fast/hidpi/image-set-gradient.html
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
Added new files
* css/CSSCursorImageValue.cpp:
(WebCore::CSSCursorImageValue::selectBestFitImage):
(WebCore::CSSCursorImageValue::loadImage): Deleted.
* css/CSSCursorImageValue.h:
Instead of cursor loading the image, it selects an image CSS value
* css/CSSImageSetValue.cpp:
(WebCore::CSSImageSetValue::CSSImageSetValue):
(WebCore::CSSImageSetValue::fillImageSet):
(WebCore::CSSImageSetValue::cachedImage const):
(WebCore::CSSImageSetValue::selectBestFitImage):
(WebCore::CSSImageSetValue::updateDeviceScaleFactor):
(WebCore::CSSImageSetValue::imageSetWithStylesResolved):
(WebCore::CSSImageSetValue::traverseSubresources const):
(WebCore::CSSImageSetValue::loadBestFitImage): Deleted.
* css/CSSImageSetValue.h:
Refactor CSSImageSetValue to include non-cachedImage images
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeCursor):
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeImageSet):
(WebCore::CSSPropertyParserHelpers::consumeImage):
(WebCore::CSSPropertyParserHelpers::consumeUrlOrStringAsStringView): Deleted.
* css/parser/CSSPropertyParserHelpers.h:
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::blendFunc):
When blending two images, get the selected images in case it is an image-set
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
* rendering/RenderImageResourceStyleImage.cpp:
(WebCore::RenderImageResourceStyleImage::initialize):
* rendering/RenderLayerBacking.cpp:
(WebCore::canDirectlyCompositeBackgroundBackgroundImage):
* rendering/style/ShapeValue.cpp:
(WebCore::ShapeValue::isImageValid const):
Use hasCachedImage() instead of isCachedImage() as a StyleImageSet is no longer an isCachedImage()
* rendering/style/StyleCachedImage.cpp:
(WebCore::StyleCachedImage::StyleCachedImage):
(WebCore::StyleCachedImage::imageURL):
(WebCore::StyleCachedImage::load):
* rendering/style/StyleCachedImage.h:
* rendering/style/StyleCursorImage.h:
* rendering/style/StyleCursorImage.cpp:
* rendering/style/StyleMultiImage.h:
* rendering/style/StyleMultiImage.cpp:
* rendering/style/StyleImageSet.h:
* rendering/style/StyleImageSet.cpp:
* rendering/style/StyleImage.h:
(WebCore::StyleImage::selectedImage):
(WebCore::StyleImage::selectedImage const):
(WebCore::StyleImage::isCursorImage const):
(WebCore::StyleImage::isImageSet const):
(WebCore::StyleImage::hasCachedImage const):
(WebCore::StyleImage::StyleImage):
Separate cursor/image-set related stuff away from StyleCachedImage.
* style/StyleBuilderCustom.h:
(WebCore::Style::BuilderCustom::applyValueContent):
* style/StyleBuilderState.cpp:
(WebCore::Style::BuilderState::resolveImageStyles):
(WebCore::Style::BuilderState::createStyleImage):
* style/StyleBuilderState.h:
Match the CSS values with the correct Style class. Also, ensure image-sets resolve their
images' styles as they may contain gradients and other context-aware values.
LayoutTests:
* fast/css/cursor-parsing-expected.txt:
* fast/css/cursor-parsing.html:
Added parsing test to ensure arrow image-sets disable generated images
* fast/css/image-set-parsing-generated-expected.txt: Added.
* fast/css/image-set-parsing-generated.html: Added.
* fast/css/image-set-parsing-invalid-expected.txt:
* fast/css/image-set-parsing-invalid.html:
Added parsing tests for new generated-inside-image-set use cases
Test that image-set inside image-set is not supported
* fast/hidpi/image-set-cross-fade-expected.html: Added.
* fast/hidpi/image-set-cross-fade.html: Added.
* fast/hidpi/image-set-gradient-expected.html: Added.
* fast/hidpi/image-set-gradient-multi-expected.html: Added.
* fast/hidpi/image-set-gradient-multi.html: Added.
* fast/hidpi/image-set-gradient-single-expected.html: Added.
* fast/hidpi/image-set-gradient-single.html: Added.
* fast/hidpi/image-set-gradient.html: Added.
Added ref-tests for several generated-inside-image-set use-cases
Canonical link: https://commits.webkit.org/219598@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254861 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-01-21 18:28:17 +00:00
|
|
|
const StyleImage* selectedImage() const final { return m_selectedImage.get(); }
|
|
|
|
StyleImage* selectedImage() final { return m_selectedImage.get(); }
|
|
|
|
|
|
|
|
RefPtr<StyleImage> m_selectedImage;
|
|
|
|
bool m_isPending { true };
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace WebCore
|