| 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 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 | 395 |
| 396 void HTMLTreeBuilder::processToken(AtomicHTMLToken* token) | 396 void HTMLTreeBuilder::processToken(AtomicHTMLToken* token) |
| 397 { | 397 { |
| 398 if (token->type() == HTMLToken::Character) { | 398 if (token->type() == HTMLToken::Character) { |
| 399 processCharacter(token); | 399 processCharacter(token); |
| 400 return; | 400 return; |
| 401 } | 401 } |
| 402 | 402 |
| 403 // Any non-character token needs to cause us to flush any pending text immed
iately. | 403 // Any non-character token needs to cause us to flush any pending text immed
iately. |
| 404 // NOTE: flush() can cause any queued tasks to execute, possibly re-entering
the parser. | 404 // NOTE: flush() can cause any queued tasks to execute, possibly re-entering
the parser. |
| 405 m_tree.flush(); | 405 m_tree.flush(FlushAlways); |
| 406 m_shouldSkipLeadingNewline = false; | 406 m_shouldSkipLeadingNewline = false; |
| 407 | 407 |
| 408 switch (token->type()) { | 408 switch (token->type()) { |
| 409 case HTMLToken::Uninitialized: | 409 case HTMLToken::Uninitialized: |
| 410 case HTMLToken::Character: | 410 case HTMLToken::Character: |
| 411 ASSERT_NOT_REACHED(); | 411 ASSERT_NOT_REACHED(); |
| 412 break; | 412 break; |
| 413 case HTMLToken::DOCTYPE: | 413 case HTMLToken::DOCTYPE: |
| 414 processDoctypeToken(token); | 414 processDoctypeToken(token); |
| 415 break; | 415 break; |
| (...skipping 2266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2682 void HTMLTreeBuilder::processTokenInForeignContent(AtomicHTMLToken* token) | 2682 void HTMLTreeBuilder::processTokenInForeignContent(AtomicHTMLToken* token) |
| 2683 { | 2683 { |
| 2684 if (token->type() == HTMLToken::Character) { | 2684 if (token->type() == HTMLToken::Character) { |
| 2685 const String& characters = token->characters(); | 2685 const String& characters = token->characters(); |
| 2686 m_tree.insertTextNode(characters); | 2686 m_tree.insertTextNode(characters); |
| 2687 if (m_framesetOk && !isAllWhitespaceOrReplacementCharacters(characters)) | 2687 if (m_framesetOk && !isAllWhitespaceOrReplacementCharacters(characters)) |
| 2688 m_framesetOk = false; | 2688 m_framesetOk = false; |
| 2689 return; | 2689 return; |
| 2690 } | 2690 } |
| 2691 | 2691 |
| 2692 m_tree.flush(); | 2692 m_tree.flush(FlushAlways); |
| 2693 HTMLStackItem* adjustedCurrentNode = adjustedCurrentStackItem(); | 2693 HTMLStackItem* adjustedCurrentNode = adjustedCurrentStackItem(); |
| 2694 | 2694 |
| 2695 switch (token->type()) { | 2695 switch (token->type()) { |
| 2696 case HTMLToken::Uninitialized: | 2696 case HTMLToken::Uninitialized: |
| 2697 ASSERT_NOT_REACHED(); | 2697 ASSERT_NOT_REACHED(); |
| 2698 break; | 2698 break; |
| 2699 case HTMLToken::DOCTYPE: | 2699 case HTMLToken::DOCTYPE: |
| 2700 parseError(token); | 2700 parseError(token); |
| 2701 break; | 2701 break; |
| 2702 case HTMLToken::StartTag: { | 2702 case HTMLToken::StartTag: { |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2805 ASSERT(m_isAttached); | 2805 ASSERT(m_isAttached); |
| 2806 // Warning, this may detach the parser. Do not do anything else after this. | 2806 // Warning, this may detach the parser. Do not do anything else after this. |
| 2807 m_tree.finishedParsing(); | 2807 m_tree.finishedParsing(); |
| 2808 } | 2808 } |
| 2809 | 2809 |
| 2810 void HTMLTreeBuilder::parseError(AtomicHTMLToken*) | 2810 void HTMLTreeBuilder::parseError(AtomicHTMLToken*) |
| 2811 { | 2811 { |
| 2812 } | 2812 } |
| 2813 | 2813 |
| 2814 } // namespace blink | 2814 } // namespace blink |
| OLD | NEW |