Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1145)

Unified Diff: Source/core/html/LinkRelAttribute.cpp

Issue 132723002: Remove compile time flag TOUCH_ICON_LOADING and use runtime flag instead. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix unit test case Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/IconURL.h ('k') | Source/core/html/LinkRelAttributeTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/LinkRelAttribute.cpp
diff --git a/Source/core/html/LinkRelAttribute.cpp b/Source/core/html/LinkRelAttribute.cpp
index 0c2f32be4cad260e060b9c5a034b31094910b6f0..8ac4d7c08e9787614f7dd0d968858e34bdcb7419 100644
--- a/Source/core/html/LinkRelAttribute.cpp
+++ b/Source/core/html/LinkRelAttribute.cpp
@@ -32,6 +32,7 @@
#include "config.h"
#include "core/html/LinkRelAttribute.h"
+#include "RuntimeEnabledFeatures.h"
#include "wtf/text/WTFString.h"
namespace WebCore {
@@ -58,23 +59,22 @@ LinkRelAttribute::LinkRelAttribute(const String& rel)
, m_isLinkPrerender(false)
, m_isImport(false)
{
- if (equalIgnoringCase(rel, "stylesheet"))
+ if (equalIgnoringCase(rel, "stylesheet")) {
m_isStyleSheet = true;
- else if (equalIgnoringCase(rel, "icon") || equalIgnoringCase(rel, "shortcut icon"))
+ } else if (equalIgnoringCase(rel, "icon") || equalIgnoringCase(rel, "shortcut icon")) {
m_iconType = Favicon;
-#if ENABLE(TOUCH_ICON_LOADING)
- else if (equalIgnoringCase(rel, "apple-touch-icon"))
- m_iconType = TouchIcon;
- else if (equalIgnoringCase(rel, "apple-touch-icon-precomposed"))
- m_iconType = TouchPrecomposedIcon;
-#endif
- else if (equalIgnoringCase(rel, "dns-prefetch"))
+ } else if (equalIgnoringCase(rel, "dns-prefetch")) {
m_isDNSPrefetch = true;
- else if (equalIgnoringCase(rel, "alternate stylesheet") || equalIgnoringCase(rel, "stylesheet alternate")) {
+ } else if (equalIgnoringCase(rel, "alternate stylesheet") || equalIgnoringCase(rel, "stylesheet alternate")) {
m_isStyleSheet = true;
m_isAlternate = true;
} else if (equalIgnoringCase(rel, "import")) {
m_isImport = true;
+ } else if (RuntimeEnabledFeatures::touchIconLoadingEnabled()) {
+ if (equalIgnoringCase(rel, "apple-touch-icon"))
+ m_iconType = TouchIcon;
+ else if (equalIgnoringCase(rel, "apple-touch-icon-precomposed"))
+ m_iconType = TouchPrecomposedIcon;
} else {
// Tokenize the rel attribute and set bits based on specific keywords that we find.
String relCopy = rel;
@@ -83,24 +83,24 @@ LinkRelAttribute::LinkRelAttribute(const String& rel)
relCopy.split(' ', list);
Vector<String>::const_iterator end = list.end();
for (Vector<String>::const_iterator it = list.begin(); it != end; ++it) {
- if (equalIgnoringCase(*it, "stylesheet"))
+ if (equalIgnoringCase(*it, "stylesheet")) {
m_isStyleSheet = true;
- else if (equalIgnoringCase(*it, "alternate"))
+ } else if (equalIgnoringCase(*it, "alternate")) {
m_isAlternate = true;
- else if (equalIgnoringCase(*it, "icon"))
+ } else if (equalIgnoringCase(*it, "icon")) {
m_iconType = Favicon;
-#if ENABLE(TOUCH_ICON_LOADING)
- else if (equalIgnoringCase(*it, "apple-touch-icon"))
- m_iconType = TouchIcon;
- else if (equalIgnoringCase(*it, "apple-touch-icon-precomposed"))
- m_iconType = TouchPrecomposedIcon;
-#endif
- else if (equalIgnoringCase(*it, "prefetch"))
- m_isLinkPrefetch = true;
- else if (equalIgnoringCase(*it, "subresource"))
- m_isLinkSubresource = true;
- else if (equalIgnoringCase(*it, "prerender"))
- m_isLinkPrerender = true;
+ } else if (equalIgnoringCase(*it, "prefetch")) {
+ m_isLinkPrefetch = true;
+ } else if (equalIgnoringCase(*it, "subresource")) {
+ m_isLinkSubresource = true;
+ } else if (equalIgnoringCase(*it, "prerender")) {
+ m_isLinkPrerender = true;
+ } else if (RuntimeEnabledFeatures::touchIconLoadingEnabled()) {
+ if (equalIgnoringCase(*it, "apple-touch-icon"))
+ m_iconType = TouchIcon;
+ else if (equalIgnoringCase(*it, "apple-touch-icon-precomposed"))
+ m_iconType = TouchPrecomposedIcon;
+ }
}
}
}
« no previous file with comments | « Source/core/dom/IconURL.h ('k') | Source/core/html/LinkRelAttributeTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698