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 Apple Inc. All rights reserved. | 3 * Copyright (C) 2005, 2006, 2008 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 break; | 830 break; |
831 parentElement = toElement(n); | 831 parentElement = toElement(n); |
832 } | 832 } |
833 | 833 |
834 if (elemStack.isEmpty()) | 834 if (elemStack.isEmpty()) |
835 return; | 835 return; |
836 | 836 |
837 for (; !elemStack.isEmpty(); elemStack.removeLast()) { | 837 for (; !elemStack.isEmpty(); elemStack.removeLast()) { |
838 Element* element = elemStack.last(); | 838 Element* element = elemStack.last(); |
839 if (element->hasAttributes()) { | 839 if (element->hasAttributes()) { |
840 for (unsigned i = 0; i < element->attributeCount(); i++) { | 840 unsigned attributeCount = element->attributeCount(); |
| 841 for (unsigned i = 0; i < attributeCount; ++i) { |
841 const Attribute* attribute = element->attributeItem(i); | 842 const Attribute* attribute = element->attributeItem(i); |
842 if (attribute->localName() == xmlnsAtom) | 843 if (attribute->localName() == xmlnsAtom) |
843 m_defaultNamespaceURI = attribute->value(); | 844 m_defaultNamespaceURI = attribute->value(); |
844 else if (attribute->prefix() == xmlnsAtom) | 845 else if (attribute->prefix() == xmlnsAtom) |
845 m_prefixToNamespaceMap.set(attribute->localName(), attribute
->value()); | 846 m_prefixToNamespaceMap.set(attribute->localName(), attribute
->value()); |
846 } | 847 } |
847 } | 848 } |
848 } | 849 } |
849 | 850 |
850 // If the parent element is not in document tree, there may be no xmlns attr
ibute; just default to the parent's namespace. | 851 // If the parent element is not in document tree, there may be no xmlns attr
ibute; just default to the parent's namespace. |
(...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1633 sax.initialized = XML_SAX2_MAGIC; | 1634 sax.initialized = XML_SAX2_MAGIC; |
1634 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax,
&state); | 1635 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax,
&state); |
1635 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />"; | 1636 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />"; |
1636 parseChunk(parser->context(), parseString); | 1637 parseChunk(parser->context(), parseString); |
1637 finishParsing(parser->context()); | 1638 finishParsing(parser->context()); |
1638 attrsOK = state.gotAttributes; | 1639 attrsOK = state.gotAttributes; |
1639 return state.attributes; | 1640 return state.attributes; |
1640 } | 1641 } |
1641 | 1642 |
1642 } // namespace WebCore | 1643 } // namespace WebCore |
OLD | NEW |