Changeset 89830 in webkit


Ignore:
Timestamp:
Jun 27, 2011 10:18:24 AM (13 years ago)
Author:
caio.oliveira@openbossa.org
Message:

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.
Location:
trunk/Source
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r89828 r89830  
     12011-06-27  Caio Marcelo de Oliveira Filho  <caio.oliveira@openbossa.org>
     2
     3        Reviewed by Andreas Kling.
     4
     5        [Qt] tst_QWebFrame::overloadedSlots() fails
     6        https://bugs.webkit.org/show_bug.cgi?id=37319
     7
     8        This patch is based on Noam Rosenthal original patch in the same bug.
     9
     10        When hinted with QWebElement metatype, we qualify the conversion
     11        from JSElement as a "perfect match".
     12
     13        The test was failing because the wrong slot was called, since the QWebElement
     14        match was taken as equal to the others and not chosen when the metacall happened.
     15
     16        * bridge/qt/qt_runtime.cpp:
     17        (JSC::Bindings::convertValueToQVariant): Identify the conversion between JSElement
     18        to QWebElement as a "perfect match" (dist = 0). Add comments to explain the reason
     19        why we have the implicit conversion.
     20
    1212011-06-27  ChangSeok Oh  <shivamidow@gmail.com>
    222
  • trunk/Source/WebCore/bridge/qt/qt_runtime.cpp

    r89019 r89830  
    779779                ret = QtPixmapInstance::variantFromObject(object, static_cast<QMetaType::Type>(hint));
    780780            } else if (hint == (QMetaType::Type) qMetaTypeId<QWebElement>()) {
    781                 if (object && object->inherits(&JSHTMLElement::s_info))
    782                     ret = QVariant::fromValue<QWebElement>(QtWebElementRuntime::create((static_cast<JSHTMLElement*>(object))->impl()));
    783                 else if (object && object->inherits(&JSDocument::s_info))
     781                if (object && object->inherits(&JSElement::s_info)) {
     782                    ret = QVariant::fromValue<QWebElement>(QtWebElementRuntime::create((static_cast<JSElement*>(object))->impl()));
     783                    dist = 0;
     784                    // Allow other objects to reach this one. This won't cause our algorithm to
     785                    // loop since when we find an Element we do not recurse.
     786                    visitedObjects->remove(object);
     787                    break;
     788                }
     789                if (object && object->inherits(&JSDocument::s_info)) {
     790                    // To support LayoutTestControllerQt::nodesFromRect(), used in DRT, we do an implicit
     791                    // conversion from 'document' to the QWebElement representing the 'document.documentElement'.
     792                    // We can't simply use a QVariantMap in nodesFromRect() because it currently times out
     793                    // when serializing DOMMimeType and DOMPlugin, even if we limit the recursion.
    784794                    ret = QVariant::fromValue<QWebElement>(QtWebElementRuntime::create((static_cast<JSDocument*>(object))->impl()->documentElement()));
    785                 else
     795                } else
    786796                    ret = QVariant::fromValue<QWebElement>(QWebElement());
    787797            } else if (hint == (QMetaType::Type) qMetaTypeId<QDRTNode>()) {
  • trunk/Source/WebKit/qt/ChangeLog

    r89744 r89830  
     12011-06-27  Caio Marcelo de Oliveira Filho  <caio.oliveira@openbossa.org>
     2
     3        Reviewed by Andreas Kling.
     4
     5        [Qt] tst_QWebFrame::overloadedSlots() fails
     6        https://bugs.webkit.org/show_bug.cgi?id=37319
     7
     8        * tests/qwebframe/tst_qwebframe.cpp:
     9        (tst_QWebFrame::overloadedSlots): Remove expected failure and
     10        fix the comment.
     11
    1122011-06-20  Robert Hogan  <robert@webkit.org>
    213
  • trunk/Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp

    r89561 r89830  
    20052005    */
    20062006
    2007     // should pick myOverloadedSlot(QRegExp)
     2007    // Should pick myOverloadedSlot(QWebElement).
    20082008    m_myObject->resetQtFunctionInvoked();
    20092009    evalJS("myObject.myOverloadedSlot(document.body)");
    2010     QEXPECT_FAIL("", "https://bugs.webkit.org/show_bug.cgi?id=37319", Continue);
    20112010    QCOMPARE(m_myObject->qtFunctionInvoked(), 36);
    20122011
Note: See TracChangeset for help on using the changeset viewer.