OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2012 Motorola Mobility, Inc. All rights reserved. | 2 * Copyright (c) 2012 Motorola Mobility, 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 14 matching lines...) Expand all Loading... | |
25 | 25 |
26 #ifndef RadioNodeList_h | 26 #ifndef RadioNodeList_h |
27 #define RadioNodeList_h | 27 #define RadioNodeList_h |
28 | 28 |
29 #include "core/dom/LiveNodeList.h" | 29 #include "core/dom/LiveNodeList.h" |
30 #include "wtf/PassRefPtr.h" | 30 #include "wtf/PassRefPtr.h" |
31 #include "wtf/text/AtomicString.h" | 31 #include "wtf/text/AtomicString.h" |
32 | 32 |
33 namespace WebCore { | 33 namespace WebCore { |
34 | 34 |
35 class RadioNodeList FINAL : public LiveNodeList { | 35 class RadioNodeList : public LiveNodeList { |
36 public: | 36 public: |
37 static PassRefPtr<RadioNodeList> create(Node* ownerNode, CollectionType type , const AtomicString& name) | 37 static PassRefPtr<RadioNodeList> create(Node* ownerNode, CollectionType type , const AtomicString& name) |
38 { | 38 { |
39 ASSERT_UNUSED(type, type == RadioNodeListType); | 39 ASSERT_UNUSED(type, type == RadioNodeListType); |
40 return adoptRef(new RadioNodeList(ownerNode, name)); | 40 return adoptRef(new RadioNodeList(ownerNode, name)); |
41 } | 41 } |
42 | 42 |
43 virtual ~RadioNodeList(); | 43 virtual ~RadioNodeList(); |
44 | 44 |
45 String value() const; | 45 virtual String value() const; |
46 void setValue(const String&); | 46 virtual void setValue(const String&); |
47 | |
48 protected: | |
49 RadioNodeList(Node*, const AtomicString& name); | |
47 | 50 |
48 private: | 51 private: |
49 RadioNodeList(Node*, const AtomicString& name); | |
50 bool checkElementMatchesRadioNodeListFilter(Element*) const; | 52 bool checkElementMatchesRadioNodeListFilter(Element*) const; |
51 | 53 |
52 virtual bool nodeMatches(Element*) const OVERRIDE; | 54 virtual bool nodeMatches(Element*) const OVERRIDE; |
53 | 55 |
54 AtomicString m_name; | 56 AtomicString m_name; |
55 }; | 57 }; |
56 | 58 |
57 } // namepsace | 59 // A specialized version of RadioNodeList, limited to <img> elements. |
60 class RadioImgNodeList FINAL : public RadioNodeList { | |
61 public: | |
esprehn
2013/12/19 11:02:48
I'd rather you just added a bool to the RadioNodeL
sof
2013/12/19 12:15:05
Done.
| |
62 static PassRefPtr<RadioImgNodeList> create(Node* ownerNode, CollectionType t ype, const AtomicString& name) | |
63 { | |
64 ASSERT_UNUSED(type, type == RadioNodeListType); | |
65 return adoptRef(new RadioImgNodeList(ownerNode, name)); | |
66 } | |
67 | |
68 virtual String value() const OVERRIDE { return String(); } | |
69 virtual void setValue(const String&) OVERRIDE { } | |
70 | |
71 private: | |
72 RadioImgNodeList(Node*, const AtomicString& name); | |
73 | |
74 virtual bool nodeMatches(Element*) const OVERRIDE; | |
75 | |
76 AtomicString m_name; | |
77 }; | |
78 | |
79 } // namespace | |
58 | 80 |
59 #endif | 81 #endif |
60 | 82 |
OLD | NEW |