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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 { | 54 { |
55 const CSSSelector& current = selectorAt(index); | 55 const CSSSelector& current = selectorAt(index); |
56 const CSSSelector* next = this->next(current); | 56 const CSSSelector* next = this->next(current); |
57 if (!next) | 57 if (!next) |
58 return kNotFound; | 58 return kNotFound; |
59 return next - m_selectorArray; | 59 return next - m_selectorArray; |
60 } | 60 } |
61 | 61 |
62 bool selectorsNeedNamespaceResolution(); | 62 bool selectorsNeedNamespaceResolution(); |
63 | 63 |
| 64 bool selectorNeedsUpdatedDistribution(size_t index) const; |
| 65 |
| 66 // TODO(esprehn): These methods are confusing and incorrectly named. |
64 bool hasShadowDistributedAt(size_t index) const; | 67 bool hasShadowDistributedAt(size_t index) const; |
65 bool selectorCrossesTreeScopes(size_t index) const; | 68 bool selectorCrossesTreeScopes(size_t index) const; |
66 | 69 |
67 String selectorsText() const; | 70 String selectorsText() const; |
68 | 71 |
69 private: | 72 private: |
70 unsigned length() const; | 73 unsigned length() const; |
71 void deleteSelectors(); | 74 void deleteSelectors(); |
72 | 75 |
73 // Hide. | 76 // Hide. |
74 CSSSelectorList& operator=(const CSSSelectorList&); | 77 CSSSelectorList& operator=(const CSSSelectorList&); |
75 | 78 |
76 // End of a multipart selector is indicated by m_isLastInTagHistory bit in t
he last item. | 79 // End of a multipart selector is indicated by m_isLastInTagHistory bit in t
he last item. |
77 // End of the array is indicated by m_isLastInSelectorList bit in the last i
tem. | 80 // End of the array is indicated by m_isLastInSelectorList bit in the last i
tem. |
78 CSSSelector* m_selectorArray; | 81 CSSSelector* m_selectorArray; |
79 }; | 82 }; |
80 | 83 |
81 inline const CSSSelector* CSSSelectorList::next(const CSSSelector& current) | 84 inline const CSSSelector* CSSSelectorList::next(const CSSSelector& current) |
82 { | 85 { |
83 // Skip subparts of compound selectors. | 86 // Skip subparts of compound selectors. |
84 const CSSSelector* last = ¤t; | 87 const CSSSelector* last = ¤t; |
85 while (!last->isLastInTagHistory()) | 88 while (!last->isLastInTagHistory()) |
86 last++; | 89 last++; |
87 return last->isLastInSelectorList() ? 0 : last + 1; | 90 return last->isLastInSelectorList() ? 0 : last + 1; |
88 } | 91 } |
89 | 92 |
90 } // namespace blink | 93 } // namespace blink |
91 | 94 |
92 #endif // CSSSelectorList_h | 95 #endif // CSSSelectorList_h |
OLD | NEW |