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 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
638 const AtomicString& Node::prefix() const | 638 const AtomicString& Node::prefix() const |
639 { | 639 { |
640 // For nodes other than elements and attributes, the prefix is always null | 640 // For nodes other than elements and attributes, the prefix is always null |
641 return nullAtom; | 641 return nullAtom; |
642 } | 642 } |
643 | 643 |
644 void Node::setPrefix(const AtomicString& /*prefix*/, ExceptionCode& ec) | 644 void Node::setPrefix(const AtomicString& /*prefix*/, ExceptionCode& ec) |
645 { | 645 { |
646 // The spec says that for nodes other than elements and attributes, prefix i
s always null. | 646 // The spec says that for nodes other than elements and attributes, prefix i
s always null. |
647 // It does not say what to do when the user tries to set the prefix on anoth
er type of | 647 // It does not say what to do when the user tries to set the prefix on anoth
er type of |
648 // node, however Mozilla throws a NAMESPACE_ERR exception. | 648 // node, however Mozilla throws a NamespaceError exception. |
649 ec = NAMESPACE_ERR; | 649 ec = NamespaceError; |
650 } | 650 } |
651 | 651 |
652 const AtomicString& Node::localName() const | 652 const AtomicString& Node::localName() const |
653 { | 653 { |
654 return nullAtom; | 654 return nullAtom; |
655 } | 655 } |
656 | 656 |
657 const AtomicString& Node::namespaceURI() const | 657 const AtomicString& Node::namespaceURI() const |
658 { | 658 { |
659 return nullAtom; | 659 return nullAtom; |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
970 void Node::checkSetPrefix(const AtomicString& prefix, ExceptionCode& ec) | 970 void Node::checkSetPrefix(const AtomicString& prefix, ExceptionCode& ec) |
971 { | 971 { |
972 // Perform error checking as required by spec for setting Node.prefix. Used
by | 972 // Perform error checking as required by spec for setting Node.prefix. Used
by |
973 // Element::setPrefix() and Attr::setPrefix() | 973 // Element::setPrefix() and Attr::setPrefix() |
974 | 974 |
975 if (!prefix.isEmpty() && !Document::isValidName(prefix)) { | 975 if (!prefix.isEmpty() && !Document::isValidName(prefix)) { |
976 ec = InvalidCharacterError; | 976 ec = InvalidCharacterError; |
977 return; | 977 return; |
978 } | 978 } |
979 | 979 |
980 // FIXME: Raise NAMESPACE_ERR if prefix is malformed per the Namespaces in X
ML specification. | 980 // FIXME: Raise NamespaceError if prefix is malformed per the Namespaces in
XML specification. |
981 | 981 |
982 const AtomicString& nodeNamespaceURI = namespaceURI(); | 982 const AtomicString& nodeNamespaceURI = namespaceURI(); |
983 if ((nodeNamespaceURI.isEmpty() && !prefix.isEmpty()) | 983 if ((nodeNamespaceURI.isEmpty() && !prefix.isEmpty()) |
984 || (prefix == xmlAtom && nodeNamespaceURI != XMLNames::xmlNamespaceURI))
{ | 984 || (prefix == xmlAtom && nodeNamespaceURI != XMLNames::xmlNamespaceURI))
{ |
985 ec = NAMESPACE_ERR; | 985 ec = NamespaceError; |
986 return; | 986 return; |
987 } | 987 } |
988 // Attribute-specific checks are in Attr::setPrefix(). | 988 // Attribute-specific checks are in Attr::setPrefix(). |
989 } | 989 } |
990 | 990 |
991 bool Node::isDescendantOf(const Node *other) const | 991 bool Node::isDescendantOf(const Node *other) const |
992 { | 992 { |
993 // Return true if other is an ancestor of this, otherwise false | 993 // Return true if other is an ancestor of this, otherwise false |
994 if (!other || !other->hasChildNodes() || inDocument() != other->inDocument()
) | 994 if (!other || !other->hasChildNodes() || inDocument() != other->inDocument()
) |
995 return false; | 995 return false; |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1339 | 1339 |
1340 PassRefPtr<RadioNodeList> Node::radioNodeList(const AtomicString& name) | 1340 PassRefPtr<RadioNodeList> Node::radioNodeList(const AtomicString& name) |
1341 { | 1341 { |
1342 ASSERT(hasTagName(formTag) || hasTagName(fieldsetTag)); | 1342 ASSERT(hasTagName(formTag) || hasTagName(fieldsetTag)); |
1343 return ensureRareData()->ensureNodeLists()->addCacheWithAtomicName<RadioNode
List>(this, RadioNodeListType, name); | 1343 return ensureRareData()->ensureNodeLists()->addCacheWithAtomicName<RadioNode
List>(this, RadioNodeListType, name); |
1344 } | 1344 } |
1345 | 1345 |
1346 PassRefPtr<Element> Node::querySelector(const AtomicString& selectors, Exception
Code& ec) | 1346 PassRefPtr<Element> Node::querySelector(const AtomicString& selectors, Exception
Code& ec) |
1347 { | 1347 { |
1348 if (selectors.isEmpty()) { | 1348 if (selectors.isEmpty()) { |
1349 ec = SYNTAX_ERR; | 1349 ec = SyntaxError; |
1350 return 0; | 1350 return 0; |
1351 } | 1351 } |
1352 | 1352 |
1353 SelectorQuery* selectorQuery = document()->selectorQueryCache()->add(selecto
rs, document(), ec); | 1353 SelectorQuery* selectorQuery = document()->selectorQueryCache()->add(selecto
rs, document(), ec); |
1354 if (!selectorQuery) | 1354 if (!selectorQuery) |
1355 return 0; | 1355 return 0; |
1356 return selectorQuery->queryFirst(this); | 1356 return selectorQuery->queryFirst(this); |
1357 } | 1357 } |
1358 | 1358 |
1359 PassRefPtr<NodeList> Node::querySelectorAll(const AtomicString& selectors, Excep
tionCode& ec) | 1359 PassRefPtr<NodeList> Node::querySelectorAll(const AtomicString& selectors, Excep
tionCode& ec) |
1360 { | 1360 { |
1361 if (selectors.isEmpty()) { | 1361 if (selectors.isEmpty()) { |
1362 ec = SYNTAX_ERR; | 1362 ec = SyntaxError; |
1363 return 0; | 1363 return 0; |
1364 } | 1364 } |
1365 | 1365 |
1366 SelectorQuery* selectorQuery = document()->selectorQueryCache()->add(selecto
rs, document(), ec); | 1366 SelectorQuery* selectorQuery = document()->selectorQueryCache()->add(selecto
rs, document(), ec); |
1367 if (!selectorQuery) | 1367 if (!selectorQuery) |
1368 return 0; | 1368 return 0; |
1369 return selectorQuery->queryAll(this); | 1369 return selectorQuery->queryAll(this); |
1370 } | 1370 } |
1371 | 1371 |
1372 Document *Node::ownerDocument() const | 1372 Document *Node::ownerDocument() const |
(...skipping 1357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2730 node->showTreeForThis(); | 2730 node->showTreeForThis(); |
2731 } | 2731 } |
2732 | 2732 |
2733 void showNodePath(const WebCore::Node* node) | 2733 void showNodePath(const WebCore::Node* node) |
2734 { | 2734 { |
2735 if (node) | 2735 if (node) |
2736 node->showNodePathForThis(); | 2736 node->showNodePathForThis(); |
2737 } | 2737 } |
2738 | 2738 |
2739 #endif | 2739 #endif |
OLD | NEW |