CS Painting API should support multiple worklets.
authorjustin_michaud@apple.com <justin_michaud@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Dec 2018 03:55:49 +0000 (03:55 +0000)
committerjustin_michaud@apple.com <justin_michaud@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Dec 2018 03:55:49 +0000 (03:55 +0000)
commit566cbf935c6a3bc4db7e0171a7faba4d85559e6a
tree133ded954b442cebed117c9bd76c0e7c77441074
parentd7ef1538a8b1718d61d3a3fc11011021315c0f35
CS Painting API should support multiple worklets.
https://bugs.webkit.org/show_bug.cgi?id=192335

Reviewed by Dean Jackson.

Source/WebCore:

Adds a new map to support separate paint worklet global scopes (one for each worklet). Also
adds some tests and a fix for a repaint bug that this oncovered, where changing a custom property required
for paint would not trigger a repaint if there had not been a valid value set before.

Test: fast/css-custom-paint/multiple-worklets.html

* css/CSSPaintImageValue.cpp:
(WebCore::CSSPaintImageValue::image):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::applyProperty):
* dom/Document.cpp:
(WebCore::Document::prepareForDestruction):
(WebCore::Document::paintWorkletGlobalScope):
(WebCore::Document::setPaintWorkletGlobalScope):
* dom/Document.h:
(WebCore::Document::paintWorkletGlobalScope): Deleted.
* rendering/style/RenderStyle.cpp:
(WebCore::changedCustomPaintWatchedProperty):
* worklets/Worklet.cpp:
(WebCore::Worklet::addModule):
* worklets/WorkletGlobalScope.cpp:
(WebCore::WorkletGlobalScope::prepareForDestruction):

LayoutTests:

* fast/css-custom-paint/animate-repaint-expected.txt:
* fast/css-custom-paint/animate-repaint.html:
* fast/css-custom-paint/delay-expected.html: Added.
* fast/css-custom-paint/delay-repaint-expected.txt: Copied from LayoutTests/fast/css-custom-paint/animate-repaint-expected.txt.
* fast/css-custom-paint/delay-repaint.html: Copied from LayoutTests/fast/css-custom-paint/animate-repaint.html.
* fast/css-custom-paint/delay.html: Copied from LayoutTests/fast/css-custom-paint/animate-repaint.html.
* fast/css-custom-paint/multiple-worklets-expected.html: Added.
* fast/css-custom-paint/multiple-worklets.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239067 268f45cc-cd09-0410-ab3c-d52691b4dbfc
19 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/css-custom-paint/animate-repaint-expected.txt
LayoutTests/fast/css-custom-paint/animate-repaint.html
LayoutTests/fast/css-custom-paint/delay-expected.html [new file with mode: 0644]
LayoutTests/fast/css-custom-paint/delay-repaint-expected.txt [new file with mode: 0644]
LayoutTests/fast/css-custom-paint/delay-repaint.html [new file with mode: 0644]
LayoutTests/fast/css-custom-paint/delay.html [new file with mode: 0644]
LayoutTests/fast/css-custom-paint/multiple-worklets-expected.html [new file with mode: 0644]
LayoutTests/fast/css-custom-paint/multiple-worklets-isolation-expected.html [new file with mode: 0644]
LayoutTests/fast/css-custom-paint/multiple-worklets-isolation.html [new file with mode: 0644]
LayoutTests/fast/css-custom-paint/multiple-worklets.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/CSSPaintImageValue.cpp
Source/WebCore/css/StyleResolver.cpp
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Document.h
Source/WebCore/rendering/style/RenderStyle.cpp
Source/WebCore/worklets/Worklet.cpp
Source/WebCore/worklets/WorkletGlobalScope.cpp