Commit 6423d9fe authored by haraken@chromium.org's avatar haraken@chromium.org

Rename [HasOverridingNameGetter] attribute to [CustomNamedGetter] attribute

https://bugs.webkit.org/show_bug.cgi?id=78076

Reviewed by Adam Barth.

This patch renames the [HasOverridingNameGetter] attribute to the
[CustomNamedGetter] attribute, for naming consistency with [CustomNamedSetter].

Test: bindings/scripts/test/TestCustomNamedGetter.idl

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateGetOwnPropertySlotBody):
(GenerateGetOwnPropertyDescriptorBody):
(GenerateHeader):
(GenerateImplementation):
* bindings/scripts/CodeGeneratorV8.pm:
(GenerateHeaderNamedAndIndexedPropertyAccessors):
(GenerateImplementationNamedPropertyGetter):

* html/HTMLDocument.idl:
* html/HTMLFormElement.idl:
* html/HTMLFrameSetElement.idl:

* bindings/scripts/test/TestCustomNamedGetter.idl: Renamed from Source/WebCore/bindings/scripts/test/TestOverridingNameGetter.idl.

* bindings/scripts/test/CPP/WebDOMTestCustomNamedGetter.cpp: Updated run-bindings-tests results.
(WebDOMTestCustomNamedGetter::WebDOMTestCustomNamedGetterPrivate::WebDOMTestCustomNamedGetterPrivate):
(WebDOMTestCustomNamedGetter::WebDOMTestCustomNamedGetterPrivate):
(WebDOMTestCustomNamedGetter::WebDOMTestCustomNamedGetter):
(WebDOMTestCustomNamedGetter::operator=):
(WebDOMTestCustomNamedGetter::impl):
(WebDOMTestCustomNamedGetter::~WebDOMTestCustomNamedGetter):
(WebDOMTestCustomNamedGetter::anotherFunction):
(toWebCore):
(toWebKit):
* bindings/scripts/test/CPP/WebDOMTestCustomNamedGetter.h: Ditto.
(WebCore):
(WebDOMTestCustomNamedGetter):
* bindings/scripts/test/GObject/WebKitDOMTestCustomNamedGetter.cpp: Ditto.
(WebKit):
(WebKit::kit):
(webkit_dom_test_custom_named_getter_another_function):
(WebKit::core):
(webkit_dom_test_custom_named_getter_finalize):
(webkit_dom_test_custom_named_getter_set_property):
(webkit_dom_test_custom_named_getter_get_property):
(webkit_dom_test_custom_named_getter_constructed):
(webkit_dom_test_custom_named_getter_class_init):
(webkit_dom_test_custom_named_getter_init):
(WebKit::wrapTestCustomNamedGetter):
* bindings/scripts/test/GObject/WebKitDOMTestCustomNamedGetter.h: Ditto.
(_WebKitDOMTestCustomNamedGetter):
(_WebKitDOMTestCustomNamedGetterClass):
* bindings/scripts/test/GObject/WebKitDOMTestCustomNamedGetterPrivate.h: Ditto.
(WebKit):
* bindings/scripts/test/GObject/WebKitDOMTestOverridingNameGetter.h: Ditto.
* bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp: Ditto.
(WebCore):
(WebCore::JSTestCustomNamedGetterConstructor::JSTestCustomNamedGetterConstructor):
(WebCore::JSTestCustomNamedGetterConstructor::finishCreation):
(WebCore::JSTestCustomNamedGetterConstructor::getOwnPropertySlot):
(WebCore::JSTestCustomNamedGetterConstructor::getOwnPropertyDescriptor):
(WebCore::JSTestCustomNamedGetterPrototype::self):
(WebCore::JSTestCustomNamedGetterPrototype::getOwnPropertySlot):
(WebCore::JSTestCustomNamedGetterPrototype::getOwnPropertyDescriptor):
(WebCore::JSTestCustomNamedGetter::JSTestCustomNamedGetter):
(WebCore::JSTestCustomNamedGetter::finishCreation):
(WebCore::JSTestCustomNamedGetter::createPrototype):
(WebCore::JSTestCustomNamedGetter::destroy):
(WebCore::JSTestCustomNamedGetter::getOwnPropertySlot):
(WebCore::JSTestCustomNamedGetter::getOwnPropertyDescriptor):
(WebCore::jsTestCustomNamedGetterConstructor):
(WebCore::JSTestCustomNamedGetter::getConstructor):
(WebCore::jsTestCustomNamedGetterPrototypeFunctionAnotherFunction):
(WebCore::isObservable):
(WebCore::JSTestCustomNamedGetterOwner::isReachableFromOpaqueRoots):
(WebCore::JSTestCustomNamedGetterOwner::finalize):
(WebCore::toJS):
(WebCore::toTestCustomNamedGetter):
* bindings/scripts/test/JS/JSTestCustomNamedGetter.h: Ditto.
(WebCore):
(JSTestCustomNamedGetter):
(WebCore::JSTestCustomNamedGetter::create):
(WebCore::JSTestCustomNamedGetter::createStructure):
(WebCore::JSTestCustomNamedGetter::impl):
(WebCore::JSTestCustomNamedGetter::releaseImpl):
(WebCore::JSTestCustomNamedGetter::releaseImplIfNotNull):
(JSTestCustomNamedGetterOwner):
(WebCore::wrapperOwner):
(WebCore::wrapperContext):
(JSTestCustomNamedGetterPrototype):
(WebCore::JSTestCustomNamedGetterPrototype::create):
(WebCore::JSTestCustomNamedGetterPrototype::createStructure):
(WebCore::JSTestCustomNamedGetterPrototype::JSTestCustomNamedGetterPrototype):
(JSTestCustomNamedGetterConstructor):
(WebCore::JSTestCustomNamedGetterConstructor::create):
(WebCore::JSTestCustomNamedGetterConstructor::createStructure):
* bindings/scripts/test/JS/JSTestOverridingNameGetter.cpp:
* bindings/scripts/test/ObjC/DOMTestCustomNamedGetter.h: Ditto.
* bindings/scripts/test/ObjC/DOMTestCustomNamedGetter.mm: Ditto.
(-[DOMTestCustomNamedGetter dealloc]):
(-[DOMTestCustomNamedGetter finalize]):
(-[DOMTestCustomNamedGetter anotherFunction:]):
(core):
(kit):
* bindings/scripts/test/ObjC/DOMTestCustomNamedGetterInternal.h: Ditto.
(WebCore):
* bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp: Ditto.
(WebCore):
(TestCustomNamedGetterInternal):
(WebCore::TestCustomNamedGetterInternal::V8_USE):
(WebCore::TestCustomNamedGetterInternal::anotherFunctionCallback):
(WebCore::ConfigureV8TestCustomNamedGetterTemplate):
(WebCore::V8TestCustomNamedGetter::GetRawTemplate):
(WebCore::V8TestCustomNamedGetter::GetTemplate):
(WebCore::V8TestCustomNamedGetter::HasInstance):
(WebCore::V8TestCustomNamedGetter::wrapSlow):
(WebCore::V8TestCustomNamedGetter::derefObject):
* bindings/scripts/test/V8/V8TestCustomNamedGetter.h: Ditto.
(WebCore):
(V8TestCustomNamedGetter):
(WebCore::V8TestCustomNamedGetter::toNative):
(WebCore::V8TestCustomNamedGetter::existingWrapper):
(WebCore::V8TestCustomNamedGetter::wrap):
(WebCore::toV8):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107039 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 351bc646
2012-02-07 Kentaro Hara <haraken@chromium.org>
Rename [HasOverridingNameGetter] attribute to [CustomNamedGetter] attribute
https://bugs.webkit.org/show_bug.cgi?id=78076
Reviewed by Adam Barth.
This patch renames the [HasOverridingNameGetter] attribute to the
[CustomNamedGetter] attribute, for naming consistency with [CustomNamedSetter].
Test: bindings/scripts/test/TestCustomNamedGetter.idl
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateGetOwnPropertySlotBody):
(GenerateGetOwnPropertyDescriptorBody):
(GenerateHeader):
(GenerateImplementation):
* bindings/scripts/CodeGeneratorV8.pm:
(GenerateHeaderNamedAndIndexedPropertyAccessors):
(GenerateImplementationNamedPropertyGetter):
* html/HTMLDocument.idl:
* html/HTMLFormElement.idl:
* html/HTMLFrameSetElement.idl:
* bindings/scripts/test/TestCustomNamedGetter.idl: Renamed from Source/WebCore/bindings/scripts/test/TestOverridingNameGetter.idl.
* bindings/scripts/test/CPP/WebDOMTestCustomNamedGetter.cpp: Updated run-bindings-tests results.
(WebDOMTestCustomNamedGetter::WebDOMTestCustomNamedGetterPrivate::WebDOMTestCustomNamedGetterPrivate):
(WebDOMTestCustomNamedGetter::WebDOMTestCustomNamedGetterPrivate):
(WebDOMTestCustomNamedGetter::WebDOMTestCustomNamedGetter):
(WebDOMTestCustomNamedGetter::operator=):
(WebDOMTestCustomNamedGetter::impl):
(WebDOMTestCustomNamedGetter::~WebDOMTestCustomNamedGetter):
(WebDOMTestCustomNamedGetter::anotherFunction):
(toWebCore):
(toWebKit):
* bindings/scripts/test/CPP/WebDOMTestCustomNamedGetter.h: Ditto.
(WebCore):
(WebDOMTestCustomNamedGetter):
* bindings/scripts/test/GObject/WebKitDOMTestCustomNamedGetter.cpp: Ditto.
(WebKit):
(WebKit::kit):
(webkit_dom_test_custom_named_getter_another_function):
(WebKit::core):
(webkit_dom_test_custom_named_getter_finalize):
(webkit_dom_test_custom_named_getter_set_property):
(webkit_dom_test_custom_named_getter_get_property):
(webkit_dom_test_custom_named_getter_constructed):
(webkit_dom_test_custom_named_getter_class_init):
(webkit_dom_test_custom_named_getter_init):
(WebKit::wrapTestCustomNamedGetter):
* bindings/scripts/test/GObject/WebKitDOMTestCustomNamedGetter.h: Ditto.
(_WebKitDOMTestCustomNamedGetter):
(_WebKitDOMTestCustomNamedGetterClass):
* bindings/scripts/test/GObject/WebKitDOMTestCustomNamedGetterPrivate.h: Ditto.
(WebKit):
* bindings/scripts/test/GObject/WebKitDOMTestOverridingNameGetter.h: Ditto.
* bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp: Ditto.
(WebCore):
(WebCore::JSTestCustomNamedGetterConstructor::JSTestCustomNamedGetterConstructor):
(WebCore::JSTestCustomNamedGetterConstructor::finishCreation):
(WebCore::JSTestCustomNamedGetterConstructor::getOwnPropertySlot):
(WebCore::JSTestCustomNamedGetterConstructor::getOwnPropertyDescriptor):
(WebCore::JSTestCustomNamedGetterPrototype::self):
(WebCore::JSTestCustomNamedGetterPrototype::getOwnPropertySlot):
(WebCore::JSTestCustomNamedGetterPrototype::getOwnPropertyDescriptor):
(WebCore::JSTestCustomNamedGetter::JSTestCustomNamedGetter):
(WebCore::JSTestCustomNamedGetter::finishCreation):
(WebCore::JSTestCustomNamedGetter::createPrototype):
(WebCore::JSTestCustomNamedGetter::destroy):
(WebCore::JSTestCustomNamedGetter::getOwnPropertySlot):
(WebCore::JSTestCustomNamedGetter::getOwnPropertyDescriptor):
(WebCore::jsTestCustomNamedGetterConstructor):
(WebCore::JSTestCustomNamedGetter::getConstructor):
(WebCore::jsTestCustomNamedGetterPrototypeFunctionAnotherFunction):
(WebCore::isObservable):
(WebCore::JSTestCustomNamedGetterOwner::isReachableFromOpaqueRoots):
(WebCore::JSTestCustomNamedGetterOwner::finalize):
(WebCore::toJS):
(WebCore::toTestCustomNamedGetter):
* bindings/scripts/test/JS/JSTestCustomNamedGetter.h: Ditto.
(WebCore):
(JSTestCustomNamedGetter):
(WebCore::JSTestCustomNamedGetter::create):
(WebCore::JSTestCustomNamedGetter::createStructure):
(WebCore::JSTestCustomNamedGetter::impl):
(WebCore::JSTestCustomNamedGetter::releaseImpl):
(WebCore::JSTestCustomNamedGetter::releaseImplIfNotNull):
(JSTestCustomNamedGetterOwner):
(WebCore::wrapperOwner):
(WebCore::wrapperContext):
(JSTestCustomNamedGetterPrototype):
(WebCore::JSTestCustomNamedGetterPrototype::create):
(WebCore::JSTestCustomNamedGetterPrototype::createStructure):
(WebCore::JSTestCustomNamedGetterPrototype::JSTestCustomNamedGetterPrototype):
(JSTestCustomNamedGetterConstructor):
(WebCore::JSTestCustomNamedGetterConstructor::create):
(WebCore::JSTestCustomNamedGetterConstructor::createStructure):
* bindings/scripts/test/JS/JSTestOverridingNameGetter.cpp:
* bindings/scripts/test/ObjC/DOMTestCustomNamedGetter.h: Ditto.
* bindings/scripts/test/ObjC/DOMTestCustomNamedGetter.mm: Ditto.
(-[DOMTestCustomNamedGetter dealloc]):
(-[DOMTestCustomNamedGetter finalize]):
(-[DOMTestCustomNamedGetter anotherFunction:]):
(core):
(kit):
* bindings/scripts/test/ObjC/DOMTestCustomNamedGetterInternal.h: Ditto.
(WebCore):
* bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp: Ditto.
(WebCore):
(TestCustomNamedGetterInternal):
(WebCore::TestCustomNamedGetterInternal::V8_USE):
(WebCore::TestCustomNamedGetterInternal::anotherFunctionCallback):
(WebCore::ConfigureV8TestCustomNamedGetterTemplate):
(WebCore::V8TestCustomNamedGetter::GetRawTemplate):
(WebCore::V8TestCustomNamedGetter::GetTemplate):
(WebCore::V8TestCustomNamedGetter::HasInstance):
(WebCore::V8TestCustomNamedGetter::wrapSlow):
(WebCore::V8TestCustomNamedGetter::derefObject):
* bindings/scripts/test/V8/V8TestCustomNamedGetter.h: Ditto.
(WebCore):
(V8TestCustomNamedGetter):
(WebCore::V8TestCustomNamedGetter::toNative):
(WebCore::V8TestCustomNamedGetter::existingWrapper):
(WebCore::V8TestCustomNamedGetter::wrap):
(WebCore::toV8):
2012-02-07 Emil A Eklund <eae@chromium.org>
Revert TableSection cell and border calculations to integers
......@@ -429,7 +429,7 @@ sub GenerateGetOwnPropertySlotBody
}
};
if (!$dataNode->extendedAttributes->{"HasOverridingNameGetter"}) {
if (!$dataNode->extendedAttributes->{"CustomNamedGetter"}) {
&$manualLookupGetterGeneration();
}
......@@ -453,7 +453,7 @@ sub GenerateGetOwnPropertySlotBody
push(@getOwnPropertySlotImpl, " }\n");
}
if ($dataNode->extendedAttributes->{"NamedGetter"} || $dataNode->extendedAttributes->{"HasOverridingNameGetter"}) {
if ($dataNode->extendedAttributes->{"NamedGetter"} || $dataNode->extendedAttributes->{"CustomNamedGetter"}) {
push(@getOwnPropertySlotImpl, " if (canGetItemsForName(exec, static_cast<$implClassName*>(thisObject->impl()), propertyName)) {\n");
push(@getOwnPropertySlotImpl, " slot.setCustom(thisObject, thisObject->nameGetter);\n");
push(@getOwnPropertySlotImpl, " return true;\n");
......@@ -465,7 +465,7 @@ sub GenerateGetOwnPropertySlotBody
}
}
if ($dataNode->extendedAttributes->{"HasOverridingNameGetter"}) {
if ($dataNode->extendedAttributes->{"CustomNamedGetter"}) {
&$manualLookupGetterGeneration();
}
......@@ -522,11 +522,11 @@ sub GenerateGetOwnPropertyDescriptorBody
push(@getOwnPropertyDescriptorImpl, " }\n");
}
};
if (!$dataNode->extendedAttributes->{"HasOverridingNameGetter"}) {
if (!$dataNode->extendedAttributes->{"CustomNamedGetter"}) {
&$manualLookupGetterGeneration();
}
if ($dataNode->extendedAttributes->{"IndexedGetter"} || $dataNode->extendedAttributes->{"HasNumericIndexGetter"}) {
push(@getOwnPropertyDescriptorImpl, " bool ok;\n");
push(@getOwnPropertyDescriptorImpl, " unsigned index = propertyName.toUInt32(ok);\n");
......@@ -551,8 +551,8 @@ sub GenerateGetOwnPropertyDescriptorBody
push(@getOwnPropertyDescriptorImpl, " return true;\n");
push(@getOwnPropertyDescriptorImpl, " }\n");
}
if ($dataNode->extendedAttributes->{"NamedGetter"} || $dataNode->extendedAttributes->{"HasOverridingNameGetter"}) {
if ($dataNode->extendedAttributes->{"NamedGetter"} || $dataNode->extendedAttributes->{"CustomNamedGetter"}) {
push(@getOwnPropertyDescriptorImpl, " if (canGetItemsForName(exec, static_cast<$implClassName*>(thisObject->impl()), propertyName)) {\n");
push(@getOwnPropertyDescriptorImpl, " ${namespaceMaybe}PropertySlot slot;\n");
push(@getOwnPropertyDescriptorImpl, " slot.setCustom(thisObject, nameGetter);\n");
......@@ -565,16 +565,16 @@ sub GenerateGetOwnPropertyDescriptorBody
$implIncludes{"wtf/text/AtomicString.h"} = 1;
}
}
if ($dataNode->extendedAttributes->{"HasOverridingNameGetter"}) {
if ($dataNode->extendedAttributes->{"CustomNamedGetter"}) {
&$manualLookupGetterGeneration();
}
if ($dataNode->extendedAttributes->{"DelegatingGetOwnPropertySlot"}) {
push(@getOwnPropertyDescriptorImpl, " if (thisObject->getOwnPropertyDescriptorDelegate(exec, propertyName, descriptor))\n");
push(@getOwnPropertyDescriptorImpl, " return true;\n");
}
if ($hasAttributes) {
if ($inlined) {
die "Cannot inline if NoStaticTables is set." if ($dataNode->extendedAttributes->{"JSNoStaticTables"});
......@@ -753,20 +753,20 @@ sub GenerateHeader
$implIncludes{"${className}Custom.h"} = 1 if !$dataNode->extendedAttributes->{"CustomHeader"} && ($dataNode->extendedAttributes->{"CustomPutFunction"} || $dataNode->extendedAttributes->{"DelegatingPutFunction"});
my $hasGetter = $numAttributes > 0
my $hasGetter = $numAttributes > 0
|| !$dataNode->extendedAttributes->{"OmitConstructor"}
|| $dataNode->extendedAttributes->{"IndexedGetter"}
|| $dataNode->extendedAttributes->{"HasNumericIndexGetter"}
|| $dataNode->extendedAttributes->{"CustomGetOwnPropertySlot"}
|| $dataNode->extendedAttributes->{"DelegatingGetOwnPropertySlot"}
|| $dataNode->extendedAttributes->{"NamedGetter"}
|| $dataNode->extendedAttributes->{"HasOverridingNameGetter"};
|| $dataNode->extendedAttributes->{"CustomNamedGetter"};
# Getters
if ($hasGetter) {
push(@headerContent, " static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);\n");
push(@headerContent, " static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);\n");
push(@headerContent, " static bool getOwnPropertySlotByIndex(JSC::JSCell*, JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&);\n") if ($dataNode->extendedAttributes->{"IndexedGetter"} || $dataNode->extendedAttributes->{"HasNumericIndexGetter"}) && !$dataNode->extendedAttributes->{"HasOverridingNameGetter"};
push(@headerContent, " static bool getOwnPropertySlotByIndex(JSC::JSCell*, JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&);\n") if ($dataNode->extendedAttributes->{"IndexedGetter"} || $dataNode->extendedAttributes->{"HasNumericIndexGetter"}) && !$dataNode->extendedAttributes->{"CustomNamedGetter"};
push(@headerContent, " bool getOwnPropertySlotDelegate(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);\n") if $dataNode->extendedAttributes->{"DelegatingGetOwnPropertySlot"};
push(@headerContent, " bool getOwnPropertyDescriptorDelegate(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);\n") if $dataNode->extendedAttributes->{"DelegatingGetOwnPropertySlot"};
$structureFlags{"JSC::OverridesGetOwnPropertySlot"} = 1;
......@@ -951,13 +951,13 @@ sub GenerateHeader
push(@headerContent, " JSC::JSValue getByIndex(JSC::ExecState*, unsigned index);\n");
}
# Index setter
if ($dataNode->extendedAttributes->{"CustomIndexedSetter"}) {
push(@headerContent, " void indexSetter(JSC::ExecState*, unsigned index, JSC::JSValue);\n");
}
# Name getter
if ($dataNode->extendedAttributes->{"NamedGetter"} || $dataNode->extendedAttributes->{"HasOverridingNameGetter"}) {
if ($dataNode->extendedAttributes->{"NamedGetter"} || $dataNode->extendedAttributes->{"CustomNamedGetter"}) {
push(@headerContent, "private:\n");
push(@headerContent, " static bool canGetItemsForName(JSC::ExecState*, $implClassName*, const JSC::Identifier&);\n");
push(@headerContent, " static JSC::JSValue nameGetter(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);\n");
......@@ -1620,14 +1620,14 @@ sub GenerateImplementation
push(@implContent, "}\n\n");
}
my $hasGetter = $numAttributes > 0
my $hasGetter = $numAttributes > 0
|| !$dataNode->extendedAttributes->{"OmitConstructor"}
|| $dataNode->extendedAttributes->{"IndexedGetter"}
|| $dataNode->extendedAttributes->{"HasNumericIndexGetter"}
|| $dataNode->extendedAttributes->{"DelegatingGetOwnPropertySlot"}
|| $dataNode->extendedAttributes->{"CustomGetOwnPropertySlot"}
|| $dataNode->extendedAttributes->{"NamedGetter"}
|| $dataNode->extendedAttributes->{"HasOverridingNameGetter"};
|| $dataNode->extendedAttributes->{"CustomNamedGetter"};
# Attributes
if ($hasGetter) {
......@@ -1646,8 +1646,8 @@ sub GenerateImplementation
push(@implContent, "}\n\n");
}
if (($dataNode->extendedAttributes->{"IndexedGetter"} || $dataNode->extendedAttributes->{"HasNumericIndexGetter"})
&& !$dataNode->extendedAttributes->{"HasOverridingNameGetter"}) {
if (($dataNode->extendedAttributes->{"IndexedGetter"} || $dataNode->extendedAttributes->{"HasNumericIndexGetter"})
&& !$dataNode->extendedAttributes->{"CustomNamedGetter"}) {
push(@implContent, "bool ${className}::getOwnPropertySlotByIndex(JSCell* cell, ExecState* exec, unsigned propertyName, PropertySlot& slot)\n");
push(@implContent, "{\n");
push(@implContent, " ${className}* thisObject = jsCast<${className}*>(cell);\n");
......
......@@ -565,7 +565,7 @@ sub GenerateHeaderNamedAndIndexedPropertyAccessors
my $interfaceName = $dataNode->name;
my $hasCustomIndexedGetter = $dataNode->extendedAttributes->{"IndexedGetter"} || $dataNode->extendedAttributes->{"CustomGetOwnPropertySlot"};
my $hasCustomIndexedSetter = $dataNode->extendedAttributes->{"CustomIndexedSetter"} && !$dataNode->extendedAttributes->{"HasNumericIndexGetter"};
my $hasCustomNamedGetter = $dataNode->extendedAttributes->{"NamedGetter"} || $dataNode->extendedAttributes->{"HasOverridingNameGetter"} || $dataNode->extendedAttributes->{"CustomGetOwnPropertySlot"};
my $hasCustomNamedGetter = $dataNode->extendedAttributes->{"NamedGetter"} || $dataNode->extendedAttributes->{"CustomNamedGetter"} || $dataNode->extendedAttributes->{"CustomGetOwnPropertySlot"};
my $hasCustomNamedSetter = $dataNode->extendedAttributes->{"DelegatingPutFunction"};
my $hasCustomDeleters = $dataNode->extendedAttributes->{"CustomDeleteProperty"};
my $hasCustomEnumerator = $dataNode->extendedAttributes->{"CustomGetPropertyNames"};
......@@ -2133,24 +2133,24 @@ sub GenerateImplementationNamedPropertyGetter
my $dataNode = shift;
my $namedPropertyGetter = shift;
my $interfaceName = $dataNode->name;
my $hasCustomGetter = $dataNode->extendedAttributes->{"HasOverridingNameGetter"} || $dataNode->extendedAttributes->{"CustomGetOwnPropertySlot"};
my $hasCustomNamedGetter = $dataNode->extendedAttributes->{"CustomNamedGetter"} || $dataNode->extendedAttributes->{"CustomGetOwnPropertySlot"};
# FIXME: Remove hard-coded HTMLOptionsCollection reference by changing HTMLOptionsCollection to not inherit
# from HTMLCollection per W3C spec (http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html#HTMLOptionsCollection).
if ($interfaceName eq "HTMLOptionsCollection") {
$interfaceName = "HTMLCollection";
$hasCustomGetter = 1;
$hasCustomNamedGetter = 1;
}
if ($interfaceName eq "HTMLAppletElement" || $interfaceName eq "HTMLEmbedElement" || $interfaceName eq "HTMLObjectElement") {
$hasCustomGetter = 1;
$hasCustomNamedGetter = 1;
}
if ($interfaceName eq "HTMLDocument") {
$hasCustomGetter = 0;
$hasCustomNamedGetter = 0;
}
my $hasGetter = $dataNode->extendedAttributes->{"NamedGetter"} || $hasCustomGetter;
my $hasGetter = $dataNode->extendedAttributes->{"NamedGetter"} || $hasCustomNamedGetter;
if (!$hasGetter) {
return;
}
......@@ -2159,7 +2159,7 @@ sub GenerateImplementationNamedPropertyGetter
$namedPropertyGetter = $codeGenerator->FindSuperMethod($dataNode, "namedItem");
}
if ($namedPropertyGetter && $namedPropertyGetter->type ne "Node" && !$namedPropertyGetter->extendedAttributes->{"Custom"} && !$hasCustomGetter) {
if ($namedPropertyGetter && $namedPropertyGetter->type ne "Node" && !$namedPropertyGetter->extendedAttributes->{"Custom"} && !$hasCustomNamedGetter) {
AddToImplIncludes("V8Collection.h");
my $type = $namedPropertyGetter->type;
push(@implContent, <<END);
......
......@@ -19,62 +19,62 @@
*/
#include "config.h"
#include "WebDOMTestOverridingNameGetter.h"
#include "WebDOMTestCustomNamedGetter.h"
#include "KURL.h"
#include "TestOverridingNameGetter.h"
#include "TestCustomNamedGetter.h"
#include "WebDOMString.h"
#include "WebExceptionHandler.h"
#include "wtf/text/AtomicString.h"
#include <wtf/GetPtr.h>
#include <wtf/RefPtr.h>
struct WebDOMTestOverridingNameGetter::WebDOMTestOverridingNameGetterPrivate {
WebDOMTestOverridingNameGetterPrivate(WebCore::TestOverridingNameGetter* object = 0)
struct WebDOMTestCustomNamedGetter::WebDOMTestCustomNamedGetterPrivate {
WebDOMTestCustomNamedGetterPrivate(WebCore::TestCustomNamedGetter* object = 0)
: impl(object)
{
}
RefPtr<WebCore::TestOverridingNameGetter> impl;
RefPtr<WebCore::TestCustomNamedGetter> impl;
};
WebDOMTestOverridingNameGetter::WebDOMTestOverridingNameGetter()
WebDOMTestCustomNamedGetter::WebDOMTestCustomNamedGetter()
: WebDOMObject()
, m_impl(0)
{
}
WebDOMTestOverridingNameGetter::WebDOMTestOverridingNameGetter(WebCore::TestOverridingNameGetter* impl)
WebDOMTestCustomNamedGetter::WebDOMTestCustomNamedGetter(WebCore::TestCustomNamedGetter* impl)
: WebDOMObject()
, m_impl(new WebDOMTestOverridingNameGetterPrivate(impl))
, m_impl(new WebDOMTestCustomNamedGetterPrivate(impl))
{
}
WebDOMTestOverridingNameGetter::WebDOMTestOverridingNameGetter(const WebDOMTestOverridingNameGetter& copy)
WebDOMTestCustomNamedGetter::WebDOMTestCustomNamedGetter(const WebDOMTestCustomNamedGetter& copy)
: WebDOMObject()
{
m_impl = copy.impl() ? new WebDOMTestOverridingNameGetterPrivate(copy.impl()) : 0;
m_impl = copy.impl() ? new WebDOMTestCustomNamedGetterPrivate(copy.impl()) : 0;
}
WebDOMTestOverridingNameGetter& WebDOMTestOverridingNameGetter::operator=(const WebDOMTestOverridingNameGetter& copy)
WebDOMTestCustomNamedGetter& WebDOMTestCustomNamedGetter::operator=(const WebDOMTestCustomNamedGetter& copy)
{
delete m_impl;
m_impl = copy.impl() ? new WebDOMTestOverridingNameGetterPrivate(copy.impl()) : 0;
m_impl = copy.impl() ? new WebDOMTestCustomNamedGetterPrivate(copy.impl()) : 0;
return *this;
}
WebCore::TestOverridingNameGetter* WebDOMTestOverridingNameGetter::impl() const
WebCore::TestCustomNamedGetter* WebDOMTestCustomNamedGetter::impl() const
{
return m_impl ? WTF::getPtr(m_impl->impl) : 0;
}
WebDOMTestOverridingNameGetter::~WebDOMTestOverridingNameGetter()
WebDOMTestCustomNamedGetter::~WebDOMTestCustomNamedGetter()
{
delete m_impl;
m_impl = 0;
}
void WebDOMTestOverridingNameGetter::anotherFunction(const WebDOMString& str)
void WebDOMTestCustomNamedGetter::anotherFunction(const WebDOMString& str)
{
if (!impl())
return;
......@@ -82,12 +82,12 @@ void WebDOMTestOverridingNameGetter::anotherFunction(const WebDOMString& str)
impl()->anotherFunction(str);
}
WebCore::TestOverridingNameGetter* toWebCore(const WebDOMTestOverridingNameGetter& wrapper)
WebCore::TestCustomNamedGetter* toWebCore(const WebDOMTestCustomNamedGetter& wrapper)
{
return wrapper.impl();
}
WebDOMTestOverridingNameGetter toWebKit(WebCore::TestOverridingNameGetter* value)
WebDOMTestCustomNamedGetter toWebKit(WebCore::TestCustomNamedGetter* value)
{
return WebDOMTestOverridingNameGetter(value);
return WebDOMTestCustomNamedGetter(value);
}
......@@ -20,35 +20,35 @@
* Boston, MA 02110-1301, USA.
*/
#ifndef WebDOMTestOverridingNameGetter_h
#define WebDOMTestOverridingNameGetter_h
#ifndef WebDOMTestCustomNamedGetter_h
#define WebDOMTestCustomNamedGetter_h
#include <WebDOMObject.h>
#include <WebDOMString.h>
namespace WebCore {
class TestOverridingNameGetter;
class TestCustomNamedGetter;
};
class WebDOMTestOverridingNameGetter : public WebDOMObject {
class WebDOMTestCustomNamedGetter : public WebDOMObject {
public:
WebDOMTestOverridingNameGetter();
explicit WebDOMTestOverridingNameGetter(WebCore::TestOverridingNameGetter*);
WebDOMTestOverridingNameGetter(const WebDOMTestOverridingNameGetter&);
WebDOMTestOverridingNameGetter& operator=(const WebDOMTestOverridingNameGetter&);
virtual ~WebDOMTestOverridingNameGetter();
WebDOMTestCustomNamedGetter();
explicit WebDOMTestCustomNamedGetter(WebCore::TestCustomNamedGetter*);
WebDOMTestCustomNamedGetter(const WebDOMTestCustomNamedGetter&);
WebDOMTestCustomNamedGetter& operator=(const WebDOMTestCustomNamedGetter&);
virtual ~WebDOMTestCustomNamedGetter();
void anotherFunction(const WebDOMString& str);
WebCore::TestOverridingNameGetter* impl() const;
WebCore::TestCustomNamedGetter* impl() const;
protected:
struct WebDOMTestOverridingNameGetterPrivate;
WebDOMTestOverridingNameGetterPrivate* m_impl;
struct WebDOMTestCustomNamedGetterPrivate;
WebDOMTestCustomNamedGetterPrivate* m_impl;
};
WebCore::TestOverridingNameGetter* toWebCore(const WebDOMTestOverridingNameGetter&);
WebDOMTestOverridingNameGetter toWebKit(WebCore::TestOverridingNameGetter*);
WebCore::TestCustomNamedGetter* toWebCore(const WebDOMTestCustomNamedGetter&);
WebDOMTestCustomNamedGetter toWebKit(WebCore::TestCustomNamedGetter*);
#endif
......@@ -26,50 +26,50 @@
#include "DOMObjectCache.h"
#include "ExceptionCode.h"
#include "JSMainThreadExecState.h"
#include "TestOverridingNameGetter.h"
#include "TestCustomNamedGetter.h"
#include "WebKitDOMBinding.h"
#include "gobject/ConvertToUTF8String.h"
#include "webkit/WebKitDOMTestOverridingNameGetter.h"
#include "webkit/WebKitDOMTestOverridingNameGetterPrivate.h"
#include "webkit/WebKitDOMTestCustomNamedGetter.h"
#include "webkit/WebKitDOMTestCustomNamedGetterPrivate.h"
#include "webkitdefines.h"
#include "webkitglobalsprivate.h"
#include "webkitmarshal.h"
namespace WebKit {
WebKitDOMTestOverridingNameGetter* kit(WebCore::TestOverridingNameGetter* obj)
WebKitDOMTestCustomNamedGetter* kit(WebCore::TestCustomNamedGetter* obj)
{
g_return_val_if_fail(obj, 0);
if (gpointer ret = DOMObjectCache::get(obj))
return static_cast<WebKitDOMTestOverridingNameGetter*>(ret);
return static_cast<WebKitDOMTestCustomNamedGetter*>(ret);
return static_cast<WebKitDOMTestOverridingNameGetter*>(DOMObjectCache::put(obj, WebKit::wrapTestOverridingNameGetter(obj)));
return static_cast<WebKitDOMTestCustomNamedGetter*>(DOMObjectCache::put(obj, WebKit::wrapTestCustomNamedGetter(obj)));
}
} // namespace WebKit //
void
webkit_dom_test_overriding_name_getter_another_function(WebKitDOMTestOverridingNameGetter* self, const gchar* str)
webkit_dom_test_custom_named_getter_another_function(WebKitDOMTestCustomNamedGetter* self, const gchar* str)
{
g_return_if_fail(self);
WebCore::JSMainThreadNullState state;
WebCore::TestOverridingNameGetter * item = WebKit::core(self);
WebCore::TestCustomNamedGetter * item = WebKit::core(self);
g_return_if_fail(str);
WTF::String converted_str = WTF::String::fromUTF8(str);
item->anotherFunction(converted_str);
}
G_DEFINE_TYPE(WebKitDOMTestOverridingNameGetter, webkit_dom_test_overriding_name_getter, WEBKIT_TYPE_DOM_OBJECT)
G_DEFINE_TYPE(WebKitDOMTestCustomNamedGetter, webkit_dom_test_custom_named_getter, WEBKIT_TYPE_DOM_OBJECT)
namespace WebKit {
WebCore::TestOverridingNameGetter* core(WebKitDOMTestOverridingNameGetter* request)
WebCore::TestCustomNamedGetter* core(WebKitDOMTestCustomNamedGetter* request)
{
g_return_val_if_fail(request, 0);
WebCore::TestOverridingNameGetter* coreObject = static_cast<WebCore::TestOverridingNameGetter*>(WEBKIT_DOM_OBJECT(request)->coreObject);
WebCore::TestCustomNamedGetter* coreObject = static_cast<WebCore::TestCustomNamedGetter*>(WEBKIT_DOM_OBJECT(request)->coreObject);
g_return_val_if_fail(coreObject, 0);
return coreObject;
......@@ -81,12 +81,12 @@ enum {
};
static void webkit_dom_test_overriding_name_getter_finalize(GObject* object)
static void webkit_dom_test_custom_named_getter_finalize(GObject* object)
{
WebKitDOMObject* dom_object = WEBKIT_DOM_OBJECT(object);
if (dom_object->coreObject) {
WebCore::TestOverridingNameGetter* coreObject = static_cast<WebCore::TestOverridingNameGetter *>(dom_object->coreObject);
WebCore::TestCustomNamedGetter* coreObject = static_cast<WebCore::TestCustomNamedGetter *>(dom_object->coreObject);
WebKit::DOMObjectCache::forget(coreObject);
coreObject->deref();
......@@ -94,10 +94,10 @@ static void webkit_dom_test_overriding_name_getter_finalize(GObject* object)
dom_object->coreObject = NULL;
}
G_OBJECT_CLASS(webkit_dom_test_overriding_name_getter_parent_class)->finalize(object);
G_OBJECT_CLASS(webkit_dom_test_custom_named_getter_parent_class)->finalize(object);
}
static void webkit_dom_test_overriding_name_getter_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec)
static void webkit_dom_test_custom_named_getter_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec)
{
WebCore::JSMainThreadNullState state;
switch (prop_id) {
......@@ -108,7 +108,7 @@ static void webkit_dom_test_overriding_name_getter_set_property(GObject* object,
}
static void webkit_dom_test_overriding_name_getter_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec)
static void webkit_dom_test_custom_named_getter_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec)
{
WebCore::JSMainThreadNullState state;
switch (prop_id) {
......@@ -119,31 +119,31 @@ static void webkit_dom_test_overriding_name_getter_get_property(GObject* object,
}
static void webkit_dom_test_overriding_name_getter_constructed(GObject* object)
static void webkit_dom_test_custom_named_getter_constructed(GObject* object)
{
if (G_OBJECT_CLASS(webkit_dom_test_overriding_name_getter_parent_class)->constructed)
G_OBJECT_CLASS(webkit_dom_test_overriding_name_getter_parent_class)->constructed(object);
if (G_OBJECT_CLASS(webkit_dom_test_custom_named_getter_parent_class)->constructed)
G_OBJECT_CLASS(webkit_dom_test_custom_named_getter_parent_class)->constructed(object);
}
static void webkit_dom_test_overriding_name_getter_class_init(WebKitDOMTestOverridingNameGetterClass* requestClass)
static void webkit_dom_test_custom_named_getter_class_init(WebKitDOMTestCustomNamedGetterClass* requestClass)
{
GObjectClass *gobjectClass = G_OBJECT_CLASS(requestClass);
gobjectClass->finalize = webkit_dom_test_overriding_name_getter_finalize;
gobjectClass->set_property = webkit_dom_test_overriding_name_getter_set_property;
gobjectClass->get_property = webkit_dom_test_overriding_name_getter_get_property;
gobjectClass->constructed = webkit_dom_test_overriding_name_getter_constructed;
gobjectClass->finalize = webkit_dom_test_custom_named_getter_finalize;
gobjectClass->set_property = webkit_dom_test_custom_named_getter_set_property;
gobjectClass->get_property = webkit_dom_test_custom_named_getter_get_property;
gobjectClass->constructed = webkit_dom_test_custom_named_getter_constructed;
}
static void webkit_dom_test_overriding_name_getter_init(WebKitDOMTestOverridingNameGetter* request)
static void webkit_dom_test_custom_named_getter_init(WebKitDOMTestCustomNamedGetter* request)
{
}
namespace WebKit {
WebKitDOMTestOverridingNameGetter* wrapTestOverridingNameGetter(WebCore::TestOverridingNameGetter* coreObject)
WebKitDOMTestCustomNamedGetter* wrapTestCustomNamedGetter(WebCore::TestCustomNamedGetter* coreObject)
{