| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 bool isSelectValid() const; | 60 bool isSelectValid() const; |
| 61 | 61 |
| 62 private: | 62 private: |
| 63 HTMLContentElement(Document&, PassOwnPtrWillBeRawPtr<HTMLContentSelectFilter
>); | 63 HTMLContentElement(Document&, PassOwnPtrWillBeRawPtr<HTMLContentSelectFilter
>); |
| 64 | 64 |
| 65 virtual void parseAttribute(const QualifiedName&, const AtomicString&) overr
ide; | 65 virtual void parseAttribute(const QualifiedName&, const AtomicString&) overr
ide; |
| 66 | 66 |
| 67 bool validateSelect() const; | 67 bool validateSelect() const; |
| 68 void parseSelect(); | 68 void parseSelect(); |
| 69 | 69 |
| 70 bool matchSelector(const WillBeHeapVector<RawPtrWillBeMember<Node>, 32>& sib
lings, int nth) const; | 70 bool matchSelector(Element&) const; |
| 71 | 71 |
| 72 bool m_shouldParseSelect; | 72 bool m_shouldParseSelect; |
| 73 bool m_isValidSelector; | 73 bool m_isValidSelector; |
| 74 AtomicString m_select; | 74 AtomicString m_select; |
| 75 CSSSelectorList m_selectorList; | 75 CSSSelectorList m_selectorList; |
| 76 OwnPtrWillBeMember<HTMLContentSelectFilter> m_filter; | 76 OwnPtrWillBeMember<HTMLContentSelectFilter> m_filter; |
| 77 }; | 77 }; |
| 78 | 78 |
| 79 inline const CSSSelectorList& HTMLContentElement::selectorList() const | 79 inline const CSSSelectorList& HTMLContentElement::selectorList() const |
| 80 { | 80 { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 93 inline bool HTMLContentElement::canSelectNode(const WillBeHeapVector<RawPtrWillB
eMember<Node>, 32>& siblings, int nth) const | 93 inline bool HTMLContentElement::canSelectNode(const WillBeHeapVector<RawPtrWillB
eMember<Node>, 32>& siblings, int nth) const |
| 94 { | 94 { |
| 95 if (m_filter) | 95 if (m_filter) |
| 96 return m_filter->canSelectNode(siblings, nth); | 96 return m_filter->canSelectNode(siblings, nth); |
| 97 if (m_select.isNull() || m_select.isEmpty()) | 97 if (m_select.isNull() || m_select.isEmpty()) |
| 98 return true; | 98 return true; |
| 99 if (!isSelectValid()) | 99 if (!isSelectValid()) |
| 100 return false; | 100 return false; |
| 101 if (!siblings[nth]->isElementNode()) | 101 if (!siblings[nth]->isElementNode()) |
| 102 return false; | 102 return false; |
| 103 return matchSelector(siblings, nth); | 103 return matchSelector(*toElement(siblings[nth])); |
| 104 } | 104 } |
| 105 | 105 |
| 106 } // namespace blink | 106 } // namespace blink |
| 107 | 107 |
| 108 #endif // HTMLContentElement_h | 108 #endif // HTMLContentElement_h |
| OLD | NEW |