JSC bindings generator should generate deletable JSC functions
authorzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Nov 2013 08:33:35 +0000 (08:33 +0000)
committerzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Nov 2013 08:33:35 +0000 (08:33 +0000)
commitd2d6baf839adc8e58564459b2aacd6c6d5b0e753
treed6c4809686803b6571af401b266c29c11690d2a4
parent390a0c088192ccbc3ddc39c1348ebb0e896ee068
JSC bindings generator should generate deletable JSC functions
https://bugs.webkit.org/show_bug.cgi?id=122422

Reviewed by Geoffrey Garen.

Source/WebCore:

The JSC functions that the JSC bindings generator generates should be deletable to conform to
the WebIDL specification, which instructs that the WebIDL operations must be configurable (which
translates to the JSC functions being deletable).

The generator will still produce a non-deletable JSC function for operations under almost all
Web-facing interfaces since they're annotated with the OperationsNotDeletable attribute. The
exception here is the Node interface that is having the attribute removed, with the provided
test case testing that all the functions on the Node prototype object are writable, enumerable
and configurable. This behavior conforms to the WebIDL specification and the behaviors of IE
and Firefox. Chrome at the moment still provides non-configurable functions.

Test: fast/dom/webidl-operations-on-node-prototype.html

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation): Enforce the non-deletable behavior of the JSC function if either the
operation's interface is annotated with the OperationsNotDeletable attribute or the operation itself
is annotated with the NotDeletable attribute.
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: Update the JSC generator test baselines.
* bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp: Ditto.
* bindings/scripts/test/JS/JSTestEventTarget.cpp: Ditto.
* bindings/scripts/test/JS/JSTestInterface.cpp: Ditto.
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp: Ditto.
* bindings/scripts/test/JS/JSTestObj.cpp: Ditto.
* bindings/scripts/test/JS/JSTestTypedefs.cpp: Ditto.
* dom/Node.idl: Remove the OperationsNotDeletable attribute.

LayoutTests:

Test that all the functions on the Node prototype object (apart from the constructor) are
writable, enumerable and configurable, as expected for WebIDL operations. This matches the
WebIDL specification as well as IE and Firefox.

Other affected test cases and baselines are updated to reflect the new behavior.

* fast/dom/webidl-operations-on-node-prototype-expected.txt: Added.
* fast/dom/webidl-operations-on-node-prototype.html: Added.
* js/dom/getOwnPropertyDescriptor-expected.txt:
* js/resources/getOwnPropertyDescriptor.js:
* platform/mac/canvas/philip/tests/type.prototype-expected.txt: Removed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159100 268f45cc-cd09-0410-ab3c-d52691b4dbfc
15 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/dom/webidl-operations-on-node-prototype-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/webidl-operations-on-node-prototype.html [new file with mode: 0644]
LayoutTests/js/dom/getOwnPropertyDescriptor-expected.txt
LayoutTests/js/resources/getOwnPropertyDescriptor.js
LayoutTests/platform/mac/canvas/philip/tests/type.prototype-expected.txt [deleted file]
Source/WebCore/ChangeLog
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp