| 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 819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 830 AttributeCollection attributes = element->attributes(); | 830 AttributeCollection attributes = element->attributes(); |
| 831 for (auto& attribute : attributes) { | 831 for (auto& attribute : attributes) { |
| 832 if (attribute.localName() == xmlnsAtom) | 832 if (attribute.localName() == xmlnsAtom) |
| 833 m_defaultNamespaceURI = attribute.value(); | 833 m_defaultNamespaceURI = attribute.value(); |
| 834 else if (attribute.prefix() == xmlnsAtom) | 834 else if (attribute.prefix() == xmlnsAtom) |
| 835 m_prefixToNamespaceMap.set(attribute.localName(), attribute.valu
e()); | 835 m_prefixToNamespaceMap.set(attribute.localName(), attribute.valu
e()); |
| 836 } | 836 } |
| 837 } | 837 } |
| 838 | 838 |
| 839 // If the parent element is not in document tree, there may be no xmlns attr
ibute; just default to the parent's namespace. | 839 // If the parent element is not in document tree, there may be no xmlns attr
ibute; just default to the parent's namespace. |
| 840 if (m_defaultNamespaceURI.isNull() && !parentElement->inDocument()) | 840 if (m_defaultNamespaceURI.isNull() && !parentElement->inShadowIncludingDocum
ent()) |
| 841 m_defaultNamespaceURI = parentElement->namespaceURI(); | 841 m_defaultNamespaceURI = parentElement->namespaceURI(); |
| 842 } | 842 } |
| 843 | 843 |
| 844 XMLParserContext::~XMLParserContext() | 844 XMLParserContext::~XMLParserContext() |
| 845 { | 845 { |
| 846 if (m_context->myDoc) | 846 if (m_context->myDoc) |
| 847 xmlFreeDoc(m_context->myDoc); | 847 xmlFreeDoc(m_context->myDoc); |
| 848 xmlFreeParserCtxt(m_context); | 848 xmlFreeParserCtxt(m_context); |
| 849 } | 849 } |
| 850 | 850 |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1074 | 1074 |
| 1075 if (!n->isElementNode() || !m_hasView) { | 1075 if (!n->isElementNode() || !m_hasView) { |
| 1076 popCurrentNode(); | 1076 popCurrentNode(); |
| 1077 return; | 1077 return; |
| 1078 } | 1078 } |
| 1079 | 1079 |
| 1080 Element* element = toElement(n); | 1080 Element* element = toElement(n); |
| 1081 | 1081 |
| 1082 // The element's parent may have already been removed from document. | 1082 // The element's parent may have already been removed from document. |
| 1083 // Parsing continues in this case, but scripts aren't executed. | 1083 // Parsing continues in this case, but scripts aren't executed. |
| 1084 if (!element->inDocument()) { | 1084 if (!element->inShadowIncludingDocument()) { |
| 1085 popCurrentNode(); | 1085 popCurrentNode(); |
| 1086 return; | 1086 return; |
| 1087 } | 1087 } |
| 1088 | 1088 |
| 1089 ScriptLoader* scriptLoader = toScriptLoaderIfPossible(element); | 1089 ScriptLoader* scriptLoader = toScriptLoaderIfPossible(element); |
| 1090 if (!scriptLoader) { | 1090 if (!scriptLoader) { |
| 1091 popCurrentNode(); | 1091 popCurrentNode(); |
| 1092 return; | 1092 return; |
| 1093 } | 1093 } |
| 1094 | 1094 |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1655 sax.initialized = XML_SAX2_MAGIC; | 1655 sax.initialized = XML_SAX2_MAGIC; |
| 1656 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax,
&state); | 1656 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax,
&state); |
| 1657 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />"; | 1657 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />"; |
| 1658 parseChunk(parser->context(), parseString); | 1658 parseChunk(parser->context(), parseString); |
| 1659 finishParsing(parser->context()); | 1659 finishParsing(parser->context()); |
| 1660 attrsOK = state.gotAttributes; | 1660 attrsOK = state.gotAttributes; |
| 1661 return state.attributes; | 1661 return state.attributes; |
| 1662 } | 1662 } |
| 1663 | 1663 |
| 1664 } // namespace blink | 1664 } // namespace blink |
| OLD | NEW |