[Qt] Remove Qt specific code from css/SelectorChecker.cpp
authorabecsi@webkit.org <abecsi@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Sep 2011 08:59:13 +0000 (08:59 +0000)
committerabecsi@webkit.org <abecsi@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Sep 2011 08:59:13 +0000 (08:59 +0000)
https://bugs.webkit.org/show_bug.cgi?id=67702

Reviewed by Csaba Osztrogonác.

Source/WebCore:

No new tests needed.

* css/SelectorChecker.cpp: Move Qt-specific code to the Qt-specific WebPlatformStrategies.
(WebCore::SelectorChecker::determineLinkStateSlowCase):
* platform/VisitedLinkStrategy.h:

Source/WebKit/mac:

* WebCoreSupport/WebPlatformStrategies.h:
* WebCoreSupport/WebPlatformStrategies.mm:
(WebPlatformStrategies::isLinkVisited):

Source/WebKit/qt:

* WebCoreSupport/WebPlatformStrategies.cpp: Check the Qt global history here, instead of a platform independent file.
(WebPlatformStrategies::isLinkVisited):
* WebCoreSupport/WebPlatformStrategies.h:

Source/WebKit/win:

* WebCoreSupport/WebPlatformStrategies.cpp: Modify to match new prototype.
(WebPlatformStrategies::isLinkVisited):
* WebCoreSupport/WebPlatformStrategies.h: Ditto.

Source/WebKit/wince:

* WebCoreSupport/PlatformStrategiesWinCE.cpp:
(PlatformStrategiesWinCE::addVisitedLink):
* WebCoreSupport/PlatformStrategiesWinCE.h:

Source/WebKit2:

* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: Modify to match new prototype.
(WebKit::WebPlatformStrategies::isLinkVisited):
(WebKit::WebPlatformStrategies::addVisitedLink):
* WebProcess/WebCoreSupport/WebPlatformStrategies.h: Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95604 268f45cc-cd09-0410-ab3c-d52691b4dbfc

18 files changed:
Source/WebCore/ChangeLog
Source/WebCore/css/SelectorChecker.cpp
Source/WebCore/platform/VisitedLinkStrategy.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebPlatformStrategies.h
Source/WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm
Source/WebKit/qt/ChangeLog
Source/WebKit/qt/WebCoreSupport/WebPlatformStrategies.cpp
Source/WebKit/qt/WebCoreSupport/WebPlatformStrategies.h
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebCoreSupport/WebPlatformStrategies.cpp
Source/WebKit/win/WebCoreSupport/WebPlatformStrategies.h
Source/WebKit/wince/ChangeLog
Source/WebKit/wince/WebCoreSupport/PlatformStrategiesWinCE.cpp
Source/WebKit/wince/WebCoreSupport/PlatformStrategiesWinCE.h
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.h

index 474b51e..7baadea 100644 (file)
@@ -1,3 +1,16 @@
+2011-09-21  Andras Becsi  <andras.becsi@nokia.com>
+
+        [Qt] Remove Qt specific code from css/SelectorChecker.cpp
+        https://bugs.webkit.org/show_bug.cgi?id=67702
+
+        Reviewed by Csaba Osztrogonác.
+
+        No new tests needed.
+
+        * css/SelectorChecker.cpp: Move Qt-specific code to the Qt-specific WebPlatformStrategies.
+        (WebCore::SelectorChecker::determineLinkStateSlowCase):
+        * platform/VisitedLinkStrategy.h:
+
 2011-09-16  MORITA Hajime  <morrita@google.com>
 
         Style changes on forwarded shadow children should trigger shadow renderer reconstruction.
index 6eb1212..3aeffe4 100644 (file)
 #include "XLinkNames.h"
 #endif
 
-#if PLATFORM(QT)
-//FIXME: Remove this Qt specific code from a platform neutral file.
-#include <qwebhistoryinterface.h>
-#endif
-
 namespace WebCore {
     
 using namespace HTMLNames;
@@ -230,29 +225,11 @@ EInsideLink SelectorChecker::determineLinkStateSlowCase(Element* element) const
     const AtomicString* attr = linkAttribute(element);
     if (!attr || attr->isNull())
         return NotInsideLink;
-    
-#if PLATFORM(QT)
-    //FIXME: Remove this Qt specific code from a platform neutral file.
-    Vector<UChar, 512> url;
-    visitedURL(m_document->baseURL(), *attr, url);
-    if (url.isEmpty())
-        return InsideUnvisitedLink;
-    
-    // If the Qt4.4 interface for the history is used, we will have to fallback
-    // to the old global history.
-    QWebHistoryInterface* iface = QWebHistoryInterface::defaultInterface();
-    if (iface)
-        return iface->historyContains(QString(reinterpret_cast<QChar*>(url.data()), url.size())) ? InsideVisitedLink : InsideUnvisitedLink;
-    
-    LinkHash hash = visitedLinkHash(url.data(), url.size());
-    if (!hash)
-        return InsideUnvisitedLink;
-#else
+
     LinkHash hash = visitedLinkHash(m_document->baseURL(), *attr);
     if (!hash)
         return InsideUnvisitedLink;
-#endif
-    
+
     Frame* frame = m_document->frame();
     if (!frame)
         return InsideUnvisitedLink;
@@ -264,7 +241,7 @@ EInsideLink SelectorChecker::determineLinkStateSlowCase(Element* element) const
     m_linksCheckedForVisitedState.add(hash);
     
 #if USE(PLATFORM_STRATEGIES)
-    return platformStrategies()->visitedLinkStrategy()->isLinkVisited(page, hash) ? InsideVisitedLink : InsideUnvisitedLink;
+    return platformStrategies()->visitedLinkStrategy()->isLinkVisited(page, hash, m_document->baseURL(), *attr) ? InsideVisitedLink : InsideUnvisitedLink;
 #else
     return page->group().isLinkVisited(hash) ? InsideVisitedLink : InsideUnvisitedLink;
 #endif
index fc88010..236fe2f 100644 (file)
@@ -32,10 +32,11 @@ namespace WebCore {
 
 typedef uint64_t LinkHash;
 class Page;
+class KURL;
 
 class VisitedLinkStrategy {
 public:
-    virtual bool isLinkVisited(Page*, LinkHash) = 0;
+    virtual bool isLinkVisited(Page*, LinkHash, const KURL& baseURL, const AtomicString& attributeURL) = 0;
     virtual void addVisitedLink(Page*, LinkHash) = 0;
 
 protected:
index 3ba834f..7e54d68 100644 (file)
@@ -1,3 +1,14 @@
+2011-09-21  Andras Becsi  <andras.becsi@nokia.com>
+
+        [Qt] Remove Qt specific code from css/SelectorChecker.cpp
+        https://bugs.webkit.org/show_bug.cgi?id=67702
+
+        Reviewed by Csaba Osztrogonác.
+
+        * WebCoreSupport/WebPlatformStrategies.h:
+        * WebCoreSupport/WebPlatformStrategies.mm:
+        (WebPlatformStrategies::isLinkVisited):
+
 2011-09-20  Anders Carlsson  <andersca@apple.com>
 
         Remove ScrollView::platformContentsSize
index 87471f6..953abe6 100644 (file)
@@ -51,7 +51,7 @@ private:
     virtual void getPluginInfo(const WebCore::Page*, Vector<WebCore::PluginInfo>&);
 
     // WebCore::VisitedLinkStrategy
-    virtual bool isLinkVisited(WebCore::Page*, WebCore::LinkHash);
+    virtual bool isLinkVisited(WebCore::Page*, WebCore::LinkHash, const WebCore::KURL& baseURL, const WTF::AtomicString& attributeURL);
     virtual void addVisitedLink(WebCore::Page*, WebCore::LinkHash);
 };
 
index f8e1a7a..d1a4d95 100644 (file)
@@ -81,7 +81,7 @@ void WebPlatformStrategies::getPluginInfo(const WebCore::Page*, Vector<WebCore::
     END_BLOCK_OBJC_EXCEPTIONS;
 }
 
-bool WebPlatformStrategies::isLinkVisited(Page* page, LinkHash hash)
+bool WebPlatformStrategies::isLinkVisited(Page* page, LinkHash hash, const KURL&, const AtomicString&)
 {
     return page->group().isLinkVisited(hash);
 }
index c28af21..a2fb815 100644 (file)
@@ -1,3 +1,14 @@
+2011-09-21  Andras Becsi  <andras.becsi@nokia.com>
+
+        [Qt] Remove Qt specific code from css/SelectorChecker.cpp
+        https://bugs.webkit.org/show_bug.cgi?id=67702
+
+        Reviewed by Csaba Osztrogonác.
+
+        * WebCoreSupport/WebPlatformStrategies.cpp: Check the Qt global history here, instead of a platform independent file.
+        (WebPlatformStrategies::isLinkVisited):
+        * WebCoreSupport/WebPlatformStrategies.h:
+
 2011-09-20  Jarred Nicholls  <jarred@sencha.com>
 
         [Qt] Permit qrc resources to load in QWebSettings::setUserStyleSheetUrl()
index adf8614..a775f31 100644 (file)
@@ -39,6 +39,7 @@
 #include <PluginDatabase.h>
 #include <QCoreApplication>
 #include <QLocale>
+#include <qwebhistoryinterface.h>
 #include <qwebpage.h>
 #include <qwebpluginfactory.h>
 #include <wtf/MathExtras.h>
@@ -743,8 +744,19 @@ String WebPlatformStrategies::validationMessageStepMismatchText()
 
 // VisitedLinkStrategy
 
-bool WebPlatformStrategies::isLinkVisited(Page* page, LinkHash hash)
+bool WebPlatformStrategies::isLinkVisited(Page* page, LinkHash hash, const KURL& baseURL, const AtomicString& attributeURL)
 {
+    ASSERT(hash);
+
+    Vector<UChar, 512> url;
+    visitedURL(baseURL, attributeURL, url);
+
+    // If the Qt4.4 interface for the history is used, we will have to fallback
+    // to the old global history.
+    QWebHistoryInterface* iface = QWebHistoryInterface::defaultInterface();
+    if (iface)
+        return iface->historyContains(QString(reinterpret_cast<QChar*>(url.data()), url.size()));
+
     return page->group().isLinkVisited(hash);
 }
 
index 1024dac..9315291 100644 (file)
@@ -153,7 +153,7 @@ private:
     virtual WTF::String validationMessageStepMismatchText();
 
     // WebCore::VisitedLinkStrategy
-    virtual bool isLinkVisited(WebCore::Page*, WebCore::LinkHash);
+    virtual bool isLinkVisited(WebCore::Page*, WebCore::LinkHash, const WebCore::KURL& baseURL, const WTF::AtomicString& attributeURL);
     virtual void addVisitedLink(WebCore::Page*, WebCore::LinkHash);
 };
 
index 09062fe..c64fc82 100644 (file)
@@ -1,3 +1,14 @@
+2011-09-21  Andras Becsi  <andras.becsi@nokia.com>
+
+        [Qt] Remove Qt specific code from css/SelectorChecker.cpp
+        https://bugs.webkit.org/show_bug.cgi?id=67702
+
+        Reviewed by Csaba Osztrogonác.
+
+        * WebCoreSupport/WebPlatformStrategies.cpp: Modify to match new prototype.
+        (WebPlatformStrategies::isLinkVisited):
+        * WebCoreSupport/WebPlatformStrategies.h: Ditto.
+
 2011-09-17  Mihai Parparita  <mihaip@chromium.org>
 
         FrameLoaderClient BackForwardList-related methods are unsued
index fdafa25..7a3febb 100644 (file)
@@ -99,7 +99,7 @@ void WebPlatformStrategies::getPluginInfo(const WebCore::Page*, Vector<WebCore::
     }
 }
 
-bool WebPlatformStrategies::isLinkVisited(Page* page, LinkHash hash)
+bool WebPlatformStrategies::isLinkVisited(Page* page, LinkHash hash, const KURL&, const AtomicString&)
 {
     return page->group().isLinkVisited(hash);
 }
index c4f199b..509de09 100644 (file)
@@ -51,7 +51,7 @@ private:
     virtual void getPluginInfo(const WebCore::Page*, Vector<WebCore::PluginInfo>&);
 
     // WebCore::VisitedLinkStrategy
-    virtual bool isLinkVisited(WebCore::Page*, WebCore::LinkHash);
+    virtual bool isLinkVisited(WebCore::Page*, WebCore::LinkHash, const WebCore::KURL& baseURL, const WTF::AtomicString& attributeURL);
     virtual void addVisitedLink(WebCore::Page*, WebCore::LinkHash);
 };
 
index 58897d8..39e2d11 100644 (file)
@@ -1,3 +1,14 @@
+2011-09-21  Andras Becsi  <andras.becsi@nokia.com>
+
+        [Qt] Remove Qt specific code from css/SelectorChecker.cpp
+        https://bugs.webkit.org/show_bug.cgi?id=67702
+
+        Reviewed by Csaba Osztrogonác.
+
+        * WebCoreSupport/PlatformStrategiesWinCE.cpp:
+        (PlatformStrategiesWinCE::addVisitedLink):
+        * WebCoreSupport/PlatformStrategiesWinCE.h:
+
 2011-09-17  Mihai Parparita  <mihaip@chromium.org>
 
         FrameLoaderClient BackForwardList-related methods are unsued
index 4869674..c23d615 100644 (file)
@@ -676,7 +676,7 @@ bool PlatformStrategiesWinCE::isLinkVisited(Page* page, LinkHash hash)
     return page->group().isLinkVisited(hash);
 }
 
-void PlatformStrategiesWinCE::addVisitedLink(Page* page, LinkHash hash)
+void PlatformStrategiesWinCE::addVisitedLink(Page* page, LinkHash hash, const KURL&, const AtomicString&)
 {
     page->group().addVisitedLinkHash(hash);
 }
index 83a7491..2f05245 100644 (file)
@@ -148,7 +148,7 @@ private:
     virtual WTF::String validationMessageStepMismatchText();
 
     // WebCore::VisitedLinkStrategy
-    virtual bool isLinkVisited(WebCore::Page*, WebCore::LinkHash);
+    virtual bool isLinkVisited(WebCore::Page*, WebCore::LinkHash, const WebCore::KURL&, const WTF::AtomicString&);
     virtual void addVisitedLink(WebCore::Page*, WebCore::LinkHash);
 };
 
index b8a79bc..1e4eb28 100644 (file)
@@ -1,3 +1,15 @@
+2011-09-21  Andras Becsi  <andras.becsi@nokia.com>
+
+        [Qt] Remove Qt specific code from css/SelectorChecker.cpp
+        https://bugs.webkit.org/show_bug.cgi?id=67702
+
+        Reviewed by Csaba Osztrogonác.
+
+        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: Modify to match new prototype.
+        (WebKit::WebPlatformStrategies::isLinkVisited):
+        (WebKit::WebPlatformStrategies::addVisitedLink):
+        * WebProcess/WebCoreSupport/WebPlatformStrategies.h: Ditto.
+
 2011-09-20  Anders Carlsson  <andersca@apple.com>
 
         Get rid of PluginView::setBoundsSize from WebKit2
index 9cb6bec..65240ee 100644 (file)
@@ -115,12 +115,12 @@ void WebPlatformStrategies::populatePluginCache()
 
 // VisitedLinkStrategy
 
-bool WebPlatformStrategies::isLinkVisited(Page* page, LinkHash linkHash)
+bool WebPlatformStrategies::isLinkVisited(Page*, LinkHash linkHash, const KURL&, const AtomicString&)
 {
     return WebProcess::shared().isLinkVisited(linkHash);
 }
 
-void WebPlatformStrategies::addVisitedLink(Page* page, LinkHash linkHash)
+void WebPlatformStrategies::addVisitedLink(Page*, LinkHash linkHash)
 {
     WebProcess::shared().addVisitedLink(linkHash);
 }
index 55285de..e772ce0 100644 (file)
@@ -56,7 +56,7 @@ private:
     void populatePluginCache();
 
     // WebCore::VisitedLinkStrategy
-    virtual bool isLinkVisited(WebCore::Page*, WebCore::LinkHash);
+    virtual bool isLinkVisited(WebCore::Page*, WebCore::LinkHash, const WebCore::KURL& baseURL, const WTF::AtomicString& attributeURL);
     virtual void addVisitedLink(WebCore::Page*, WebCore::LinkHash);
 
     bool m_pluginCacheIsPopulated;