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

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

Issue 590193002: Use xmlnsWithColon instead of literal (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch for landing Created 6 years, 3 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
« no previous file with comments | « no previous file | no next file » | 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 897 matching lines...) Expand 10 before | Expand all | Expand 10 after
908 const xmlChar* uri; 908 const xmlChar* uri;
909 }; 909 };
910 910
911 static inline void handleNamespaceAttributes(Vector<Attribute>& prefixedAttribut es, const xmlChar** libxmlNamespaces, int nbNamespaces, ExceptionState& exceptio nState) 911 static inline void handleNamespaceAttributes(Vector<Attribute>& prefixedAttribut es, const xmlChar** libxmlNamespaces, int nbNamespaces, ExceptionState& exceptio nState)
912 { 912 {
913 xmlSAX2Namespace* namespaces = reinterpret_cast<xmlSAX2Namespace*>(libxmlNam espaces); 913 xmlSAX2Namespace* namespaces = reinterpret_cast<xmlSAX2Namespace*>(libxmlNam espaces);
914 for (int i = 0; i < nbNamespaces; ++i) { 914 for (int i = 0; i < nbNamespaces; ++i) {
915 AtomicString namespaceQName = xmlnsAtom; 915 AtomicString namespaceQName = xmlnsAtom;
916 AtomicString namespaceURI = toAtomicString(namespaces[i].uri); 916 AtomicString namespaceURI = toAtomicString(namespaces[i].uri);
917 if (namespaces[i].prefix) 917 if (namespaces[i].prefix)
918 namespaceQName = "xmlns:" + toString(namespaces[i].prefix); 918 namespaceQName = WTF::xmlnsWithColon + namespaces[i].prefix;
919 919
920 QualifiedName parsedName = anyName; 920 QualifiedName parsedName = anyName;
921 if (!Element::parseAttributeName(parsedName, XMLNSNames::xmlnsNamespaceU RI, namespaceQName, exceptionState)) 921 if (!Element::parseAttributeName(parsedName, XMLNSNames::xmlnsNamespaceU RI, namespaceQName, exceptionState))
922 return; 922 return;
923 923
924 prefixedAttributes.append(Attribute(parsedName, namespaceURI)); 924 prefixedAttributes.append(Attribute(parsedName, namespaceURI));
925 } 925 }
926 } 926 }
927 927
928 struct xmlSAX2Attributes { 928 struct xmlSAX2Attributes {
(...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after
1644 sax.initialized = XML_SAX2_MAGIC; 1644 sax.initialized = XML_SAX2_MAGIC;
1645 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax, &state); 1645 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax, &state);
1646 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />"; 1646 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />";
1647 parseChunk(parser->context(), parseString); 1647 parseChunk(parser->context(), parseString);
1648 finishParsing(parser->context()); 1648 finishParsing(parser->context());
1649 attrsOK = state.gotAttributes; 1649 attrsOK = state.gotAttributes;
1650 return state.attributes; 1650 return state.attributes;
1651 } 1651 }
1652 1652
1653 } // namespace blink 1653 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698