2010-11-11 Joone Hur <joone@kldp.org>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Nov 2010 06:20:45 +0000 (06:20 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Nov 2010 06:20:45 +0000 (06:20 +0000)
        Reviewed by Antonio Gomes.

        [GTK][DRT] Implement LayoutTestController::nodesFromRect
        https://bugs.webkit.org/show_bug.cgi?id=46598

        Unskip fast/dom/nodesFromRect-basic.html on Gtk+.

        * platform/gtk/Skipped:
2010-11-11  Joone Hur  <joone@kldp.org>

        Reviewed by Antonio Gomes.

        [GTK][DRT] Implement LayoutTestController::nodesFromRect
        https://bugs.webkit.org/show_bug.cgi?id=46598

        Support nodesFromRect in DRT

        * WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
        (DumpRenderTreeSupportGtk::nodesFromRect): Added.
        * WebCoreSupport/DumpRenderTreeSupportGtk.h:
2010-11-11  Joone Hur  <joone@kldp.org>

        Reviewed by Antonio Gomes.

        [GTK][DRT] Implement LayoutTestController::nodesFromRect
        https://bugs.webkit.org/show_bug.cgi?id=46598

        Support nodesFromRect in DRT

        * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
        (LayoutTestController::nodesFromRect):

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

LayoutTests/ChangeLog
LayoutTests/platform/gtk/Skipped
WebKit/gtk/ChangeLog
WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp
WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h
WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp

index 46c8af2..b4183bb 100644 (file)
@@ -1,3 +1,14 @@
+2010-11-11  Joone Hur  <joone@kldp.org>
+
+        Reviewed by Antonio Gomes.
+
+        [GTK][DRT] Implement LayoutTestController::nodesFromRect
+        https://bugs.webkit.org/show_bug.cgi?id=46598
+
+        Unskip fast/dom/nodesFromRect-basic.html on Gtk+.
+
+        * platform/gtk/Skipped:
+
 2010-11-11  James Simonsen  <simonjam@chromium.org>
 
         Reviewed by Tony Chang.
index ca01a5d..d68b99d 100644 (file)
@@ -5620,8 +5620,7 @@ fast/parser/pre-html5-parser-quirks.html
 # FileSystem API is not supported.
 fast/filesystem
 
-# LayoutTestController::nodesFromRect is not supported.
-fast/dom/nodesFromRect-basic.html
+# Needs more investigation like QT
 fast/dom/nodesFromRect-links-and-text.html
 fast/dom/nodesFromRect-inner-documents.html
 
index 580d23a..aa0c0da 100644 (file)
@@ -1,3 +1,16 @@
+2010-11-11  Joone Hur  <joone@kldp.org>
+
+        Reviewed by Antonio Gomes.
+
+        [GTK][DRT] Implement LayoutTestController::nodesFromRect
+        https://bugs.webkit.org/show_bug.cgi?id=46598
+
+        Support nodesFromRect in DRT
+
+        * WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
+        (DumpRenderTreeSupportGtk::nodesFromRect): Added.
+        * WebCoreSupport/DumpRenderTreeSupportGtk.h:
+
 2010-11-11  Chang Shu  <chang.shu@nokia.com>
 
         Reviewed by Antonio Gomes.
index 8296206..f237e9d 100644 (file)
 #include "config.h"
 #include "DumpRenderTreeSupportGtk.h"
 
-#include "webkitwebview.h"
+#include "APICast.h"
+#include "Document.h"
+#include "JSDocument.h"
+#include "JSLock.h"
+#include "JSNodeList.h"
+#include "JSValue.h"
+#include "NodeList.h"
 #include "webkitprivate.h"
+#include "webkitwebview.h"
 
+using namespace JSC;
 using namespace WebCore;
 
 bool DumpRenderTreeSupportGtk::s_drtRun = false;
@@ -54,3 +62,18 @@ bool DumpRenderTreeSupportGtk::linksIncludedInFocusChain()
     return s_linksIncludedInTabChain;
 }
 
+JSValueRef DumpRenderTreeSupportGtk::nodesFromRect(JSContextRef context, JSValueRef value, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping)
+{
+    JSLock lock(SilenceAssertionsOnly);
+    ExecState* exec = toJS(context);
+    if (!value)
+        return JSValueMakeUndefined(context);
+    JSValue jsValue = toJS(exec, value);
+    if (!jsValue.inherits(&JSDocument::s_info))
+       return JSValueMakeUndefined(context);
+
+    JSDocument* jsDocument = static_cast<JSDocument*>(asObject(jsValue));
+    Document* document = jsDocument->impl();
+    RefPtr<NodeList> nodes = document->nodesFromRect(x, y, top, right, bottom, left, ignoreClipping);
+    return toRef(exec, toJS(exec, jsDocument->globalObject(), nodes.get()));
+}
index 5b494ff..17e9f6d 100644 (file)
@@ -19,6 +19,8 @@
 #ifndef DumpRenderTreeSupportGtk_h
 #define DumpRenderTreeSupportGtk_h
 
+#include "JSStringRef.h"
+
 class DumpRenderTreeSupportGtk {
 
 public:
@@ -30,6 +32,7 @@ public:
 
     static void setLinksIncludedInFocusChain(bool);
     static bool linksIncludedInFocusChain();
+    static JSValueRef nodesFromRect(JSContextRef context, JSValueRef value, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping);
 
 private:
     static bool s_drtRun;
index 7b173bf..79b9c24 100644 (file)
@@ -1,3 +1,15 @@
+2010-11-11  Joone Hur  <joone@kldp.org>
+
+        Reviewed by Antonio Gomes.
+
+        [GTK][DRT] Implement LayoutTestController::nodesFromRect
+        https://bugs.webkit.org/show_bug.cgi?id=46598
+
+        Support nodesFromRect in DRT
+
+        * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+        (LayoutTestController::nodesFromRect):
+
 2010-11-11  MORITA Hajime  <morrita@google.com>
 
         Reviewed by Kent Tamura.
index ab70a3e..39fb116 100644 (file)
@@ -140,8 +140,7 @@ JSValueRef LayoutTestController::computedStyleIncludingVisitedInfo(JSContextRef
 
 JSValueRef LayoutTestController::nodesFromRect(JSContextRef context, JSValueRef value, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping)
 {
-    // FIXME: Implement this.
-    return JSValueMakeUndefined(context);
+    return DumpRenderTreeSupportGtk::nodesFromRect(context, value, x, y, top, right, bottom, left, ignoreClipping);
 }
 
 JSRetainPtr<JSStringRef> LayoutTestController::layerTreeAsText() const