Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(482)

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLContentElement.h

Issue 1686483002: Oilpan: Remove most WillBe types from the code base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 20 matching lines...) Expand all
31 #ifndef HTMLContentElement_h 31 #ifndef HTMLContentElement_h
32 #define HTMLContentElement_h 32 #define HTMLContentElement_h
33 33
34 #include "core/CoreExport.h" 34 #include "core/CoreExport.h"
35 #include "core/css/CSSSelectorList.h" 35 #include "core/css/CSSSelectorList.h"
36 #include "core/dom/shadow/InsertionPoint.h" 36 #include "core/dom/shadow/InsertionPoint.h"
37 #include "platform/heap/Handle.h" 37 #include "platform/heap/Handle.h"
38 38
39 namespace blink { 39 namespace blink {
40 40
41 class HTMLContentSelectFilter : public NoBaseWillBeGarbageCollectedFinalized<HTM LContentSelectFilter> { 41 class HTMLContentSelectFilter : public GarbageCollectedFinalized<HTMLContentSele ctFilter> {
42 USING_FAST_MALLOC_WILL_BE_REMOVED(HTMLContentSelectFilter);
43 public: 42 public:
44 virtual ~HTMLContentSelectFilter() { } 43 virtual ~HTMLContentSelectFilter() { }
45 virtual bool canSelectNode(const WillBeHeapVector<RawPtrWillBeMember<Node>, 32>& siblings, int nth) const = 0; 44 virtual bool canSelectNode(const HeapVector<Member<Node>, 32>& siblings, int nth) const = 0;
46 45
47 DEFINE_INLINE_VIRTUAL_TRACE() { } 46 DEFINE_INLINE_VIRTUAL_TRACE() { }
48 }; 47 };
49 48
50 class CORE_EXPORT HTMLContentElement final : public InsertionPoint { 49 class CORE_EXPORT HTMLContentElement final : public InsertionPoint {
51 DEFINE_WRAPPERTYPEINFO(); 50 DEFINE_WRAPPERTYPEINFO();
52 public: 51 public:
53 static PassRefPtrWillBeRawPtr<HTMLContentElement> create(Document&, PassOwnP trWillBeRawPtr<HTMLContentSelectFilter> = nullptr); 52 static RawPtr<HTMLContentElement> create(Document&, RawPtr<HTMLContentSelect Filter> = nullptr);
54 ~HTMLContentElement() override; 53 ~HTMLContentElement() override;
55 54
56 bool canAffectSelector() const override { return true; } 55 bool canAffectSelector() const override { return true; }
57 56
58 bool canSelectNode(const WillBeHeapVector<RawPtrWillBeMember<Node>, 32>& sib lings, int nth) const; 57 bool canSelectNode(const HeapVector<Member<Node>, 32>& siblings, int nth) co nst;
59 58
60 const CSSSelectorList& selectorList() const; 59 const CSSSelectorList& selectorList() const;
61 bool isSelectValid() const; 60 bool isSelectValid() const;
62 61
63 DECLARE_VIRTUAL_TRACE(); 62 DECLARE_VIRTUAL_TRACE();
64 63
65 private: 64 private:
66 HTMLContentElement(Document&, PassOwnPtrWillBeRawPtr<HTMLContentSelectFilter >); 65 HTMLContentElement(Document&, RawPtr<HTMLContentSelectFilter>);
67 66
68 void parseAttribute(const QualifiedName&, const AtomicString&, const AtomicS tring&) override; 67 void parseAttribute(const QualifiedName&, const AtomicString&, const AtomicS tring&) override;
69 68
70 bool validateSelect() const; 69 bool validateSelect() const;
71 void parseSelect(); 70 void parseSelect();
72 71
73 bool matchSelector(Element&) const; 72 bool matchSelector(Element&) const;
74 73
75 bool m_shouldParseSelect; 74 bool m_shouldParseSelect;
76 bool m_isValidSelector; 75 bool m_isValidSelector;
77 AtomicString m_select; 76 AtomicString m_select;
78 CSSSelectorList m_selectorList; 77 CSSSelectorList m_selectorList;
79 OwnPtrWillBeMember<HTMLContentSelectFilter> m_filter; 78 Member<HTMLContentSelectFilter> m_filter;
80 }; 79 };
81 80
82 inline const CSSSelectorList& HTMLContentElement::selectorList() const 81 inline const CSSSelectorList& HTMLContentElement::selectorList() const
83 { 82 {
84 if (m_shouldParseSelect) 83 if (m_shouldParseSelect)
85 const_cast<HTMLContentElement*>(this)->parseSelect(); 84 const_cast<HTMLContentElement*>(this)->parseSelect();
86 return m_selectorList; 85 return m_selectorList;
87 } 86 }
88 87
89 inline bool HTMLContentElement::isSelectValid() const 88 inline bool HTMLContentElement::isSelectValid() const
90 { 89 {
91 if (m_shouldParseSelect) 90 if (m_shouldParseSelect)
92 const_cast<HTMLContentElement*>(this)->parseSelect(); 91 const_cast<HTMLContentElement*>(this)->parseSelect();
93 return m_isValidSelector; 92 return m_isValidSelector;
94 } 93 }
95 94
96 inline bool HTMLContentElement::canSelectNode(const WillBeHeapVector<RawPtrWillB eMember<Node>, 32>& siblings, int nth) const 95 inline bool HTMLContentElement::canSelectNode(const HeapVector<Member<Node>, 32> & siblings, int nth) const
97 { 96 {
98 if (m_filter) 97 if (m_filter)
99 return m_filter->canSelectNode(siblings, nth); 98 return m_filter->canSelectNode(siblings, nth);
100 if (m_select.isNull() || m_select.isEmpty()) 99 if (m_select.isNull() || m_select.isEmpty())
101 return true; 100 return true;
102 if (!isSelectValid()) 101 if (!isSelectValid())
103 return false; 102 return false;
104 if (!siblings[nth]->isElementNode()) 103 if (!siblings[nth]->isElementNode())
105 return false; 104 return false;
106 return matchSelector(*toElement(siblings[nth])); 105 return matchSelector(*toElement(siblings[nth]));
107 } 106 }
108 107
109 } // namespace blink 108 } // namespace blink
110 109
111 #endif // HTMLContentElement_h 110 #endif // HTMLContentElement_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLCollection.idl ('k') | third_party/WebKit/Source/core/html/HTMLContentElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698