| 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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 // before running scripts. | 427 // before running scripts. |
| 428 m_isPaused = false; | 428 m_isPaused = false; |
| 429 scriptStartPosition = m_scriptToProcessStartPosition; | 429 scriptStartPosition = m_scriptToProcessStartPosition; |
| 430 m_scriptToProcessStartPosition = uninitializedPositionValue1(); | 430 m_scriptToProcessStartPosition = uninitializedPositionValue1(); |
| 431 return m_scriptToProcess.release(); | 431 return m_scriptToProcess.release(); |
| 432 } | 432 } |
| 433 | 433 |
| 434 void HTMLTreeBuilder::constructTreeFromToken(HTMLToken& rawToken) | 434 void HTMLTreeBuilder::constructTreeFromToken(HTMLToken& rawToken) |
| 435 { | 435 { |
| 436 AtomicHTMLToken token(rawToken); | 436 AtomicHTMLToken token(rawToken); |
| 437 |
| 438 // We clear the rawToken in case constructTreeFromAtomicToken |
| 439 // synchronously re-enters the parser. We don't clear the token immedately |
| 440 // for Character tokens because the AtomicHTMLToken avoids copying the |
| 441 // characters by keeping a pointer to the underlying buffer in the |
| 442 // HTMLToken. Fortuantely, Character tokens can't cause use to re-enter |
| 443 // the parser. |
| 444 // |
| 445 // FIXME: Top clearing the rawToken once we start running the parser off |
| 446 // the main thread or once we stop allowing synchronous JavaScript |
| 447 // execution from parseMappedAttribute. |
| 448 if (rawToken.type() != HTMLToken::Character) |
| 449 rawToken.clear(); |
| 450 |
| 437 constructTreeFromAtomicToken(token); | 451 constructTreeFromAtomicToken(token); |
| 452 |
| 453 if (!rawToken.isUninitialized()) { |
| 454 ASSERT(rawToken.type() == HTMLToken::Character); |
| 455 rawToken.clear(); |
| 456 } |
| 438 } | 457 } |
| 439 | 458 |
| 440 void HTMLTreeBuilder::constructTreeFromAtomicToken(AtomicHTMLToken& token) | 459 void HTMLTreeBuilder::constructTreeFromAtomicToken(AtomicHTMLToken& token) |
| 441 { | 460 { |
| 442 processToken(token); | 461 processToken(token); |
| 443 | 462 |
| 444 // Swallowing U+0000 characters isn't in the HTML5 spec, but turning all | 463 // Swallowing U+0000 characters isn't in the HTML5 spec, but turning all |
| 445 // the U+0000 characters into replacement characters has compatibility | 464 // the U+0000 characters into replacement characters has compatibility |
| 446 // problems. | 465 // problems. |
| 447 m_parser->tokenizer()->setForceNullCharacterReplacement(m_insertionMode == T
extMode || m_insertionMode == InForeignContentMode); | 466 m_parser->tokenizer()->setForceNullCharacterReplacement(m_insertionMode == T
extMode || m_insertionMode == InForeignContentMode); |
| (...skipping 2366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2814 } | 2833 } |
| 2815 | 2834 |
| 2816 bool HTMLTreeBuilder::pluginsEnabled(Frame* frame) | 2835 bool HTMLTreeBuilder::pluginsEnabled(Frame* frame) |
| 2817 { | 2836 { |
| 2818 if (!frame) | 2837 if (!frame) |
| 2819 return false; | 2838 return false; |
| 2820 return frame->loader()->subframeLoader()->allowPlugins(NotAboutToInstantiate
Plugin); | 2839 return frame->loader()->subframeLoader()->allowPlugins(NotAboutToInstantiate
Plugin); |
| 2821 } | 2840 } |
| 2822 | 2841 |
| 2823 } | 2842 } |
| OLD | NEW |