| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
| 3 * Copyright (C) 2009 Torch Mobile, Inc. http://www.torchmobile.com/ | 3 * Copyright (C) 2009 Torch Mobile, Inc. http://www.torchmobile.com/ |
| 4 * Copyright (C) 2010 Google Inc. All Rights Reserved. | 4 * Copyright (C) 2010 Google Inc. All Rights Reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 22 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
| 23 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 26 */ | 26 */ |
| 27 | 27 |
| 28 #include "config.h" | 28 #include "config.h" |
| 29 #include "core/html/parser/HTMLPreloadScanner.h" | 29 #include "core/html/parser/HTMLPreloadScanner.h" |
| 30 | 30 |
| 31 #include "HTMLNames.h" | 31 #include "HTMLNames.h" |
| 32 #include "InputTypeNames.h" |
| 32 #include "RuntimeEnabledFeatures.h" | 33 #include "RuntimeEnabledFeatures.h" |
| 33 #include "core/html/LinkRelAttribute.h" | 34 #include "core/html/LinkRelAttribute.h" |
| 34 #include "core/html/forms/InputTypeNames.h" | |
| 35 #include "core/html/parser/HTMLParserIdioms.h" | 35 #include "core/html/parser/HTMLParserIdioms.h" |
| 36 #include "core/html/parser/HTMLSrcsetParser.h" | 36 #include "core/html/parser/HTMLSrcsetParser.h" |
| 37 #include "core/html/parser/HTMLTokenizer.h" | 37 #include "core/html/parser/HTMLTokenizer.h" |
| 38 #include "platform/TraceEvent.h" | 38 #include "platform/TraceEvent.h" |
| 39 #include "wtf/MainThread.h" | 39 #include "wtf/MainThread.h" |
| 40 | 40 |
| 41 namespace WebCore { | 41 namespace WebCore { |
| 42 | 42 |
| 43 using namespace HTMLNames; | 43 using namespace HTMLNames; |
| 44 | 44 |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 if (match(attributeName, hrefAttr)) | 172 if (match(attributeName, hrefAttr)) |
| 173 setUrlToLoad(attributeValue, DisallowURLReplacement); | 173 setUrlToLoad(attributeValue, DisallowURLReplacement); |
| 174 else if (match(attributeName, relAttr)) | 174 else if (match(attributeName, relAttr)) |
| 175 m_linkIsStyleSheet = relAttributeIsStyleSheet(attributeValue); | 175 m_linkIsStyleSheet = relAttributeIsStyleSheet(attributeValue); |
| 176 else if (match(attributeName, mediaAttr)) | 176 else if (match(attributeName, mediaAttr)) |
| 177 m_mediaAttribute = attributeValue; | 177 m_mediaAttribute = attributeValue; |
| 178 } else if (match(m_tagImpl, inputTag)) { | 178 } else if (match(m_tagImpl, inputTag)) { |
| 179 if (match(attributeName, srcAttr)) | 179 if (match(attributeName, srcAttr)) |
| 180 setUrlToLoad(attributeValue, DisallowURLReplacement); | 180 setUrlToLoad(attributeValue, DisallowURLReplacement); |
| 181 else if (match(attributeName, typeAttr)) | 181 else if (match(attributeName, typeAttr)) |
| 182 m_inputIsImage = equalIgnoringCase(attributeValue, "image"); | 182 m_inputIsImage = equalIgnoringCase(attributeValue, InputTypeName
s::image); |
| 183 } | 183 } |
| 184 } | 184 } |
| 185 | 185 |
| 186 static bool relAttributeIsStyleSheet(const String& attributeValue) | 186 static bool relAttributeIsStyleSheet(const String& attributeValue) |
| 187 { | 187 { |
| 188 LinkRelAttribute rel(attributeValue); | 188 LinkRelAttribute rel(attributeValue); |
| 189 return rel.isStyleSheet() && !rel.isAlternate() && rel.iconType() == Inv
alidIcon && !rel.isDNSPrefetch(); | 189 return rel.isStyleSheet() && !rel.isAlternate() && rel.iconType() == Inv
alidIcon && !rel.isDNSPrefetch(); |
| 190 } | 190 } |
| 191 | 191 |
| 192 void setUrlToLoad(const String& value, URLReplacement replacement) | 192 void setUrlToLoad(const String& value, URLReplacement replacement) |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 if (m_token.type() == HTMLToken::StartTag) | 383 if (m_token.type() == HTMLToken::StartTag) |
| 384 m_tokenizer->updateStateFor(AtomicString(m_token.name())); | 384 m_tokenizer->updateStateFor(AtomicString(m_token.name())); |
| 385 m_scanner.scan(m_token, m_source, requests); | 385 m_scanner.scan(m_token, m_source, requests); |
| 386 m_token.clear(); | 386 m_token.clear(); |
| 387 } | 387 } |
| 388 | 388 |
| 389 preloader->takeAndPreload(requests); | 389 preloader->takeAndPreload(requests); |
| 390 } | 390 } |
| 391 | 391 |
| 392 } | 392 } |
| OLD | NEW |