Ignore:
Timestamp:
Oct 17, 2018, 7:47:00 PM (7 years ago)
Author:
[email protected]
Message:

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> 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:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/css/CSSValue.cpp

    r236998 r237243  
    5353#include "CSSLineBoxContainValue.h"
    5454#include "CSSNamedImageValue.h"
     55#include "CSSPaintImageValue.h"
    5556#include "CSSPendingSubstitutionValue.h"
    5657#include "CSSPrimitiveValue.h"
     
    152153        case FilterImageClass:
    153154            return compareCSSValues<CSSFilterImageValue>(*this, other);
     155#if ENABLE(CSS_PAINTING_API)
     156        case PaintImageClass:
     157            return compareCSSValues<CSSPaintImageValue>(*this, other);
     158#endif
    154159        case FontClass:
    155160            return compareCSSValues<CSSFontValue>(*this, other);
     
    248253    case FilterImageClass:
    249254        return downcast<CSSFilterImageValue>(*this).customCSSText();
     255#if ENABLE(CSS_PAINTING_API)
     256    case PaintImageClass:
     257        return downcast<CSSPaintImageValue>(*this).customCSSText();
     258#endif
    250259    case FontClass:
    251260        return downcast<CSSFontValue>(*this).customCSSText();
     
    433442        delete downcast<CSSFilterImageValue>(this);
    434443        return;
     444#if ENABLE(CSS_PAINTING_API)
     445    case PaintImageClass:
     446        delete downcast<CSSPaintImageValue>(this);
     447        return;
     448#endif
    435449    case CSSContentDistributionClass:
    436450        delete downcast<CSSContentDistributionValue>(this);
Note: See TracChangeset for help on using the changeset viewer.