| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. |
| 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) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
| (...skipping 1487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1498 String Node::lookupPrefix(const AtomicString &namespaceURI) const | 1498 String Node::lookupPrefix(const AtomicString &namespaceURI) const |
| 1499 { | 1499 { |
| 1500 // Implemented according to | 1500 // Implemented according to |
| 1501 // http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/namespaces-algori
thms.html#lookupNamespacePrefixAlgo | 1501 // http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/namespaces-algori
thms.html#lookupNamespacePrefixAlgo |
| 1502 | 1502 |
| 1503 if (namespaceURI.isEmpty()) | 1503 if (namespaceURI.isEmpty()) |
| 1504 return String(); | 1504 return String(); |
| 1505 | 1505 |
| 1506 switch (nodeType()) { | 1506 switch (nodeType()) { |
| 1507 case ELEMENT_NODE: | 1507 case ELEMENT_NODE: |
| 1508 return lookupNamespacePrefix(namespaceURI, static_cast<const Element
*>(this)); | 1508 return lookupNamespacePrefix(namespaceURI, toElement(this)); |
| 1509 case DOCUMENT_NODE: | 1509 case DOCUMENT_NODE: |
| 1510 if (Element* de = toDocument(this)->documentElement()) | 1510 if (Element* de = toDocument(this)->documentElement()) |
| 1511 return de->lookupPrefix(namespaceURI); | 1511 return de->lookupPrefix(namespaceURI); |
| 1512 return String(); | 1512 return String(); |
| 1513 case ENTITY_NODE: | 1513 case ENTITY_NODE: |
| 1514 case NOTATION_NODE: | 1514 case NOTATION_NODE: |
| 1515 case DOCUMENT_FRAGMENT_NODE: | 1515 case DOCUMENT_FRAGMENT_NODE: |
| 1516 case DOCUMENT_TYPE_NODE: | 1516 case DOCUMENT_TYPE_NODE: |
| 1517 return String(); | 1517 return String(); |
| 1518 case ATTRIBUTE_NODE: { | 1518 case ATTRIBUTE_NODE: { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 1531 String Node::lookupNamespaceURI(const String &prefix) const | 1531 String Node::lookupNamespaceURI(const String &prefix) const |
| 1532 { | 1532 { |
| 1533 // Implemented according to | 1533 // Implemented according to |
| 1534 // http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/namespaces-algori
thms.html#lookupNamespaceURIAlgo | 1534 // http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/namespaces-algori
thms.html#lookupNamespaceURIAlgo |
| 1535 | 1535 |
| 1536 if (!prefix.isNull() && prefix.isEmpty()) | 1536 if (!prefix.isNull() && prefix.isEmpty()) |
| 1537 return String(); | 1537 return String(); |
| 1538 | 1538 |
| 1539 switch (nodeType()) { | 1539 switch (nodeType()) { |
| 1540 case ELEMENT_NODE: { | 1540 case ELEMENT_NODE: { |
| 1541 const Element *elem = static_cast<const Element *>(this); | 1541 const Element *elem = toElement(this); |
| 1542 | 1542 |
| 1543 if (!elem->namespaceURI().isNull() && elem->prefix() == prefix) | 1543 if (!elem->namespaceURI().isNull() && elem->prefix() == prefix) |
| 1544 return elem->namespaceURI(); | 1544 return elem->namespaceURI(); |
| 1545 | 1545 |
| 1546 if (elem->hasAttributes()) { | 1546 if (elem->hasAttributes()) { |
| 1547 for (unsigned i = 0; i < elem->attributeCount(); i++) { | 1547 for (unsigned i = 0; i < elem->attributeCount(); i++) { |
| 1548 const Attribute* attr = elem->attributeItem(i); | 1548 const Attribute* attr = elem->attributeItem(i); |
| 1549 | 1549 |
| 1550 if (attr->prefix() == xmlnsAtom && attr->localName() == pref
ix) { | 1550 if (attr->prefix() == xmlnsAtom && attr->localName() == pref
ix) { |
| 1551 if (!attr->value().isEmpty()) | 1551 if (!attr->value().isEmpty()) |
| (...skipping 1182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2734 node->showTreeForThis(); | 2734 node->showTreeForThis(); |
| 2735 } | 2735 } |
| 2736 | 2736 |
| 2737 void showNodePath(const WebCore::Node* node) | 2737 void showNodePath(const WebCore::Node* node) |
| 2738 { | 2738 { |
| 2739 if (node) | 2739 if (node) |
| 2740 node->showNodePathForThis(); | 2740 node->showNodePathForThis(); |
| 2741 } | 2741 } |
| 2742 | 2742 |
| 2743 #endif | 2743 #endif |
| OLD | NEW |