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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 if (!size) | 226 if (!size) |
227 return; | 227 return; |
228 | 228 |
229 m_attributes.clear(); | 229 m_attributes.clear(); |
230 m_attributes.reserveInitialCapacity(size); | 230 m_attributes.reserveInitialCapacity(size); |
231 for (size_t i = 0; i < size; ++i) { | 231 for (size_t i = 0; i < size; ++i) { |
232 const HTMLToken::Attribute& attribute = attributes[i]; | 232 const HTMLToken::Attribute& attribute = attributes[i]; |
233 if (attribute.name.isEmpty()) | 233 if (attribute.name.isEmpty()) |
234 continue; | 234 continue; |
235 | 235 |
236 // FIXME: We should be able to add the following ASSERT once we fix | 236 ASSERT(attribute.nameRange.start); |
237 // https://bugs.webkit.org/show_bug.cgi?id=62971 | |
238 // ASSERT(attribute.nameRange.start); | |
239 ASSERT(attribute.nameRange.end); | 237 ASSERT(attribute.nameRange.end); |
240 ASSERT(attribute.valueRange.start); | 238 ASSERT(attribute.valueRange.start); |
241 ASSERT(attribute.valueRange.end); | 239 ASSERT(attribute.valueRange.end); |
242 | 240 |
243 AtomicString value(attribute.value); | 241 AtomicString value(attribute.value); |
244 const QualifiedName& name = nameForAttribute(attribute); | 242 const QualifiedName& name = nameForAttribute(attribute); |
245 // FIXME: This is N^2 for the number of attributes. | 243 // FIXME: This is N^2 for the number of attributes. |
246 if (!findAttributeInVector(m_attributes, name)) | 244 if (!findAttributeInVector(m_attributes, name)) |
247 m_attributes.append(Attribute(name, value)); | 245 m_attributes.append(Attribute(name, value)); |
248 } | 246 } |
249 } | 247 } |
250 | 248 |
251 } | 249 } |
252 | 250 |
253 #endif | 251 #endif |
OLD | NEW |