| OLD | NEW |
| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 virtual ~HTMLContentSelectFilter() { } | 43 virtual ~HTMLContentSelectFilter() { } |
| 44 virtual bool canSelectNode(const WillBeHeapVector<RawPtrWillBeMember<Node>,
32>& siblings, int nth) const = 0; | 44 virtual bool canSelectNode(const WillBeHeapVector<RawPtrWillBeMember<Node>,
32>& siblings, int nth) const = 0; |
| 45 | 45 |
| 46 DEFINE_INLINE_VIRTUAL_TRACE() { } | 46 DEFINE_INLINE_VIRTUAL_TRACE() { } |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 class CORE_EXPORT HTMLContentElement final : public InsertionPoint { | 49 class CORE_EXPORT HTMLContentElement final : public InsertionPoint { |
| 50 DEFINE_WRAPPERTYPEINFO(); | 50 DEFINE_WRAPPERTYPEINFO(); |
| 51 public: | 51 public: |
| 52 static PassRefPtrWillBeRawPtr<HTMLContentElement> create(Document&, PassOwnP
trWillBeRawPtr<HTMLContentSelectFilter> = nullptr); | 52 static PassRefPtrWillBeRawPtr<HTMLContentElement> create(Document&, PassOwnP
trWillBeRawPtr<HTMLContentSelectFilter> = nullptr); |
| 53 virtual ~HTMLContentElement(); | 53 ~HTMLContentElement() override; |
| 54 | 54 |
| 55 virtual bool canAffectSelector() const override { return true; } | 55 bool canAffectSelector() const override { return true; } |
| 56 | 56 |
| 57 bool canSelectNode(const WillBeHeapVector<RawPtrWillBeMember<Node>, 32>& sib
lings, int nth) const; | 57 bool canSelectNode(const WillBeHeapVector<RawPtrWillBeMember<Node>, 32>& sib
lings, int nth) const; |
| 58 | 58 |
| 59 const CSSSelectorList& selectorList() const; | 59 const CSSSelectorList& selectorList() const; |
| 60 bool isSelectValid() const; | 60 bool isSelectValid() const; |
| 61 | 61 |
| 62 DECLARE_VIRTUAL_TRACE(); | 62 DECLARE_VIRTUAL_TRACE(); |
| 63 | 63 |
| 64 private: | 64 private: |
| 65 HTMLContentElement(Document&, PassOwnPtrWillBeRawPtr<HTMLContentSelectFilter
>); | 65 HTMLContentElement(Document&, PassOwnPtrWillBeRawPtr<HTMLContentSelectFilter
>); |
| 66 | 66 |
| 67 virtual void parseAttribute(const QualifiedName&, const AtomicString&) overr
ide; | 67 void parseAttribute(const QualifiedName&, const AtomicString&) override; |
| 68 | 68 |
| 69 bool validateSelect() const; | 69 bool validateSelect() const; |
| 70 void parseSelect(); | 70 void parseSelect(); |
| 71 | 71 |
| 72 bool matchSelector(Element&) const; | 72 bool matchSelector(Element&) const; |
| 73 | 73 |
| 74 bool m_shouldParseSelect; | 74 bool m_shouldParseSelect; |
| 75 bool m_isValidSelector; | 75 bool m_isValidSelector; |
| 76 AtomicString m_select; | 76 AtomicString m_select; |
| 77 CSSSelectorList m_selectorList; | 77 CSSSelectorList m_selectorList; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 101 if (!isSelectValid()) | 101 if (!isSelectValid()) |
| 102 return false; | 102 return false; |
| 103 if (!siblings[nth]->isElementNode()) | 103 if (!siblings[nth]->isElementNode()) |
| 104 return false; | 104 return false; |
| 105 return matchSelector(*toElement(siblings[nth])); | 105 return matchSelector(*toElement(siblings[nth])); |
| 106 } | 106 } |
| 107 | 107 |
| 108 } // namespace blink | 108 } // namespace blink |
| 109 | 109 |
| 110 #endif // HTMLContentElement_h | 110 #endif // HTMLContentElement_h |
| OLD | NEW |