| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google, Inc. All Rights Reserved. | 2 * Copyright (C) 2013 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 m_doctypeData->m_hasPublicIdentifier = true; | 155 m_doctypeData->m_hasPublicIdentifier = true; |
| 156 append(m_doctypeData->m_publicIdentifier, token.publicIdentifier()); | 156 append(m_doctypeData->m_publicIdentifier, token.publicIdentifier()); |
| 157 m_doctypeData->m_hasSystemIdentifier = true; | 157 m_doctypeData->m_hasSystemIdentifier = true; |
| 158 append(m_doctypeData->m_systemIdentifier, token.systemIdentifier()); | 158 append(m_doctypeData->m_systemIdentifier, token.systemIdentifier()); |
| 159 m_doctypeData->m_forceQuirks = token.doctypeForcesQuirks(); | 159 m_doctypeData->m_forceQuirks = token.doctypeForcesQuirks(); |
| 160 break; | 160 break; |
| 161 case HTMLToken::EndOfFile: | 161 case HTMLToken::EndOfFile: |
| 162 break; | 162 break; |
| 163 case HTMLToken::StartTag: | 163 case HTMLToken::StartTag: |
| 164 m_attributes.reserveInitialCapacity(token.attributes().size()); | 164 m_attributes.reserveInitialCapacity(token.attributes().size()); |
| 165 for (Vector<CompactHTMLToken::Attribute>::const_iterator it = token.
attributes().begin(); it != token.attributes().end(); ++it) { | 165 for (const auto& it : token.attributes()) { |
| 166 QualifiedName name(nullAtom, AtomicString(it->name), nullAtom); | 166 QualifiedName name(nullAtom, AtomicString(it.name), nullAtom); |
| 167 // FIXME: This is N^2 for the number of attributes. | 167 // FIXME: This is N^2 for the number of attributes. |
| 168 if (!findAttributeInVector(m_attributes, name)) | 168 if (!findAttributeInVector(m_attributes, name)) |
| 169 m_attributes.append(Attribute(name, AtomicString(it->value))
); | 169 m_attributes.append(Attribute(name, AtomicString(it.value)))
; |
| 170 } | 170 } |
| 171 // Fall through! | 171 // Fall through! |
| 172 case HTMLToken::EndTag: | 172 case HTMLToken::EndTag: |
| 173 m_selfClosing = token.selfClosing(); | 173 m_selfClosing = token.selfClosing(); |
| 174 m_name = AtomicString(token.data()); | 174 m_name = AtomicString(token.data()); |
| 175 break; | 175 break; |
| 176 case HTMLToken::Character: | 176 case HTMLToken::Character: |
| 177 case HTMLToken::Comment: | 177 case HTMLToken::Comment: |
| 178 m_data = token.data(); | 178 m_data = token.data(); |
| 179 break; | 179 break; |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 const QualifiedName& name = nameForAttribute(attribute); | 242 const QualifiedName& name = nameForAttribute(attribute); |
| 243 // FIXME: This is N^2 for the number of attributes. | 243 // FIXME: This is N^2 for the number of attributes. |
| 244 if (!findAttributeInVector(m_attributes, name)) | 244 if (!findAttributeInVector(m_attributes, name)) |
| 245 m_attributes.append(Attribute(name, value)); | 245 m_attributes.append(Attribute(name, value)); |
| 246 } | 246 } |
| 247 } | 247 } |
| 248 | 248 |
| 249 } | 249 } |
| 250 | 250 |
| 251 #endif | 251 #endif |
| OLD | NEW |