haikuwebkit/LayoutTests/fast/storage
Sam Weinig 5e20e1a236 Support serializing ImageData object colorSpace property in SerializedScriptValue
https://bugs.webkit.org/show_bug.cgi?id=225854

Reviewed by Chris Dumez.

Source/WebCore:

Test: storage/indexeddb/structured-clone-image-data-display-p3.html

Update SerializedScriptValue schema to version 8 and add serialization
of the colorSpace property.

* bindings/js/SerializedScriptValue.cpp:
(WebCore::PredefinedColorSpaceTag):
Add copy of the PredefinedColorSpace values that are guaranteed to
stay consistent forever.

(WebCore::CloneSerializer::dumpIfTerminal):
Add encoding of the colorSpace when serializing ImageData.

(WebCore::CloneSerializer::write):
(WebCore::CloneDeserializer::read):
Add coders for PredefinedColorSpaceTag.

(WebCore::CloneDeserializer::getJSValue):
Replace multiple overloads with one perfect forwarding overload which does
what we want and works with r-values.

(WebCore::CloneDeserializer::readImageBitmap):
Use auto in two places.

(WebCore::CloneDeserializer::readTerminal):
Add decoding of the colorSpace when deserializing ImageData. For prior versions,
the colorSpace defaults to sRGB, which was the only color space supported.

LayoutTests:

Updates existing tests for new serialization version (version 8) and support
for serializing color space in ImageData.

To avoid multiple result files due to lack of support for display-p3, testing
that the display-p3 color space is serialized correctly was put into its own
test that is skipped on non-supporting platforms.

* platform/glib/TestExpectations:
* platform/win/TestExpectations:
Skip structured-clone-image-data-display-p3.html on platforms that don't support
display-p3 color spaces.

* fast/storage/serialized-script-value.html:
Bump version to version 8.

* storage/indexeddb/resources/structured-clone.js:
* storage/indexeddb/structured-clone-expected.txt:
Add tests for ImageData colorSpace round tripping.

* storage/indexeddb/structured-clone-image-data-display-p3-expected.txt: Added.
* storage/indexeddb/structured-clone-image-data-display-p3.html: Added.
Add test for ImageData display-p3 colorSpace round tripping as its own test
to allow targetted skipping by non-supporting platforms.


Canonical link: https://commits.webkit.org/237802@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277574 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-16 22:00:30 +00:00
..
resources
serialized-script-value-expected.txt
serialized-script-value.html
storage-detached-iframe-expected.txt
storage-detached-iframe.html