Title: [89019] trunk
Revision
89019
Author
[email protected]
Date
2011-06-16 01:50:21 -0700 (Thu, 16 Jun 2011)

Log Message

2011-06-16  Sheriff Bot  <[email protected]>

        Unreviewed, rolling out r88796.
        http://trac.webkit.org/changeset/88796
        https://bugs.webkit.org/show_bug.cgi?id=62790

        It made fast/dom/nodesFromRect-basic.html time out on Qt,
        64-bit, debug mode (Requested by Ossy on #webkit).

        * bridge/qt/qt_runtime.cpp:
        (JSC::Bindings::convertValueToQVariant):
2011-06-16  Sheriff Bot  <[email protected]>

        Unreviewed, rolling out r88796.
        http://trac.webkit.org/changeset/88796
        https://bugs.webkit.org/show_bug.cgi?id=62790

        It made fast/dom/nodesFromRect-basic.html time out on Qt,
        64-bit, debug mode (Requested by Ossy on #webkit).

        * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
        (DumpRenderTreeSupportQt::plainText):
        (DumpRenderTreeSupportQt::nodesFromRect):
        * WebCoreSupport/DumpRenderTreeSupportQt.h:
        * tests/qwebframe/tst_qwebframe.cpp:
        (tst_QWebFrame::overloadedSlots):
        (tst_QWebFrame::domCycles):
2011-06-16  Sheriff Bot  <[email protected]>

        Unreviewed, rolling out r88796.
        http://trac.webkit.org/changeset/88796
        https://bugs.webkit.org/show_bug.cgi?id=62790

        It made fast/dom/nodesFromRect-basic.html time out on Qt,
        64-bit, debug mode (Requested by Ossy on #webkit).

        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
        (LayoutTestController::nodesFromRect):
        * DumpRenderTree/qt/LayoutTestControllerQt.h:
        * DumpRenderTree/qt/PlainTextControllerQt.cpp:
        (PlainTextController::plainText):
        * DumpRenderTree/qt/PlainTextControllerQt.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (89018 => 89019)


--- trunk/Source/WebCore/ChangeLog	2011-06-16 08:49:12 UTC (rev 89018)
+++ trunk/Source/WebCore/ChangeLog	2011-06-16 08:50:21 UTC (rev 89019)
@@ -1,3 +1,15 @@
+2011-06-16  Sheriff Bot  <[email protected]>
+
+        Unreviewed, rolling out r88796.
+        http://trac.webkit.org/changeset/88796
+        https://bugs.webkit.org/show_bug.cgi?id=62790
+
+        It made fast/dom/nodesFromRect-basic.html time out on Qt,
+        64-bit, debug mode (Requested by Ossy on #webkit).
+
+        * bridge/qt/qt_runtime.cpp:
+        (JSC::Bindings::convertValueToQVariant):
+
 2011-06-16  Adam Barth  <[email protected]>
 
         Reviewed by Eric Seidel.

Modified: trunk/Source/WebCore/bridge/qt/qt_runtime.cpp (89018 => 89019)


--- trunk/Source/WebCore/bridge/qt/qt_runtime.cpp	2011-06-16 08:49:12 UTC (rev 89018)
+++ trunk/Source/WebCore/bridge/qt/qt_runtime.cpp	2011-06-16 08:50:21 UTC (rev 89019)
@@ -182,38 +182,6 @@
     return String; // I don't know.
 }
 
-static QMetaType::Type hintForRealType(JSRealType type, JSObject* object)
-{
-    switch (type) {
-    case Number:
-        return QMetaType::Double;
-    case Boolean:
-        return QMetaType::Bool;
-    case String:
-        return QMetaType::QString;
-    case Date:
-        return QMetaType::QDateTime;
-    case RegExp:
-        return QMetaType::QRegExp;
-    case Object:
-        if (object->inherits(&NumberObject::s_info))
-            return QMetaType::Double;
-        if (object->inherits(&BooleanObject::s_info))
-            return QMetaType::Bool;
-        if (object->inherits(&JSElement::s_info))
-            return static_cast<QMetaType::Type>(qMetaTypeId<QWebElement>());
-        return QMetaType::QVariantMap;
-    case QObj:
-        return QMetaType::QObjectStar;
-    case JSByteArray:
-        return QMetaType::QByteArray;
-    case Array:
-    case RTArray:
-        return QMetaType::QVariantList;
-    }
-    return QMetaType::QString;
-}
-
 QVariant convertValueToQVariant(ExecState*, JSValue, QMetaType::Type, int*, HashSet<JSObject*>*, int);
 
 static QVariantMap convertValueToQVariantMap(ExecState* exec, JSObject* object, HashSet<JSObject*>* visitedObjects, int recursionLimit)
@@ -273,8 +241,44 @@
 
     JSLock lock(SilenceAssertionsOnly);
     JSRealType type = valueRealType(exec, value);
-    if (hint == QMetaType::Void)
-        hint = hintForRealType(type, object);
+    if (hint == QMetaType::Void) {
+        switch(type) {
+            case Number:
+                hint = QMetaType::Double;
+                break;
+            case Boolean:
+                hint = QMetaType::Bool;
+                break;
+            case String:
+            default:
+                hint = QMetaType::QString;
+                break;
+            case Date:
+                hint = QMetaType::QDateTime;
+                break;
+            case RegExp:
+                hint = QMetaType::QRegExp;
+                break;
+            case Object:
+                if (object->inherits(&NumberObject::s_info))
+                    hint = QMetaType::Double;
+                else if (object->inherits(&BooleanObject::s_info))
+                    hint = QMetaType::Bool;
+                else
+                    hint = QMetaType::QVariantMap;
+                break;
+            case QObj:
+                hint = QMetaType::QObjectStar;
+                break;
+            case JSByteArray:
+                hint = QMetaType::QByteArray;
+                break;
+            case Array:
+            case RTArray:
+                hint = QMetaType::QVariantList;
+                break;
+        }
+    }
 
     qConvDebug() << "convertValueToQVariant: jstype is " << type << ", hint is" << hint;
 
@@ -774,15 +778,12 @@
             } else if (QtPixmapInstance::canHandle(static_cast<QMetaType::Type>(hint))) {
                 ret = QtPixmapInstance::variantFromObject(object, static_cast<QMetaType::Type>(hint));
             } else if (hint == (QMetaType::Type) qMetaTypeId<QWebElement>()) {
-                if (object && object->inherits(&JSElement::s_info)) {
-                    ret = QVariant::fromValue<QWebElement>(QtWebElementRuntime::create((static_cast<JSElement*>(object))->impl()));
-                    dist = 0;
-                    // Allow other objects to reach this one. This won't cause our algorithm to
-                    // loop since when we find an Element we do not recurse.
-                    visitedObjects->remove(object);
-                    break;
-                }
-                ret = QVariant::fromValue<QWebElement>(QWebElement());
+                if (object && object->inherits(&JSHTMLElement::s_info))
+                    ret = QVariant::fromValue<QWebElement>(QtWebElementRuntime::create((static_cast<JSHTMLElement*>(object))->impl()));
+                else if (object && object->inherits(&JSDocument::s_info))
+                    ret = QVariant::fromValue<QWebElement>(QtWebElementRuntime::create((static_cast<JSDocument*>(object))->impl()->documentElement()));
+                else
+                    ret = QVariant::fromValue<QWebElement>(QWebElement());
             } else if (hint == (QMetaType::Type) qMetaTypeId<QDRTNode>()) {
                 if (object && object->inherits(&JSNode::s_info))
                     ret = QVariant::fromValue<QDRTNode>(QtDRTNodeRuntime::create((static_cast<JSNode*>(object))->impl()));

Modified: trunk/Source/WebKit/qt/ChangeLog (89018 => 89019)


--- trunk/Source/WebKit/qt/ChangeLog	2011-06-16 08:49:12 UTC (rev 89018)
+++ trunk/Source/WebKit/qt/ChangeLog	2011-06-16 08:50:21 UTC (rev 89019)
@@ -1,3 +1,20 @@
+2011-06-16  Sheriff Bot  <[email protected]>
+
+        Unreviewed, rolling out r88796.
+        http://trac.webkit.org/changeset/88796
+        https://bugs.webkit.org/show_bug.cgi?id=62790
+
+        It made fast/dom/nodesFromRect-basic.html time out on Qt,
+        64-bit, debug mode (Requested by Ossy on #webkit).
+
+        * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
+        (DumpRenderTreeSupportQt::plainText):
+        (DumpRenderTreeSupportQt::nodesFromRect):
+        * WebCoreSupport/DumpRenderTreeSupportQt.h:
+        * tests/qwebframe/tst_qwebframe.cpp:
+        (tst_QWebFrame::overloadedSlots):
+        (tst_QWebFrame::domCycles):
+
 2011-06-15  Diego Gonzalez  <[email protected]>
 
         Reviewed by Kenneth Rohde Christiansen.

Modified: trunk/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp (89018 => 89019)


--- trunk/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp	2011-06-16 08:49:12 UTC (rev 89018)
+++ trunk/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp	2011-06-16 08:50:21 UTC (rev 89019)
@@ -974,31 +974,23 @@
 #endif
 }
 
-QString DumpRenderTreeSupportQt::plainText(const QVariantMap& range)
+QString DumpRenderTreeSupportQt::plainText(const QVariant& range)
 {
-    QVariant v = range.value(QLatin1String("startContainer"));
-    ASSERT(v.isValid());
-    QWebElement startContainer = qvariant_cast<QWebElement>(v);
-    return startContainer.toPlainText();
-}
+    QMap<QString, QVariant> map = range.toMap();
+    QVariant startContainer  = map.value(QLatin1String("startContainer"));
+    map = startContainer.toMap();
 
-WebCore::Document* DumpRenderTreeSupportQt::getCoreDocumentFromVariantMap(const QVariantMap& document)
-{
-    QVariant v = document.value(QLatin1String("documentElement"));
-    ASSERT(v.isValid());
-    QWebElement documentElement = qvariant_cast<QWebElement>(v);
-
-    WebCore::Element* element = documentElement.m_element;
-    if (!element)
-        return 0;
-
-    return element->document();
+    return map.value(QLatin1String("innerText")).toString();
 }
 
-QVariantList DumpRenderTreeSupportQt::nodesFromRect(const QVariantMap& document, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping)
+QVariantList DumpRenderTreeSupportQt::nodesFromRect(const QWebElement& document, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping)
 {
     QVariantList res;
-    Document* doc = getCoreDocumentFromVariantMap(document);
+    WebCore::Element* webElement = document.m_element;
+    if (!webElement)
+        return res;
+
+    Document* doc = webElement->document();
     if (!doc)
         return res;
     RefPtr<NodeList> nodes = doc->nodesFromRect(x, y, top, right, bottom, left, ignoreClipping);

Modified: trunk/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h (89018 => 89019)


--- trunk/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h	2011-06-16 08:49:12 UTC (rev 89018)
+++ trunk/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h	2011-06-16 08:50:21 UTC (rev 89019)
@@ -27,7 +27,6 @@
 #include <QVariant>
 
 namespace WebCore {
-class Document;
 class Text;
 class Node;
 }
@@ -161,7 +160,7 @@
 
     static QString markerTextForListItem(const QWebElement& listItem);
     static QVariantMap computedStyleIncludingVisitedInfo(const QWebElement& element);
-    static QString plainText(const QVariantMap& range);
+    static QString plainText(const QVariant& rng);
 
     static void dumpFrameLoader(bool b);
     static void dumpUserGestureInFrameLoader(bool b);
@@ -199,7 +198,7 @@
 
     static void scalePageBy(QWebFrame*, float scale, const QPoint& origin);
 
-    static QVariantList nodesFromRect(const QVariantMap& document, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping);
+    static QVariantList nodesFromRect(const QWebElement& document, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping);
     static QString responseMimeType(QWebFrame*);
     static void clearOpener(QWebFrame*);
     static void addURLToRedirect(const QString& origin, const QString& destination);
@@ -219,9 +218,6 @@
     static QString layerTreeAsText(QWebFrame*);
 
     static void injectInternalsObject(QWebFrame*);
-
-private:
-    static WebCore::Document* getCoreDocumentFromVariantMap(const QVariantMap& document);
 };
 
 #endif

Modified: trunk/Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp (89018 => 89019)


--- trunk/Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp	2011-06-16 08:49:12 UTC (rev 89018)
+++ trunk/Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp	2011-06-16 08:50:21 UTC (rev 89019)
@@ -612,8 +612,7 @@
     void symmetricUrl();
     void progressSignal();
     void urlChange();
-    void documentHasDocumentElement();
-    void documentAllHasDocumentElement();
+    void domCycles();
     void requestedUrl();
     void requestedUrlAfterSetAndLoadFailures();
     void _javascript_WindowObjectCleared_data();
@@ -2005,9 +2004,10 @@
     QCOMPARE(m_myObject->qtFunctionInvoked(), 35);
     */
 
-    // should pick myOverloadedSlot(QWebElement)
+    // should pick myOverloadedSlot(QRegExp)
     m_myObject->resetQtFunctionInvoked();
     evalJS("myObject.myOverloadedSlot(document.body)");
+    QEXPECT_FAIL("", "https://bugs.webkit.org/show_bug.cgi?id=37319", Continue);
     QCOMPARE(m_myObject->qtFunctionInvoked(), 36);
 
     // should pick myOverloadedSlot(QObject*)
@@ -2291,48 +2291,13 @@
 }
 
 
-void tst_QWebFrame::documentHasDocumentElement()
+void tst_QWebFrame::domCycles()
 {
-    m_view->setHtml("<html><body></body></html>");
-    QVariant docVariant = m_page->mainFrame()->evaluateJavaScript("document");
-    QVERIFY(docVariant.isValid());
-    QCOMPARE(docVariant.type(), QVariant::Map);
-    QVariantMap document = docVariant.toMap();
-
-    QVariant docElementVariant = document.value("documentElement");
-    QVERIFY(docElementVariant.isValid());
-    QCOMPARE(docElementVariant.userType(), qMetaTypeId<QWebElement>());
-    QWebElement documentElement = qvariant_cast<QWebElement>(docElementVariant);
-
-    QVERIFY(!documentElement.isNull());
-    QCOMPARE(documentElement, m_page->mainFrame()->documentElement());
+    m_view->setHtml("<html><body>");
+    QVariant v = m_page->mainFrame()->evaluateJavaScript("document");
+    QVERIFY(v.type() == QVariant::Map);
 }
 
-void tst_QWebFrame::documentAllHasDocumentElement()
-{
-    m_view->setHtml("<html><body></body></html>");
-    QVariant docVariant = m_page->mainFrame()->evaluateJavaScript("document");
-    QVariantMap document = docVariant.toMap();
-
-    QVariant allVariant = document.value("all");
-    QVERIFY(allVariant.isValid());
-    QCOMPARE(allVariant.type(), QVariant::Map);
-    QVariantMap all = allVariant.toMap();
-
-    bool foundDocumentElement = false;
-    foreach (QVariant v, all.values()) {
-        if (v.userType() != qMetaTypeId<QWebElement>())
-            continue;
-        QWebElement e = qvariant_cast<QWebElement>(v);
-        if (e == m_page->mainFrame()->documentElement()) {
-            foundDocumentElement = true;
-            break;
-        }
-    }
-
-    QVERIFY(foundDocumentElement);
-}
-
 class FakeReply : public QNetworkReply {
     Q_OBJECT
 

Modified: trunk/Tools/ChangeLog (89018 => 89019)


--- trunk/Tools/ChangeLog	2011-06-16 08:49:12 UTC (rev 89018)
+++ trunk/Tools/ChangeLog	2011-06-16 08:50:21 UTC (rev 89019)
@@ -1,3 +1,19 @@
+2011-06-16  Sheriff Bot  <[email protected]>
+
+        Unreviewed, rolling out r88796.
+        http://trac.webkit.org/changeset/88796
+        https://bugs.webkit.org/show_bug.cgi?id=62790
+
+        It made fast/dom/nodesFromRect-basic.html time out on Qt,
+        64-bit, debug mode (Requested by Ossy on #webkit).
+
+        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+        (LayoutTestController::nodesFromRect):
+        * DumpRenderTree/qt/LayoutTestControllerQt.h:
+        * DumpRenderTree/qt/PlainTextControllerQt.cpp:
+        (PlainTextController::plainText):
+        * DumpRenderTree/qt/PlainTextControllerQt.h:
+
 2011-06-15  Dirk Pranke  <[email protected]>
 
         Unreviewed, build fix.

Modified: trunk/Tools/DumpRenderTree/qt/LayoutTestControllerQt.cpp (89018 => 89019)


--- trunk/Tools/DumpRenderTree/qt/LayoutTestControllerQt.cpp	2011-06-16 08:49:12 UTC (rev 89018)
+++ trunk/Tools/DumpRenderTree/qt/LayoutTestControllerQt.cpp	2011-06-16 08:50:21 UTC (rev 89019)
@@ -919,7 +919,7 @@
     return false;
 }
 
-QVariantList LayoutTestController::nodesFromRect(const QVariantMap& document, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping)
+QVariantList LayoutTestController::nodesFromRect(const QWebElement& document, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping)
 {
     return DumpRenderTreeSupportQt::nodesFromRect(document, x, y, top, right, bottom, left, ignoreClipping);
 }

Modified: trunk/Tools/DumpRenderTree/qt/LayoutTestControllerQt.h (89018 => 89019)


--- trunk/Tools/DumpRenderTree/qt/LayoutTestControllerQt.h	2011-06-16 08:49:12 UTC (rev 89018)
+++ trunk/Tools/DumpRenderTree/qt/LayoutTestControllerQt.h	2011-06-16 08:50:21 UTC (rev 89019)
@@ -237,7 +237,7 @@
     void abortModal() {}
     bool hasSpellingMarker(int from, int length);
 
-    QVariantList nodesFromRect(const QVariantMap& document, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping);
+    QVariantList nodesFromRect(const QWebElement& document, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping);
 
     void addURLToRedirect(const QString& origin, const QString& destination);
 

Modified: trunk/Tools/DumpRenderTree/qt/PlainTextControllerQt.cpp (89018 => 89019)


--- trunk/Tools/DumpRenderTree/qt/PlainTextControllerQt.cpp	2011-06-16 08:49:12 UTC (rev 89018)
+++ trunk/Tools/DumpRenderTree/qt/PlainTextControllerQt.cpp	2011-06-16 08:50:21 UTC (rev 89019)
@@ -38,7 +38,7 @@
 {
 }
 
-QString PlainTextController::plainText(const QVariantMap& range)
+QString PlainTextController::plainText(const QVariant& range)
 {
     return DumpRenderTreeSupportQt::plainText(range);
 }

Modified: trunk/Tools/DumpRenderTree/qt/PlainTextControllerQt.h (89018 => 89019)


--- trunk/Tools/DumpRenderTree/qt/PlainTextControllerQt.h	2011-06-16 08:49:12 UTC (rev 89018)
+++ trunk/Tools/DumpRenderTree/qt/PlainTextControllerQt.h	2011-06-16 08:50:21 UTC (rev 89019)
@@ -41,7 +41,7 @@
     PlainTextController(QWebPage* parent);
 
 public slots:
-    QString plainText(const QVariantMap& range);
+    QString plainText(const QVariant& range);
 };
 
 #endif // PlainTextControllerQt_h
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to