| 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 30 matching lines...) Expand all Loading... |
| 41 #include "core/html/HTMLPlugInElement.h" | 41 #include "core/html/HTMLPlugInElement.h" |
| 42 #include "core/html/HTMLScriptElement.h" | 42 #include "core/html/HTMLScriptElement.h" |
| 43 #include "core/html/HTMLTemplateElement.h" | 43 #include "core/html/HTMLTemplateElement.h" |
| 44 #include "core/html/parser/AtomicHTMLToken.h" | 44 #include "core/html/parser/AtomicHTMLToken.h" |
| 45 #include "core/html/parser/HTMLParserIdioms.h" | 45 #include "core/html/parser/HTMLParserIdioms.h" |
| 46 #include "core/html/parser/HTMLStackItem.h" | 46 #include "core/html/parser/HTMLStackItem.h" |
| 47 #include "core/html/parser/HTMLToken.h" | 47 #include "core/html/parser/HTMLToken.h" |
| 48 #include "core/loader/FrameLoader.h" | 48 #include "core/loader/FrameLoader.h" |
| 49 #include "core/loader/FrameLoaderClient.h" | 49 #include "core/loader/FrameLoaderClient.h" |
| 50 #include "core/svg/SVGScriptElement.h" | 50 #include "core/svg/SVGScriptElement.h" |
| 51 #include "platform/NotImplemented.h" |
| 51 #include "platform/text/TextBreakIterator.h" | 52 #include "platform/text/TextBreakIterator.h" |
| 52 #include <limits> | 53 #include <limits> |
| 53 | 54 |
| 54 namespace blink { | 55 namespace blink { |
| 55 | 56 |
| 56 using namespace HTMLNames; | 57 using namespace HTMLNames; |
| 57 | 58 |
| 58 static const unsigned maximumHTMLParserDOMTreeDepth = 512; | 59 static const unsigned maximumHTMLParserDOMTreeDepth = 512; |
| 59 | 60 |
| 60 static inline void setAttributes(Element* element, AtomicHTMLToken* token, Parse
rContentPolicy parserContentPolicy) | 61 static inline void setAttributes(Element* element, AtomicHTMLToken* token, Parse
rContentPolicy parserContentPolicy) |
| (...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 657 RefPtrWillBeRawPtr<HTMLScriptElement> element = HTMLScriptElement::create(ow
nerDocumentForCurrentNode(), parserInserted, alreadyStarted); | 658 RefPtrWillBeRawPtr<HTMLScriptElement> element = HTMLScriptElement::create(ow
nerDocumentForCurrentNode(), parserInserted, alreadyStarted); |
| 658 setAttributes(element.get(), token, m_parserContentPolicy); | 659 setAttributes(element.get(), token, m_parserContentPolicy); |
| 659 if (scriptingContentIsAllowed(m_parserContentPolicy)) | 660 if (scriptingContentIsAllowed(m_parserContentPolicy)) |
| 660 attachLater(currentNode(), element); | 661 attachLater(currentNode(), element); |
| 661 m_openElements.push(HTMLStackItem::create(element.release(), token)); | 662 m_openElements.push(HTMLStackItem::create(element.release(), token)); |
| 662 } | 663 } |
| 663 | 664 |
| 664 void HTMLConstructionSite::insertForeignElement(AtomicHTMLToken* token, const At
omicString& namespaceURI) | 665 void HTMLConstructionSite::insertForeignElement(AtomicHTMLToken* token, const At
omicString& namespaceURI) |
| 665 { | 666 { |
| 666 ASSERT(token->type() == HTMLToken::StartTag); | 667 ASSERT(token->type() == HTMLToken::StartTag); |
| 667 NOTIMPLEMENTED(); // parseError when xmlns or xmlns:xlink are wrong. | 668 notImplemented(); // parseError when xmlns or xmlns:xlink are wrong. |
| 668 | 669 |
| 669 RefPtrWillBeRawPtr<Element> element = createElement(token, namespaceURI); | 670 RefPtrWillBeRawPtr<Element> element = createElement(token, namespaceURI); |
| 670 if (scriptingContentIsAllowed(m_parserContentPolicy) || !toScriptLoaderIfPos
sible(element.get())) | 671 if (scriptingContentIsAllowed(m_parserContentPolicy) || !toScriptLoaderIfPos
sible(element.get())) |
| 671 attachLater(currentNode(), element, token->selfClosing()); | 672 attachLater(currentNode(), element, token->selfClosing()); |
| 672 if (!token->selfClosing()) | 673 if (!token->selfClosing()) |
| 673 m_openElements.push(HTMLStackItem::create(element.release(), token, name
spaceURI)); | 674 m_openElements.push(HTMLStackItem::create(element.release(), token, name
spaceURI)); |
| 674 } | 675 } |
| 675 | 676 |
| 676 void HTMLConstructionSite::insertTextNode(const String& string, WhitespaceMode w
hitespaceMode) | 677 void HTMLConstructionSite::insertTextNode(const String& string, WhitespaceMode w
hitespaceMode) |
| 677 { | 678 { |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 873 queueTask(task); | 874 queueTask(task); |
| 874 } | 875 } |
| 875 | 876 |
| 876 DEFINE_TRACE(HTMLConstructionSite::PendingText) | 877 DEFINE_TRACE(HTMLConstructionSite::PendingText) |
| 877 { | 878 { |
| 878 visitor->trace(parent); | 879 visitor->trace(parent); |
| 879 visitor->trace(nextChild); | 880 visitor->trace(nextChild); |
| 880 } | 881 } |
| 881 | 882 |
| 882 } // namespace blink | 883 } // namespace blink |
| OLD | NEW |