Changeset 58427 in webkit


Ignore:
Timestamp:
Apr 28, 2010 1:50:23 PM (14 years ago)
Author:
tonikitoo@webkit.org
Message:

[Qt] tst_QWebHistoryInterface::visitedLinks() fails
https://bugs.webkit.org/show_bug.cgi?id=37323

Patch by Antonio Gomes <tonikitoo@webkit.org>, Yi Shen <yi.4.shen@nokia.com> on 2010-04-28
Reviewed by NOBODY Simon Hausmann.

Patch fixes styleProperty method of QWebElement to make use of
CSSComputedStyleDeclaration::computedStyle 'allowVisitedStyle' parameter
and the corresponding failing QWebHistoryInterface::visitedLinks method.

  • Api/qwebelement.cpp:

(QWebElement::styleProperty):

  • tests/qwebhistoryinterface/tst_qwebhistoryinterface.cpp:

(tst_QWebHistoryInterface::visitedLinks):

Location:
trunk/WebKit/qt
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/qt/Api/qwebelement.cpp

    r56825 r58427  
    822822        int propID = cssPropertyID(name);
    823823
    824         RefPtr<CSSComputedStyleDeclaration> style = computedStyle(m_element);
     824        RefPtr<CSSComputedStyleDeclaration> style = computedStyle(m_element, true);
    825825        if (!propID || !style)
    826826            return QString();
  • trunk/WebKit/qt/ChangeLog

    r58405 r58427  
     12010-04-28  Antonio Gomes  <tonikitoo@webkit.org>, Yi Shen <yi.4.shen@nokia.com>
     2
     3        Reviewed by Simon Hausmann.
     4
     5        [Qt] tst_QWebHistoryInterface::visitedLinks() fails
     6        https://bugs.webkit.org/show_bug.cgi?id=37323
     7
     8        Patch fixes styleProperty method of QWebElement to make use of
     9        CSSComputedStyleDeclaration::computedStyle 'allowVisitedStyle' parameter
     10        and the corresponding failing QWebHistoryInterface::visitedLinks method.
     11
     12        * Api/qwebelement.cpp:
     13        (QWebElement::styleProperty):
     14        * tests/qwebhistoryinterface/tst_qwebhistoryinterface.cpp:
     15        (tst_QWebHistoryInterface::visitedLinks):
     16
    1172010-04-28  Luiz Agostini  <luiz.agostini@openbossa.org>
    218
  • trunk/WebKit/qt/tests/qwebhistoryinterface/tst_qwebhistoryinterface.cpp

    r43052 r58427  
    2424#include <qwebview.h>
    2525#include <qwebframe.h>
     26#include <qwebelement.h>
    2627#include <qwebhistoryinterface.h>
    2728#include <QDebug>
     
    8687{
    8788    QWebHistoryInterface::setDefaultInterface(new FakeHistoryImplementation);
    88     m_view->setHtml("<html><body><a href='http://www.trolltech.com'>Trolltech</a></body></html>");
    89     QCOMPARE(m_page->mainFrame()->evaluateJavaScript("document.querySelectorAll(':visited').length;").toString(),
    90              QString::fromLatin1("1"));
     89    m_view->setHtml("<html><style>:link{color:green}:visited{color:red}</style><body><a href='http://www.trolltech.com' id='vlink'>Trolltech</a></body></html>");
     90    QWebElement anchor = m_view->page()->mainFrame()->findFirstElement("a[id=vlink]");
     91    QString linkColor = anchor.styleProperty("color", QWebElement::ComputedStyle);
     92    QCOMPARE(linkColor, QString::fromLatin1("rgb(255, 0, 0)"));
    9193}
    9294
Note: See TracChangeset for help on using the changeset viewer.