source: webkit/trunk/Source/WebCore/css/CSSImageValue.h

Last change on this file was 286795, checked in by [email protected], 3 years ago

Unprefix -webkit-mask
https://bugs.webkit.org/show_bug.cgi?id=229082

Patch by Matt Woodrow <[email protected]> on 2021-12-09
Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

  • web-platform-tests/css/css-masking/animations/mask-image-interpolation-expected.txt:
  • web-platform-tests/css/css-masking/animations/mask-position-interpolation-expected.txt:
  • web-platform-tests/css/css-masking/clip-path/animations/clip-path-animation-expected.html:
  • web-platform-tests/css/css-masking/clip-path/animations/clip-path-animation-filter-expected.html: Copied from LayoutTests/imported/w3c/web-platform-tests/css/css-masking/clip-path/animations/clip-path-animation-expected.html.
  • web-platform-tests/css/css-masking/clip-path/animations/clip-path-animation-filter.html: Copied from LayoutTests/imported/w3c/web-platform-tests/css/css-masking/clip-path/animations/clip-path-animation.html.
  • web-platform-tests/css/css-masking/clip-path/animations/clip-path-animation-incompatible-shapes1-expected.html: Copied from LayoutTests/imported/w3c/web-platform-tests/css/css-masking/clip-path/animations/clip-path-animation-expected.html.
  • web-platform-tests/css/css-masking/clip-path/animations/clip-path-animation-incompatible-shapes1.html: Copied from LayoutTests/imported/w3c/web-platform-tests/css/css-masking/clip-path/animations/clip-path-animation.html.
  • web-platform-tests/css/css-masking/clip-path/animations/clip-path-animation-incompatible-shapes2-expected.html: Copied from LayoutTests/imported/w3c/web-platform-tests/css/css-masking/clip-path/animations/clip-path-animation-expected.html.
  • web-platform-tests/css/css-masking/clip-path/animations/clip-path-animation-incompatible-shapes2.html: Copied from LayoutTests/imported/w3c/web-platform-tests/css/css-masking/clip-path/animations/clip-path-animation.html.
  • web-platform-tests/css/css-masking/clip-path/animations/clip-path-animation-overflow-expected.html: Added.
  • web-platform-tests/css/css-masking/clip-path/animations/clip-path-animation-overflow.html: Copied from LayoutTests/imported/w3c/web-platform-tests/css/css-masking/clip-path/animations/clip-path-animation.html.
  • web-platform-tests/css/css-masking/clip-path/animations/clip-path-animation-three-keyframes1-expected.html: Copied from LayoutTests/imported/w3c/web-platform-tests/css/css-masking/clip-path/animations/clip-path-animation-expected.html.
  • web-platform-tests/css/css-masking/clip-path/animations/clip-path-animation-three-keyframes1.html: Copied from LayoutTests/imported/w3c/web-platform-tests/css/css-masking/clip-path/animations/clip-path-animation.html.
  • web-platform-tests/css/css-masking/clip-path/animations/clip-path-animation-three-keyframes2-expected.html: Copied from LayoutTests/imported/w3c/web-platform-tests/css/css-masking/clip-path/animations/clip-path-animation-expected.html.
  • web-platform-tests/css/css-masking/clip-path/animations/clip-path-animation-three-keyframes2.html: Copied from LayoutTests/imported/w3c/web-platform-tests/css/css-masking/clip-path/animations/clip-path-animation.html.
  • web-platform-tests/css/css-masking/clip-path/animations/clip-path-animation.html:
  • web-platform-tests/css/css-masking/clip-path/animations/clip-path-transition-expected.html: Copied from LayoutTests/imported/w3c/web-platform-tests/css/css-masking/clip-path/animations/clip-path-animation-expected.html.
  • web-platform-tests/css/css-masking/clip-path/animations/clip-path-transition.html: Copied from LayoutTests/imported/w3c/web-platform-tests/css/css-masking/clip-path/animations/clip-path-animation.html.
  • web-platform-tests/css/css-masking/clip-path/animations/w3c-import.log:
  • web-platform-tests/css/css-masking/clip-path/clip-path-columns-shape-002.html:
  • web-platform-tests/css/css-masking/clip-path/clip-path-descendant-text-mutated-001.html:
  • web-platform-tests/css/css-masking/clip-path/clip-path-element-userSpaceOnUse-001.html:
  • web-platform-tests/css/css-masking/clip-path/clip-path-element-userSpaceOnUse-002.html:
  • web-platform-tests/css/css-masking/clip-path/clip-path-element-userSpaceOnUse-003.html:
  • web-platform-tests/css/css-masking/clip-path/clip-path-element-userSpaceOnUse-004.html:
  • web-platform-tests/css/css-masking/clip-path/clip-path-fixed-scroll-expected.html: Added.
  • web-platform-tests/css/css-masking/clip-path/clip-path-fixed-scroll.html: Added.
  • web-platform-tests/css/css-masking/clip-path/clip-path-path-001-expected.html:
  • web-platform-tests/css/css-masking/clip-path/clip-path-path-002-expected.html:
  • web-platform-tests/css/css-masking/clip-path/clip-path-path-interpolation-001-expected.html:
  • web-platform-tests/css/css-masking/clip-path/clip-path-path-interpolation-002-expected.html:
  • web-platform-tests/css/css-masking/clip-path/clip-path-reference-restore.html:
  • web-platform-tests/css/css-masking/clip-path/clip-path-svg-invalidate-expected.html:
  • web-platform-tests/css/css-masking/clip-path/clip-path-svg-invalidate.html:
  • web-platform-tests/css/css-masking/clip-path/clip-path-svg-text-backdrop-filter.html:
  • web-platform-tests/css/css-masking/clip-path/clip-path-svg-text-font-loading.html:
  • web-platform-tests/css/css-masking/clip-path/clip-path-transform-mutated-001.html:
  • web-platform-tests/css/css-masking/clip-path/clip-path-transform-mutated-002.html:
  • web-platform-tests/css/css-masking/clip-path/clip-path-url-reference-change-from-empty.html:
  • web-platform-tests/css/css-masking/clip-path/clip-path-url-reference-change.html:
  • web-platform-tests/css/css-masking/clip-path/reference-local-url-with-base-001.html:
  • web-platform-tests/css/css-masking/clip-path/reference-mutated.html:
  • web-platform-tests/css/css-masking/clip-path/reference-nonexisting-existing-local.html:
  • web-platform-tests/css/css-masking/clip-path/w3c-import.log:
  • web-platform-tests/css/css-masking/clip-rule/clip-rule-001.html:
  • web-platform-tests/css/css-masking/clip-rule/clip-rule-002.html:
  • web-platform-tests/css/css-masking/hit-test/clip-path-element-objectboundingbox-001.html:
  • web-platform-tests/css/css-masking/hit-test/clip-path-element-objectboundingbox-002.html:
  • web-platform-tests/css/css-masking/hit-test/clip-path-element-userspaceonuse-001.html:
  • web-platform-tests/css/css-masking/idlharness.html:
  • web-platform-tests/css/css-masking/inheritance.sub-expected.txt:
  • web-platform-tests/css/css-masking/parsing/mask-position-valid-expected.txt:
  • web-platform-tests/css/css-masking/parsing/mask-valid.sub-expected.txt:

Source/WebCore:

Tests: fast/masking/parsing-webkit-mask.html

imported/w3c/web-platform-tests/css/css-masking/clip-path/animations/clip-path-animation-filter.html
imported/w3c/web-platform-tests/css/css-masking/clip-path/animations/clip-path-animation-incompatible-shapes1.html
imported/w3c/web-platform-tests/css/css-masking/clip-path/animations/clip-path-animation-incompatible-shapes2.html
imported/w3c/web-platform-tests/css/css-masking/clip-path/animations/clip-path-animation-overflow.html
imported/w3c/web-platform-tests/css/css-masking/clip-path/animations/clip-path-animation-three-keyframes1.html
imported/w3c/web-platform-tests/css/css-masking/clip-path/animations/clip-path-animation-three-keyframes2.html
imported/w3c/web-platform-tests/css/css-masking/clip-path/animations/clip-path-transition.html
imported/w3c/web-platform-tests/css/css-masking/clip-path/clip-path-fixed-scroll.html
svg/masking/mask-external-reference-expected.svg
svg/masking/mask-external-reference.svg

  • animation/CSSPropertyAnimation.cpp:

(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):

  • css/CSSComputedStyleDeclaration.cpp:

(WebCore::createPositionListForLayer):
(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):

  • css/CSSImageValue.cpp:

(WebCore::ResolvedURL::isLocalURL const):
(WebCore::CSSImageValue::reresolvedURL const):

  • css/CSSImageValue.h:
  • css/CSSPrimitiveValue.h:

(WebCore::CSSPrimitiveValue::create):

  • css/CSSPrimitiveValueMappings.h:

(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator CompositeOperator const):
(WebCore::CSSPrimitiveValue::operator FillBox const):

  • css/CSSProperties.json:
  • css/CSSToStyleMap.cpp:

(WebCore::CSSToStyleMap::mapFillMaskMode):

  • css/CSSValueKeywords.in:
  • css/CSSValuePool.h:

(WebCore::CSSValuePool::createValue):

  • css/SVGCSSComputedStyleDeclaration.cpp:

(WebCore::ComputedStyleExtractor::svgPropertyValue):

  • css/StyleProperties.cpp:

(WebCore::StyleProperties::getPropertyValue const):
(WebCore::resolvedClipValue):
(WebCore::isSameAsInitialClipValue):
(WebCore::StyleProperties::getLayeredShorthandValue const):
(WebCore::StyleProperties::asText const):

  • css/parser/CSSPropertyParser.cpp:

(WebCore::consumeMaskClip):
(WebCore::consumePrefixedBackgroundComposite):
(WebCore::consumeBackgroundComposite):
(WebCore::consumeBackgroundComponent):
(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::consumeBackgroundPosition):
(WebCore::CSSPropertyParser::consumeBackgroundShorthand):
(WebCore::CSSPropertyParser::parseShorthand):

  • css/parser/CSSPropertyParserHelpers.cpp:

(WebCore::CSSPropertyParserHelpers::consumePositionCoordinates):

  • display/css/DisplayBoxDecorationPainter.cpp:

(WebCore::Display::BoxDecorationPainter::paintFillLayer const):

  • rendering/style/FillLayer.cpp:

(WebCore::clipMax):
(WebCore::FillLayer::computeClipMax const):

  • rendering/style/FillLayer.h:
  • rendering/style/RenderStyle.cpp:

(WebCore::rareNonInheritedDataChangeRequiresLayerRepaint):

  • rendering/style/RenderStyle.h:

(WebCore::RenderStyle::hasPositionedMask const):

  • rendering/style/RenderStyleConstants.cpp:

(WebCore::operator<<):

  • rendering/style/RenderStyleConstants.h:
  • rendering/style/SVGRenderStyle.cpp:

(WebCore::SVGRenderStyle::SVGRenderStyle):
(WebCore::SVGRenderStyle::operator== const):
(WebCore::SVGRenderStyle::copyNonInheritedFrom):
(WebCore::SVGRenderStyle::diff const):

  • rendering/style/SVGRenderStyle.h:

(WebCore::SVGRenderStyle::initialLightingColor):
(WebCore::SVGRenderStyle::y const):
(WebCore::SVGRenderStyle::hasFill const):
(WebCore::SVGRenderStyle::initialMaskerResource): Deleted.
(WebCore::SVGRenderStyle::maskerResource const): Deleted.
(WebCore::SVGRenderStyle::hasMasker const): Deleted.
(WebCore::SVGRenderStyle::isolatesBlending const): Deleted.
(WebCore::SVGRenderStyle::setMaskerResource): Deleted.

  • rendering/style/SVGRenderStyleDefs.cpp:

(WebCore::StyleResourceData::StyleResourceData): Deleted.
(WebCore::StyleResourceData::copy const): Deleted.
(WebCore::StyleResourceData::operator== const): Deleted.

  • rendering/style/SVGRenderStyleDefs.h:

(WebCore::StyleResourceData::create): Deleted.
(WebCore::StyleResourceData::operator!= const): Deleted.

  • rendering/style/StyleCachedImage.cpp:

(WebCore::StyleCachedImage::imageURL const):
(WebCore::StyleCachedImage::reresolvedURL const):
(WebCore::StyleCachedImage::imageURL): Deleted.

  • rendering/style/StyleCachedImage.h:
  • rendering/style/WillChangeData.cpp:

(WebCore::WillChangeData::propertyCreatesStackingContext):

  • rendering/svg/SVGRenderSupport.cpp:

(WebCore::SVGRenderSupport::isolatesBlending):
(WebCore::SVGRenderSupport::updateMaskedAncestorShouldIsolateBlending):

  • rendering/svg/SVGRenderTreeAsText.cpp:

(WebCore::writeResources):

  • rendering/svg/SVGRenderingContext.cpp:

(WebCore::SVGRenderingContext::prepareToRenderSVGContent):

  • rendering/svg/SVGResources.cpp:

(WebCore::SVGResources::buildCachedResources):

LayoutTests:

  • fast/masking/parsing-mask-expected.txt:
  • fast/masking/parsing-mask-mode.html:
  • fast/masking/parsing-mask.html:
  • fast/masking/parsing-webkit-mask-expected.txt: Copied from LayoutTests/fast/masking/parsing-mask-expected.txt.
  • fast/masking/parsing-webkit-mask.html: Copied from LayoutTests/fast/masking/parsing-mask.html.
  • platform/mac/imported/w3c/web-platform-tests/css/css-masking/animations/mask-image-interpolation-expected.png: Added.
  • platform/mac/imported/w3c/web-platform-tests/css/css-masking/parsing/mask-valid.sub-expected.png: Added.
  • svg/masking/mask-external-reference-expected.svg: Added.
  • svg/masking/mask-external-reference.svg: Added.
  • svg/masking/resources/mask-resource.svg: Added.
  • Property svn:eol-style set to native
File size: 2.9 KB
Line 
1/*
2 * (C) 1999-2003 Lars Knoll ([email protected])
3 * Copyright (C) 2004-2021 Apple Inc. All rights reserved.
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
14 *
15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19 */
20
21#pragma once
22
23#include "CSSValue.h"
24#include "CachedResourceHandle.h"
25#include "ResourceLoaderOptions.h"
26#include <wtf/Function.h>
27#include <wtf/Ref.h>
28
29namespace WebCore {
30
31class CachedImage;
32class CachedResourceLoader;
33class DeprecatedCSSOMValue;
34class CSSStyleDeclaration;
35class RenderElement;
36
37namespace Style {
38class BuilderState;
39}
40
41struct ResolvedURL {
42 String specifiedURLString;
43 URL resolvedURL;
44 bool isLocalURL() const;
45};
46
47class CSSImageValue final : public CSSValue {
48public:
49 static Ref<CSSImageValue> create(ResolvedURL&&, LoadedFromOpaqueSource);
50 static Ref<CSSImageValue> create(URL&&, LoadedFromOpaqueSource);
51 static Ref<CSSImageValue> create(CachedImage&);
52 ~CSSImageValue();
53
54 bool isPending() const;
55 CachedImage* loadImage(CachedResourceLoader&, const ResourceLoaderOptions&);
56 CachedImage* cachedImage() const { return m_cachedImage ? m_cachedImage.value().get() : nullptr; }
57
58 // Take care when using this, and read https://drafts.csswg.org/css-values/#relative-urls
59 const URL& imageURL() const { return m_location.resolvedURL; }
60
61 URL reresolvedURL(const Document&) const;
62
63 String customCSSText() const;
64
65 Ref<DeprecatedCSSOMValue> createDeprecatedCSSOMWrapper(CSSStyleDeclaration&) const;
66
67 bool traverseSubresources(const Function<bool(const CachedResource&)>& handler) const;
68
69 bool equals(const CSSImageValue&) const;
70
71 bool knownToBeOpaque(const RenderElement&) const;
72
73 void setInitiator(const AtomString& name) { m_initiatorName = name; }
74
75 Ref<CSSImageValue> valueWithStylesResolved(Style::BuilderState&);
76
77private:
78 CSSImageValue(ResolvedURL&&, LoadedFromOpaqueSource);
79 explicit CSSImageValue(CachedImage&);
80
81 ResolvedURL m_location;
82 std::optional<CachedResourceHandle<CachedImage>> m_cachedImage;
83 AtomString m_initiatorName;
84 LoadedFromOpaqueSource m_loadedFromOpaqueSource { LoadedFromOpaqueSource::No };
85 RefPtr<CSSImageValue> m_unresolvedValue;
86};
87
88} // namespace WebCore
89
90SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSImageValue, isImageValue())
Note: See TracBrowser for help on using the repository browser.