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

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

Issue 448043003: Drop const_iterator for AttributeCollection (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/xml/XPathStep.cpp ('k') | Source/web/WebPageSerializerImpl.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 795 matching lines...) Expand 10 before | Expand all | Expand 10 after
806 break; 806 break;
807 parentElement = toElement(n); 807 parentElement = toElement(n);
808 } 808 }
809 809
810 if (elemStack.isEmpty()) 810 if (elemStack.isEmpty())
811 return; 811 return;
812 812
813 for (; !elemStack.isEmpty(); elemStack.removeLast()) { 813 for (; !elemStack.isEmpty(); elemStack.removeLast()) {
814 Element* element = elemStack.last(); 814 Element* element = elemStack.last();
815 AttributeCollection attributes = element->attributes(); 815 AttributeCollection attributes = element->attributes();
816 AttributeCollection::const_iterator end = attributes.end(); 816 AttributeCollection::iterator end = attributes.end();
817 for (AttributeCollection::const_iterator it = attributes.begin(); it != end; ++it) { 817 for (AttributeCollection::iterator it = attributes.begin(); it != end; + +it) {
818 if (it->localName() == xmlnsAtom) 818 if (it->localName() == xmlnsAtom)
819 m_defaultNamespaceURI = it->value(); 819 m_defaultNamespaceURI = it->value();
820 else if (it->prefix() == xmlnsAtom) 820 else if (it->prefix() == xmlnsAtom)
821 m_prefixToNamespaceMap.set(it->localName(), it->value()); 821 m_prefixToNamespaceMap.set(it->localName(), it->value());
822 } 822 }
823 } 823 }
824 824
825 // If the parent element is not in document tree, there may be no xmlns attr ibute; just default to the parent's namespace. 825 // If the parent element is not in document tree, there may be no xmlns attr ibute; just default to the parent's namespace.
826 if (m_defaultNamespaceURI.isNull() && !parentElement->inDocument()) 826 if (m_defaultNamespaceURI.isNull() && !parentElement->inDocument())
827 m_defaultNamespaceURI = parentElement->namespaceURI(); 827 m_defaultNamespaceURI = parentElement->namespaceURI();
(...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after
1629 sax.initialized = XML_SAX2_MAGIC; 1629 sax.initialized = XML_SAX2_MAGIC;
1630 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax, &state); 1630 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax, &state);
1631 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />"; 1631 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />";
1632 parseChunk(parser->context(), parseString); 1632 parseChunk(parser->context(), parseString);
1633 finishParsing(parser->context()); 1633 finishParsing(parser->context());
1634 attrsOK = state.gotAttributes; 1634 attrsOK = state.gotAttributes;
1635 return state.attributes; 1635 return state.attributes;
1636 } 1636 }
1637 1637
1638 } // namespace blink 1638 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/xml/XPathStep.cpp ('k') | Source/web/WebPageSerializerImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698