2011-04-08 Dominic Cooney <dominicc@google.com>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Apr 2011 09:04:42 +0000 (09:04 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Apr 2011 09:04:42 +0000 (09:04 +0000)
        Reviewed by Kent Tamura.

        Make WK2 layoutTestController.shadowRoot return undefined, not
        null, when its argument is not an element.
        https://bugs.webkit.org/show_bug.cgi?id=58121

        * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
        (WTR::LayoutTestController::shadowRoot):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@83270 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp

index 57b88da..d7e55cd 100644 (file)
@@ -1,3 +1,14 @@
+2011-04-08  Dominic Cooney  <dominicc@google.com>
+
+        Reviewed by Kent Tamura.
+
+        Make WK2 layoutTestController.shadowRoot return undefined, not
+        null, when its argument is not an element.
+        https://bugs.webkit.org/show_bug.cgi?id=58121
+
+        * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+        (WTR::LayoutTestController::shadowRoot):
+
 2011-04-07  Dirk Pranke  <dpranke@chromium.org>
 
         Reviewed by Mihai Parparita.
index b575077..4608121 100644 (file)
@@ -360,11 +360,11 @@ JSValueRef LayoutTestController::shadowRoot(JSValueRef element)
     JSContextRef context = WKBundleFrameGetJavaScriptContext(mainFrame);
 
     if (!element || !JSValueIsObject(context, element))
-        return JSValueMakeNull(context);
+        return JSValueMakeUndefined(context);
 
     WKRetainPtr<WKBundleNodeHandleRef> domElement = adoptWK(WKBundleNodeHandleCreate(context, const_cast<JSObjectRef>(element)));
     if (!domElement)
-        return JSValueMakeNull(context);
+        return JSValueMakeUndefined(context);
 
     WKRetainPtr<WKBundleNodeHandleRef> shadowRootDOMElement = adoptWK(WKBundleNodeHandleCopyElementShadowRoot(domElement.get()));
     if (!shadowRootDOMElement)