Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(111)

Side by Side Diff: third_party/WebKit/Source/core/html/parser/HTMLTokenizer.h

Issue 2717303002: Considering HTMLTokenizer state in HTMLSourceTracker (Closed)
Patch Set: Considering HTMLTokenizer state in HTMLSourceTracker Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 State getState() const { return m_state; } 173 State getState() const { return m_state; }
174 void setState(State state) { m_state = state; } 174 void setState(State state) { m_state = state; }
175 175
176 inline bool shouldSkipNullCharacters() const { 176 inline bool shouldSkipNullCharacters() const {
177 return !m_forceNullCharacterReplacement && 177 return !m_forceNullCharacterReplacement &&
178 (m_state == HTMLTokenizer::DataState || 178 (m_state == HTMLTokenizer::DataState ||
179 m_state == HTMLTokenizer::RCDATAState || 179 m_state == HTMLTokenizer::RCDATAState ||
180 m_state == HTMLTokenizer::RAWTEXTState); 180 m_state == HTMLTokenizer::RAWTEXTState);
181 } 181 }
182 182
183 inline static bool isEndTagBufferingState(HTMLTokenizer::State state) {
184 switch (state) {
185 case HTMLTokenizer::RCDATAEndTagOpenState:
186 case HTMLTokenizer::RCDATAEndTagNameState:
187 case HTMLTokenizer::RAWTEXTEndTagOpenState:
188 case HTMLTokenizer::RAWTEXTEndTagNameState:
189 case HTMLTokenizer::ScriptDataEndTagOpenState:
190 case HTMLTokenizer::ScriptDataEndTagNameState:
191 case HTMLTokenizer::ScriptDataEscapedEndTagOpenState:
192 case HTMLTokenizer::ScriptDataEscapedEndTagNameState:
193 return true;
194 default:
195 return false;
196 }
197 }
198
183 private: 199 private:
184 explicit HTMLTokenizer(const HTMLParserOptions&); 200 explicit HTMLTokenizer(const HTMLParserOptions&);
185 201
186 inline bool processEntity(SegmentedString&); 202 inline bool processEntity(SegmentedString&);
187 203
188 inline void parseError(); 204 inline void parseError();
189 205
190 inline void bufferCharacter(UChar character) { 206 inline void bufferCharacter(UChar character) {
191 ASSERT(character != kEndOfFileMarker); 207 ASSERT(character != kEndOfFileMarker);
192 m_token->ensureIsCharacterToken(); 208 m_token->ensureIsCharacterToken();
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 // token (e.g., when lexing script). We buffer the name of the end tag 278 // token (e.g., when lexing script). We buffer the name of the end tag
263 // token here so we remember it next time we re-enter the tokenizer. 279 // token here so we remember it next time we re-enter the tokenizer.
264 Vector<LChar, 32> m_bufferedEndTagName; 280 Vector<LChar, 32> m_bufferedEndTagName;
265 281
266 HTMLParserOptions m_options; 282 HTMLParserOptions m_options;
267 }; 283 };
268 284
269 } // namespace blink 285 } // namespace blink
270 286
271 #endif 287 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698