diff options
author | Patrick Scott <phanna@android.com> | 2009-09-18 16:28:07 -0400 |
---|---|---|
committer | Patrick Scott <phanna@android.com> | 2009-09-22 13:28:47 -0400 |
commit | c6fbc06882c120f5f51090203775eb0421550d13 (patch) | |
tree | 1779462f4f7a9d3d9fd9ec32abdf5bfc0c612558 /WebCore/html | |
parent | f10585d69aaccf4c1b021df143ee0f08e338cf31 (diff) | |
download | external_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.
Diffstat (limited to 'WebCore/html')
-rw-r--r-- | WebCore/html/HTMLLinkElement.cpp | 17 | ||||
-rw-r--r-- | WebCore/html/HTMLLinkElement.h | 3 | ||||
-rw-r--r-- | WebCore/html/PreloadScanner.cpp | 5 |
3 files changed, 18 insertions, 7 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; |