| 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, 2014 Apple Inc. All rights reserved. | 3 * Copyright (C) 2011, 2014 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 // NOTE: flush() can cause any queued tasks to execute, possibly re-entering
the parser. | 121 // NOTE: flush() can cause any queued tasks to execute, possibly re-entering
the parser. |
| 122 m_tree.flush(); | 122 m_tree.flush(); |
| 123 | 123 |
| 124 if (type == HTMLToken::StartTag) { | 124 if (type == HTMLToken::StartTag) { |
| 125 processStartTag(token); | 125 processStartTag(token); |
| 126 } else if (type == HTMLToken::EndTag) { | 126 } else if (type == HTMLToken::EndTag) { |
| 127 processEndTag(token); | 127 processEndTag(token); |
| 128 } else if (type == HTMLToken::EndOfFile) { | 128 } else if (type == HTMLToken::EndOfFile) { |
| 129 processEndOfFile(token); | 129 processEndOfFile(token); |
| 130 } else { | 130 } else { |
| 131 // We ignore Comments. | 131 ASSERT_NOT_REACHED(); |
| 132 ASSERT(type == HTMLToken::Comment); | |
| 133 } | 132 } |
| 134 | 133 |
| 135 m_tree.executeQueuedTasks(); | 134 m_tree.executeQueuedTasks(); |
| 136 // We might be detached now. | 135 // We might be detached now. |
| 137 } | 136 } |
| 138 | 137 |
| 139 void HTMLTreeBuilder::processStartTag(AtomicHTMLToken* token) | 138 void HTMLTreeBuilder::processStartTag(AtomicHTMLToken* token) |
| 140 { | 139 { |
| 141 ASSERT(token->type() == HTMLToken::StartTag); | 140 ASSERT(token->type() == HTMLToken::StartTag); |
| 142 const AtomicString& name = token->name(); | 141 const AtomicString& name = token->name(); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 void HTMLTreeBuilder::finished() | 216 void HTMLTreeBuilder::finished() |
| 218 { | 217 { |
| 219 if (isParsingFragment()) | 218 if (isParsingFragment()) |
| 220 return; | 219 return; |
| 221 ASSERT(m_isAttached); | 220 ASSERT(m_isAttached); |
| 222 // Warning, this may detach the parser. Do not do anything else after this. | 221 // Warning, this may detach the parser. Do not do anything else after this. |
| 223 m_tree.finishedParsing(); | 222 m_tree.finishedParsing(); |
| 224 } | 223 } |
| 225 | 224 |
| 226 } // namespace blink | 225 } // namespace blink |
| OLD | NEW |