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 18 matching lines...) Expand all Loading... |
29 #include "core/HTMLElementLookupTrie.h" | 29 #include "core/HTMLElementLookupTrie.h" |
30 #include "core/dom/Attribute.h" | 30 #include "core/dom/Attribute.h" |
31 #include "core/html/parser/CompactHTMLToken.h" | 31 #include "core/html/parser/CompactHTMLToken.h" |
32 #include "core/html/parser/HTMLToken.h" | 32 #include "core/html/parser/HTMLToken.h" |
33 #include "wtf/Allocator.h" | 33 #include "wtf/Allocator.h" |
34 #include "wtf/RefCounted.h" | 34 #include "wtf/RefCounted.h" |
35 #include "wtf/RefPtr.h" | 35 #include "wtf/RefPtr.h" |
36 | 36 |
37 namespace blink { | 37 namespace blink { |
38 | 38 |
39 class AtomicHTMLToken { | 39 class CORE_EXPORT AtomicHTMLToken { |
40 STACK_ALLOCATED(); | 40 STACK_ALLOCATED(); |
41 WTF_MAKE_NONCOPYABLE(AtomicHTMLToken); | 41 WTF_MAKE_NONCOPYABLE(AtomicHTMLToken); |
42 public: | 42 public: |
43 | 43 |
44 bool forceQuirks() const | 44 bool forceQuirks() const |
45 { | 45 { |
46 ASSERT(m_type == HTMLToken::DOCTYPE); | 46 ASSERT(m_type == HTMLToken::DOCTYPE); |
47 return m_doctypeData->m_forceQuirks; | 47 return m_doctypeData->m_forceQuirks; |
48 } | 48 } |
49 | 49 |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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.name.isEmpty()) | 235 if (attribute.name.isEmpty()) |
236 continue; | 236 continue; |
237 | 237 |
238 ASSERT(attribute.nameRange.start); | 238 ASSERT(attribute.nameRange.start); |
239 ASSERT(attribute.nameRange.end); | 239 ASSERT(attribute.nameRange.end); |
240 ASSERT(attribute.valueRange.start); | 240 ASSERT(attribute.valueRange.start); |
241 ASSERT(attribute.valueRange.end); | 241 ASSERT(attribute.valueRange.end); |
242 | 242 |
243 AtomicString value(attribute.value); | 243 AtomicString value(StringImpl::create8BitIfPossible(attribute.value)); |
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 |