[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.17-1283-gcf603cf
dglazkov at chromium.org
dglazkov at chromium.org
Tue Jan 5 23:51:28 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit 0db895d16b172cb6366f922fcdb1f66640bba575
Author: dglazkov at chromium.org <dglazkov at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Dec 17 00:03:49 2009 +0000
2009-12-16 Dimitri Glazkov <dglazkov at chromium.org>
Reviewed by David Levin.
https://bugs.webkit.org/show_bug.cgi?id=32637
[V8] Generate most named property getters.
Covered by existing tests.
* bindings/scripts/CodeGeneratorV8.pm: Added generation of SetNamedPropertyHandler call.
* bindings/v8/V8DOMWrapper.cpp:
(WebCore::V8DOMWrapper::getTemplate): Removed now-generated SetNamedPropertyHandler callsites.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52224 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 1968a1d..e1f3bdd 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2009-12-16 Dimitri Glazkov <dglazkov at chromium.org>
+
+ Reviewed by David Levin.
+
+ https://bugs.webkit.org/show_bug.cgi?id=32637
+ [V8] Generate most named property getters.
+
+ Covered by existing tests.
+
+ * bindings/scripts/CodeGeneratorV8.pm: Added generation of SetNamedPropertyHandler call.
+ * bindings/v8/V8DOMWrapper.cpp:
+ (WebCore::V8DOMWrapper::getTemplate): Removed now-generated SetNamedPropertyHandler callsites.
+
2009-12-16 Luiz Agostini <luiz.agostini at openbossa.org>
Reviewed by Kenneth Rohde Christiansen.
diff --git a/WebCore/bindings/scripts/CodeGeneratorV8.pm b/WebCore/bindings/scripts/CodeGeneratorV8.pm
index 5961946..7507fcb 100644
--- a/WebCore/bindings/scripts/CodeGeneratorV8.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorV8.pm
@@ -1164,14 +1164,31 @@ sub GenerateImplementationNamedPropertyGetter
my $namedPropertyGetter = shift;
my $interfaceName = $dataNode->name;
- if ($dataNode->extendedAttributes->{"HasNameGetter"} && !$namedPropertyGetter->extendedAttributes->{"Custom"}) {
+ my $hasGetter = $dataNode->extendedAttributes->{"HasNameGetter"} || $namedPropertyGetter;
+ if (!$hasGetter) {
+ return;
+ }
+
+ if ($namedPropertyGetter && $namedPropertyGetter->type ne "Node" && !$namedPropertyGetter->extendedAttributes->{"Custom"}) {
$implIncludes{"V8Collection.h"} = 1;
my $type = $namedPropertyGetter->type;
my $classIndex = uc($type);
push(@implContent, <<END);
setCollectionNamedGetter<${interfaceName}, ${type}>(desc, V8ClassIndex::${classIndex});
END
+ return;
}
+
+ my $hasSetter = $dataNode->extendedAttributes->{"DelegatingPutFunction"};
+ my $hasDeleter = $dataNode->extendedAttributes->{"CustomDeleteProperty"};
+ my $hasEnumerator = $dataNode->extendedAttributes->{"CustomGetPropertyNames"};
+
+ push(@implContent, " desc->InstanceTemplate()->SetNamedPropertyHandler(V8Custom::v8${interfaceName}NamedPropertyGetter, ");
+ push(@implContent, $hasSetter ? "V8Custom::v8${interfaceName}NamedPropertySetter, " : "0, ");
+ push(@implContent, "0 ,"); # NamedPropertyQuery -- not being used at the moment.
+ push(@implContent, $hasDeleter ? "V8Custom::v8${interfaceName}NamedPropertyDeleter, " : "0, ");
+ push(@implContent, $hasEnumerator ? "V8Custom::v8${interfaceName}NamedPropertyEnumerator" : "0");
+ push(@implContent, ");\n");
}
sub GenerateImplementation
@@ -1467,7 +1484,7 @@ END
}
GenerateImplementationIndexer($dataNode, $indexer) if $indexer;
- GenerateImplementationNamedPropertyGetter($dataNode, $namedPropertyGetter) if $namedPropertyGetter;
+ GenerateImplementationNamedPropertyGetter($dataNode, $namedPropertyGetter);
# Define our functions with Set() or SetAccessor()
$total_functions = 0;
diff --git a/WebCore/bindings/v8/V8DOMWrapper.cpp b/WebCore/bindings/v8/V8DOMWrapper.cpp
index 40b6923..c3cd615 100644
--- a/WebCore/bindings/v8/V8DOMWrapper.cpp
+++ b/WebCore/bindings/v8/V8DOMWrapper.cpp
@@ -271,16 +271,9 @@ v8::Persistent<v8::FunctionTemplate> V8DOMWrapper::getTemplate(V8ClassIndex::V8W
toStringTemplate = v8::Persistent<v8::FunctionTemplate>::New(v8::FunctionTemplate::New(ConstructorToString));
descriptor->Set(GetToStringName(), toStringTemplate);
switch (type) {
- case V8ClassIndex::CSSSTYLEDECLARATION:
- // The named property handler for style declarations has a
- // setter. Therefore, the interceptor has to be on the object
- // itself and not on the prototype object.
- descriptor->InstanceTemplate()->SetNamedPropertyHandler( USE_NAMED_PROPERTY_GETTER(CSSStyleDeclaration), USE_NAMED_PROPERTY_SETTER(CSSStyleDeclaration));
- break;
case V8ClassIndex::HTMLALLCOLLECTION:
descriptor->InstanceTemplate()->MarkAsUndetectable(); // fall through
case V8ClassIndex::HTMLCOLLECTION:
- descriptor->InstanceTemplate()->SetNamedPropertyHandler(USE_NAMED_PROPERTY_GETTER(HTMLCollection));
descriptor->InstanceTemplate()->SetCallAsFunctionHandler(USE_CALLBACK(HTMLCollectionCallAsFunction));
break;
case V8ClassIndex::HTMLOPTIONSCOLLECTION:
@@ -289,7 +282,6 @@ v8::Persistent<v8::FunctionTemplate> V8DOMWrapper::getTemplate(V8ClassIndex::V8W
descriptor->InstanceTemplate()->SetCallAsFunctionHandler(USE_CALLBACK(HTMLCollectionCallAsFunction));
break;
case V8ClassIndex::HTMLSELECTELEMENT:
- descriptor->InstanceTemplate()->SetNamedPropertyHandler(USE_NAMED_PROPERTY_GETTER(HTMLSelectElement));
descriptor->InstanceTemplate()->SetIndexedPropertyHandler(USE_INDEXED_PROPERTY_GETTER(HTMLSelectElement), USE_INDEXED_PROPERTY_SETTER(HTMLSelectElement), 0, 0, nodeCollectionIndexedPropertyEnumerator<HTMLSelectElement>, v8::Integer::New(V8ClassIndex::NODE));
break;
case V8ClassIndex::HTMLDOCUMENT: {
@@ -351,22 +343,14 @@ v8::Persistent<v8::FunctionTemplate> V8DOMWrapper::getTemplate(V8ClassIndex::V8W
v8::Local<v8::ObjectTemplate> instanceTemplate = descriptor->InstanceTemplate();
ASSERT(instanceTemplate->InternalFieldCount() == V8Custom::kDefaultWrapperInternalFieldCount);
instanceTemplate->SetInternalFieldCount(V8Custom::kNamedNodeMapInternalFieldCount);
- instanceTemplate->SetNamedPropertyHandler(USE_NAMED_PROPERTY_GETTER(NamedNodeMap));
instanceTemplate->SetIndexedPropertyHandler(USE_INDEXED_PROPERTY_GETTER(NamedNodeMap), 0, 0, 0, collectionIndexedPropertyEnumerator<NamedNodeMap>, v8::Integer::New(V8ClassIndex::NODE));
break;
}
#if ENABLE(DOM_STORAGE)
case V8ClassIndex::STORAGE:
- descriptor->InstanceTemplate()->SetNamedPropertyHandler(USE_NAMED_PROPERTY_GETTER(Storage), USE_NAMED_PROPERTY_SETTER(Storage), 0, USE_NAMED_PROPERTY_DELETER(Storage), V8Custom::v8StorageNamedPropertyEnumerator);
descriptor->InstanceTemplate()->SetIndexedPropertyHandler(USE_INDEXED_PROPERTY_GETTER(Storage), USE_INDEXED_PROPERTY_SETTER(Storage), 0, USE_INDEXED_PROPERTY_DELETER(Storage));
break;
#endif
- case V8ClassIndex::NODELIST:
- descriptor->InstanceTemplate()->SetNamedPropertyHandler(USE_NAMED_PROPERTY_GETTER(NodeList));
- break;
- case V8ClassIndex::STYLESHEETLIST:
- descriptor->InstanceTemplate()->SetNamedPropertyHandler(USE_NAMED_PROPERTY_GETTER(StyleSheetList));
- break;
case V8ClassIndex::DOMWINDOW: {
v8::Local<v8::Signature> defaultSignature = v8::Signature::New(descriptor);
@@ -563,11 +547,6 @@ v8::Persistent<v8::FunctionTemplate> V8DOMWrapper::getTemplate(V8ClassIndex::V8W
case V8ClassIndex::XSLTPROCESSOR:
descriptor->SetCallHandler(USE_CALLBACK(XSLTProcessorConstructor));
break;
-#if ENABLE(DATAGRID)
- case V8ClassIndex::DATAGRIDCOLUMNLIST:
- descriptor->InstanceTemplate()->SetNamedPropertyHandler(USE_NAMED_PROPERTY_GETTER(DataGridColumnList));
- break;
-#endif
default:
break;
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list