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 1950 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1961 | 1961 |
1962 const Element* element = toElement(node); | 1962 const Element* element = toElement(node); |
1963 const AtomicString& idattr = element->getIdAttribute(); | 1963 const AtomicString& idattr = element->getIdAttribute(); |
1964 bool hasIdAttr = !idattr.isNull() && !idattr.isEmpty(); | 1964 bool hasIdAttr = !idattr.isNull() && !idattr.isEmpty(); |
1965 if (node->previousSibling() || node->nextSibling()) { | 1965 if (node->previousSibling() || node->nextSibling()) { |
1966 int count = 0; | 1966 int count = 0; |
1967 for (Node* previous = node->previousSibling(); previous; previou
s = previous->previousSibling()) | 1967 for (Node* previous = node->previousSibling(); previous; previou
s = previous->previousSibling()) |
1968 if (previous->nodeName() == node->nodeName()) | 1968 if (previous->nodeName() == node->nodeName()) |
1969 ++count; | 1969 ++count; |
1970 if (hasIdAttr) | 1970 if (hasIdAttr) |
1971 fprintf(stderr, "[@id=\"%s\" and position()=%d]", idattr.str
ing().utf8().data(), count); | 1971 fprintf(stderr, "[@id=\"%s\" and position()=%d]", idattr.utf
8().data(), count); |
1972 else | 1972 else |
1973 fprintf(stderr, "[%d]", count); | 1973 fprintf(stderr, "[%d]", count); |
1974 } else if (hasIdAttr) | 1974 } else if (hasIdAttr) { |
1975 fprintf(stderr, "[@id=\"%s\"]", idattr.string().utf8().data()); | 1975 fprintf(stderr, "[@id=\"%s\"]", idattr.utf8().data()); |
| 1976 } |
1976 break; | 1977 break; |
1977 } | 1978 } |
1978 case TEXT_NODE: | 1979 case TEXT_NODE: |
1979 fprintf(stderr, "/text()"); | 1980 fprintf(stderr, "/text()"); |
1980 break; | 1981 break; |
1981 case ATTRIBUTE_NODE: | 1982 case ATTRIBUTE_NODE: |
1982 fprintf(stderr, "/@%s", node->nodeName().utf8().data()); | 1983 fprintf(stderr, "/@%s", node->nodeName().utf8().data()); |
1983 break; | 1984 break; |
1984 default: | 1985 default: |
1985 break; | 1986 break; |
(...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2742 node->showTreeForThis(); | 2743 node->showTreeForThis(); |
2743 } | 2744 } |
2744 | 2745 |
2745 void showNodePath(const WebCore::Node* node) | 2746 void showNodePath(const WebCore::Node* node) |
2746 { | 2747 { |
2747 if (node) | 2748 if (node) |
2748 node->showNodePathForThis(); | 2749 node->showNodePathForThis(); |
2749 } | 2750 } |
2750 | 2751 |
2751 #endif | 2752 #endif |
OLD | NEW |