summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--WebCore/html/HTMLLinkElement.cpp12
-rw-r--r--WebCore/html/HTMLLinkElement.h14
2 files changed, 19 insertions, 7 deletions
diff --git a/WebCore/html/HTMLLinkElement.cpp b/WebCore/html/HTMLLinkElement.cpp
index 5ac39d9..13e43fd 100644
--- a/WebCore/html/HTMLLinkElement.cpp
+++ b/WebCore/html/HTMLLinkElement.cpp
@@ -41,7 +41,7 @@
#include "ScriptEventListener.h"
#include "Settings.h"
#include <wtf/StdLibExtras.h>
-#if ENABLE(LINK_PREFETCH)
+#if PLATFORM(ANDROID) && ENABLE(LINK_PREFETCH)
#include "CachedLinkPrefetch.h"
#endif
@@ -137,8 +137,10 @@ void HTMLLinkElement::parseMappedAttribute(Attribute* attr)
setDisabledState(!attr->isNull());
else if (attr->name() == onbeforeloadAttr)
setAttributeEventListener(eventNames().beforeloadEvent, createAttributeEventListener(this, attr));
+#if PLATFORM(ANDROID) && ENABLE(LINK_PREFETCH)
else if (attr->name() == onloadAttr)
setAttributeEventListener(eventNames().loadEvent, createAttributeEventListener(this, attr));
+#endif
else {
if (attr->name() == titleAttr && m_sheet)
m_sheet->setTitle(attr->value());
@@ -152,7 +154,7 @@ void HTMLLinkElement::tokenizeRelAttribute(const AtomicString& rel, RelAttribute
relAttribute.m_isIcon = false;
relAttribute.m_isAlternate = false;
relAttribute.m_isDNSPrefetch = false;
-#if ENABLE(LINK_PREFETCH)
+#if PLATFORM(ANDROID) && ENABLE(LINK_PREFETCH)
relAttribute.m_isLinkPrefetch = false;
#endif
#ifdef ANDROID_APPLE_TOUCH_ICON
@@ -171,7 +173,7 @@ void HTMLLinkElement::tokenizeRelAttribute(const AtomicString& rel, RelAttribute
#endif
else if (equalIgnoringCase(rel, "dns-prefetch"))
relAttribute.m_isDNSPrefetch = true;
-#if ENABLE(LINK_PREFETCH)
+#if PLATFORM(ANDROID) && ENABLE(LINK_PREFETCH)
else if (equalIgnoringCase(rel, "prefetch"))
relAttribute.m_isLinkPrefetch = true;
#endif
@@ -219,7 +221,7 @@ void HTMLLinkElement::process()
if (m_relAttribute.m_isDNSPrefetch && m_url.isValid() && !m_url.isEmpty())
ResourceHandle::prepareForURL(m_url);
-#if ENABLE(LINK_PREFETCH)
+#if PLATFORM(ANDROID) && ENABLE(LINK_PREFETCH)
if (m_relAttribute.m_isLinkPrefetch && m_url.isValid()) {
m_cachedLinkPrefetch = document()->docLoader()->requestLinkPrefetch(m_url);
m_loading = true;
@@ -391,6 +393,7 @@ bool HTMLLinkElement::isLoading() const
return static_cast<CSSStyleSheet *>(m_sheet.get())->isLoading();
}
+#if PLATFORM(ANDROID) && ENABLE(LINK_PREFETCH)
void HTMLLinkElement::notifyFinished(CachedResource*)
{
if (!m_timer.isActive())
@@ -401,6 +404,7 @@ void HTMLLinkElement::timerFired(Timer<HTMLLinkElement>*)
{
dispatchEvent(Event::create(eventNames().loadEvent, false, false));
}
+#endif
bool HTMLLinkElement::sheetLoaded()
{
diff --git a/WebCore/html/HTMLLinkElement.h b/WebCore/html/HTMLLinkElement.h
index c8f0ca0..bd1642b 100644
--- a/WebCore/html/HTMLLinkElement.h
+++ b/WebCore/html/HTMLLinkElement.h
@@ -27,12 +27,16 @@
#include "CachedResourceClient.h"
#include "CachedResourceHandle.h"
#include "HTMLElement.h"
+#if PLATFORM(ANDROID) && ENABLE(LINK_PREFETCH)
#include "Timer.h"
+#endif
namespace WebCore {
class CachedCSSStyleSheet;
+#if PLATFORM(ANDROID) && ENABLE(LINK_PREFETCH)
class CachedLinkPrefetch;
+#endif
class KURL;
class HTMLLinkElement : public HTMLElement, public CachedResourceClient {
@@ -46,7 +50,7 @@ public:
bool m_isTouchIcon;
bool m_isPrecomposedTouchIcon;
#endif
-#if ENABLE(LINK_PREFETCH)
+#if PLATFORM(ANDROID) && ENABLE(LINK_PREFETCH)
bool m_isLinkPrefetch;
#endif
@@ -54,7 +58,7 @@ public:
#ifdef ANDROID_APPLE_TOUCH_ICON
, m_isTouchIcon(false), m_isPrecomposedTouchIcon(false)
#endif
-#if ENABLE(LINK_PREFETCH)
+#if PLATFORM(ANDROID) && ENABLE(LINK_PREFETCH)
, m_isLinkPrefetch(false)
#endif
{ };
@@ -115,7 +119,9 @@ private:
// from CachedResourceClient
virtual void setCSSStyleSheet(const String& href, const KURL& baseURL, const String& charset, const CachedCSSStyleSheet* sheet);
+#if PLATFORM(ANDROID) && ENABLE(LINK_PREFETCH)
virtual void notifyFinished(CachedResource*);
+#endif
virtual bool sheetLoaded();
@@ -142,7 +148,9 @@ private:
#endif
private:
+#if PLATFORM(ANDROID) && ENABLE(LINK_PREFETCH)
void timerFired(Timer<HTMLLinkElement>*);
+#endif
HTMLLinkElement(const QualifiedName&, Document*, bool createdByParser);
enum DisabledState {
@@ -153,7 +161,7 @@ private:
CachedResourceHandle<CachedCSSStyleSheet> m_cachedSheet;
RefPtr<CSSStyleSheet> m_sheet;
-#if ENABLE(LINK_PREFETCH)
+#if PLATFORM(ANDROID) && ENABLE(LINK_PREFETCH)
CachedResourceHandle<CachedLinkPrefetch> m_cachedLinkPrefetch;
#endif
KURL m_url;