haikuwebkit/Source/WebCore/css/CSSPaintImageValue.h

75 lines
2.6 KiB
C
Raw Permalink Normal View History

Parse paint() and store paint callbacks for CSS Painting API https://bugs.webkit.org/show_bug.cgi?id=190657 Patch by Justin Michaud <justin_michaud@apple.com> on 2018-10-17 Reviewed by Dean Jackson. Source/WebCore: Implement support for parsing paint() images in css, and store CSS paint callback objects in the paint definition map. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSCSSPaintWorkletGlobalScopeCustom.cpp: (WebCore::JSCSSPaintWorkletGlobalScope::visitAdditionalChildren): (WebCore::JSCSSPaintWorkletGlobalScope::registerPaint): * css/CSSImageGeneratorValue.cpp: (WebCore::CSSImageGeneratorValue::image): (WebCore::CSSImageGeneratorValue::isFixedSize const): (WebCore::CSSImageGeneratorValue::fixedSize): (WebCore::CSSImageGeneratorValue::isPending const): (WebCore::CSSImageGeneratorValue::knownToBeOpaque const): (WebCore::CSSImageGeneratorValue::loadSubimages): * css/CSSPaintImageValue.cpp: Added. (WebCore::CSSPaintImageValue::customCSSText const): * css/CSSPaintImageValue.h: Added. * css/CSSPaintWorkletGlobalScope.h: * css/CSSPaintWorkletGlobalScope.idl: * css/CSSValue.cpp: (WebCore::CSSValue::equals const): (WebCore::CSSValue::cssText const): (WebCore::CSSValue::destroy): * css/CSSValue.h: (WebCore::CSSValue::isPaintImageValue const): * css/CSSValueKeywords.in: * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::consumeCustomPaint): (WebCore::CSSPropertyParserHelpers::consumeGeneratedImage): (WebCore::CSSPropertyParserHelpers::isGeneratedImage): * platform/mediastream/mac/RealtimeVideoUtilities.h: LayoutTests: * fast/css-custom-paint/basic-expected.txt: * fast/css-custom-paint/basic.html: Canonical link: https://commits.webkit.org/205614@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237243 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-18 02:47:00 +00:00
/*
* Copyright (C) 2018 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
* THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#pragma once
#if ENABLE(CSS_PAINTING_API)
#include "CSSImageGeneratorValue.h"
namespace WebCore {
CSS Painting API should pass size, arguments and input properties to paint callback https://bugs.webkit.org/show_bug.cgi?id=191309 Reviewed by Chris Dumez. Source/WebCore: Call paint() callback with input properties and arguments. This patch adds a stub for the CSS Typed OM StylePropertyMapReadOnly, and passes all the arguments as strings without any syntax checking to the paint callback. Test: fast/css-custom-paint/properties.html * CMakeLists.txt: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSCSSStyleValueCustom.cpp: Copied from Source/WebCore/css/CSSPaintCallback.h. (WebCore::toJSNewlyCreated): (WebCore::toJS): * bindings/js/WebCoreBuiltinNames.h: * css/CSSPaintCallback.h: * css/CSSPaintCallback.idl: * css/CSSPaintImageValue.cpp: (WebCore::CSSPaintImageValue::image): * css/CSSPaintImageValue.h: * css/CSSPaintSize.h: Copied from Source/WebCore/css/CSSPaintCallback.h. (WebCore::CSSPaintSize::create): (WebCore::CSSPaintSize::width const): (WebCore::CSSPaintSize::height const): (WebCore::CSSPaintSize::CSSPaintSize): * css/CSSPaintSize.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl. * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::consumeCustomPaint): * css/typedom/CSSNumericValue.h: Copied from Source/WebCore/css/CSSPaintCallback.h. * css/typedom/CSSNumericValue.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl. * css/typedom/CSSStyleValue.h: Copied from Source/WebCore/css/CSSPaintCallback.h. (WebCore::CSSStyleValue::isUnitValue): (WebCore::CSSStyleValue::isUnparsedValue): * css/typedom/CSSStyleValue.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl. * css/typedom/CSSUnitValue.h: Copied from Source/WebCore/css/CSSPaintCallback.h. * css/typedom/CSSUnitValue.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl. * css/typedom/CSSUnparsedValue.h: Copied from Source/WebCore/css/CSSPaintCallback.h. * css/typedom/CSSUnparsedValue.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl. * css/typedom/StylePropertyMapReadOnly.h: Copied from Source/WebCore/css/CSSPaintCallback.h. (WebCore::StylePropertyMapReadOnly::create): (WebCore::StylePropertyMapReadOnly::get): (WebCore::StylePropertyMapReadOnly::StylePropertyMapReadOnly): * css/typedom/StylePropertyMapReadOnly.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl. * platform/graphics/CustomPaintImage.cpp: (WebCore::CustomPaintImage::CustomPaintImage): (WebCore::CustomPaintImage::doCustomPaint): * platform/graphics/CustomPaintImage.h: LayoutTests: * fast/css-custom-paint/properties-expected.html: Added. * fast/css-custom-paint/properties.html: Added. * fast/css-custom-paint/worklet.html: Canonical link: https://commits.webkit.org/206202@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-11-08 05:29:59 +00:00
class CSSVariableData;
Parse paint() and store paint callbacks for CSS Painting API https://bugs.webkit.org/show_bug.cgi?id=190657 Patch by Justin Michaud <justin_michaud@apple.com> on 2018-10-17 Reviewed by Dean Jackson. Source/WebCore: Implement support for parsing paint() images in css, and store CSS paint callback objects in the paint definition map. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSCSSPaintWorkletGlobalScopeCustom.cpp: (WebCore::JSCSSPaintWorkletGlobalScope::visitAdditionalChildren): (WebCore::JSCSSPaintWorkletGlobalScope::registerPaint): * css/CSSImageGeneratorValue.cpp: (WebCore::CSSImageGeneratorValue::image): (WebCore::CSSImageGeneratorValue::isFixedSize const): (WebCore::CSSImageGeneratorValue::fixedSize): (WebCore::CSSImageGeneratorValue::isPending const): (WebCore::CSSImageGeneratorValue::knownToBeOpaque const): (WebCore::CSSImageGeneratorValue::loadSubimages): * css/CSSPaintImageValue.cpp: Added. (WebCore::CSSPaintImageValue::customCSSText const): * css/CSSPaintImageValue.h: Added. * css/CSSPaintWorkletGlobalScope.h: * css/CSSPaintWorkletGlobalScope.idl: * css/CSSValue.cpp: (WebCore::CSSValue::equals const): (WebCore::CSSValue::cssText const): (WebCore::CSSValue::destroy): * css/CSSValue.h: (WebCore::CSSValue::isPaintImageValue const): * css/CSSValueKeywords.in: * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::consumeCustomPaint): (WebCore::CSSPropertyParserHelpers::consumeGeneratedImage): (WebCore::CSSPropertyParserHelpers::isGeneratedImage): * platform/mediastream/mac/RealtimeVideoUtilities.h: LayoutTests: * fast/css-custom-paint/basic-expected.txt: * fast/css-custom-paint/basic.html: Canonical link: https://commits.webkit.org/205614@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237243 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-18 02:47:00 +00:00
class CSSPaintImageValue final : public CSSImageGeneratorValue {
public:
CSS Painting API should pass size, arguments and input properties to paint callback https://bugs.webkit.org/show_bug.cgi?id=191309 Reviewed by Chris Dumez. Source/WebCore: Call paint() callback with input properties and arguments. This patch adds a stub for the CSS Typed OM StylePropertyMapReadOnly, and passes all the arguments as strings without any syntax checking to the paint callback. Test: fast/css-custom-paint/properties.html * CMakeLists.txt: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSCSSStyleValueCustom.cpp: Copied from Source/WebCore/css/CSSPaintCallback.h. (WebCore::toJSNewlyCreated): (WebCore::toJS): * bindings/js/WebCoreBuiltinNames.h: * css/CSSPaintCallback.h: * css/CSSPaintCallback.idl: * css/CSSPaintImageValue.cpp: (WebCore::CSSPaintImageValue::image): * css/CSSPaintImageValue.h: * css/CSSPaintSize.h: Copied from Source/WebCore/css/CSSPaintCallback.h. (WebCore::CSSPaintSize::create): (WebCore::CSSPaintSize::width const): (WebCore::CSSPaintSize::height const): (WebCore::CSSPaintSize::CSSPaintSize): * css/CSSPaintSize.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl. * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::consumeCustomPaint): * css/typedom/CSSNumericValue.h: Copied from Source/WebCore/css/CSSPaintCallback.h. * css/typedom/CSSNumericValue.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl. * css/typedom/CSSStyleValue.h: Copied from Source/WebCore/css/CSSPaintCallback.h. (WebCore::CSSStyleValue::isUnitValue): (WebCore::CSSStyleValue::isUnparsedValue): * css/typedom/CSSStyleValue.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl. * css/typedom/CSSUnitValue.h: Copied from Source/WebCore/css/CSSPaintCallback.h. * css/typedom/CSSUnitValue.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl. * css/typedom/CSSUnparsedValue.h: Copied from Source/WebCore/css/CSSPaintCallback.h. * css/typedom/CSSUnparsedValue.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl. * css/typedom/StylePropertyMapReadOnly.h: Copied from Source/WebCore/css/CSSPaintCallback.h. (WebCore::StylePropertyMapReadOnly::create): (WebCore::StylePropertyMapReadOnly::get): (WebCore::StylePropertyMapReadOnly::StylePropertyMapReadOnly): * css/typedom/StylePropertyMapReadOnly.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl. * platform/graphics/CustomPaintImage.cpp: (WebCore::CustomPaintImage::CustomPaintImage): (WebCore::CustomPaintImage::doCustomPaint): * platform/graphics/CustomPaintImage.h: LayoutTests: * fast/css-custom-paint/properties-expected.html: Added. * fast/css-custom-paint/properties.html: Added. * fast/css-custom-paint/worklet.html: Canonical link: https://commits.webkit.org/206202@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-11-08 05:29:59 +00:00
static Ref<CSSPaintImageValue> create(const String& name, Ref<CSSVariableData>&& arguments)
Parse paint() and store paint callbacks for CSS Painting API https://bugs.webkit.org/show_bug.cgi?id=190657 Patch by Justin Michaud <justin_michaud@apple.com> on 2018-10-17 Reviewed by Dean Jackson. Source/WebCore: Implement support for parsing paint() images in css, and store CSS paint callback objects in the paint definition map. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSCSSPaintWorkletGlobalScopeCustom.cpp: (WebCore::JSCSSPaintWorkletGlobalScope::visitAdditionalChildren): (WebCore::JSCSSPaintWorkletGlobalScope::registerPaint): * css/CSSImageGeneratorValue.cpp: (WebCore::CSSImageGeneratorValue::image): (WebCore::CSSImageGeneratorValue::isFixedSize const): (WebCore::CSSImageGeneratorValue::fixedSize): (WebCore::CSSImageGeneratorValue::isPending const): (WebCore::CSSImageGeneratorValue::knownToBeOpaque const): (WebCore::CSSImageGeneratorValue::loadSubimages): * css/CSSPaintImageValue.cpp: Added. (WebCore::CSSPaintImageValue::customCSSText const): * css/CSSPaintImageValue.h: Added. * css/CSSPaintWorkletGlobalScope.h: * css/CSSPaintWorkletGlobalScope.idl: * css/CSSValue.cpp: (WebCore::CSSValue::equals const): (WebCore::CSSValue::cssText const): (WebCore::CSSValue::destroy): * css/CSSValue.h: (WebCore::CSSValue::isPaintImageValue const): * css/CSSValueKeywords.in: * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::consumeCustomPaint): (WebCore::CSSPropertyParserHelpers::consumeGeneratedImage): (WebCore::CSSPropertyParserHelpers::isGeneratedImage): * platform/mediastream/mac/RealtimeVideoUtilities.h: LayoutTests: * fast/css-custom-paint/basic-expected.txt: * fast/css-custom-paint/basic.html: Canonical link: https://commits.webkit.org/205614@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237243 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-18 02:47:00 +00:00
{
CSS Painting API should pass size, arguments and input properties to paint callback https://bugs.webkit.org/show_bug.cgi?id=191309 Reviewed by Chris Dumez. Source/WebCore: Call paint() callback with input properties and arguments. This patch adds a stub for the CSS Typed OM StylePropertyMapReadOnly, and passes all the arguments as strings without any syntax checking to the paint callback. Test: fast/css-custom-paint/properties.html * CMakeLists.txt: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSCSSStyleValueCustom.cpp: Copied from Source/WebCore/css/CSSPaintCallback.h. (WebCore::toJSNewlyCreated): (WebCore::toJS): * bindings/js/WebCoreBuiltinNames.h: * css/CSSPaintCallback.h: * css/CSSPaintCallback.idl: * css/CSSPaintImageValue.cpp: (WebCore::CSSPaintImageValue::image): * css/CSSPaintImageValue.h: * css/CSSPaintSize.h: Copied from Source/WebCore/css/CSSPaintCallback.h. (WebCore::CSSPaintSize::create): (WebCore::CSSPaintSize::width const): (WebCore::CSSPaintSize::height const): (WebCore::CSSPaintSize::CSSPaintSize): * css/CSSPaintSize.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl. * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::consumeCustomPaint): * css/typedom/CSSNumericValue.h: Copied from Source/WebCore/css/CSSPaintCallback.h. * css/typedom/CSSNumericValue.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl. * css/typedom/CSSStyleValue.h: Copied from Source/WebCore/css/CSSPaintCallback.h. (WebCore::CSSStyleValue::isUnitValue): (WebCore::CSSStyleValue::isUnparsedValue): * css/typedom/CSSStyleValue.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl. * css/typedom/CSSUnitValue.h: Copied from Source/WebCore/css/CSSPaintCallback.h. * css/typedom/CSSUnitValue.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl. * css/typedom/CSSUnparsedValue.h: Copied from Source/WebCore/css/CSSPaintCallback.h. * css/typedom/CSSUnparsedValue.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl. * css/typedom/StylePropertyMapReadOnly.h: Copied from Source/WebCore/css/CSSPaintCallback.h. (WebCore::StylePropertyMapReadOnly::create): (WebCore::StylePropertyMapReadOnly::get): (WebCore::StylePropertyMapReadOnly::StylePropertyMapReadOnly): * css/typedom/StylePropertyMapReadOnly.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl. * platform/graphics/CustomPaintImage.cpp: (WebCore::CustomPaintImage::CustomPaintImage): (WebCore::CustomPaintImage::doCustomPaint): * platform/graphics/CustomPaintImage.h: LayoutTests: * fast/css-custom-paint/properties-expected.html: Added. * fast/css-custom-paint/properties.html: Added. * fast/css-custom-paint/worklet.html: Canonical link: https://commits.webkit.org/206202@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-11-08 05:29:59 +00:00
return adoptRef(*new CSSPaintImageValue(name, WTFMove(arguments)));
Parse paint() and store paint callbacks for CSS Painting API https://bugs.webkit.org/show_bug.cgi?id=190657 Patch by Justin Michaud <justin_michaud@apple.com> on 2018-10-17 Reviewed by Dean Jackson. Source/WebCore: Implement support for parsing paint() images in css, and store CSS paint callback objects in the paint definition map. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSCSSPaintWorkletGlobalScopeCustom.cpp: (WebCore::JSCSSPaintWorkletGlobalScope::visitAdditionalChildren): (WebCore::JSCSSPaintWorkletGlobalScope::registerPaint): * css/CSSImageGeneratorValue.cpp: (WebCore::CSSImageGeneratorValue::image): (WebCore::CSSImageGeneratorValue::isFixedSize const): (WebCore::CSSImageGeneratorValue::fixedSize): (WebCore::CSSImageGeneratorValue::isPending const): (WebCore::CSSImageGeneratorValue::knownToBeOpaque const): (WebCore::CSSImageGeneratorValue::loadSubimages): * css/CSSPaintImageValue.cpp: Added. (WebCore::CSSPaintImageValue::customCSSText const): * css/CSSPaintImageValue.h: Added. * css/CSSPaintWorkletGlobalScope.h: * css/CSSPaintWorkletGlobalScope.idl: * css/CSSValue.cpp: (WebCore::CSSValue::equals const): (WebCore::CSSValue::cssText const): (WebCore::CSSValue::destroy): * css/CSSValue.h: (WebCore::CSSValue::isPaintImageValue const): * css/CSSValueKeywords.in: * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::consumeCustomPaint): (WebCore::CSSPropertyParserHelpers::consumeGeneratedImage): (WebCore::CSSPropertyParserHelpers::isGeneratedImage): * platform/mediastream/mac/RealtimeVideoUtilities.h: LayoutTests: * fast/css-custom-paint/basic-expected.txt: * fast/css-custom-paint/basic.html: Canonical link: https://commits.webkit.org/205614@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237243 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-18 02:47:00 +00:00
}
CSS Painting API should pass 'this' correctly to paint callback, and repaint when properties change. https://bugs.webkit.org/show_bug.cgi?id=191443 Reviewed by Dean Jackson. Source/JavaScriptCore: Export the simpler construct() method for use in WebCore. * runtime/ConstructData.h: Source/WebCore: Instantiate a new instance of the paint class, and pass it as 'this' object when the paint callback is called. Also, this patch makes sure that custom paint elements get repainted when properties that they care about get changed. Finally, we fix two reference cycles that caused WorkletGlobalScope to never be destroyed. Tests: fast/css-custom-paint/animate-repaint.html fast/css-custom-paint/animate.html * bindings/js/JSDOMWrapper.cpp: * bindings/js/JSPaintWorkletGlobalScopeCustom.cpp: (WebCore::JSPaintWorkletGlobalScope::visitAdditionalChildren): * bindings/js/JSWorkletGlobalScopeBase.cpp: (WebCore::toJS): * bindings/js/ScriptState.cpp: (WebCore::execStateFromWorkletGlobalScope): * css/CSSPaintCallback.h: * css/CSSPaintCallback.idl: * css/CSSPaintImageValue.h: * css/StyleResolver.cpp: (WebCore::StyleResolver::applyProperty): * dom/Document.cpp: (WebCore::Document::prepareForDestruction): * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::vm): * platform/graphics/CustomPaintImage.cpp: (WebCore::CustomPaintImage::CustomPaintImage): (WebCore::CustomPaintImage::doCustomPaint): * platform/graphics/CustomPaintImage.h: * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::addCustomPaintWatchProperty): (WebCore::RenderStyle::changeRequiresRepaint const): * rendering/style/RenderStyle.h: * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): (WebCore::StyleRareNonInheritedData::operator== const): * rendering/style/StyleRareNonInheritedData.h: * testing/Internals.cpp: (WebCore::Internals::isAnyWorkletGlobalScopeAlive const): * testing/Internals.h: * testing/Internals.idl: * worklets/PaintWorkletGlobalScope.cpp: (WebCore::PaintWorkletGlobalScope::devicePixelRatio const): (WebCore::PaintWorkletGlobalScope::PaintDefinition::PaintDefinition): (WebCore::PaintWorkletGlobalScope::registerPaint): * worklets/PaintWorkletGlobalScope.h: (WebCore::PaintWorkletGlobalScope::~PaintWorkletGlobalScope): * worklets/WorkletGlobalScope.cpp: (WebCore::WorkletGlobalScope::WorkletGlobalScope): (WebCore::WorkletGlobalScope::~WorkletGlobalScope): (WebCore::WorkletGlobalScope::prepareForDestruction): (WebCore::WorkletGlobalScope::allWorkletGlobalScopesSet): (WebCore::WorkletGlobalScope::isJSExecutionForbidden const): (WebCore::WorkletGlobalScope::logExceptionToConsole): (WebCore::WorkletGlobalScope::addConsoleMessage): (WebCore::WorkletGlobalScope::addMessage): * worklets/WorkletGlobalScope.h: (WebCore::WorkletGlobalScope::script): (WebCore::WorkletGlobalScope::responsibleDocument): (WebCore::WorkletGlobalScope::responsibleDocument const): (WebCore::WorkletGlobalScope::identifier const): Deleted. (WebCore::WorkletGlobalScope::responsableDocument): Deleted. (WebCore::WorkletGlobalScope::responsableDocument const): Deleted. * worklets/WorkletScriptController.cpp: (WebCore::WorkletScriptController::~WorkletScriptController): (WebCore::WorkletScriptController::disableEval): (WebCore::WorkletScriptController::disableWebAssembly): (WebCore::WorkletScriptController::initScript): LayoutTests: * fast/css-custom-paint/animate-expected.html: Added. * fast/css-custom-paint/animate-repaint-expected.txt: Added. * fast/css-custom-paint/animate-repaint.html: Added. * fast/css-custom-paint/animate.html: Added. * fast/css-custom-paint/constructor-expected.html: Added. * fast/css-custom-paint/constructor.html: Added. * fast/css-custom-paint/leaks-expected.txt: Added. * fast/css-custom-paint/leaks.html: Added. * fast/css-custom-paint/properties.html: * fast/css-custom-paint/resources/leaks-frame.html: Added. * platform/mac/fast/css-custom-paint/raf-leak-expected.txt: Added. Canonical link: https://commits.webkit.org/206836@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238686 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-11-29 21:01:15 +00:00
const String& name() const { return m_name; }
Add new image type for CSS painting API https://bugs.webkit.org/show_bug.cgi?id=190697 Patch by Justin Michaud <justin_michaud@apple.com> on 2018-10-18 Reviewed by Dean Jackson. Source/WebCore: Add a new image type for the CSS painting API, and hook it up so it can be drawn. For now, it uses a WebGL rendering context from OfflineCanvas because that was easy to hook up. The spec actually calls for a RenderingContext2D, which can be handled in another patch. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * css/CSSImageGeneratorValue.cpp: (WebCore::CSSImageGeneratorValue::image): (WebCore::CSSImageGeneratorValue::isFixedSize const): (WebCore::CSSImageGeneratorValue::fixedSize): (WebCore::CSSImageGeneratorValue::isPending const): (WebCore::CSSImageGeneratorValue::knownToBeOpaque const): (WebCore::CSSImageGeneratorValue::loadSubimages): * css/CSSPaintCallback.h: * css/CSSPaintCallback.idl: * css/CSSPaintImageValue.cpp: (WebCore::CSSPaintImageValue::image): * css/CSSPaintImageValue.h: * platform/graphics/CustomPaintImage.cpp: Added. (WebCore::CustomPaintImage::CustomPaintImage): (WebCore::CustomPaintImage::doCustomPaint): (WebCore::CustomPaintImage::draw): (WebCore::CustomPaintImage::drawPattern): * platform/graphics/CustomPaintImage.h: Copied from Source/WebCore/css/CSSPaintCallback.h. * platform/graphics/Image.h: (WebCore::Image::isCustomPaintImage const): * platform/graphics/ImageBuffer.h: * platform/graphics/cairo/CairoOperations.cpp: LayoutTests: * fast/css-custom-paint/basic-expected.txt: * fast/css-custom-paint/basic.html: Canonical link: https://commits.webkit.org/205641@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237276 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-18 23:59:49 +00:00
RefPtr<Image> image(RenderElement&, const FloatSize&);
Parse paint() and store paint callbacks for CSS Painting API https://bugs.webkit.org/show_bug.cgi?id=190657 Patch by Justin Michaud <justin_michaud@apple.com> on 2018-10-17 Reviewed by Dean Jackson. Source/WebCore: Implement support for parsing paint() images in css, and store CSS paint callback objects in the paint definition map. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSCSSPaintWorkletGlobalScopeCustom.cpp: (WebCore::JSCSSPaintWorkletGlobalScope::visitAdditionalChildren): (WebCore::JSCSSPaintWorkletGlobalScope::registerPaint): * css/CSSImageGeneratorValue.cpp: (WebCore::CSSImageGeneratorValue::image): (WebCore::CSSImageGeneratorValue::isFixedSize const): (WebCore::CSSImageGeneratorValue::fixedSize): (WebCore::CSSImageGeneratorValue::isPending const): (WebCore::CSSImageGeneratorValue::knownToBeOpaque const): (WebCore::CSSImageGeneratorValue::loadSubimages): * css/CSSPaintImageValue.cpp: Added. (WebCore::CSSPaintImageValue::customCSSText const): * css/CSSPaintImageValue.h: Added. * css/CSSPaintWorkletGlobalScope.h: * css/CSSPaintWorkletGlobalScope.idl: * css/CSSValue.cpp: (WebCore::CSSValue::equals const): (WebCore::CSSValue::cssText const): (WebCore::CSSValue::destroy): * css/CSSValue.h: (WebCore::CSSValue::isPaintImageValue const): * css/CSSValueKeywords.in: * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::consumeCustomPaint): (WebCore::CSSPropertyParserHelpers::consumeGeneratedImage): (WebCore::CSSPropertyParserHelpers::isGeneratedImage): * platform/mediastream/mac/RealtimeVideoUtilities.h: LayoutTests: * fast/css-custom-paint/basic-expected.txt: * fast/css-custom-paint/basic.html: Canonical link: https://commits.webkit.org/205614@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237243 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-18 02:47:00 +00:00
Add new image type for CSS painting API https://bugs.webkit.org/show_bug.cgi?id=190697 Patch by Justin Michaud <justin_michaud@apple.com> on 2018-10-18 Reviewed by Dean Jackson. Source/WebCore: Add a new image type for the CSS painting API, and hook it up so it can be drawn. For now, it uses a WebGL rendering context from OfflineCanvas because that was easy to hook up. The spec actually calls for a RenderingContext2D, which can be handled in another patch. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * css/CSSImageGeneratorValue.cpp: (WebCore::CSSImageGeneratorValue::image): (WebCore::CSSImageGeneratorValue::isFixedSize const): (WebCore::CSSImageGeneratorValue::fixedSize): (WebCore::CSSImageGeneratorValue::isPending const): (WebCore::CSSImageGeneratorValue::knownToBeOpaque const): (WebCore::CSSImageGeneratorValue::loadSubimages): * css/CSSPaintCallback.h: * css/CSSPaintCallback.idl: * css/CSSPaintImageValue.cpp: (WebCore::CSSPaintImageValue::image): * css/CSSPaintImageValue.h: * platform/graphics/CustomPaintImage.cpp: Added. (WebCore::CustomPaintImage::CustomPaintImage): (WebCore::CustomPaintImage::doCustomPaint): (WebCore::CustomPaintImage::draw): (WebCore::CustomPaintImage::drawPattern): * platform/graphics/CustomPaintImage.h: Copied from Source/WebCore/css/CSSPaintCallback.h. * platform/graphics/Image.h: (WebCore::Image::isCustomPaintImage const): * platform/graphics/ImageBuffer.h: * platform/graphics/cairo/CairoOperations.cpp: LayoutTests: * fast/css-custom-paint/basic-expected.txt: * fast/css-custom-paint/basic.html: Canonical link: https://commits.webkit.org/205641@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237276 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-18 23:59:49 +00:00
bool equals(const CSSPaintImageValue& other) const { return m_name == other.m_name; }
Parse paint() and store paint callbacks for CSS Painting API https://bugs.webkit.org/show_bug.cgi?id=190657 Patch by Justin Michaud <justin_michaud@apple.com> on 2018-10-17 Reviewed by Dean Jackson. Source/WebCore: Implement support for parsing paint() images in css, and store CSS paint callback objects in the paint definition map. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSCSSPaintWorkletGlobalScopeCustom.cpp: (WebCore::JSCSSPaintWorkletGlobalScope::visitAdditionalChildren): (WebCore::JSCSSPaintWorkletGlobalScope::registerPaint): * css/CSSImageGeneratorValue.cpp: (WebCore::CSSImageGeneratorValue::image): (WebCore::CSSImageGeneratorValue::isFixedSize const): (WebCore::CSSImageGeneratorValue::fixedSize): (WebCore::CSSImageGeneratorValue::isPending const): (WebCore::CSSImageGeneratorValue::knownToBeOpaque const): (WebCore::CSSImageGeneratorValue::loadSubimages): * css/CSSPaintImageValue.cpp: Added. (WebCore::CSSPaintImageValue::customCSSText const): * css/CSSPaintImageValue.h: Added. * css/CSSPaintWorkletGlobalScope.h: * css/CSSPaintWorkletGlobalScope.idl: * css/CSSValue.cpp: (WebCore::CSSValue::equals const): (WebCore::CSSValue::cssText const): (WebCore::CSSValue::destroy): * css/CSSValue.h: (WebCore::CSSValue::isPaintImageValue const): * css/CSSValueKeywords.in: * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::consumeCustomPaint): (WebCore::CSSPropertyParserHelpers::consumeGeneratedImage): (WebCore::CSSPropertyParserHelpers::isGeneratedImage): * platform/mediastream/mac/RealtimeVideoUtilities.h: LayoutTests: * fast/css-custom-paint/basic-expected.txt: * fast/css-custom-paint/basic.html: Canonical link: https://commits.webkit.org/205614@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237243 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-18 02:47:00 +00:00
String customCSSText() const;
Add new image type for CSS painting API https://bugs.webkit.org/show_bug.cgi?id=190697 Patch by Justin Michaud <justin_michaud@apple.com> on 2018-10-18 Reviewed by Dean Jackson. Source/WebCore: Add a new image type for the CSS painting API, and hook it up so it can be drawn. For now, it uses a WebGL rendering context from OfflineCanvas because that was easy to hook up. The spec actually calls for a RenderingContext2D, which can be handled in another patch. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * css/CSSImageGeneratorValue.cpp: (WebCore::CSSImageGeneratorValue::image): (WebCore::CSSImageGeneratorValue::isFixedSize const): (WebCore::CSSImageGeneratorValue::fixedSize): (WebCore::CSSImageGeneratorValue::isPending const): (WebCore::CSSImageGeneratorValue::knownToBeOpaque const): (WebCore::CSSImageGeneratorValue::loadSubimages): * css/CSSPaintCallback.h: * css/CSSPaintCallback.idl: * css/CSSPaintImageValue.cpp: (WebCore::CSSPaintImageValue::image): * css/CSSPaintImageValue.h: * platform/graphics/CustomPaintImage.cpp: Added. (WebCore::CustomPaintImage::CustomPaintImage): (WebCore::CustomPaintImage::doCustomPaint): (WebCore::CustomPaintImage::draw): (WebCore::CustomPaintImage::drawPattern): * platform/graphics/CustomPaintImage.h: Copied from Source/WebCore/css/CSSPaintCallback.h. * platform/graphics/Image.h: (WebCore::Image::isCustomPaintImage const): * platform/graphics/ImageBuffer.h: * platform/graphics/cairo/CairoOperations.cpp: LayoutTests: * fast/css-custom-paint/basic-expected.txt: * fast/css-custom-paint/basic.html: Canonical link: https://commits.webkit.org/205641@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237276 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-18 23:59:49 +00:00
bool isFixedSize() const { return false; }
FloatSize fixedSize(const RenderElement&) const { return FloatSize(); }
bool isPending() const { return false; }
bool knownToBeOpaque(const RenderElement&) const { return false; }
void loadSubimages(CachedResourceLoader&, const ResourceLoaderOptions&) { }
Parse paint() and store paint callbacks for CSS Painting API https://bugs.webkit.org/show_bug.cgi?id=190657 Patch by Justin Michaud <justin_michaud@apple.com> on 2018-10-17 Reviewed by Dean Jackson. Source/WebCore: Implement support for parsing paint() images in css, and store CSS paint callback objects in the paint definition map. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSCSSPaintWorkletGlobalScopeCustom.cpp: (WebCore::JSCSSPaintWorkletGlobalScope::visitAdditionalChildren): (WebCore::JSCSSPaintWorkletGlobalScope::registerPaint): * css/CSSImageGeneratorValue.cpp: (WebCore::CSSImageGeneratorValue::image): (WebCore::CSSImageGeneratorValue::isFixedSize const): (WebCore::CSSImageGeneratorValue::fixedSize): (WebCore::CSSImageGeneratorValue::isPending const): (WebCore::CSSImageGeneratorValue::knownToBeOpaque const): (WebCore::CSSImageGeneratorValue::loadSubimages): * css/CSSPaintImageValue.cpp: Added. (WebCore::CSSPaintImageValue::customCSSText const): * css/CSSPaintImageValue.h: Added. * css/CSSPaintWorkletGlobalScope.h: * css/CSSPaintWorkletGlobalScope.idl: * css/CSSValue.cpp: (WebCore::CSSValue::equals const): (WebCore::CSSValue::cssText const): (WebCore::CSSValue::destroy): * css/CSSValue.h: (WebCore::CSSValue::isPaintImageValue const): * css/CSSValueKeywords.in: * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::consumeCustomPaint): (WebCore::CSSPropertyParserHelpers::consumeGeneratedImage): (WebCore::CSSPropertyParserHelpers::isGeneratedImage): * platform/mediastream/mac/RealtimeVideoUtilities.h: LayoutTests: * fast/css-custom-paint/basic-expected.txt: * fast/css-custom-paint/basic.html: Canonical link: https://commits.webkit.org/205614@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237243 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-18 02:47:00 +00:00
private:
CSS Painting API should pass size, arguments and input properties to paint callback https://bugs.webkit.org/show_bug.cgi?id=191309 Reviewed by Chris Dumez. Source/WebCore: Call paint() callback with input properties and arguments. This patch adds a stub for the CSS Typed OM StylePropertyMapReadOnly, and passes all the arguments as strings without any syntax checking to the paint callback. Test: fast/css-custom-paint/properties.html * CMakeLists.txt: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSCSSStyleValueCustom.cpp: Copied from Source/WebCore/css/CSSPaintCallback.h. (WebCore::toJSNewlyCreated): (WebCore::toJS): * bindings/js/WebCoreBuiltinNames.h: * css/CSSPaintCallback.h: * css/CSSPaintCallback.idl: * css/CSSPaintImageValue.cpp: (WebCore::CSSPaintImageValue::image): * css/CSSPaintImageValue.h: * css/CSSPaintSize.h: Copied from Source/WebCore/css/CSSPaintCallback.h. (WebCore::CSSPaintSize::create): (WebCore::CSSPaintSize::width const): (WebCore::CSSPaintSize::height const): (WebCore::CSSPaintSize::CSSPaintSize): * css/CSSPaintSize.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl. * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::consumeCustomPaint): * css/typedom/CSSNumericValue.h: Copied from Source/WebCore/css/CSSPaintCallback.h. * css/typedom/CSSNumericValue.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl. * css/typedom/CSSStyleValue.h: Copied from Source/WebCore/css/CSSPaintCallback.h. (WebCore::CSSStyleValue::isUnitValue): (WebCore::CSSStyleValue::isUnparsedValue): * css/typedom/CSSStyleValue.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl. * css/typedom/CSSUnitValue.h: Copied from Source/WebCore/css/CSSPaintCallback.h. * css/typedom/CSSUnitValue.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl. * css/typedom/CSSUnparsedValue.h: Copied from Source/WebCore/css/CSSPaintCallback.h. * css/typedom/CSSUnparsedValue.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl. * css/typedom/StylePropertyMapReadOnly.h: Copied from Source/WebCore/css/CSSPaintCallback.h. (WebCore::StylePropertyMapReadOnly::create): (WebCore::StylePropertyMapReadOnly::get): (WebCore::StylePropertyMapReadOnly::StylePropertyMapReadOnly): * css/typedom/StylePropertyMapReadOnly.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl. * platform/graphics/CustomPaintImage.cpp: (WebCore::CustomPaintImage::CustomPaintImage): (WebCore::CustomPaintImage::doCustomPaint): * platform/graphics/CustomPaintImage.h: LayoutTests: * fast/css-custom-paint/properties-expected.html: Added. * fast/css-custom-paint/properties.html: Added. * fast/css-custom-paint/worklet.html: Canonical link: https://commits.webkit.org/206202@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-11-08 05:29:59 +00:00
CSSPaintImageValue(const String& name, Ref<CSSVariableData>&& arguments)
Parse paint() and store paint callbacks for CSS Painting API https://bugs.webkit.org/show_bug.cgi?id=190657 Patch by Justin Michaud <justin_michaud@apple.com> on 2018-10-17 Reviewed by Dean Jackson. Source/WebCore: Implement support for parsing paint() images in css, and store CSS paint callback objects in the paint definition map. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSCSSPaintWorkletGlobalScopeCustom.cpp: (WebCore::JSCSSPaintWorkletGlobalScope::visitAdditionalChildren): (WebCore::JSCSSPaintWorkletGlobalScope::registerPaint): * css/CSSImageGeneratorValue.cpp: (WebCore::CSSImageGeneratorValue::image): (WebCore::CSSImageGeneratorValue::isFixedSize const): (WebCore::CSSImageGeneratorValue::fixedSize): (WebCore::CSSImageGeneratorValue::isPending const): (WebCore::CSSImageGeneratorValue::knownToBeOpaque const): (WebCore::CSSImageGeneratorValue::loadSubimages): * css/CSSPaintImageValue.cpp: Added. (WebCore::CSSPaintImageValue::customCSSText const): * css/CSSPaintImageValue.h: Added. * css/CSSPaintWorkletGlobalScope.h: * css/CSSPaintWorkletGlobalScope.idl: * css/CSSValue.cpp: (WebCore::CSSValue::equals const): (WebCore::CSSValue::cssText const): (WebCore::CSSValue::destroy): * css/CSSValue.h: (WebCore::CSSValue::isPaintImageValue const): * css/CSSValueKeywords.in: * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::consumeCustomPaint): (WebCore::CSSPropertyParserHelpers::consumeGeneratedImage): (WebCore::CSSPropertyParserHelpers::isGeneratedImage): * platform/mediastream/mac/RealtimeVideoUtilities.h: LayoutTests: * fast/css-custom-paint/basic-expected.txt: * fast/css-custom-paint/basic.html: Canonical link: https://commits.webkit.org/205614@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237243 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-18 02:47:00 +00:00
: CSSImageGeneratorValue(PaintImageClass)
, m_name(name)
CSS Painting API should pass size, arguments and input properties to paint callback https://bugs.webkit.org/show_bug.cgi?id=191309 Reviewed by Chris Dumez. Source/WebCore: Call paint() callback with input properties and arguments. This patch adds a stub for the CSS Typed OM StylePropertyMapReadOnly, and passes all the arguments as strings without any syntax checking to the paint callback. Test: fast/css-custom-paint/properties.html * CMakeLists.txt: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSCSSStyleValueCustom.cpp: Copied from Source/WebCore/css/CSSPaintCallback.h. (WebCore::toJSNewlyCreated): (WebCore::toJS): * bindings/js/WebCoreBuiltinNames.h: * css/CSSPaintCallback.h: * css/CSSPaintCallback.idl: * css/CSSPaintImageValue.cpp: (WebCore::CSSPaintImageValue::image): * css/CSSPaintImageValue.h: * css/CSSPaintSize.h: Copied from Source/WebCore/css/CSSPaintCallback.h. (WebCore::CSSPaintSize::create): (WebCore::CSSPaintSize::width const): (WebCore::CSSPaintSize::height const): (WebCore::CSSPaintSize::CSSPaintSize): * css/CSSPaintSize.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl. * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::consumeCustomPaint): * css/typedom/CSSNumericValue.h: Copied from Source/WebCore/css/CSSPaintCallback.h. * css/typedom/CSSNumericValue.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl. * css/typedom/CSSStyleValue.h: Copied from Source/WebCore/css/CSSPaintCallback.h. (WebCore::CSSStyleValue::isUnitValue): (WebCore::CSSStyleValue::isUnparsedValue): * css/typedom/CSSStyleValue.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl. * css/typedom/CSSUnitValue.h: Copied from Source/WebCore/css/CSSPaintCallback.h. * css/typedom/CSSUnitValue.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl. * css/typedom/CSSUnparsedValue.h: Copied from Source/WebCore/css/CSSPaintCallback.h. * css/typedom/CSSUnparsedValue.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl. * css/typedom/StylePropertyMapReadOnly.h: Copied from Source/WebCore/css/CSSPaintCallback.h. (WebCore::StylePropertyMapReadOnly::create): (WebCore::StylePropertyMapReadOnly::get): (WebCore::StylePropertyMapReadOnly::StylePropertyMapReadOnly): * css/typedom/StylePropertyMapReadOnly.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl. * platform/graphics/CustomPaintImage.cpp: (WebCore::CustomPaintImage::CustomPaintImage): (WebCore::CustomPaintImage::doCustomPaint): * platform/graphics/CustomPaintImage.h: LayoutTests: * fast/css-custom-paint/properties-expected.html: Added. * fast/css-custom-paint/properties.html: Added. * fast/css-custom-paint/worklet.html: Canonical link: https://commits.webkit.org/206202@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-11-08 05:29:59 +00:00
, m_arguments(WTFMove(arguments))
Parse paint() and store paint callbacks for CSS Painting API https://bugs.webkit.org/show_bug.cgi?id=190657 Patch by Justin Michaud <justin_michaud@apple.com> on 2018-10-17 Reviewed by Dean Jackson. Source/WebCore: Implement support for parsing paint() images in css, and store CSS paint callback objects in the paint definition map. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSCSSPaintWorkletGlobalScopeCustom.cpp: (WebCore::JSCSSPaintWorkletGlobalScope::visitAdditionalChildren): (WebCore::JSCSSPaintWorkletGlobalScope::registerPaint): * css/CSSImageGeneratorValue.cpp: (WebCore::CSSImageGeneratorValue::image): (WebCore::CSSImageGeneratorValue::isFixedSize const): (WebCore::CSSImageGeneratorValue::fixedSize): (WebCore::CSSImageGeneratorValue::isPending const): (WebCore::CSSImageGeneratorValue::knownToBeOpaque const): (WebCore::CSSImageGeneratorValue::loadSubimages): * css/CSSPaintImageValue.cpp: Added. (WebCore::CSSPaintImageValue::customCSSText const): * css/CSSPaintImageValue.h: Added. * css/CSSPaintWorkletGlobalScope.h: * css/CSSPaintWorkletGlobalScope.idl: * css/CSSValue.cpp: (WebCore::CSSValue::equals const): (WebCore::CSSValue::cssText const): (WebCore::CSSValue::destroy): * css/CSSValue.h: (WebCore::CSSValue::isPaintImageValue const): * css/CSSValueKeywords.in: * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::consumeCustomPaint): (WebCore::CSSPropertyParserHelpers::consumeGeneratedImage): (WebCore::CSSPropertyParserHelpers::isGeneratedImage): * platform/mediastream/mac/RealtimeVideoUtilities.h: LayoutTests: * fast/css-custom-paint/basic-expected.txt: * fast/css-custom-paint/basic.html: Canonical link: https://commits.webkit.org/205614@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237243 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-18 02:47:00 +00:00
{
}
const String m_name;
CSS Painting API should pass size, arguments and input properties to paint callback https://bugs.webkit.org/show_bug.cgi?id=191309 Reviewed by Chris Dumez. Source/WebCore: Call paint() callback with input properties and arguments. This patch adds a stub for the CSS Typed OM StylePropertyMapReadOnly, and passes all the arguments as strings without any syntax checking to the paint callback. Test: fast/css-custom-paint/properties.html * CMakeLists.txt: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSCSSStyleValueCustom.cpp: Copied from Source/WebCore/css/CSSPaintCallback.h. (WebCore::toJSNewlyCreated): (WebCore::toJS): * bindings/js/WebCoreBuiltinNames.h: * css/CSSPaintCallback.h: * css/CSSPaintCallback.idl: * css/CSSPaintImageValue.cpp: (WebCore::CSSPaintImageValue::image): * css/CSSPaintImageValue.h: * css/CSSPaintSize.h: Copied from Source/WebCore/css/CSSPaintCallback.h. (WebCore::CSSPaintSize::create): (WebCore::CSSPaintSize::width const): (WebCore::CSSPaintSize::height const): (WebCore::CSSPaintSize::CSSPaintSize): * css/CSSPaintSize.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl. * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::consumeCustomPaint): * css/typedom/CSSNumericValue.h: Copied from Source/WebCore/css/CSSPaintCallback.h. * css/typedom/CSSNumericValue.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl. * css/typedom/CSSStyleValue.h: Copied from Source/WebCore/css/CSSPaintCallback.h. (WebCore::CSSStyleValue::isUnitValue): (WebCore::CSSStyleValue::isUnparsedValue): * css/typedom/CSSStyleValue.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl. * css/typedom/CSSUnitValue.h: Copied from Source/WebCore/css/CSSPaintCallback.h. * css/typedom/CSSUnitValue.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl. * css/typedom/CSSUnparsedValue.h: Copied from Source/WebCore/css/CSSPaintCallback.h. * css/typedom/CSSUnparsedValue.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl. * css/typedom/StylePropertyMapReadOnly.h: Copied from Source/WebCore/css/CSSPaintCallback.h. (WebCore::StylePropertyMapReadOnly::create): (WebCore::StylePropertyMapReadOnly::get): (WebCore::StylePropertyMapReadOnly::StylePropertyMapReadOnly): * css/typedom/StylePropertyMapReadOnly.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl. * platform/graphics/CustomPaintImage.cpp: (WebCore::CustomPaintImage::CustomPaintImage): (WebCore::CustomPaintImage::doCustomPaint): * platform/graphics/CustomPaintImage.h: LayoutTests: * fast/css-custom-paint/properties-expected.html: Added. * fast/css-custom-paint/properties.html: Added. * fast/css-custom-paint/worklet.html: Canonical link: https://commits.webkit.org/206202@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-11-08 05:29:59 +00:00
Ref<CSSVariableData> m_arguments;
Parse paint() and store paint callbacks for CSS Painting API https://bugs.webkit.org/show_bug.cgi?id=190657 Patch by Justin Michaud <justin_michaud@apple.com> on 2018-10-17 Reviewed by Dean Jackson. Source/WebCore: Implement support for parsing paint() images in css, and store CSS paint callback objects in the paint definition map. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSCSSPaintWorkletGlobalScopeCustom.cpp: (WebCore::JSCSSPaintWorkletGlobalScope::visitAdditionalChildren): (WebCore::JSCSSPaintWorkletGlobalScope::registerPaint): * css/CSSImageGeneratorValue.cpp: (WebCore::CSSImageGeneratorValue::image): (WebCore::CSSImageGeneratorValue::isFixedSize const): (WebCore::CSSImageGeneratorValue::fixedSize): (WebCore::CSSImageGeneratorValue::isPending const): (WebCore::CSSImageGeneratorValue::knownToBeOpaque const): (WebCore::CSSImageGeneratorValue::loadSubimages): * css/CSSPaintImageValue.cpp: Added. (WebCore::CSSPaintImageValue::customCSSText const): * css/CSSPaintImageValue.h: Added. * css/CSSPaintWorkletGlobalScope.h: * css/CSSPaintWorkletGlobalScope.idl: * css/CSSValue.cpp: (WebCore::CSSValue::equals const): (WebCore::CSSValue::cssText const): (WebCore::CSSValue::destroy): * css/CSSValue.h: (WebCore::CSSValue::isPaintImageValue const): * css/CSSValueKeywords.in: * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::consumeCustomPaint): (WebCore::CSSPropertyParserHelpers::consumeGeneratedImage): (WebCore::CSSPropertyParserHelpers::isGeneratedImage): * platform/mediastream/mac/RealtimeVideoUtilities.h: LayoutTests: * fast/css-custom-paint/basic-expected.txt: * fast/css-custom-paint/basic.html: Canonical link: https://commits.webkit.org/205614@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237243 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-18 02:47:00 +00:00
};
} // namespace WebCore
SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSPaintImageValue, isPaintImageValue())
#endif