2010-04-21 Yi Shen <yi.4.shen@nokia.com>
authoreric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Apr 2010 10:54:46 +0000 (10:54 +0000)
committereric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Apr 2010 10:54:46 +0000 (10:54 +0000)
        Reviewed by Simon Hausmann.

        [Qt] Unskip a bunch of now passing tests, which was skipped because of
        missing LayoutTestController::computedStyleIncludingVisitedInfo
        https://bugs.webkit.org/show_bug.cgi?id=37759

        * platform/qt/Skipped:
2010-04-21  Yi Shen  <yi.4.shen@nokia.com>

        Reviewed by Simon Hausmann.

        [Qt] Add LayoutTestController interface: computedStyleIncludingVisitedInfo
        https://bugs.webkit.org/show_bug.cgi?id=37759

        * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
        (DumpRenderTreeSupportQt::computedStyleIncludingVisitedInfo):
        * WebCoreSupport/DumpRenderTreeSupportQt.h:
2010-04-21  Yi Shen  <yi.4.shen@nokia.com>

        Reviewed by Simon Hausmann.

        [Qt] Add LayoutTestController interface: computedStyleIncludingVisitedInfo
        https://bugs.webkit.org/show_bug.cgi?id=37759

        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
        (LayoutTestController::computedStyleIncludingVisitedInfo):
        * DumpRenderTree/qt/LayoutTestControllerQt.h:

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

LayoutTests/ChangeLog
LayoutTests/platform/qt/Skipped
WebKit/qt/ChangeLog
WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h
WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h

index c467e8c..c8693e4 100644 (file)
@@ -1,3 +1,13 @@
+2010-04-21  Yi Shen  <yi.4.shen@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Unskip a bunch of now passing tests, which was skipped because of 
+        missing LayoutTestController::computedStyleIncludingVisitedInfo
+        https://bugs.webkit.org/show_bug.cgi?id=37759
+
+        * platform/qt/Skipped:
+
 2010-04-21  Alejandro G. Castro  <alex@igalia.com>
 
         Rubber-stamped by Xan Lopez.
index 23fef89..775a4e6 100644 (file)
@@ -337,12 +337,6 @@ http/tests/plugins/third-party-cookie-accept-policy.html
 # Missing layoutTestController.evaluateScriptInIsolatedWorld()
 storage/open-database-creation-callback-isolated-world.html
 
-# Missing layoutTestController.computedStyleIncludingVisitedInfo()
-fast/history/multiple-classes-visited.html
-fast/history/nested-visited-test.html
-fast/history/self-is-visited.html
-fast/history/sibling-visited-test.html
-
 # Missing layoutTestController.dumpWillCacheResponse
 http/tests/misc/willCacheResponse-delegate-callback.html
 # ============================================================================= #
index 294b0fa..5bd5ca2 100644 (file)
@@ -1,3 +1,14 @@
+2010-04-21  Yi Shen  <yi.4.shen@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Add LayoutTestController interface: computedStyleIncludingVisitedInfo
+        https://bugs.webkit.org/show_bug.cgi?id=37759
+
+        * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
+        (DumpRenderTreeSupportQt::computedStyleIncludingVisitedInfo):
+        * WebCoreSupport/DumpRenderTreeSupportQt.h:
+
 2010-04-21  No'am Rosenthal  <noam.rosenthal@nokia.com>
 
         Reviewed by Simon Fraser.
index 8c2117e..330a52f 100644 (file)
@@ -23,6 +23,7 @@
 #include "config.h"
 #include "DumpRenderTreeSupportQt.h"
 
+#include "CSSComputedStyleDeclaration.h"
 #include "ContextMenu.h"
 #include "ContextMenuClientQt.h"
 #include "ContextMenuController.h"
@@ -364,3 +365,24 @@ bool DumpRenderTreeSupportQt::isCommandEnabled(QWebPage* page, const QString& na
 {
     return page->handle()->page->focusController()->focusedOrMainFrame()->editor()->command(name).isEnabled();
 }
+
+QVariantMap DumpRenderTreeSupportQt::computedStyleIncludingVisitedInfo(QWebFrame* frame, const QString& id)
+{
+    QVariantMap ret;
+    Frame* coreFrame = QWebFramePrivate::core(frame);
+    if (!coreFrame)
+        return ret;
+
+    Element* element = coreFrame->document()->getElementById(AtomicString(id));
+    if (!element)
+        return ret;
+
+    RefPtr<CSSComputedStyleDeclaration> style = computedStyle(element, true);
+    for (int i = 0; i < style->length(); i++) {
+        QString name = style->item(i);
+        QString value = (static_cast<CSSStyleDeclaration*>(style.get()))->getPropertyValue(name);
+        ret[name] = QVariant(value);
+    }
+    return ret;
+}
+
index 0c3cf9a..eb1042c 100644 (file)
@@ -24,6 +24,7 @@
 #define DumpRenderTreeSupportQt_h
 
 #include "qwebkitglobal.h"
+#include <QVariant>
 
 class QWebPage;
 class QWebFrame;
@@ -78,6 +79,7 @@ public:
     static void resetOriginAccessWhiteLists();
 
     static int workerThreadCount();
+    static QVariantMap computedStyleIncludingVisitedInfo(QWebFrame* frame, const QString& id);
 };
 
 #endif
index 017f2e7..86edbd7 100644 (file)
@@ -1,3 +1,14 @@
+2010-04-21  Yi Shen  <yi.4.shen@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Add LayoutTestController interface: computedStyleIncludingVisitedInfo
+        https://bugs.webkit.org/show_bug.cgi?id=37759
+
+        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+        (LayoutTestController::computedStyleIncludingVisitedInfo):
+        * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
 2010-04-21  Eric Seidel  <eric@webkit.org>
 
         Unreviewed, test fix only.
index a065ffd..fb2f9ec 100644 (file)
@@ -35,6 +35,7 @@
 #include "WorkQueueItemQt.h"
 #include <QDir>
 #include <QLocale>
+#include <QMap>
 #include <qwebsettings.h>
 
 extern void qt_wrt_setViewMode(QWebPage* page, const QString& mode);
@@ -609,5 +610,13 @@ bool LayoutTestController::isCommandEnabled(const QString& name) const
     return DumpRenderTreeSupportQt::isCommandEnabled(m_drt->webPage(), name);
 }
 
+QVariantMap LayoutTestController::computedStyleIncludingVisitedInfo(const QVariant& obj) const
+{
+    QMap<QString, QVariant> map = obj.toMap();
+    QString id = map.value("id").toString();
+
+    return DumpRenderTreeSupportQt::computedStyleIncludingVisitedInfo(m_drt->webPage()->mainFrame(), id);
+}
+
 const unsigned LayoutTestController::maxViewWidth = 800;
 const unsigned LayoutTestController::maxViewHeight = 600;
index bc4eb42..ee9276f 100644 (file)
@@ -175,6 +175,7 @@ public slots:
     int pageNumberForElementById(const QString& id, float width = 0, float height = 0);
     int numberOfPages(float width = maxViewWidth, float height = maxViewHeight);
     bool callShouldCloseOnWebView();
+    QVariantMap computedStyleIncludingVisitedInfo(const QVariant& obj) const;
 
     /*
         Policy values: 'on', 'auto' or 'off'.