| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009, 2011, 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009, 2011, 2012 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 } | 59 } |
| 60 | 60 |
| 61 if (WillBeHeapVector<RawPtrWillBeMember<Element> >* elements = cache.getElem
entsByName(name)) { | 61 if (WillBeHeapVector<RawPtrWillBeMember<Element> >* elements = cache.getElem
entsByName(name)) { |
| 62 if (index < elements->size()) | 62 if (index < elements->size()) |
| 63 return elements->at(index); | 63 return elements->at(index); |
| 64 } | 64 } |
| 65 | 65 |
| 66 return 0; | 66 return 0; |
| 67 } | 67 } |
| 68 | 68 |
| 69 void HTMLAllCollection::namedGetter(const AtomicString& name, bool& returnValue0
Enabled, RefPtrWillBeRawPtr<NodeList>& returnValue0, bool& returnValue1Enabled,
RefPtrWillBeRawPtr<Element>& returnValue1) | 69 void HTMLAllCollection::namedGetter(const AtomicString& name, RefPtrWillBeRawPtr
<NodeList>& returnValue0, RefPtrWillBeRawPtr<Element>& returnValue1) |
| 70 { | 70 { |
| 71 WillBeHeapVector<RefPtrWillBeMember<Element> > namedItems; | 71 WillBeHeapVector<RefPtrWillBeMember<Element> > namedItems; |
| 72 this->namedItems(name, namedItems); | 72 this->namedItems(name, namedItems); |
| 73 | 73 |
| 74 if (!namedItems.size()) | 74 if (!namedItems.size()) |
| 75 return; | 75 return; |
| 76 | 76 |
| 77 if (namedItems.size() == 1) { | 77 if (namedItems.size() == 1) { |
| 78 returnValue1Enabled = true; | |
| 79 returnValue1 = namedItems.at(0); | 78 returnValue1 = namedItems.at(0); |
| 80 return; | 79 return; |
| 81 } | 80 } |
| 82 | 81 |
| 83 // FIXME: HTML5 specification says this should be a HTMLCollection. | 82 // FIXME: HTML5 specification says this should be a HTMLCollection. |
| 84 // http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-in
terfaces.html#htmlallcollection | 83 // http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-in
terfaces.html#htmlallcollection |
| 85 returnValue0Enabled = true; | |
| 86 returnValue0 = StaticElementList::adopt(namedItems); | 84 returnValue0 = StaticElementList::adopt(namedItems); |
| 87 } | 85 } |
| 88 | 86 |
| 89 } // namespace blink | 87 } // namespace blink |
| OLD | NEW |