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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 DOCTYPESystemIdentifierDoubleQuotedState, | 114 DOCTYPESystemIdentifierDoubleQuotedState, |
115 DOCTYPESystemIdentifierSingleQuotedState, | 115 DOCTYPESystemIdentifierSingleQuotedState, |
116 AfterDOCTYPESystemIdentifierState, | 116 AfterDOCTYPESystemIdentifierState, |
117 BogusDOCTYPEState, | 117 BogusDOCTYPEState, |
118 CDATASectionState, | 118 CDATASectionState, |
119 // These CDATA states are not in the HTML5 spec, but we use them interna
lly. | 119 // These CDATA states are not in the HTML5 spec, but we use them interna
lly. |
120 CDATASectionRightSquareBracketState, | 120 CDATASectionRightSquareBracketState, |
121 CDATASectionDoubleRightSquareBracketState, | 121 CDATASectionDoubleRightSquareBracketState, |
122 }; | 122 }; |
123 | 123 |
124 struct Checkpoint { | |
125 STACK_ALLOCATED(); | |
126 HTMLParserOptions options; | |
127 State state; | |
128 UChar additionalAllowedCharacter; | |
129 bool skipNextNewLine; | |
130 bool shouldAllowCDATA; | |
131 | |
132 Checkpoint() | |
133 : options(0) | |
134 , state() | |
135 , additionalAllowedCharacter('\0') | |
136 , skipNextNewLine(false) | |
137 , shouldAllowCDATA(false) | |
138 { | |
139 } | |
140 }; | |
141 | |
142 // This function returns true if it emits a token. Otherwise, callers | 124 // This function returns true if it emits a token. Otherwise, callers |
143 // must provide the same (in progress) token on the next call (unless | 125 // must provide the same (in progress) token on the next call (unless |
144 // they call reset() first). | 126 // they call reset() first). |
145 bool nextToken(SegmentedString&, HTMLToken&); | 127 bool nextToken(SegmentedString&, HTMLToken&); |
146 | 128 |
147 // Returns a copy of any characters buffered internally by the tokenizer. | 129 // Returns a copy of any characters buffered internally by the tokenizer. |
148 // The tokenizer buffers characters when searching for the </script> token | 130 // The tokenizer buffers characters when searching for the </script> token |
149 // that terminates a script element. | 131 // that terminates a script element. |
150 String bufferedCharacters() const; | 132 String bufferedCharacters() const; |
151 | 133 |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 // token (e.g., when lexing script). We buffer the name of the end tag | 261 // token (e.g., when lexing script). We buffer the name of the end tag |
280 // token here so we remember it next time we re-enter the tokenizer. | 262 // token here so we remember it next time we re-enter the tokenizer. |
281 Vector<LChar, 32> m_bufferedEndTagName; | 263 Vector<LChar, 32> m_bufferedEndTagName; |
282 | 264 |
283 HTMLParserOptions m_options; | 265 HTMLParserOptions m_options; |
284 }; | 266 }; |
285 | 267 |
286 } | 268 } |
287 | 269 |
288 #endif | 270 #endif |
OLD | NEW |