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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
143 } | 143 } |
144 | 144 |
145 explicit AtomicHTMLToken(const CompactHTMLToken& token) | 145 explicit AtomicHTMLToken(const CompactHTMLToken& token) |
146 : m_type(token.type()) | 146 : m_type(token.type()) |
147 { | 147 { |
148 switch (m_type) { | 148 switch (m_type) { |
149 case HTMLToken::Uninitialized: | 149 case HTMLToken::Uninitialized: |
150 ASSERT_NOT_REACHED(); | 150 ASSERT_NOT_REACHED(); |
151 break; | 151 break; |
152 case HTMLToken::DOCTYPE: | 152 case HTMLToken::DOCTYPE: |
153 m_name = token.data(); | 153 m_name = AtomicString(token.data()); |
154 m_doctypeData = adoptPtr(new DoctypeData()); | 154 m_doctypeData = adoptPtr(new DoctypeData()); |
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 (Vector<CompactHTMLToken::Attribute>::const_iterator it = token. attributes().begin(); it != token.attributes().end(); ++it) { |
166 QualifiedName name(nullAtom, 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. |
eseidel
2014/01/02 19:18:28
I love that this has still never shown up on any b
| |
168 if (!findAttributeInVector(m_attributes, name)) | 168 if (!findAttributeInVector(m_attributes, name)) |
169 m_attributes.append(Attribute(name, 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 = 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; |
180 } | 180 } |
181 } | 181 } |
182 | 182 |
183 explicit AtomicHTMLToken(HTMLToken::Type type) | 183 explicit AtomicHTMLToken(HTMLToken::Type type) |
184 : m_type(type) | 184 : m_type(type) |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
244 const QualifiedName& name = nameForAttribute(attribute); | 244 const QualifiedName& name = nameForAttribute(attribute); |
245 // FIXME: This is N^2 for the number of attributes. | 245 // FIXME: This is N^2 for the number of attributes. |
246 if (!findAttributeInVector(m_attributes, name)) | 246 if (!findAttributeInVector(m_attributes, name)) |
247 m_attributes.append(Attribute(name, value)); | 247 m_attributes.append(Attribute(name, value)); |
248 } | 248 } |
249 } | 249 } |
250 | 250 |
251 } | 251 } |
252 | 252 |
253 #endif | 253 #endif |
OLD | NEW |