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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 | 58 |
59 private: | 59 private: |
60 String m_name; | 60 String m_name; |
61 String m_value; | 61 String m_value; |
62 }; | 62 }; |
63 | 63 |
64 CompactHTMLToken(const HTMLToken*, const TextPosition&); | 64 CompactHTMLToken(const HTMLToken*, const TextPosition&); |
65 | 65 |
66 bool isSafeToSendToAnotherThread() const; | 66 bool isSafeToSendToAnotherThread() const; |
67 | 67 |
68 HTMLToken::Type type() const { return static_cast<HTMLToken::Type>(m_type);
} | 68 HTMLToken::TokenType type() const { return static_cast<HTMLToken::TokenType>
(m_type); } |
69 const String& data() const { return m_data; } | 69 const String& data() const { return m_data; } |
70 bool selfClosing() const { return m_selfClosing; } | 70 bool selfClosing() const { return m_selfClosing; } |
71 bool isAll8BitData() const { return m_isAll8BitData; } | 71 bool isAll8BitData() const { return m_isAll8BitData; } |
72 const Vector<Attribute>& attributes() const { return m_attributes; } | 72 const Vector<Attribute>& attributes() const { return m_attributes; } |
73 const Attribute* getAttributeItem(const QualifiedName&) const; | 73 const Attribute* getAttributeItem(const QualifiedName&) const; |
74 const TextPosition& textPosition() const { return m_textPosition; } | 74 const TextPosition& textPosition() const { return m_textPosition; } |
75 | 75 |
76 // There is only 1 DOCTYPE token per document, so to avoid increasing the | 76 // There is only 1 DOCTYPE token per document, so to avoid increasing the |
77 // size of CompactHTMLToken, we just use the m_attributes vector. | 77 // size of CompactHTMLToken, we just use the m_attributes vector. |
78 const String& publicIdentifier() const { return m_attributes[0].name(); } | 78 const String& publicIdentifier() const { return m_attributes[0].name(); } |
79 const String& systemIdentifier() const { return m_attributes[0].value(); } | 79 const String& systemIdentifier() const { return m_attributes[0].value(); } |
80 bool doctypeForcesQuirks() const { return m_doctypeForcesQuirks; } | 80 bool doctypeForcesQuirks() const { return m_doctypeForcesQuirks; } |
81 | 81 |
82 private: | 82 private: |
83 unsigned m_type : 4; | 83 unsigned m_type : 4; |
84 unsigned m_selfClosing : 1; | 84 unsigned m_selfClosing : 1; |
85 unsigned m_isAll8BitData : 1; | 85 unsigned m_isAll8BitData : 1; |
86 unsigned m_doctypeForcesQuirks: 1; | 86 unsigned m_doctypeForcesQuirks: 1; |
87 | 87 |
88 String m_data; // "name", "characters", or "data" depending on m_type | 88 String m_data; // "name", "characters", or "data" depending on m_type |
89 Vector<Attribute> m_attributes; | 89 Vector<Attribute> m_attributes; |
90 TextPosition m_textPosition; | 90 TextPosition m_textPosition; |
91 }; | 91 }; |
92 | 92 |
93 typedef Vector<CompactHTMLToken> CompactHTMLTokenStream; | 93 typedef Vector<CompactHTMLToken> CompactHTMLTokenStream; |
94 | 94 |
95 } // namespace blink | 95 } // namespace blink |
96 | 96 |
97 #endif | 97 #endif |
OLD | NEW |