Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / Source / core / html / WindowNameCollection.cpp
blob4adf390cc104fe36119854f2f477604dc2be23d3
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "config.h"
6 #include "core/html/WindowNameCollection.h"
8 #include "core/html/HTMLImageElement.h"
10 namespace blink {
12 WindowNameCollection::WindowNameCollection(ContainerNode& document, const AtomicString& name)
13 : HTMLNameCollection(document, WindowNamedItems, name)
17 bool WindowNameCollection::elementMatches(const Element& element) const
19 // Match only images, forms, embeds and objects by name,
20 // but anything by id
21 if (isHTMLImageElement(element)
22 || isHTMLFormElement(element)
23 || isHTMLEmbedElement(element)
24 || isHTMLObjectElement(element)) {
25 if (element.getNameAttribute() == m_name)
26 return true;
28 return element.getIdAttribute() == m_name;
31 } // namespace blink