[V8] Improve Replaceable extended attribute
authorarv@chromium.org <arv@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Jul 2012 23:54:23 +0000 (23:54 +0000)
committerarv@chromium.org <arv@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Jul 2012 23:54:23 +0000 (23:54 +0000)
commit07eecd5861be967c282077c50cf3d7d63e9ab673
tree4e0803c8be565e444628623845d014cbd2263889
parent2e78f54413f05091e0573b9b5fe41901a3ebfefb
[V8] Improve Replaceable extended attribute
https://bugs.webkit.org/show_bug.cgi?id=91668

Reviewed by Adam Barth.

Replaceable is working by chance in the V8 bindings because V8 does not correctly handle
read only properties on the prototype chain. With this change we generate a setter that
uses ForceSet to replace the existing property when set.

Source/WebCore:

Test: fast/dom/Window/replaceable.html

* bindings/scripts/CodeGeneratorV8.pm:
(GenerateReplaceableAttrSetter):
(GenerateFunctionCallback):
(GenerateSingleBatchedAttribute):
(GenerateImplementation):
* bindings/scripts/test/CPP/WebDOMTestObj.cpp:
(WebDOMTestObj::replaceableAttribute):
* bindings/scripts/test/CPP/WebDOMTestObj.h:
* bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
(webkit_dom_test_obj_get_property):
(webkit_dom_test_obj_class_init):
(webkit_dom_test_obj_get_replaceable_attribute):
* bindings/scripts/test/GObject/WebKitDOMTestObj.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore):
(WebCore::jsTestObjReplaceableAttribute):
(WebCore::setJSTestObjReplaceableAttribute):
* bindings/scripts/test/JS/JSTestObj.h:
(WebCore):
* bindings/scripts/test/ObjC/DOMTestObj.h:
* bindings/scripts/test/ObjC/DOMTestObj.mm:
(-[DOMTestObj replaceableAttribute]):
(-[DOMTestObj setReplaceableAttribute:]):
* bindings/scripts/test/TestObj.idl:
* bindings/scripts/test/V8/V8TestObj.cpp:
(WebCore::TestObjV8Internal::replaceableAttributeAttrGetter):
(TestObjV8Internal):
(WebCore::TestObjV8Internal::TestObjReplaceableAttrSetter):
(WebCore):

LayoutTests:

* fast/dom/Window/replaceable-expected.txt: Added.
* fast/dom/Window/replaceable.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123047 268f45cc-cd09-0410-ab3c-d52691b4dbfc
15 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/dom/Window/replaceable-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/Window/replaceable.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp
Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h
Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp
Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h
Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestObj.h
Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h
Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm
Source/WebCore/bindings/scripts/test/TestObj.idl
Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp