diff options
Diffstat (limited to 'Source/WebCore/html/RadioNodeList.h')
-rw-r--r-- | Source/WebCore/html/RadioNodeList.h | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/Source/WebCore/html/RadioNodeList.h b/Source/WebCore/html/RadioNodeList.h index f82264ed4..b87833d78 100644 --- a/Source/WebCore/html/RadioNodeList.h +++ b/Source/WebCore/html/RadioNodeList.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2012 Motorola Mobility, Inc. All rights reserved. + * Copyright (C) 2014 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -23,39 +24,42 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef RadioNodeList_h -#define RadioNodeList_h +#pragma once +#include "HTMLElement.h" #include "LiveNodeList.h" -#include <wtf/PassRefPtr.h> #include <wtf/text/AtomicString.h> namespace WebCore { -class RadioNodeList : public LiveNodeList { +class RadioNodeList final : public CachedLiveNodeList<RadioNodeList> { public: - static PassRefPtr<RadioNodeList> create(ContainerNode& rootNode, Type type, const AtomicString& name) + static Ref<RadioNodeList> create(ContainerNode& rootNode, const AtomicString& name) { - ASSERT_UNUSED(type, type == RadioNodeListType); - return adoptRef(new RadioNodeList(rootNode, name)); + return adoptRef(*new RadioNodeList(rootNode, name)); } - ~RadioNodeList(); + virtual ~RadioNodeList(); + + HTMLElement* item(unsigned offset) const override; String value() const; void setValue(const String&); -protected: - virtual bool nodeMatches(Element*) const override; + bool elementMatches(Element&) const override; + bool isRootedAtDocument() const override { return m_isRootedAtDocument; } private: RadioNodeList(ContainerNode&, const AtomicString& name); - bool checkElementMatchesRadioNodeListFilter(Element*) const; + bool checkElementMatchesRadioNodeListFilter(const Element&) const; AtomicString m_name; + bool m_isRootedAtDocument; }; -} // namepsace - -#endif +inline HTMLElement* RadioNodeList::item(unsigned offset) const +{ + return downcast<HTMLElement>(CachedLiveNodeList<RadioNodeList>::item(offset)); +} +} // namepsace WebCore |