| 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 enum URLReplacement { | 130 enum URLReplacement { |
| 131 AllowURLReplacement, | 131 AllowURLReplacement, |
| 132 DisallowURLReplacement | 132 DisallowURLReplacement |
| 133 }; | 133 }; |
| 134 | 134 |
| 135 void processAttributes(const HTMLToken::AttributeList& attributes) | 135 void processAttributes(const HTMLToken::AttributeList& attributes) |
| 136 { | 136 { |
| 137 ASSERT(isMainThread()); | 137 ASSERT(isMainThread()); |
| 138 if (!m_tagImpl) | 138 if (!m_tagImpl) |
| 139 return; | 139 return; |
| 140 for (HTMLToken::AttributeList::const_iterator iter = attributes.begin();
iter != attributes.end(); ++iter) { | 140 for (const auto& htmlTokenAttribute : attributes) { |
| 141 AtomicString attributeName(iter->name); | 141 AtomicString attributeName(htmlTokenAttribute.name); |
| 142 String attributeValue = StringImpl::create8BitIfPossible(iter->value
); | 142 String attributeValue = StringImpl::create8BitIfPossible(htmlTokenAt
tribute.value); |
| 143 processAttribute(attributeName, attributeValue); | 143 processAttribute(attributeName, attributeValue); |
| 144 } | 144 } |
| 145 } | 145 } |
| 146 | 146 |
| 147 void processAttributes(const Vector<CompactHTMLToken::Attribute>& attributes
) | 147 void processAttributes(const Vector<CompactHTMLToken::Attribute>& attributes
) |
| 148 { | 148 { |
| 149 if (!m_tagImpl) | 149 if (!m_tagImpl) |
| 150 return; | 150 return; |
| 151 for (Vector<CompactHTMLToken::Attribute>::const_iterator iter = attribut
es.begin(); iter != attributes.end(); ++iter) | 151 for (const auto& htmlTokenAttribute : attributes) |
| 152 processAttribute(iter->name, iter->value); | 152 processAttribute(htmlTokenAttribute.name, htmlTokenAttribute.value); |
| 153 } | 153 } |
| 154 | 154 |
| 155 void handlePictureSourceURL(String& sourceURL) | 155 void handlePictureSourceURL(String& sourceURL) |
| 156 { | 156 { |
| 157 if (match(m_tagImpl, sourceTag) && m_matchedMediaAttribute && sourceURL.
isEmpty()) | 157 if (match(m_tagImpl, sourceTag) && m_matchedMediaAttribute && sourceURL.
isEmpty()) |
| 158 sourceURL = m_srcsetImageCandidate.toString(); | 158 sourceURL = m_srcsetImageCandidate.toString(); |
| 159 else if (match(m_tagImpl, imgTag) && !sourceURL.isEmpty()) | 159 else if (match(m_tagImpl, imgTag) && !sourceURL.isEmpty()) |
| 160 setUrlToLoad(sourceURL, AllowURLReplacement); | 160 setUrlToLoad(sourceURL, AllowURLReplacement); |
| 161 } | 161 } |
| 162 | 162 |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 if (m_token.type() == HTMLToken::StartTag) | 517 if (m_token.type() == HTMLToken::StartTag) |
| 518 m_tokenizer->updateStateFor(attemptStaticStringCreation(m_token.name
(), Likely8Bit)); | 518 m_tokenizer->updateStateFor(attemptStaticStringCreation(m_token.name
(), Likely8Bit)); |
| 519 m_scanner.scan(m_token, m_source, requests); | 519 m_scanner.scan(m_token, m_source, requests); |
| 520 m_token.clear(); | 520 m_token.clear(); |
| 521 } | 521 } |
| 522 | 522 |
| 523 preloader->takeAndPreload(requests); | 523 preloader->takeAndPreload(requests); |
| 524 } | 524 } |
| 525 | 525 |
| 526 } | 526 } |
| OLD | NEW |