| 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 737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 748 parseError(token); | 748 parseError(token); |
| 749 processFakeEndTag(nobrTag); | 749 processFakeEndTag(nobrTag); |
| 750 m_tree.reconstructTheActiveFormattingElements(); | 750 m_tree.reconstructTheActiveFormattingElements(); |
| 751 } | 751 } |
| 752 m_tree.insertFormattingElement(token); | 752 m_tree.insertFormattingElement(token); |
| 753 return; | 753 return; |
| 754 } | 754 } |
| 755 if (token->name() == appletTag | 755 if (token->name() == appletTag |
| 756 || token->name() == embedTag | 756 || token->name() == embedTag |
| 757 || token->name() == objectTag) { | 757 || token->name() == objectTag) { |
| 758 if (!pluginContentIsAllowed(m_tree.parserContentPolicy())) | 758 if (!pluginContentIsAllowed(m_tree.getParserContentPolicy())) |
| 759 return; | 759 return; |
| 760 } | 760 } |
| 761 if (token->name() == appletTag | 761 if (token->name() == appletTag |
| 762 || token->name() == marqueeTag | 762 || token->name() == marqueeTag |
| 763 || token->name() == objectTag) { | 763 || token->name() == objectTag) { |
| 764 m_tree.reconstructTheActiveFormattingElements(); | 764 m_tree.reconstructTheActiveFormattingElements(); |
| 765 m_tree.insertHTMLElement(token); | 765 m_tree.insertHTMLElement(token); |
| 766 m_tree.activeFormattingElements()->appendMarker(); | 766 m_tree.activeFormattingElements()->appendMarker(); |
| 767 m_framesetOk = false; | 767 m_framesetOk = false; |
| 768 return; | 768 return; |
| (...skipping 1337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2106 parseError(token); | 2106 parseError(token); |
| 2107 return; | 2107 return; |
| 2108 } | 2108 } |
| 2109 defaultForInHeadNoscript(); | 2109 defaultForInHeadNoscript(); |
| 2110 processToken(token); | 2110 processToken(token); |
| 2111 break; | 2111 break; |
| 2112 case TextMode: | 2112 case TextMode: |
| 2113 if (token->name() == scriptTag) { | 2113 if (token->name() == scriptTag) { |
| 2114 // Pause ourselves so that parsing stops until the script can be pro
cessed by the caller. | 2114 // Pause ourselves so that parsing stops until the script can be pro
cessed by the caller. |
| 2115 ASSERT(m_tree.currentStackItem()->hasTagName(scriptTag)); | 2115 ASSERT(m_tree.currentStackItem()->hasTagName(scriptTag)); |
| 2116 if (scriptingContentIsAllowed(m_tree.parserContentPolicy())) | 2116 if (scriptingContentIsAllowed(m_tree.getParserContentPolicy())) |
| 2117 m_scriptToProcess = m_tree.currentElement(); | 2117 m_scriptToProcess = m_tree.currentElement(); |
| 2118 m_tree.openElements()->pop(); | 2118 m_tree.openElements()->pop(); |
| 2119 setInsertionMode(m_originalInsertionMode); | 2119 setInsertionMode(m_originalInsertionMode); |
| 2120 | 2120 |
| 2121 if (m_parser->tokenizer()) { | 2121 if (m_parser->tokenizer()) { |
| 2122 // We must set the tokenizer's state to | 2122 // We must set the tokenizer's state to |
| 2123 // DataState explicitly if the tokenizer didn't have a chance to
. | 2123 // DataState explicitly if the tokenizer didn't have a chance to
. |
| 2124 m_parser->tokenizer()->setState(HTMLTokenizer::DataState); | 2124 m_parser->tokenizer()->setState(HTMLTokenizer::DataState); |
| 2125 } | 2125 } |
| 2126 return; | 2126 return; |
| (...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2761 } | 2761 } |
| 2762 adjustForeignAttributes(token); | 2762 adjustForeignAttributes(token); |
| 2763 m_tree.insertForeignElement(token, currentNamespace); | 2763 m_tree.insertForeignElement(token, currentNamespace); |
| 2764 break; | 2764 break; |
| 2765 } | 2765 } |
| 2766 case HTMLToken::EndTag: { | 2766 case HTMLToken::EndTag: { |
| 2767 if (adjustedCurrentNode->namespaceURI() == SVGNames::svgNamespaceURI) | 2767 if (adjustedCurrentNode->namespaceURI() == SVGNames::svgNamespaceURI) |
| 2768 adjustSVGTagNameCase(token); | 2768 adjustSVGTagNameCase(token); |
| 2769 | 2769 |
| 2770 if (token->name() == SVGNames::scriptTag && m_tree.currentStackItem()->h
asTagName(SVGNames::scriptTag)) { | 2770 if (token->name() == SVGNames::scriptTag && m_tree.currentStackItem()->h
asTagName(SVGNames::scriptTag)) { |
| 2771 if (scriptingContentIsAllowed(m_tree.parserContentPolicy())) | 2771 if (scriptingContentIsAllowed(m_tree.getParserContentPolicy())) |
| 2772 m_scriptToProcess = m_tree.currentElement(); | 2772 m_scriptToProcess = m_tree.currentElement(); |
| 2773 m_tree.openElements()->pop(); | 2773 m_tree.openElements()->pop(); |
| 2774 return; | 2774 return; |
| 2775 } | 2775 } |
| 2776 if (!m_tree.currentStackItem()->isInHTMLNamespace()) { | 2776 if (!m_tree.currentStackItem()->isInHTMLNamespace()) { |
| 2777 // FIXME: This code just wants an Element* iterator, instead of an E
lementRecord* | 2777 // FIXME: This code just wants an Element* iterator, instead of an E
lementRecord* |
| 2778 HTMLElementStack::ElementRecord* nodeRecord = m_tree.openElements()-
>topRecord(); | 2778 HTMLElementStack::ElementRecord* nodeRecord = m_tree.openElements()-
>topRecord(); |
| 2779 if (!nodeRecord->stackItem()->hasLocalName(token->name())) | 2779 if (!nodeRecord->stackItem()->hasLocalName(token->name())) |
| 2780 parseError(token); | 2780 parseError(token); |
| 2781 while (1) { | 2781 while (1) { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 2812 ASSERT(m_isAttached); | 2812 ASSERT(m_isAttached); |
| 2813 // Warning, this may detach the parser. Do not do anything else after this. | 2813 // Warning, this may detach the parser. Do not do anything else after this. |
| 2814 m_tree.finishedParsing(); | 2814 m_tree.finishedParsing(); |
| 2815 } | 2815 } |
| 2816 | 2816 |
| 2817 void HTMLTreeBuilder::parseError(AtomicHTMLToken*) | 2817 void HTMLTreeBuilder::parseError(AtomicHTMLToken*) |
| 2818 { | 2818 { |
| 2819 } | 2819 } |
| 2820 | 2820 |
| 2821 } // namespace blink | 2821 } // namespace blink |
| OLD | NEW |