summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Scott <phanna@android.com>2009-09-18 16:28:07 -0400
committerPatrick Scott <phanna@android.com>2009-09-22 13:28:47 -0400
commitc6fbc06882c120f5f51090203775eb0421550d13 (patch)
tree1779462f4f7a9d3d9fd9ec32abdf5bfc0c612558
parentf10585d69aaccf4c1b021df143ee0f08e338cf31 (diff)
downloadexternal_webkit-c6fbc06882c120f5f51090203775eb0421550d13.zip
external_webkit-c6fbc06882c120f5f51090203775eb0421550d13.tar.gz
external_webkit-c6fbc06882c120f5f51090203775eb0421550d13.tar.bz2
Add apple-touch-icon-precomposed processing.
Send up a boolean to indicate if the touch icon url is precomposed.
-rw-r--r--WebCore/html/HTMLLinkElement.cpp17
-rw-r--r--WebCore/html/HTMLLinkElement.h3
-rw-r--r--WebCore/html/PreloadScanner.cpp5
-rw-r--r--WebCore/loader/FrameLoaderClient.h2
-rw-r--r--WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp4
-rw-r--r--WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.h2
-rw-r--r--WebKit/android/jni/WebCoreFrameBridge.cpp6
-rw-r--r--WebKit/android/jni/WebCoreFrameBridge.h2
8 files changed, 26 insertions, 15 deletions
diff --git a/WebCore/html/HTMLLinkElement.cpp b/WebCore/html/HTMLLinkElement.cpp
index aa6360b..f1313bb 100644
--- a/WebCore/html/HTMLLinkElement.cpp
+++ b/WebCore/html/HTMLLinkElement.cpp
@@ -54,6 +54,7 @@ HTMLLinkElement::HTMLLinkElement(const QualifiedName& qName, Document *doc, bool
, m_isIcon(false)
#ifdef ANDROID_APPLE_TOUCH_ICON
, m_isTouchIcon(false)
+ , m_isPrecomposedTouchIcon(false)
#endif
, m_isDNSPrefetch(false)
, m_createdByParser(createdByParser)
@@ -117,7 +118,7 @@ void HTMLLinkElement::parseMappedAttribute(MappedAttribute *attr)
{
if (attr->name() == relAttr) {
#ifdef ANDROID_APPLE_TOUCH_ICON
- tokenizeRelAttribute(attr->value(), m_isStyleSheet, m_alternate, m_isIcon, m_isTouchIcon, m_isDNSPrefetch);
+ tokenizeRelAttribute(attr->value(), m_isStyleSheet, m_alternate, m_isIcon, m_isTouchIcon, m_isPrecomposedTouchIcon, m_isDNSPrefetch);
#else
tokenizeRelAttribute(attr->value(), m_isStyleSheet, m_alternate, m_isIcon, m_isDNSPrefetch);
#endif
@@ -141,7 +142,7 @@ void HTMLLinkElement::parseMappedAttribute(MappedAttribute *attr)
}
#ifdef ANDROID_APPLE_TOUCH_ICON
-void HTMLLinkElement::tokenizeRelAttribute(const AtomicString& rel, bool& styleSheet, bool& alternate, bool& icon, bool& touchIcon, bool& dnsPrefetch)
+void HTMLLinkElement::tokenizeRelAttribute(const AtomicString& rel, bool& styleSheet, bool& alternate, bool& icon, bool& touchIcon, bool& precomposedTouchIcon, bool& dnsPrefetch)
#else
void HTMLLinkElement::tokenizeRelAttribute(const AtomicString& rel, bool& styleSheet, bool& alternate, bool& icon, bool& dnsPrefetch)
#endif
@@ -150,6 +151,10 @@ void HTMLLinkElement::tokenizeRelAttribute(const AtomicString& rel, bool& styleS
icon = false;
alternate = false;
dnsPrefetch = false;
+#ifdef ANDROID_APPLE_TOUCH_ICON
+ touchIcon = false;
+ precomposedTouchIcon = false;
+#endif
if (equalIgnoringCase(rel, "stylesheet"))
styleSheet = true;
else if (equalIgnoringCase(rel, "icon") || equalIgnoringCase(rel, "shortcut icon"))
@@ -157,6 +162,8 @@ void HTMLLinkElement::tokenizeRelAttribute(const AtomicString& rel, bool& styleS
#ifdef ANDROID_APPLE_TOUCH_ICON
else if (equalIgnoringCase(rel, "apple-touch-icon"))
touchIcon = true;
+ else if (equalIgnoringCase(rel, "apple-touch-icon-precomposed"))
+ precomposedTouchIcon = true;
#endif
else if (equalIgnoringCase(rel, "dns-prefetch"))
dnsPrefetch = true;
@@ -194,9 +201,11 @@ void HTMLLinkElement::process()
document()->setIconURL(m_url.string(), type);
#ifdef ANDROID_APPLE_TOUCH_ICON
- if (m_isTouchIcon && m_url.isValid() && !m_url.isEmpty())
+ if ((m_isTouchIcon || m_isPrecomposedTouchIcon) && m_url.isValid()
+ && !m_url.isEmpty())
document()->frame()->loader()->client()
- ->dispatchDidReceiveTouchIconURL(m_url.string());
+ ->dispatchDidReceiveTouchIconURL(m_url.string(),
+ m_isPrecomposedTouchIcon);
#endif
if (m_isDNSPrefetch && m_url.isValid() && !m_url.isEmpty())
diff --git a/WebCore/html/HTMLLinkElement.h b/WebCore/html/HTMLLinkElement.h
index acecc92..cc597ea 100644
--- a/WebCore/html/HTMLLinkElement.h
+++ b/WebCore/html/HTMLLinkElement.h
@@ -94,7 +94,7 @@ public:
virtual bool isURLAttribute(Attribute*) const;
#ifdef ANDROID_APPLE_TOUCH_ICON
- static void tokenizeRelAttribute(const AtomicString& value, bool& stylesheet, bool& alternate, bool& icon, bool& touchIcon, bool& dnsPrefetch);
+ static void tokenizeRelAttribute(const AtomicString& value, bool& stylesheet, bool& alternate, bool& icon, bool& touchIcon, bool& precomposedTouchIcon, bool& dnsPrefetch);
#else
static void tokenizeRelAttribute(const AtomicString& value, bool& stylesheet, bool& alternate, bool& icon, bool& dnsPrefetch);
#endif
@@ -116,6 +116,7 @@ protected:
bool m_isIcon;
#ifdef ANDROID_APPLE_TOUCH_ICON
bool m_isTouchIcon;
+ bool m_isPrecomposedTouchIcon;
#endif
bool m_isDNSPrefetch;
bool m_createdByParser;
diff --git a/WebCore/html/PreloadScanner.cpp b/WebCore/html/PreloadScanner.cpp
index 8762b7e..624f2ae 100644
--- a/WebCore/html/PreloadScanner.cpp
+++ b/WebCore/html/PreloadScanner.cpp
@@ -709,8 +709,9 @@ void PreloadScanner::processAttribute()
bool dnsPrefetch = false;
#ifdef ANDROID_APPLE_TOUCH_ICON
bool touchIcon = false;
- HTMLLinkElement::tokenizeRelAttribute(value, styleSheet, alternate, icon, touchIcon, dnsPrefetch);
- m_linkIsStyleSheet = styleSheet && !alternate && !icon && !touchIcon && !dnsPrefetch;
+ bool precomposedTouchIcon = false;
+ HTMLLinkElement::tokenizeRelAttribute(value, styleSheet, alternate, icon, touchIcon, precomposedTouchIcon, dnsPrefetch);
+ m_linkIsStyleSheet = styleSheet && !alternate && !icon && !touchIcon && !precomposedTouchIcon && !dnsPrefetch;
#else
HTMLLinkElement::tokenizeRelAttribute(value, styleSheet, alternate, icon, dnsPrefetch);
m_linkIsStyleSheet = styleSheet && !alternate && !icon && !dnsPrefetch;
diff --git a/WebCore/loader/FrameLoaderClient.h b/WebCore/loader/FrameLoaderClient.h
index db38f01..bca0d0b 100644
--- a/WebCore/loader/FrameLoaderClient.h
+++ b/WebCore/loader/FrameLoaderClient.h
@@ -232,7 +232,7 @@ namespace WebCore {
virtual void registerForIconNotification(bool listen = true) = 0;
#ifdef ANDROID_APPLE_TOUCH_ICON
- virtual void dispatchDidReceiveTouchIconURL(const String& url) = 0;
+ virtual void dispatchDidReceiveTouchIconURL(const String& url, bool precomposed) = 0;
#endif
#if PLATFORM(MAC)
diff --git a/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp b/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp
index 74b62dd..71d5048 100644
--- a/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp
+++ b/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp
@@ -243,12 +243,12 @@ void FrameLoaderClientAndroid::dispatchDidReceiveIcon() {
}
}
-void FrameLoaderClientAndroid::dispatchDidReceiveTouchIconURL(const String& url) {
+void FrameLoaderClientAndroid::dispatchDidReceiveTouchIconURL(const String& url, bool precomposed) {
ASSERT(m_frame);
// Do not report sub frame touch icons
if (m_frame->tree() && m_frame->tree()->parent())
return;
- m_webFrame->didReceiveTouchIconURL(url);
+ m_webFrame->didReceiveTouchIconURL(url, precomposed);
}
void FrameLoaderClientAndroid::dispatchDidStartProvisionalLoad() {
diff --git a/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.h b/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.h
index c04a28f..176c8be 100644
--- a/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.h
+++ b/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.h
@@ -192,7 +192,7 @@ namespace android {
virtual void registerForIconNotification(bool listen = true);
- virtual void dispatchDidReceiveTouchIconURL(const String& url);
+ virtual void dispatchDidReceiveTouchIconURL(const String& url, bool precomposed);
// WebIconDatabaseClient api
virtual void didAddIconForPageUrl(const String& pageUrl);
diff --git a/WebKit/android/jni/WebCoreFrameBridge.cpp b/WebKit/android/jni/WebCoreFrameBridge.cpp
index f768fd0..2d5c3f0 100644
--- a/WebKit/android/jni/WebCoreFrameBridge.cpp
+++ b/WebKit/android/jni/WebCoreFrameBridge.cpp
@@ -186,7 +186,7 @@ WebFrame::WebFrame(JNIEnv* env, jobject obj, jobject historyList, WebCore::Page*
mJavaFrame->mDidReceiveIcon = env->GetMethodID(clazz, "didReceiveIcon",
"(Landroid/graphics/Bitmap;)V");
mJavaFrame->mDidReceiveTouchIconUrl = env->GetMethodID(clazz, "didReceiveTouchIconUrl",
- "(Ljava/lang/String;)V");
+ "(Ljava/lang/String;Z)V");
mJavaFrame->mUpdateVisitedHistory = env->GetMethodID(clazz, "updateVisitedHistory",
"(Ljava/lang/String;Z)V");
mJavaFrame->mHandleUrl = env->GetMethodID(clazz, "handleUrl",
@@ -596,7 +596,7 @@ WebFrame::didReceiveIcon(WebCore::Image* icon)
}
void
-WebFrame::didReceiveTouchIconURL(const WebCore::String& url)
+WebFrame::didReceiveTouchIconURL(const WebCore::String& url, bool precomposed)
{
#ifdef ANDROID_INSTRUMENT
TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter);
@@ -606,7 +606,7 @@ WebFrame::didReceiveTouchIconURL(const WebCore::String& url)
url.length());
env->CallVoidMethod(mJavaFrame->frame(env).get(),
- mJavaFrame->mDidReceiveTouchIconUrl, jUrlStr);
+ mJavaFrame->mDidReceiveTouchIconUrl, jUrlStr, precomposed);
checkException(env);
}
diff --git a/WebKit/android/jni/WebCoreFrameBridge.h b/WebKit/android/jni/WebCoreFrameBridge.h
index 609aecc..7b49981 100644
--- a/WebKit/android/jni/WebCoreFrameBridge.h
+++ b/WebKit/android/jni/WebCoreFrameBridge.h
@@ -91,7 +91,7 @@ class WebFrame : public WebCoreRefObject {
void didReceiveIcon(WebCore::Image* icon);
- void didReceiveTouchIconURL(const WebCore::String& url);
+ void didReceiveTouchIconURL(const WebCore::String& url, bool precomposed);
void updateVisitedHistory(const WebCore::KURL& url, bool reload);