| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008, 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008, 2012 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2009 Google Inc. All rights reserved. | 3 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 new (&m_selectorArray[i]) CSSSelector(other.m_selectorArray[i]); | 45 new (&m_selectorArray[i]) CSSSelector(other.m_selectorArray[i]); |
| 46 } | 46 } |
| 47 | 47 |
| 48 void CSSSelectorList::adopt(CSSSelectorList& list) | 48 void CSSSelectorList::adopt(CSSSelectorList& list) |
| 49 { | 49 { |
| 50 deleteSelectors(); | 50 deleteSelectors(); |
| 51 m_selectorArray = list.m_selectorArray; | 51 m_selectorArray = list.m_selectorArray; |
| 52 list.m_selectorArray = 0; | 52 list.m_selectorArray = 0; |
| 53 } | 53 } |
| 54 | 54 |
| 55 void CSSSelectorList::adoptSelectorVector(Vector<OwnPtr<CSSParserSelector> >& se
lectorVector) | 55 void CSSSelectorList::adoptSelectorVector(Vector<OwnPtr<CSSParserSelector>>& sel
ectorVector) |
| 56 { | 56 { |
| 57 deleteSelectors(); | 57 deleteSelectors(); |
| 58 size_t flattenedSize = 0; | 58 size_t flattenedSize = 0; |
| 59 for (size_t i = 0; i < selectorVector.size(); ++i) { | 59 for (size_t i = 0; i < selectorVector.size(); ++i) { |
| 60 for (CSSParserSelector* selector = selectorVector[i].get(); selector; se
lector = selector->tagHistory()) | 60 for (CSSParserSelector* selector = selectorVector[i].get(); selector; se
lector = selector->tagHistory()) |
| 61 ++flattenedSize; | 61 ++flattenedSize; |
| 62 } | 62 } |
| 63 ASSERT(flattenedSize); | 63 ASSERT(flattenedSize); |
| 64 m_selectorArray = reinterpret_cast<CSSSelector*>(fastMalloc(sizeof(CSSSelect
or) * flattenedSize)); | 64 m_selectorArray = reinterpret_cast<CSSSelector*>(fastMalloc(sizeof(CSSSelect
or) * flattenedSize)); |
| 65 size_t arrayIndex = 0; | 65 size_t arrayIndex = 0; |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 } | 189 } |
| 190 }; | 190 }; |
| 191 | 191 |
| 192 bool CSSSelectorList::selectorCrossesTreeScopes(size_t index) const | 192 bool CSSSelectorList::selectorCrossesTreeScopes(size_t index) const |
| 193 { | 193 { |
| 194 SelectorCrossesTreeScopes functor; | 194 SelectorCrossesTreeScopes functor; |
| 195 return forEachTagSelector(functor, selectorAt(index)); | 195 return forEachTagSelector(functor, selectorAt(index)); |
| 196 } | 196 } |
| 197 | 197 |
| 198 } // namespace blink | 198 } // namespace blink |
| OLD | NEW |