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

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

Issue 144313014: Remove NodeList's anonymous named getter (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Another clang build fix Created 6 years, 10 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 | « Source/core/dom/StaticNodeList.h ('k') | Source/web/WebNodeList.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) 2007, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2010 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 27 matching lines...) Expand all
38 return m_nodes.size(); 38 return m_nodes.size();
39 } 39 }
40 40
41 Node* StaticNodeList::item(unsigned index) const 41 Node* StaticNodeList::item(unsigned index) const
42 { 42 {
43 if (index < m_nodes.size()) 43 if (index < m_nodes.size())
44 return m_nodes[index].get(); 44 return m_nodes[index].get();
45 return 0; 45 return 0;
46 } 46 }
47 47
48 Node* StaticNodeList::namedItem(const AtomicString& elementId) const
49 {
50 size_t length = m_nodes.size();
51 for (size_t i = 0; i < length; ++i) {
52 Node* node = m_nodes[i].get();
53 if (node->isElementNode() && toElement(node)->getIdAttribute() == elemen tId)
54 return node;
55 }
56
57 return 0;
58 }
59
60 } // namespace WebCore 48 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/StaticNodeList.h ('k') | Source/web/WebNodeList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698