Make DOM attributes appear to be faux accessor properties
authoroliver@apple.com <oliver@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 29 Jan 2014 20:33:13 +0000 (20:33 +0000)
committeroliver@apple.com <oliver@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 29 Jan 2014 20:33:13 +0000 (20:33 +0000)
commit3b909f44d3db5b29c947559c53486fa2bebac366
tree748d170b1ec73fdd96042a6e8740ee229ed19c8c
parent4a10fe38b24e581b491ff3a16ce01b440e5cf7b9
Make DOM attributes appear to be faux accessor properties
https://bugs.webkit.org/show_bug.cgi?id=127797

Reviewed by Michael Saboff.

Source/JavaScriptCore:

Add flag so we can identify which properties should have the old
custom property semantics vs. the new faux accessors. Update the
inspector protocol accordingly.

These faux accessors produce descriptors with "get" and "set"
properties, but both values are undefined so can't be used
directly. A few custom properties actually require their
existing magical behaviour, so we now have a flag to
distinguish the expected output.

* inspector/InjectedScriptSource.js:
(.):
* runtime/JSObject.cpp:
(JSC::JSObject::getOwnPropertyDescriptor):
* runtime/PropertyDescriptor.cpp:
(JSC::PropertyDescriptor::setCustomDescriptor):
* runtime/PropertyDescriptor.h:
* runtime/PropertySlot.h:

Source/WebCore:

Refactor the bindings generator, and make sure we emit
the CustomAccessor flag on properties that should
appear to be accessors.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateGetOwnPropertySlotBody):
(GenerateAttributesHashTable):
(GenerateImplementation):

LayoutTests:

These properties now show up as accessors in these tests

* fast/dom/Window/replaceable-expected.txt:
* fast/dom/Window/replaceable.html:
* js/dom/getOwnPropertyDescriptor-expected.txt:
* js/resources/getOwnPropertyDescriptor.js:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@163035 268f45cc-cd09-0410-ab3c-d52691b4dbfc
29 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/dom/Window/replaceable-expected.txt
LayoutTests/fast/dom/Window/replaceable.html
LayoutTests/js/dom/getOwnPropertyDescriptor-expected.txt
LayoutTests/js/resources/getOwnPropertyDescriptor.js
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/inspector/InjectedScriptSource.js
Source/JavaScriptCore/runtime/JSObject.cpp
Source/JavaScriptCore/runtime/PropertyDescriptor.cpp
Source/JavaScriptCore/runtime/PropertyDescriptor.h
Source/JavaScriptCore/runtime/PropertySlot.h
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/JSTestEventConstructor.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestException.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp
Source/WebCore/bindings/scripts/test/JS/JSattribute.cpp
Source/WebCore/bindings/scripts/test/JS/JSreadonly.cpp