OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 24 matching lines...) Expand all Loading... |
35 | 35 |
36 namespace blink { | 36 namespace blink { |
37 | 37 |
38 LinkRelAttribute::LinkRelAttribute(const String& rel) | 38 LinkRelAttribute::LinkRelAttribute(const String& rel) |
39 : m_iconType(InvalidIcon) | 39 : m_iconType(InvalidIcon) |
40 , m_isStyleSheet(false) | 40 , m_isStyleSheet(false) |
41 , m_isAlternate(false) | 41 , m_isAlternate(false) |
42 , m_isDNSPrefetch(false) | 42 , m_isDNSPrefetch(false) |
43 , m_isPreconnect(false) | 43 , m_isPreconnect(false) |
44 , m_isLinkPrefetch(false) | 44 , m_isLinkPrefetch(false) |
45 , m_isLinkSubresource(false) | |
46 , m_isLinkPreload(false) | 45 , m_isLinkPreload(false) |
47 , m_isLinkPrerender(false) | 46 , m_isLinkPrerender(false) |
48 , m_isLinkNext(false) | 47 , m_isLinkNext(false) |
49 , m_isImport(false) | 48 , m_isImport(false) |
50 , m_isManifest(false) | 49 , m_isManifest(false) |
51 { | 50 { |
52 if (rel.isEmpty()) | 51 if (rel.isEmpty()) |
53 return; | 52 return; |
54 String relCopy = rel; | 53 String relCopy = rel; |
55 relCopy.replace('\n', ' '); | 54 relCopy.replace('\n', ' '); |
(...skipping 13 matching lines...) Expand all Loading... |
69 // FIXME: This doesn't really follow the spec that requires "shortcu
t icon" to be the | 68 // FIXME: This doesn't really follow the spec that requires "shortcu
t icon" to be the |
70 // entire string http://www.whatwg.org/specs/web-apps/current-work/m
ultipage/links.html#rel-icon | 69 // entire string http://www.whatwg.org/specs/web-apps/current-work/m
ultipage/links.html#rel-icon |
71 m_iconType = Favicon; | 70 m_iconType = Favicon; |
72 } else if (equalIgnoringCase(linkType, "prefetch")) { | 71 } else if (equalIgnoringCase(linkType, "prefetch")) { |
73 m_isLinkPrefetch = true; | 72 m_isLinkPrefetch = true; |
74 } else if (equalIgnoringCase(linkType, "dns-prefetch")) { | 73 } else if (equalIgnoringCase(linkType, "dns-prefetch")) { |
75 m_isDNSPrefetch = true; | 74 m_isDNSPrefetch = true; |
76 } else if (equalIgnoringCase(linkType, "preconnect")) { | 75 } else if (equalIgnoringCase(linkType, "preconnect")) { |
77 if (RuntimeEnabledFeatures::linkPreconnectEnabled()) | 76 if (RuntimeEnabledFeatures::linkPreconnectEnabled()) |
78 m_isPreconnect = true; | 77 m_isPreconnect = true; |
79 } else if (equalIgnoringCase(linkType, "subresource")) { | |
80 m_isLinkSubresource = true; | |
81 } else if (equalIgnoringCase(linkType, "preload")) { | 78 } else if (equalIgnoringCase(linkType, "preload")) { |
82 if (RuntimeEnabledFeatures::linkPreloadEnabled()) | 79 if (RuntimeEnabledFeatures::linkPreloadEnabled()) |
83 m_isLinkPreload = true; | 80 m_isLinkPreload = true; |
84 } else if (equalIgnoringCase(linkType, "prerender")) { | 81 } else if (equalIgnoringCase(linkType, "prerender")) { |
85 m_isLinkPrerender = true; | 82 m_isLinkPrerender = true; |
86 } else if (equalIgnoringCase(linkType, "next")) { | 83 } else if (equalIgnoringCase(linkType, "next")) { |
87 m_isLinkNext = true; | 84 m_isLinkNext = true; |
88 } else if (equalIgnoringCase(linkType, "apple-touch-icon")) { | 85 } else if (equalIgnoringCase(linkType, "apple-touch-icon")) { |
89 m_iconType = TouchIcon; | 86 m_iconType = TouchIcon; |
90 } else if (equalIgnoringCase(linkType, "apple-touch-icon-precomposed"))
{ | 87 } else if (equalIgnoringCase(linkType, "apple-touch-icon-precomposed"))
{ |
91 m_iconType = TouchPrecomposedIcon; | 88 m_iconType = TouchPrecomposedIcon; |
92 } else if (equalIgnoringCase(linkType, "manifest")) { | 89 } else if (equalIgnoringCase(linkType, "manifest")) { |
93 m_isManifest = true; | 90 m_isManifest = true; |
94 } | 91 } |
| 92 // Adding or removing a value here requires you to update RelList::suppo
rtedTokens() |
95 } | 93 } |
96 } | 94 } |
97 | 95 |
98 } // namespace blink | 96 } // namespace blink |
OLD | NEW |