OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2000 Peter Kelly (pmk@post.com) | 2 * Copyright (C) 2000 Peter Kelly (pmk@post.com) |
3 * Copyright (C) 2005, 2006, 2008, 2014 Apple Inc. All rights reserved. | 3 * Copyright (C) 2005, 2006, 2008, 2014 Apple Inc. All rights reserved. |
4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
5 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org) | 5 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org) |
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
7 * Copyright (C) 2008 Holger Hans Peter Freyther | 7 * Copyright (C) 2008 Holger Hans Peter Freyther |
8 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 8 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1029 RefPtrWillBeRawPtr<Element> newElement = m_currentNode->document().createEle
ment(qName, true); | 1029 RefPtrWillBeRawPtr<Element> newElement = m_currentNode->document().createEle
ment(qName, true); |
1030 if (!newElement) { | 1030 if (!newElement) { |
1031 stopParsing(); | 1031 stopParsing(); |
1032 return; | 1032 return; |
1033 } | 1033 } |
1034 | 1034 |
1035 Vector<Attribute> prefixedAttributes; | 1035 Vector<Attribute> prefixedAttributes; |
1036 TrackExceptionState exceptionState; | 1036 TrackExceptionState exceptionState; |
1037 handleNamespaceAttributes(prefixedAttributes, libxmlNamespaces, nbNamespaces
, exceptionState); | 1037 handleNamespaceAttributes(prefixedAttributes, libxmlNamespaces, nbNamespaces
, exceptionState); |
1038 if (exceptionState.hadException()) { | 1038 if (exceptionState.hadException()) { |
1039 setAttributes(newElement.get(), prefixedAttributes, parserContentPolicy(
)); | 1039 setAttributes(newElement.get(), prefixedAttributes, getParserContentPoli
cy()); |
1040 stopParsing(); | 1040 stopParsing(); |
1041 return; | 1041 return; |
1042 } | 1042 } |
1043 | 1043 |
1044 handleElementAttributes(prefixedAttributes, libxmlAttributes, nbAttributes,
m_prefixToNamespaceMap, exceptionState); | 1044 handleElementAttributes(prefixedAttributes, libxmlAttributes, nbAttributes,
m_prefixToNamespaceMap, exceptionState); |
1045 setAttributes(newElement.get(), prefixedAttributes, parserContentPolicy()); | 1045 setAttributes(newElement.get(), prefixedAttributes, getParserContentPolicy()
); |
1046 if (exceptionState.hadException()) { | 1046 if (exceptionState.hadException()) { |
1047 stopParsing(); | 1047 stopParsing(); |
1048 return; | 1048 return; |
1049 } | 1049 } |
1050 | 1050 |
1051 newElement->beginParsingChildren(); | 1051 newElement->beginParsingChildren(); |
1052 | 1052 |
1053 ScriptLoader* scriptLoader = toScriptLoaderIfPossible(newElement.get()); | 1053 ScriptLoader* scriptLoader = toScriptLoaderIfPossible(newElement.get()); |
1054 if (scriptLoader) | 1054 if (scriptLoader) |
1055 m_scriptStartPosition = textPosition(); | 1055 m_scriptStartPosition = textPosition(); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1089 // the end of this method. | 1089 // the end of this method. |
1090 RefPtrWillBeRawPtr<XMLDocumentParser> protect(this); | 1090 RefPtrWillBeRawPtr<XMLDocumentParser> protect(this); |
1091 | 1091 |
1092 if (!updateLeafTextNode()) | 1092 if (!updateLeafTextNode()) |
1093 return; | 1093 return; |
1094 | 1094 |
1095 RefPtrWillBeRawPtr<ContainerNode> n = m_currentNode; | 1095 RefPtrWillBeRawPtr<ContainerNode> n = m_currentNode; |
1096 if (m_currentNode->isElementNode()) | 1096 if (m_currentNode->isElementNode()) |
1097 toElement(n.get())->finishParsingChildren(); | 1097 toElement(n.get())->finishParsingChildren(); |
1098 | 1098 |
1099 if (!scriptingContentIsAllowed(parserContentPolicy()) && n->isElementNode()
&& toScriptLoaderIfPossible(toElement(n))) { | 1099 if (!scriptingContentIsAllowed(getParserContentPolicy()) && n->isElementNode
() && toScriptLoaderIfPossible(toElement(n))) { |
1100 popCurrentNode(); | 1100 popCurrentNode(); |
1101 n->remove(IGNORE_EXCEPTION); | 1101 n->remove(IGNORE_EXCEPTION); |
1102 return; | 1102 return; |
1103 } | 1103 } |
1104 | 1104 |
1105 if (!n->isElementNode() || !m_hasView) { | 1105 if (!n->isElementNode() || !m_hasView) { |
1106 popCurrentNode(); | 1106 popCurrentNode(); |
1107 return; | 1107 return; |
1108 } | 1108 } |
1109 | 1109 |
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1699 sax.initialized = XML_SAX2_MAGIC; | 1699 sax.initialized = XML_SAX2_MAGIC; |
1700 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax,
&state); | 1700 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax,
&state); |
1701 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />"; | 1701 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />"; |
1702 parseChunk(parser->context(), parseString); | 1702 parseChunk(parser->context(), parseString); |
1703 finishParsing(parser->context()); | 1703 finishParsing(parser->context()); |
1704 attrsOK = state.gotAttributes; | 1704 attrsOK = state.gotAttributes; |
1705 return state.attributes; | 1705 return state.attributes; |
1706 } | 1706 } |
1707 | 1707 |
1708 } // namespace blink | 1708 } // namespace blink |
OLD | NEW |