Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Add WebIDL special operation support: serializer
https://bugs.webkit.org/show_bug.cgi?id=156293 Patch by Alejandro G. Castro <alex@igalia.com> on 2016-09-28 Reviewed by Youenn Fablet. Source/WebCore: Added support for the serializer special operation for WebIDLs, current implementation adds support for: - just the keyword: serializer; It will return all the attributes of in an object. - map of entries with the attributes: serializer = {attribute1, attribute2, ...} It creates a toJSON method that returns the serialized value converted into an ECMAScript value. For more information check the definition of the operation: http://heycam.github.io/webidl/#idl-serializers We have created a new function in the API of the objects that are marked as serializer. Used the support to add new API for RTCIceCandidate and RTCSessionDescription. Updated the tests expectations of the bindings. Tests: bindings/scripts/test/TestNode.idl bindings/scripts/test/TestObj.idl fast/mediastream/RTCIceCandidate.html fast/mediastream/RTCSessionDescription.html * Modules/mediastream/RTCIceCandidate.idl: Added the serializer operation. * Modules/mediastream/RTCSessionDescription.idl: Added the serializer operation. * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementation): Added the calls to the serializer code generator. (GenerateSerializerFunction): Added, generates the toJSON function adding all the serializable->attributes value to an object as defined in the spec. * bindings/scripts/IDLParser.pm: Modified the serializer parser that was unused to support the WebIDL spec parts. Added a new domSerializable type to store the list of attributes in the possible map. (parseSerializer): Modified the function to follow the semicolon rule in the spec, now the serializer line must have a semicolon like any other line. (parseSerializerRest): The function now has to get the attributes list from the pattern parsing function and add them to the domSerializable item. (parseSerializationPattern): Now this function returns the list of attributes in the serializable map or list if we have one. (parseSerializationAttributes): Added, this function replaces the Map and List functions, the currently supported parts are similar for both situations. (applyMemberList): Added the serializable item to the interface variable and populate the serializable in case there is not a defined map. (parseSerializationPatternMap): Replaced with parseSerializationAttributes. (parseSerializationPatternList): Ditto. * bindings/scripts/test/JS/JSTestNode.cpp: Modified the expected result. (WebCore::jsTestNodePrototypeFunctionToJSON): * bindings/scripts/test/JS/JSTestObj.cpp: Modified the expected result. (WebCore::jsTestObjPrototypeFunctionToJSON): * bindings/scripts/test/TestNode.idl: Added the serializer test. * bindings/scripts/test/TestObj.idl: Added serializer map test. LayoutTests: Verify the new API of the objects and check what happens when user modifies the values and types of the attributes, or adds a null value. * fast/mediastream/RTCIceCandidate-expected.txt: * fast/mediastream/RTCIceCandidate.html: * fast/mediastream/RTCSessionDescription-expected.txt: * fast/mediastream/RTCSessionDescription.html: Canonical link: https://commits.webkit.org/180612@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@206514 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
1 parent
042b94d
commit 0e26018d9f4785e6508ae963a1ede6927e3152a8
Showing
14 changed files
with
294 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.