2011-06-27 Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>

        Reviewed by Andreas Kling.

        [Qt] tst_QWebFrame::overloadedSlots() fails
        https://bugs.webkit.org/show_bug.cgi?id=37319

        This patch is based on Noam Rosenthal original patch in the same bug.

        When hinted with QWebElement metatype, we qualify the conversion
        from JSElement as a "perfect match".

        The test was failing because the wrong slot was called, since the QWebElement
        match was taken as equal to the others and not chosen when the metacall happened.

        * bridge/qt/qt_runtime.cpp:
        (JSC::Bindings::convertValueToQVariant): Identify the conversion between JSElement
        to QWebElement as a "perfect match" (dist = 0). Add comments to explain the reason
        why we have the implicit conversion.
2011-06-27  Caio Marcelo de Oliveira Filho  <caio.oliveira@openbossa.org>

        Reviewed by Andreas Kling.

        [Qt] tst_QWebFrame::overloadedSlots() fails
        https://bugs.webkit.org/show_bug.cgi?id=37319

        * tests/qwebframe/tst_qwebframe.cpp:
        (tst_QWebFrame::overloadedSlots): Remove expected failure and
        fix the comment.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@89830 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 9cfaaeb0
2011-06-27 Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
Reviewed by Andreas Kling.
[Qt] tst_QWebFrame::overloadedSlots() fails
https://bugs.webkit.org/show_bug.cgi?id=37319
This patch is based on Noam Rosenthal original patch in the same bug.
When hinted with QWebElement metatype, we qualify the conversion
from JSElement as a "perfect match".
The test was failing because the wrong slot was called, since the QWebElement
match was taken as equal to the others and not chosen when the metacall happened.
* bridge/qt/qt_runtime.cpp:
(JSC::Bindings::convertValueToQVariant): Identify the conversion between JSElement
to QWebElement as a "perfect match" (dist = 0). Add comments to explain the reason
why we have the implicit conversion.
2011-06-27 ChangSeok Oh <shivamidow@gmail.com>
Reviewed by Martin Robinson.
......
......@@ -778,11 +778,21 @@ 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(&JSHTMLElement::s_info))
ret = QVariant::fromValue<QWebElement>(QtWebElementRuntime::create((static_cast<JSHTMLElement*>(object))->impl()));
else if (object && object->inherits(&JSDocument::s_info))
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;
}
if (object && object->inherits(&JSDocument::s_info)) {
// To support LayoutTestControllerQt::nodesFromRect(), used in DRT, we do an implicit
// conversion from 'document' to the QWebElement representing the 'document.documentElement'.
// We can't simply use a QVariantMap in nodesFromRect() because it currently times out
// when serializing DOMMimeType and DOMPlugin, even if we limit the recursion.
ret = QVariant::fromValue<QWebElement>(QtWebElementRuntime::create((static_cast<JSDocument*>(object))->impl()->documentElement()));
else
} else
ret = QVariant::fromValue<QWebElement>(QWebElement());
} else if (hint == (QMetaType::Type) qMetaTypeId<QDRTNode>()) {
if (object && object->inherits(&JSNode::s_info))
......
2011-06-27 Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
Reviewed by Andreas Kling.
[Qt] tst_QWebFrame::overloadedSlots() fails
https://bugs.webkit.org/show_bug.cgi?id=37319
* tests/qwebframe/tst_qwebframe.cpp:
(tst_QWebFrame::overloadedSlots): Remove expected failure and
fix the comment.
2011-06-20 Robert Hogan <robert@webkit.org>
Reviewed by Antonio Gomes.
......
......@@ -2004,10 +2004,9 @@ void tst_QWebFrame::overloadedSlots()
QCOMPARE(m_myObject->qtFunctionInvoked(), 35);
*/
// should pick myOverloadedSlot(QRegExp)
// Should pick myOverloadedSlot(QWebElement).
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*)
......
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