| 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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 if (!size) | 228 if (!size) |
| 229 return; | 229 return; |
| 230 | 230 |
| 231 m_attributes.clear(); | 231 m_attributes.clear(); |
| 232 m_attributes.reserveInitialCapacity(size); | 232 m_attributes.reserveInitialCapacity(size); |
| 233 for (size_t i = 0; i < size; ++i) { | 233 for (size_t i = 0; i < size; ++i) { |
| 234 const HTMLToken::Attribute& attribute = attributes[i]; | 234 const HTMLToken::Attribute& attribute = attributes[i]; |
| 235 if (attribute.nameAsVector().isEmpty()) | 235 if (attribute.nameAsVector().isEmpty()) |
| 236 continue; | 236 continue; |
| 237 | 237 |
| 238 ASSERT(attribute.nameRange().start); | 238 attribute.nameRange().checkValid(); |
| 239 ASSERT(attribute.nameRange().end); | 239 attribute.valueRange().checkValid(); |
| 240 ASSERT(attribute.valueRange().start); | |
| 241 ASSERT(attribute.valueRange().end); | |
| 242 | 240 |
| 243 AtomicString value(attribute.value8BitIfNecessary()); | 241 AtomicString value(attribute.value8BitIfNecessary()); |
| 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 } // namespace blink | 249 } // namespace blink |
| 252 | 250 |
| 253 #endif | 251 #endif |
| OLD | NEW |