summaryrefslogtreecommitdiffstats
path: root/WebCore/html/HTMLLinkElement.cpp
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-07-09 12:06:11 +0100
committerSteve Block <steveblock@google.com>2010-07-09 12:06:11 +0100
commitd4b24d9a829ed7de70381c8b99fb75a07ab40466 (patch)
tree6c10d923260d63e3a607411ce44e63ef7e121558 /WebCore/html/HTMLLinkElement.cpp
parente32ff802ed0d82511f12c353a1e84bf49b1a284b (diff)
downloadexternal_webkit-d4b24d9a829ed7de70381c8b99fb75a07ab40466.zip
external_webkit-d4b24d9a829ed7de70381c8b99fb75a07ab40466.tar.gz
external_webkit-d4b24d9a829ed7de70381c8b99fb75a07ab40466.tar.bz2
Properly guard local changes for link prefetching
This fixes the WebKit build for PLATFORM(MAC) Change-Id: Ic19e8840363bc1d42b569c3e732ee3ee4e92c00a
Diffstat (limited to 'WebCore/html/HTMLLinkElement.cpp')
-rw-r--r--WebCore/html/HTMLLinkElement.cpp12
1 files changed, 8 insertions, 4 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()
{