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) 2010 Google, Inc. All Rights Reserved. | 3 * Copyright (C) 2010 Google, Inc. All Rights Reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 16 matching lines...) Expand all Loading... | |
27 #ifndef HTMLTokenizer_h | 27 #ifndef HTMLTokenizer_h |
28 #define HTMLTokenizer_h | 28 #define HTMLTokenizer_h |
29 | 29 |
30 #include "core/html/parser/HTMLParserOptions.h" | 30 #include "core/html/parser/HTMLParserOptions.h" |
31 #include "core/html/parser/HTMLToken.h" | 31 #include "core/html/parser/HTMLToken.h" |
32 #include "core/html/parser/InputStreamPreprocessor.h" | 32 #include "core/html/parser/InputStreamPreprocessor.h" |
33 #include "platform/text/SegmentedString.h" | 33 #include "platform/text/SegmentedString.h" |
34 | 34 |
35 namespace WebCore { | 35 namespace WebCore { |
36 | 36 |
37 class HTMLIdentifier; | |
38 | |
37 class HTMLTokenizer { | 39 class HTMLTokenizer { |
38 WTF_MAKE_NONCOPYABLE(HTMLTokenizer); | 40 WTF_MAKE_NONCOPYABLE(HTMLTokenizer); |
39 WTF_MAKE_FAST_ALLOCATED; | 41 WTF_MAKE_FAST_ALLOCATED; |
40 public: | 42 public: |
41 static PassOwnPtr<HTMLTokenizer> create(const HTMLParserOptions& options) { return adoptPtr(new HTMLTokenizer(options)); } | 43 static PassOwnPtr<HTMLTokenizer> create(const HTMLParserOptions& options) { return adoptPtr(new HTMLTokenizer(options)); } |
42 ~HTMLTokenizer(); | 44 ~HTMLTokenizer(); |
43 | 45 |
44 void reset(); | 46 void reset(); |
45 | 47 |
46 enum State { | 48 enum State { |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
169 // | 171 // |
170 // The main failures in the approximation are as follows: | 172 // The main failures in the approximation are as follows: |
171 // | 173 // |
172 // * The first set of character tokens emitted for a <pre> element might | 174 // * The first set of character tokens emitted for a <pre> element might |
173 // contain an extra leading newline. | 175 // contain an extra leading newline. |
174 // * The replacement of U+0000 with U+FFFD will not be sensitive to the | 176 // * The replacement of U+0000 with U+FFFD will not be sensitive to the |
175 // tree builder's insertion mode. | 177 // tree builder's insertion mode. |
176 // * CDATA sections in foreign content will be tokenized as bogus comments | 178 // * CDATA sections in foreign content will be tokenized as bogus comments |
177 // instead of as character tokens. | 179 // instead of as character tokens. |
178 // | 180 // |
179 void updateStateFor(const AtomicString& tagName); | 181 void updateStateFor(const HTMLIdentifier& tagName); |
abarth-chromium
2013/11/27 18:18:08
Rather than introduce an AtomicString -> HTMLIdent
oystein (OOO til 10th of July)
2013/11/27 18:46:33
Which conversion do you mean here? The only place
| |
180 | 182 |
181 bool forceNullCharacterReplacement() const { return m_forceNullCharacterRepl acement; } | 183 bool forceNullCharacterReplacement() const { return m_forceNullCharacterRepl acement; } |
182 void setForceNullCharacterReplacement(bool value) { m_forceNullCharacterRepl acement = value; } | 184 void setForceNullCharacterReplacement(bool value) { m_forceNullCharacterRepl acement = value; } |
183 | 185 |
184 bool shouldAllowCDATA() const { return m_shouldAllowCDATA; } | 186 bool shouldAllowCDATA() const { return m_shouldAllowCDATA; } |
185 void setShouldAllowCDATA(bool value) { m_shouldAllowCDATA = value; } | 187 void setShouldAllowCDATA(bool value) { m_shouldAllowCDATA = value; } |
186 | 188 |
187 State state() const { return m_state; } | 189 State state() const { return m_state; } |
188 void setState(State state) { m_state = state; } | 190 void setState(State state) { m_state = state; } |
189 | 191 |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
284 // token (e.g., when lexing script). We buffer the name of the end tag | 286 // token (e.g., when lexing script). We buffer the name of the end tag |
285 // token here so we remember it next time we re-enter the tokenizer. | 287 // token here so we remember it next time we re-enter the tokenizer. |
286 Vector<LChar, 32> m_bufferedEndTagName; | 288 Vector<LChar, 32> m_bufferedEndTagName; |
287 | 289 |
288 HTMLParserOptions m_options; | 290 HTMLParserOptions m_options; |
289 }; | 291 }; |
290 | 292 |
291 } | 293 } |
292 | 294 |
293 #endif | 295 #endif |
OLD | NEW |