Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. | 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 76 uint64_t m_position; | 76 uint64_t m_position; |
| 77 RawPtrWillBeMember<const CSSStyleSheet> m_parentStyleSheet; | 77 RawPtrWillBeMember<const CSSStyleSheet> m_parentStyleSheet; |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 } // namespace blink | 80 } // namespace blink |
| 81 | 81 |
| 82 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::MatchedRule); | 82 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::MatchedRule); |
| 83 | 83 |
| 84 namespace blink { | 84 namespace blink { |
| 85 | 85 |
| 86 // FIXME: oilpan: when transition types are gone this class can be replaced with HeapVector. | 86 #if ENABLE(OILPAN) |
| 87 using StyleRuleList = HeapVector<Member<StyleRule>>; | |
| 88 #else | |
| 87 class StyleRuleList final : public RefCountedWillBeGarbageCollected<StyleRuleLis t> { | 89 class StyleRuleList final : public RefCountedWillBeGarbageCollected<StyleRuleLis t> { |
|
haraken
2015/03/10 16:16:06
RefCountedWillBeGarbageCollected => RefCounted
sof
2015/03/11 10:53:32
Thanks, missed that one - fixed.
| |
| 88 public: | 90 public: |
| 89 static PassRefPtrWillBeRawPtr<StyleRuleList> create() { return adoptRefWillB eNoop(new StyleRuleList()); } | 91 static PassRefPtr<StyleRuleList> create() { return adoptRef(new StyleRuleLis t()); } |
| 90 | 92 |
| 91 DEFINE_INLINE_TRACE() | 93 void append(StyleRule* rule) { m_list.append(rule); } |
| 92 { | 94 StyleRule* at(size_t index) const { return m_list[index]; } |
| 93 #if ENABLE(OILPAN) | 95 size_t size() const { return m_list.size(); } |
| 94 visitor->trace(m_list); | 96 |
| 97 Vector<StyleRule*> m_list; | |
| 98 }; | |
| 95 #endif | 99 #endif |
| 96 } | |
| 97 | |
| 98 WillBeHeapVector<RawPtrWillBeMember<StyleRule> > m_list; | |
| 99 }; | |
| 100 | 100 |
| 101 // ElementRuleCollector is designed to be used as a stack object. | 101 // ElementRuleCollector is designed to be used as a stack object. |
| 102 // Create one, ask what rules the ElementResolveContext matches | 102 // Create one, ask what rules the ElementResolveContext matches |
| 103 // and then let it go out of scope. | 103 // and then let it go out of scope. |
| 104 // FIXME: Currently it modifies the LayoutStyle but should not! | 104 // FIXME: Currently it modifies the LayoutStyle but should not! |
| 105 class ElementRuleCollector { | 105 class ElementRuleCollector { |
| 106 STACK_ALLOCATED(); | 106 STACK_ALLOCATED(); |
| 107 WTF_MAKE_NONCOPYABLE(ElementRuleCollector); | 107 WTF_MAKE_NONCOPYABLE(ElementRuleCollector); |
| 108 public: | 108 public: |
| 109 ElementRuleCollector(const ElementResolveContext&, const SelectorFilter&, La youtStyle* = 0); | 109 ElementRuleCollector(const ElementResolveContext&, const SelectorFilter&, La youtStyle* = 0); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 170 | 170 |
| 171 // Output. | 171 // Output. |
| 172 RefPtrWillBeMember<StaticCSSRuleList> m_cssRuleList; | 172 RefPtrWillBeMember<StaticCSSRuleList> m_cssRuleList; |
| 173 RefPtrWillBeMember<StyleRuleList> m_styleRuleList; | 173 RefPtrWillBeMember<StyleRuleList> m_styleRuleList; |
| 174 MatchResult m_result; | 174 MatchResult m_result; |
| 175 }; | 175 }; |
| 176 | 176 |
| 177 } // namespace blink | 177 } // namespace blink |
| 178 | 178 |
| 179 #endif // ElementRuleCollector_h | 179 #endif // ElementRuleCollector_h |
| OLD | NEW |