| 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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 setUrlToLoad(attributeValue, DisallowURLReplacement); | 170 setUrlToLoad(attributeValue, DisallowURLReplacement); |
| 171 else if (match(attributeName, crossoriginAttr)) | 171 else if (match(attributeName, crossoriginAttr)) |
| 172 setCrossOriginAllowed(attributeValue); | 172 setCrossOriginAllowed(attributeValue); |
| 173 } else if (match(m_tagImpl, imgTag)) { | 173 } else if (match(m_tagImpl, imgTag)) { |
| 174 int effectiveSize = -1; // FIXME - hook up the real value from `size
s` | 174 int effectiveSize = -1; // FIXME - hook up the real value from `size
s` |
| 175 if (match(attributeName, srcAttr) && !m_encounteredImgSrc) { | 175 if (match(attributeName, srcAttr) && !m_encounteredImgSrc) { |
| 176 m_encounteredImgSrc = true; | 176 m_encounteredImgSrc = true; |
| 177 setUrlToLoad(bestFitSourceForImageAttributes(m_mediaValues->devi
cePixelRatio(), effectiveSize, attributeValue, m_srcsetImageCandidate), AllowURL
Replacement); | 177 setUrlToLoad(bestFitSourceForImageAttributes(m_mediaValues->devi
cePixelRatio(), effectiveSize, attributeValue, m_srcsetImageCandidate), AllowURL
Replacement); |
| 178 } else if (match(attributeName, crossoriginAttr)) { | 178 } else if (match(attributeName, crossoriginAttr)) { |
| 179 setCrossOriginAllowed(attributeValue); | 179 setCrossOriginAllowed(attributeValue); |
| 180 } else if (RuntimeEnabledFeatures::srcsetEnabled() | 180 } else if (match(attributeName, srcsetAttr) && m_srcsetImageCandidat
e.isEmpty()) { |
| 181 && match(attributeName, srcsetAttr) | |
| 182 && m_srcsetImageCandidate.isEmpty()) { | |
| 183 m_srcsetImageCandidate = bestFitSourceForSrcsetAttribute(m_media
Values->devicePixelRatio(), effectiveSize, attributeValue); | 181 m_srcsetImageCandidate = bestFitSourceForSrcsetAttribute(m_media
Values->devicePixelRatio(), effectiveSize, attributeValue); |
| 184 setUrlToLoad(bestFitSourceForImageAttributes(m_mediaValues->devi
cePixelRatio(), effectiveSize, m_urlToLoad, m_srcsetImageCandidate), AllowURLRep
lacement); | 182 setUrlToLoad(bestFitSourceForImageAttributes(m_mediaValues->devi
cePixelRatio(), effectiveSize, m_urlToLoad, m_srcsetImageCandidate), AllowURLRep
lacement); |
| 185 } | 183 } |
| 186 } else if (match(m_tagImpl, linkTag)) { | 184 } else if (match(m_tagImpl, linkTag)) { |
| 187 if (match(attributeName, hrefAttr)) | 185 if (match(attributeName, hrefAttr)) |
| 188 setUrlToLoad(attributeValue, DisallowURLReplacement); | 186 setUrlToLoad(attributeValue, DisallowURLReplacement); |
| 189 else if (match(attributeName, relAttr)) | 187 else if (match(attributeName, relAttr)) |
| 190 m_linkIsStyleSheet = relAttributeIsStyleSheet(attributeValue); | 188 m_linkIsStyleSheet = relAttributeIsStyleSheet(attributeValue); |
| 191 else if (match(attributeName, mediaAttr)) | 189 else if (match(attributeName, mediaAttr)) |
| 192 m_matchedMediaAttribute = mediaAttributeMatches(*m_mediaValues,
attributeValue); | 190 m_matchedMediaAttribute = mediaAttributeMatches(*m_mediaValues,
attributeValue); |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 if (m_token.type() == HTMLToken::StartTag) | 415 if (m_token.type() == HTMLToken::StartTag) |
| 418 m_tokenizer->updateStateFor(attemptStaticStringCreation(m_token.name
(), Likely8Bit)); | 416 m_tokenizer->updateStateFor(attemptStaticStringCreation(m_token.name
(), Likely8Bit)); |
| 419 m_scanner.scan(m_token, m_source, requests); | 417 m_scanner.scan(m_token, m_source, requests); |
| 420 m_token.clear(); | 418 m_token.clear(); |
| 421 } | 419 } |
| 422 | 420 |
| 423 preloader->takeAndPreload(requests); | 421 preloader->takeAndPreload(requests); |
| 424 } | 422 } |
| 425 | 423 |
| 426 } | 424 } |
| OLD | NEW |