Implement serializer = { attribute }
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 15 Oct 2016 21:15:17 +0000 (21:15 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 15 Oct 2016 21:15:17 +0000 (21:15 +0000)
commit8add3c47a22ef001eb48fbd5321737b304f04100
tree30ee9606cc575d16358c713158e4d200c8617db0
parent570379e459c4a876ce7212d8c0f4376784991ed9
Implement serializer = { attribute }
https://bugs.webkit.org/show_bug.cgi?id=163466

Reviewed by Darin Adler.

Fix the code generator to generate code for serializer = { attribute }.
In IDLParser, extend domSerializable with flags for the 'inherit', 'getter' and
'attribute' values (the first two are still unsupported). Fix parseSerializationPattern()
to detect these; it needs to create the domSerializable() now. Basic support
for isSerializableAttribute() is added (primitive types only).

GenerateSerializerFunction is fixed to output code for the serializable attributes
in the order specified in "serializer = {}", as specified in WebIDL.

Removed custom serialization for ClientRect and PerformanceTiming.

Other minor cleanup to always get $interfaceName from $interface->name, and to fix
ObjectConstructor.h to be included as <runtime/ObjectConstructor.h>.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/JSClientRectCustom.cpp: Removed.
* bindings/js/JSPerformanceTimingCustom.cpp: Removed.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
(GenerateSerializerFunction):
* bindings/scripts/IDLParser.pm:
(parseSerializerRest):
(parseSerializationPattern):
(parseSerializationAttributes):
(isSerializableAttribute):
(applyMemberList):
* bindings/scripts/test/JS/JSTestNode.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionToJSONCaller):
* bindings/scripts/test/JS/JSTestSerialization.cpp: Added.
* bindings/scripts/test/JS/JSTestSerialization.h: Added.
* bindings/scripts/test/TestObj.idl:
* bindings/scripts/test/TestSerialization.idl: Copied from Source/WebCore/dom/ClientRect.idl.
* dom/ClientRect.idl:
* page/PerformanceTiming.idl:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/js/JSBindingsAllInOne.cpp
Source/WebCore/bindings/js/JSClientRectCustom.cpp [deleted file]
Source/WebCore/bindings/js/JSPerformanceTimingCustom.cpp [deleted file]
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bindings/scripts/IDLParser.pm
Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestSerialization.cpp [new file with mode: 0644]
Source/WebCore/bindings/scripts/test/JS/JSTestSerialization.h [new file with mode: 0644]
Source/WebCore/bindings/scripts/test/TestObj.idl
Source/WebCore/bindings/scripts/test/TestSerialization.idl [new file with mode: 0644]
Source/WebCore/dom/ClientRect.idl
Source/WebCore/page/PerformanceTiming.idl