| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008 Apple 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 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 class CSSSelectorList { | 35 class CSSSelectorList { |
| 36 WTF_MAKE_FAST_ALLOCATED; | 36 WTF_MAKE_FAST_ALLOCATED; |
| 37 public: | 37 public: |
| 38 CSSSelectorList() : m_selectorArray(0) { } | 38 CSSSelectorList() : m_selectorArray(0) { } |
| 39 CSSSelectorList(const CSSSelectorList&); | 39 CSSSelectorList(const CSSSelectorList&); |
| 40 | 40 |
| 41 ~CSSSelectorList(); | 41 ~CSSSelectorList(); |
| 42 | 42 |
| 43 void adopt(CSSSelectorList& list); | 43 void adopt(CSSSelectorList& list); |
| 44 void adoptSelectorVector(Vector<OwnPtr<CSSParserSelector> >& selectorVector)
; | 44 void adoptSelectorVector(Vector<OwnPtr<CSSParserSelector>>& selectorVector); |
| 45 | 45 |
| 46 bool isValid() const { return !!m_selectorArray; } | 46 bool isValid() const { return !!m_selectorArray; } |
| 47 const CSSSelector* first() const { return m_selectorArray; } | 47 const CSSSelector* first() const { return m_selectorArray; } |
| 48 static const CSSSelector* next(const CSSSelector&); | 48 static const CSSSelector* next(const CSSSelector&); |
| 49 bool hasOneSelector() const { return m_selectorArray && !next(*m_selectorArr
ay); } | 49 bool hasOneSelector() const { return m_selectorArray && !next(*m_selectorArr
ay); } |
| 50 const CSSSelector& selectorAt(size_t index) const { return m_selectorArray[i
ndex]; } | 50 const CSSSelector& selectorAt(size_t index) const { return m_selectorArray[i
ndex]; } |
| 51 | 51 |
| 52 size_t indexOfNextSelectorAfter(size_t index) const | 52 size_t indexOfNextSelectorAfter(size_t index) const |
| 53 { | 53 { |
| 54 const CSSSelector& current = selectorAt(index); | 54 const CSSSelector& current = selectorAt(index); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 82 // Skip subparts of compound selectors. | 82 // Skip subparts of compound selectors. |
| 83 const CSSSelector* last = ¤t; | 83 const CSSSelector* last = ¤t; |
| 84 while (!last->isLastInTagHistory()) | 84 while (!last->isLastInTagHistory()) |
| 85 last++; | 85 last++; |
| 86 return last->isLastInSelectorList() ? 0 : last + 1; | 86 return last->isLastInSelectorList() ? 0 : last + 1; |
| 87 } | 87 } |
| 88 | 88 |
| 89 } // namespace blink | 89 } // namespace blink |
| 90 | 90 |
| 91 #endif // CSSSelectorList_h | 91 #endif // CSSSelectorList_h |
| OLD | NEW |