OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google, Inc. All Rights Reserved. | 2 * Copyright (C) 2010 Google, Inc. All Rights Reserved. |
3 * Copyright (C) 2011 Apple Inc. All rights reserved. | 3 * Copyright (C) 2011 Apple 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 | 73 |
74 void constructTree(AtomicHTMLToken*); | 74 void constructTree(AtomicHTMLToken*); |
75 | 75 |
76 bool hasParserBlockingScript() const { return !!m_scriptToProcess; } | 76 bool hasParserBlockingScript() const { return !!m_scriptToProcess; } |
77 // Must be called to take the parser-blocking script before calling the pars
er again. | 77 // Must be called to take the parser-blocking script before calling the pars
er again. |
78 PassRefPtr<Element> takeScriptToProcess(TextPosition& scriptStartPosition); | 78 PassRefPtr<Element> takeScriptToProcess(TextPosition& scriptStartPosition); |
79 | 79 |
80 // Done, close any open tags, etc. | 80 // Done, close any open tags, etc. |
81 void finished(); | 81 void finished(); |
82 | 82 |
| 83 // Synchronously empty any queues, possibly creating more DOM nodes. |
| 84 void flush() { m_tree.flush(); } |
| 85 |
83 void setShouldSkipLeadingNewline(bool shouldSkip) { m_shouldSkipLeadingNewli
ne = shouldSkip; } | 86 void setShouldSkipLeadingNewline(bool shouldSkip) { m_shouldSkipLeadingNewli
ne = shouldSkip; } |
84 | 87 |
85 private: | 88 private: |
86 class CharacterTokenBuffer; | 89 class CharacterTokenBuffer; |
87 // Represents HTML5 "insertion mode" | 90 // Represents HTML5 "insertion mode" |
88 // http://www.whatwg.org/specs/web-apps/current-work/multipage/parsing.html#
insertion-mode | 91 // http://www.whatwg.org/specs/web-apps/current-work/multipage/parsing.html#
insertion-mode |
89 enum InsertionMode { | 92 enum InsertionMode { |
90 InitialMode, | 93 InitialMode, |
91 BeforeHTMLMode, | 94 BeforeHTMLMode, |
92 BeforeHeadMode, | 95 BeforeHeadMode, |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 | 234 |
232 RefPtr<Element> m_scriptToProcess; // <script> tag which needs processing be
fore resuming the parser. | 235 RefPtr<Element> m_scriptToProcess; // <script> tag which needs processing be
fore resuming the parser. |
233 TextPosition m_scriptToProcessStartPosition; // Starting line number of the
script tag needing processing. | 236 TextPosition m_scriptToProcessStartPosition; // Starting line number of the
script tag needing processing. |
234 | 237 |
235 HTMLParserOptions m_options; | 238 HTMLParserOptions m_options; |
236 }; | 239 }; |
237 | 240 |
238 } | 241 } |
239 | 242 |
240 #endif | 243 #endif |
OLD | NEW |