2011-06-16 Sheriff Bot <webkit.review.bot@gmail.com>

        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  <webkit.review.bot@gmail.com>

        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  <webkit.review.bot@gmail.com>

        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:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@89019 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 5906d909
2011-06-16 Sheriff Bot <webkit.review.bot@gmail.com>
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 <abarth@webkit.org>
Reviewed by Eric Seidel.
......
......@@ -182,38 +182,6 @@ static JSRealType valueRealType(ExecState* exec, JSValue val)
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 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type
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 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type
} 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()));
......
2011-06-16 Sheriff Bot <webkit.review.bot@gmail.com>
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 <diegohcg@webkit.org>
Reviewed by Kenneth Rohde Christiansen.
......
......@@ -974,31 +974,23 @@ void DumpRenderTreeSupportQt::simulateDesktopNotificationClick(const QString& ti
#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();
}
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;
QMap<QString, QVariant> map = range.toMap();
QVariant startContainer = map.value(QLatin1String("startContainer"));
map = startContainer.toMap();
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);
......
......@@ -27,7 +27,6 @@
#include <QVariant>
namespace WebCore {
class Document;
class Text;
class Node;
}
......@@ -161,7 +160,7 @@ public:
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 @@ public:
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 @@ public:
static QString layerTreeAsText(QWebFrame*);
static void injectInternalsObject(QWebFrame*);
private:
static WebCore::Document* getCoreDocumentFromVariantMap(const QVariantMap& document);
};
#endif
......@@ -612,8 +612,7 @@ private slots:
void symmetricUrl();
void progressSignal();
void urlChange();
void documentHasDocumentElement();
void documentAllHasDocumentElement();
void domCycles();
void requestedUrl();
void requestedUrlAfterSetAndLoadFailures();
void javaScriptWindowObjectCleared_data();
......@@ -2005,9 +2004,10 @@ void tst_QWebFrame::overloadedSlots()
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,46 +2291,11 @@ void tst_QWebFrame::urlChange()
}
void tst_QWebFrame::documentHasDocumentElement()
{
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());
}
void tst_QWebFrame::documentAllHasDocumentElement()
void tst_QWebFrame::domCycles()
{
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);
m_view->setHtml("<html><body>");
QVariant v = m_page->mainFrame()->evaluateJavaScript("document");
QVERIFY(v.type() == QVariant::Map);
}
class FakeReply : public QNetworkReply {
......
2011-06-16 Sheriff Bot <webkit.review.bot@gmail.com>
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 <dpranke@chromium.org>
Unreviewed, build fix.
......
......@@ -919,7 +919,7 @@ bool LayoutTestController::hasSpellingMarker(int, int)
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);
}
......
......@@ -237,7 +237,7 @@ public slots:
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);
......
......@@ -38,7 +38,7 @@ PlainTextController::PlainTextController(QWebPage* parent)
{
}
QString PlainTextController::plainText(const QVariantMap& range)
QString PlainTextController::plainText(const QVariant& range)
{
return DumpRenderTreeSupportQt::plainText(range);
}
......@@ -41,7 +41,7 @@ public:
PlainTextController(QWebPage* parent);
public slots:
QString plainText(const QVariantMap& range);
QString plainText(const QVariant& range);
};
#endif // PlainTextControllerQt_h
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment