OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
3 * Copyright (C) 2009 Torch Mobile, Inc. http://www.torchmobile.com/ | 3 * Copyright (C) 2009 Torch Mobile, Inc. http://www.torchmobile.com/ |
4 * Copyright (C) 2010 Google, Inc. All Rights Reserved. | 4 * Copyright (C) 2010 Google, Inc. All Rights Reserved. |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 18 matching lines...) Expand all Loading... |
29 #include "core/html/parser/HTMLTokenizer.h" | 29 #include "core/html/parser/HTMLTokenizer.h" |
30 | 30 |
31 #include "core/HTMLNames.h" | 31 #include "core/HTMLNames.h" |
32 #include "core/HTMLTokenizerNames.h" | 32 #include "core/HTMLTokenizerNames.h" |
33 #include "core/html/parser/HTMLEntityParser.h" | 33 #include "core/html/parser/HTMLEntityParser.h" |
34 #include "core/html/parser/HTMLParserIdioms.h" | 34 #include "core/html/parser/HTMLParserIdioms.h" |
35 #include "core/html/parser/HTMLTreeBuilder.h" | 35 #include "core/html/parser/HTMLTreeBuilder.h" |
36 #include "core/xml/parser/MarkupTokenizerInlines.h" | 36 #include "core/xml/parser/MarkupTokenizerInlines.h" |
37 #include "platform/NotImplemented.h" | 37 #include "platform/NotImplemented.h" |
38 #include "wtf/ASCIICType.h" | 38 #include "wtf/ASCIICType.h" |
39 #include "wtf/text/AtomicString.h" | |
40 #include "wtf/text/Unicode.h" | 39 #include "wtf/text/Unicode.h" |
41 | 40 |
42 // Please don't use DEFINE_STATIC_LOCAL in this file. The HTMLTokenizer is used | 41 // Please don't use DEFINE_STATIC_LOCAL in this file. The HTMLTokenizer is used |
43 // from multiple threads and DEFINE_STATIC_LOCAL isn't threadsafe. | 42 // from multiple threads and DEFINE_STATIC_LOCAL isn't threadsafe. |
44 #undef DEFINE_STATIC_LOCAL | 43 #undef DEFINE_STATIC_LOCAL |
45 | 44 |
46 namespace blink { | 45 namespace blink { |
47 | 46 |
48 using namespace HTMLNames; | 47 using namespace HTMLNames; |
49 | 48 |
50 // This has to go in a .cpp file, as the linker doesn't like it being included m
ore than once. | |
51 // We don't have an HTMLToken.cpp though, so this is the next best place. | |
52 QualifiedName AtomicHTMLToken::nameForAttribute(const HTMLToken::Attribute& attr
ibute) const | |
53 { | |
54 return QualifiedName(nullAtom, AtomicString(attribute.name), nullAtom); | |
55 } | |
56 | |
57 bool AtomicHTMLToken::usesName() const | |
58 { | |
59 return m_type == HTMLToken::StartTag || m_type == HTMLToken::EndTag || m_typ
e == HTMLToken::DOCTYPE; | |
60 } | |
61 | |
62 bool AtomicHTMLToken::usesAttributes() const | |
63 { | |
64 return m_type == HTMLToken::StartTag || m_type == HTMLToken::EndTag; | |
65 } | |
66 | |
67 static inline UChar toLowerCase(UChar cc) | 49 static inline UChar toLowerCase(UChar cc) |
68 { | 50 { |
69 ASSERT(isASCIIUpper(cc)); | 51 ASSERT(isASCIIUpper(cc)); |
70 const int lowerCaseOffset = 0x20; | 52 const int lowerCaseOffset = 0x20; |
71 return cc + lowerCaseOffset; | 53 return cc + lowerCaseOffset; |
72 } | 54 } |
73 | 55 |
74 static inline bool vectorEqualsString(const Vector<LChar, 32>& vector, const Str
ing& string) | 56 static inline bool vectorEqualsString(const Vector<LChar, 32>& vector, const Str
ing& string) |
75 { | 57 { |
76 if (vector.size() != string.length()) | 58 if (vector.size() != string.length()) |
(...skipping 1529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1606 | 1588 |
1607 return true; | 1589 return true; |
1608 } | 1590 } |
1609 | 1591 |
1610 inline void HTMLTokenizer::parseError() | 1592 inline void HTMLTokenizer::parseError() |
1611 { | 1593 { |
1612 notImplemented(); | 1594 notImplemented(); |
1613 } | 1595 } |
1614 | 1596 |
1615 } | 1597 } |
OLD | NEW |