Title: [107553] trunk/Source/WebCore
Revision
107553
Author
[email protected]
Date
2012-02-13 02:24:21 -0800 (Mon, 13 Feb 2012)

Log Message

Add [JSCustomToJSObject] IDL attribute to interfaces that have
custom toJS() but do not have custom toV8()
https://bugs.webkit.org/show_bug.cgi?id=78466

Reviewed by Adam Barth.

This is the second step to remove hard-coding in HasCustomToV8Implementation()
in CodeGeneratorV8.pm. This patch replaces [JSCustomToJS] with [JSCustomToJSObject]
for interfaces which have custom toJS() but do not have custom toV8().

No tests. No change in behavior.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GenerateImplementation):
* bindings/scripts/CodeGeneratorV8.pm:
(HasCustomToV8Implementation): I found that AbstractWorker and CanvasRenderingContext
are the only IDL files to which I need to add [JSCustomToJSObject].
Other IDL files which had been listed here do not have [JSCustomToJS].
* html/canvas/CanvasRenderingContext.idl:
* workers/AbstractWorker.idl:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (107552 => 107553)


--- trunk/Source/WebCore/ChangeLog	2012-02-13 10:23:24 UTC (rev 107552)
+++ trunk/Source/WebCore/ChangeLog	2012-02-13 10:24:21 UTC (rev 107553)
@@ -1,3 +1,27 @@
+2012-02-13  Kentaro Hara  <[email protected]>
+
+        Add [JSCustomToJSObject] IDL attribute to interfaces that have
+        custom toJS() but do not have custom toV8()
+        https://bugs.webkit.org/show_bug.cgi?id=78466
+
+        Reviewed by Adam Barth.
+
+        This is the second step to remove hard-coding in HasCustomToV8Implementation()
+        in CodeGeneratorV8.pm. This patch replaces [JSCustomToJS] with [JSCustomToJSObject]
+        for interfaces which have custom toJS() but do not have custom toV8().
+
+        No tests. No change in behavior.
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateHeader):
+        (GenerateImplementation):
+        * bindings/scripts/CodeGeneratorV8.pm:
+        (HasCustomToV8Implementation): I found that AbstractWorker and CanvasRenderingContext
+        are the only IDL files to which I need to add [JSCustomToJSObject].
+        Other IDL files which had been listed here do not have [JSCustomToJS].
+        * html/canvas/CanvasRenderingContext.idl:
+        * workers/AbstractWorker.idl:
+
 2012-02-13  Andreas Kling  <[email protected]>
 
         Avoid unnecessary work when evaluating style sharing candidates.

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (107552 => 107553)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2012-02-13 10:23:24 UTC (rev 107552)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2012-02-13 10:24:21 UTC (rev 107553)
@@ -1003,7 +1003,7 @@
         push(@headerContent, "\n");
     }
 
-    if (!$hasParent || $dataNode->extendedAttributes->{"JSGenerateToJS"} || $dataNode->extendedAttributes->{"JSCustomToJS"}) {
+    if (!$hasParent || $dataNode->extendedAttributes->{"JSGenerateToJS"} || ($dataNode->extendedAttributes->{"JSCustomToJS"} || $dataNode->extendedAttributes->{"JSCustomToJSObject"})) {
         push(@headerContent, "JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, $implType*);\n");
     }
     if (!$hasParent || $dataNode->extendedAttributes->{"JSGenerateToNativeObject"}) {
@@ -2310,7 +2310,7 @@
         push(@implContent, "}\n\n");
     }
 
-    if ((!$hasParent or $dataNode->extendedAttributes->{"JSGenerateToJS"}) and !$dataNode->extendedAttributes->{"JSCustomToJS"}) {
+    if ((!$hasParent or $dataNode->extendedAttributes->{"JSGenerateToJS"}) and !($dataNode->extendedAttributes->{"JSCustomToJS"} or $dataNode->extendedAttributes->{"JSCustomToJSObject"})) {
         push(@implContent, "JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, $implType* impl)\n");
         push(@implContent, "{\n");
         if ($svgPropertyType) {

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm (107552 => 107553)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm	2012-02-13 10:23:24 UTC (rev 107552)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm	2012-02-13 10:24:21 UTC (rev 107553)
@@ -3108,20 +3108,6 @@
 
     return 1 if $dataNode->extendedAttributes->{"V8CustomToJSObject"};
 
-    # We don't generate a custom converter (but JSC does) for the following:
-    return 0 if $interfaceName eq "AbstractWorker";
-    return 0 if $interfaceName eq "CanvasRenderingContext";
-    return 0 if $interfaceName eq "SVGElementInstance";
-    return 0 if $interfaceName eq "NodeList";
-    return 0 if $interfaceName eq "CSSRuleList";
-    return 0 if $interfaceName eq "CSSStyleDeclaration";
-    return 0 if $interfaceName eq "MediaList";
-    return 0 if $interfaceName eq "StyleSheetList";
-    return 0 if $interfaceName eq "DOMImplementation";
-    return 0 if $interfaceName eq "DOMStringMap";
-    return 0 if $interfaceName eq "DOMTokenList";
-    return 0 if $interfaceName eq "TextTrack";
-
     # For everything else, do what JSC does.
     return $dataNode->extendedAttributes->{"JSCustomToJS"};
 }

Modified: trunk/Source/WebCore/html/canvas/CanvasRenderingContext.idl (107552 => 107553)


--- trunk/Source/WebCore/html/canvas/CanvasRenderingContext.idl	2012-02-13 10:23:24 UTC (rev 107552)
+++ trunk/Source/WebCore/html/canvas/CanvasRenderingContext.idl	2012-02-13 10:24:21 UTC (rev 107553)
@@ -28,7 +28,7 @@
     interface [
         JSCustomMarkFunction,
         JSGenerateIsReachable,
-        JSCustomToJS
+        JSCustomToJSObject
     ] CanvasRenderingContext {
 
         readonly attribute HTMLCanvasElement canvas;

Modified: trunk/Source/WebCore/workers/AbstractWorker.idl (107552 => 107553)


--- trunk/Source/WebCore/workers/AbstractWorker.idl	2012-02-13 10:23:24 UTC (rev 107552)
+++ trunk/Source/WebCore/workers/AbstractWorker.idl	2012-02-13 10:24:21 UTC (rev 107553)
@@ -34,7 +34,7 @@
     interface [
         Conditional=WORKERS,
         ActiveDOMObject,
-        JSCustomToJS,
+        JSCustomToJSObject,
         EventTarget
     ] AbstractWorker {
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to