Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(167)

Side by Side Diff: Source/core/dom/Node.cpp

Issue 124003003: Add ascii() / latin1() / utf8() methods to AtomicString to avoid having to call string() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | Source/core/events/GenericEventQueue.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | Source/core/events/GenericEventQueue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698