2011-04-01 Dominic Cooney <dominicc@google.com>
[WebKit-https.git] / Source / WebKit / gtk / WebCoreSupport / DumpRenderTreeSupportGtk.cpp
index 1336f11861ae04eea8640c3af21b0961a657463e..6d9493843591a572555dfb863cd31baed2e49086 100644 (file)
@@ -28,6 +28,7 @@
 #include "AnimationController.h"
 #include "DOMWrapperWorld.h"
 #include "Document.h"
+#include "Element.h"
 #include "FocusController.h"
 #include "FrameLoaderClientGtk.h"
 #include "FrameTree.h"
@@ -636,6 +637,16 @@ void DumpRenderTreeSupportGtk::clearOpener(WebKitWebFrame* frame)
         coreFrame->loader()->setOpener(0);
 }
 
+JSValueRef DumpRenderTreeSupportGtk::shadowRoot(JSContextRef context, JSValueRef value)
+{
+    JSC::ExecState* exec = toJS(context);
+    Element* element = toElement(toJS(exec, value));
+    if (!element)
+      return JSValueMakeNull(context);
+
+    return toRef(exec, toJS(exec, element->shadowRoot()));
+}
+
 unsigned int DumpRenderTreeSupportGtk::workerThreadCount()
 {
 #if ENABLE(WORKERS)