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