Title: [152435] trunk/Source/WebCore
- Revision
- 152435
- Author
- [email protected]
- Date
- 2013-07-06 00:24:42 -0700 (Sat, 06 Jul 2013)
Log Message
Stop hardcoding interfaces that have indexed getters returning strings
https://bugs.webkit.org/show_bug.cgi?id=118414
Reviewed by Kentaro Hara.
Stop hardcoding the names of interfaces that have indexed getters returning
strings in the bindings generator. Now that we use the latest Web IDL indexed
getter, more information is provided in the IDL files and the generator is
able to figure out if the indexed getter is returning a DOMString on its own.
No new tests, no behavior change.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateGetOwnPropertySlotBody):
(GenerateImplementation):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (152434 => 152435)
--- trunk/Source/WebCore/ChangeLog 2013-07-06 05:01:31 UTC (rev 152434)
+++ trunk/Source/WebCore/ChangeLog 2013-07-06 07:24:42 UTC (rev 152435)
@@ -1,3 +1,21 @@
+2013-07-06 Christophe Dumez <[email protected]>
+
+ Stop hardcoding interfaces that have indexed getters returning strings
+ https://bugs.webkit.org/show_bug.cgi?id=118414
+
+ Reviewed by Kentaro Hara.
+
+ Stop hardcoding the names of interfaces that have indexed getters returning
+ strings in the bindings generator. Now that we use the latest Web IDL indexed
+ getter, more information is provided in the IDL files and the generator is
+ able to figure out if the indexed getter is returning a DOMString on its own.
+
+ No new tests, no behavior change.
+
+ * bindings/scripts/CodeGeneratorJS.pm:
+ (GenerateGetOwnPropertySlotBody):
+ (GenerateImplementation):
+
2013-07-05 Tim Horton <[email protected]>
Tons of crashes on bots after r152425
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (152434 => 152435)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2013-07-06 05:01:31 UTC (rev 152434)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2013-07-06 07:24:42 UTC (rev 152435)
@@ -178,14 +178,6 @@
return "JS$className";
}
-sub IndexGetterReturnsStrings
-{
- my $type = shift;
-
- return 1 if $type eq "CSSStyleDeclaration" or $type eq "MediaList" or $type eq "DOMStringList" or $type eq "DOMTokenList" or $type eq "DOMSettableTokenList";
- return 0;
-}
-
sub AddIncludesForTypeInImpl
{
my $type = shift;
@@ -390,7 +382,7 @@
# If the item function returns a string then we let the TreatReturnedNullStringAs handle the cases
# where the index is out of range.
- if (IndexGetterReturnsStrings($interfaceName)) {
+ if ($indexedGetterFunction->signature->type eq "DOMString") {
push(@getOwnPropertySlotImpl, " if (index != PropertyName::NotAnIndex) {\n");
} else {
push(@getOwnPropertySlotImpl, " if (index != PropertyName::NotAnIndex && index < static_cast<$interfaceName*>(thisObject->impl())->length()) {\n");
@@ -1979,7 +1971,7 @@
};
if ($indexedGetterFunction) {
- if (IndexGetterReturnsStrings($interfaceName)) {
+ if ($indexedGetterFunction->signature->type eq "DOMString") {
push(@implContent, " if (index <= MAX_ARRAY_INDEX) {\n");
} else {
push(@implContent, " if (index < static_cast<$interfaceName*>(thisObject->impl())->length()) {\n");
@@ -2657,7 +2649,7 @@
push(@implContent, "{\n");
push(@implContent, " ${className}* thisObj = jsCast<$className*>(asObject(slotBase));\n");
push(@implContent, " ASSERT_GC_OBJECT_INHERITS(thisObj, &s_info);\n");
- if (IndexGetterReturnsStrings($interfaceName)) {
+ if ($indexedGetterFunction->signature->type eq "DOMString") {
$implIncludes{"KURL.h"} = 1;
push(@implContent, " return jsStringOrUndefined(exec, thisObj->impl()->item(index));\n");
} else {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes