| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |