| 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 841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 852 AttributeCollection attributes = element->attributes(); | 852 AttributeCollection attributes = element->attributes(); |
| 853 for (auto& attribute : attributes) { | 853 for (auto& attribute : attributes) { |
| 854 if (attribute.localName() == xmlnsAtom) | 854 if (attribute.localName() == xmlnsAtom) |
| 855 m_defaultNamespaceURI = attribute.value(); | 855 m_defaultNamespaceURI = attribute.value(); |
| 856 else if (attribute.prefix() == xmlnsAtom) | 856 else if (attribute.prefix() == xmlnsAtom) |
| 857 m_prefixToNamespaceMap.set(attribute.localName(), attribute.valu
e()); | 857 m_prefixToNamespaceMap.set(attribute.localName(), attribute.valu
e()); |
| 858 } | 858 } |
| 859 } | 859 } |
| 860 | 860 |
| 861 // If the parent element is not in document tree, there may be no xmlns attr
ibute; just default to the parent's namespace. | 861 // If the parent element is not in document tree, there may be no xmlns attr
ibute; just default to the parent's namespace. |
| 862 if (m_defaultNamespaceURI.isNull() && !parentElement->inDocument()) | 862 if (m_defaultNamespaceURI.isNull() && !parentElement->inShadowIncludingDocum
ent()) |
| 863 m_defaultNamespaceURI = parentElement->namespaceURI(); | 863 m_defaultNamespaceURI = parentElement->namespaceURI(); |
| 864 } | 864 } |
| 865 | 865 |
| 866 XMLParserContext::~XMLParserContext() | 866 XMLParserContext::~XMLParserContext() |
| 867 { | 867 { |
| 868 if (m_context->myDoc) | 868 if (m_context->myDoc) |
| 869 xmlFreeDoc(m_context->myDoc); | 869 xmlFreeDoc(m_context->myDoc); |
| 870 xmlFreeParserCtxt(m_context); | 870 xmlFreeParserCtxt(m_context); |
| 871 } | 871 } |
| 872 | 872 |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1103 | 1103 |
| 1104 if (!n->isElementNode() || !m_hasView) { | 1104 if (!n->isElementNode() || !m_hasView) { |
| 1105 popCurrentNode(); | 1105 popCurrentNode(); |
| 1106 return; | 1106 return; |
| 1107 } | 1107 } |
| 1108 | 1108 |
| 1109 Element* element = toElement(n); | 1109 Element* element = toElement(n); |
| 1110 | 1110 |
| 1111 // The element's parent may have already been removed from document. | 1111 // The element's parent may have already been removed from document. |
| 1112 // Parsing continues in this case, but scripts aren't executed. | 1112 // Parsing continues in this case, but scripts aren't executed. |
| 1113 if (!element->inDocument()) { | 1113 if (!element->inShadowIncludingDocument()) { |
| 1114 popCurrentNode(); | 1114 popCurrentNode(); |
| 1115 return; | 1115 return; |
| 1116 } | 1116 } |
| 1117 | 1117 |
| 1118 ScriptLoader* scriptLoader = toScriptLoaderIfPossible(element); | 1118 ScriptLoader* scriptLoader = toScriptLoaderIfPossible(element); |
| 1119 if (!scriptLoader) { | 1119 if (!scriptLoader) { |
| 1120 popCurrentNode(); | 1120 popCurrentNode(); |
| 1121 return; | 1121 return; |
| 1122 } | 1122 } |
| 1123 | 1123 |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1684 sax.initialized = XML_SAX2_MAGIC; | 1684 sax.initialized = XML_SAX2_MAGIC; |
| 1685 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax,
&state); | 1685 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax,
&state); |
| 1686 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />"; | 1686 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />"; |
| 1687 parseChunk(parser->context(), parseString); | 1687 parseChunk(parser->context(), parseString); |
| 1688 finishParsing(parser->context()); | 1688 finishParsing(parser->context()); |
| 1689 attrsOK = state.gotAttributes; | 1689 attrsOK = state.gotAttributes; |
| 1690 return state.attributes; | 1690 return state.attributes; |
| 1691 } | 1691 } |
| 1692 | 1692 |
| 1693 } // namespace blink | 1693 } // namespace blink |
| OLD | NEW |