| 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 * Copyright (C) 2012 Google Inc. All rights reserved. | 4 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 22 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 24 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 24 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 25 */ | 25 */ |
| 26 | 26 |
| 27 #ifndef ScopedStyleResolver_h | 27 #ifndef ScopedStyleResolver_h |
| 28 #define ScopedStyleResolver_h | 28 #define ScopedStyleResolver_h |
| 29 | 29 |
| 30 #include "core/css/CSSKeyframesRule.h" | 30 #include "core/css/CSSKeyframesRule.h" |
| 31 #include "core/css/RuleSet.h" | 31 #include "core/css/RuleSet.h" |
| 32 #include "core/css/SiblingTraversalStrategies.h" | 32 #include "core/dom/ContainerNode.h" |
| 33 #include "core/dom/Element.h" |
| 33 #include "wtf/Forward.h" | 34 #include "wtf/Forward.h" |
| 34 #include "wtf/HashMap.h" | 35 #include "wtf/HashMap.h" |
| 35 #include "wtf/OwnPtr.h" | 36 #include "wtf/OwnPtr.h" |
| 37 #include "wtf/PassOwnPtr.h" |
| 36 #include "wtf/Vector.h" | 38 #include "wtf/Vector.h" |
| 37 | 39 |
| 38 namespace WebCore { | 40 namespace WebCore { |
| 39 | 41 |
| 40 class ContainerNode; | |
| 41 class ElementRuleCollector; | 42 class ElementRuleCollector; |
| 42 class MediaQueryEvaluator; | 43 class MediaQueryEvaluator; |
| 43 class PageRuleCollector; | 44 class PageRuleCollector; |
| 44 class ScopedStyleResolver; | |
| 45 class ShadowRoot; | 45 class ShadowRoot; |
| 46 class StyleSheetContents; | 46 class StyleSheetContents; |
| 47 | 47 |
| 48 // This class selects a RenderStyle for a given element based on a collection of
stylesheets. | 48 // This class selects a RenderStyle for a given element based on a collection of
stylesheets. |
| 49 class ScopedStyleResolver { | 49 class ScopedStyleResolver { |
| 50 WTF_MAKE_NONCOPYABLE(ScopedStyleResolver); WTF_MAKE_FAST_ALLOCATED; | 50 WTF_MAKE_NONCOPYABLE(ScopedStyleResolver); WTF_MAKE_FAST_ALLOCATED; |
| 51 public: | 51 public: |
| 52 static PassOwnPtr<ScopedStyleResolver> create(const ContainerNode* scopingNo
de) { return adoptPtr(new ScopedStyleResolver(scopingNode)); } | 52 static PassOwnPtr<ScopedStyleResolver> create(const ContainerNode* scopingNo
de) { return adoptPtr(new ScopedStyleResolver(scopingNode)); } |
| 53 | 53 |
| 54 static const ContainerNode* scopingNodeFor(const CSSStyleSheet*); | 54 static const ContainerNode* scopingNodeFor(const CSSStyleSheet*); |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 { | 151 { |
| 152 if (!cacheIsValid(element)) | 152 if (!cacheIsValid(element)) |
| 153 resolveStyleCache(element); | 153 resolveStyleCache(element); |
| 154 | 154 |
| 155 return m_cache.scopedResolver; | 155 return m_cache.scopedResolver; |
| 156 } | 156 } |
| 157 | 157 |
| 158 } // namespace WebCore | 158 } // namespace WebCore |
| 159 | 159 |
| 160 #endif // ScopedStyleResolver_h | 160 #endif // ScopedStyleResolver_h |
| OLD | NEW |