Chromium Code Reviews| 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 897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 + toString(namespaces[i].prefix ); |
|
adamk
2014/09/22 18:33:05
You can get rid of the toString() call on the righ
| |
| 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 Loading... | |
| 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 |
| OLD | NEW |