Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Side by Side Diff: third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp

Issue 2149893003: Rename Node::inShadowIncludingDocument() to Node::isConnected() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 810 matching lines...) Expand 10 before | Expand all | Expand 10 after
821 AttributeCollection attributes = element->attributes(); 821 AttributeCollection attributes = element->attributes();
822 for (auto& attribute : attributes) { 822 for (auto& attribute : attributes) {
823 if (attribute.localName() == xmlnsAtom) 823 if (attribute.localName() == xmlnsAtom)
824 m_defaultNamespaceURI = attribute.value(); 824 m_defaultNamespaceURI = attribute.value();
825 else if (attribute.prefix() == xmlnsAtom) 825 else if (attribute.prefix() == xmlnsAtom)
826 m_prefixToNamespaceMap.set(attribute.localName(), attribute.valu e()); 826 m_prefixToNamespaceMap.set(attribute.localName(), attribute.valu e());
827 } 827 }
828 } 828 }
829 829
830 // If the parent element is not in document tree, there may be no xmlns attr ibute; just default to the parent's namespace. 830 // If the parent element is not in document tree, there may be no xmlns attr ibute; just default to the parent's namespace.
831 if (m_defaultNamespaceURI.isNull() && !parentElement->inShadowIncludingDocum ent()) 831 if (m_defaultNamespaceURI.isNull() && !parentElement->isConnected())
832 m_defaultNamespaceURI = parentElement->namespaceURI(); 832 m_defaultNamespaceURI = parentElement->namespaceURI();
833 } 833 }
834 834
835 XMLParserContext::~XMLParserContext() 835 XMLParserContext::~XMLParserContext()
836 { 836 {
837 if (m_context->myDoc) 837 if (m_context->myDoc)
838 xmlFreeDoc(m_context->myDoc); 838 xmlFreeDoc(m_context->myDoc);
839 xmlFreeParserCtxt(m_context); 839 xmlFreeParserCtxt(m_context);
840 } 840 }
841 841
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
1059 1059
1060 if (!n->isElementNode() || !m_hasView) { 1060 if (!n->isElementNode() || !m_hasView) {
1061 popCurrentNode(); 1061 popCurrentNode();
1062 return; 1062 return;
1063 } 1063 }
1064 1064
1065 Element* element = toElement(n); 1065 Element* element = toElement(n);
1066 1066
1067 // The element's parent may have already been removed from document. 1067 // The element's parent may have already been removed from document.
1068 // Parsing continues in this case, but scripts aren't executed. 1068 // Parsing continues in this case, but scripts aren't executed.
1069 if (!element->inShadowIncludingDocument()) { 1069 if (!element->isConnected()) {
1070 popCurrentNode(); 1070 popCurrentNode();
1071 return; 1071 return;
1072 } 1072 }
1073 1073
1074 ScriptLoader* scriptLoader = toScriptLoaderIfPossible(element); 1074 ScriptLoader* scriptLoader = toScriptLoaderIfPossible(element);
1075 if (!scriptLoader) { 1075 if (!scriptLoader) {
1076 popCurrentNode(); 1076 popCurrentNode();
1077 return; 1077 return;
1078 } 1078 }
1079 1079
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after
1640 sax.initialized = XML_SAX2_MAGIC; 1640 sax.initialized = XML_SAX2_MAGIC;
1641 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax, &state); 1641 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax, &state);
1642 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />"; 1642 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />";
1643 parseChunk(parser->context(), parseString); 1643 parseChunk(parser->context(), parseString);
1644 finishParsing(parser->context()); 1644 finishParsing(parser->context());
1645 attrsOK = state.gotAttributes; 1645 attrsOK = state.gotAttributes;
1646 return state.attributes; 1646 return state.attributes;
1647 } 1647 }
1648 1648
1649 } // namespace blink 1649 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/xml/XPathPath.cpp ('k') | third_party/WebKit/Source/modules/canvas2d/CanvasStyle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698