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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 | 48 |
49 // This class selects a RenderStyle for a given element based on a collection of
stylesheets. | 49 // This class selects a RenderStyle for a given element based on a collection of
stylesheets. |
50 class ScopedStyleResolver { | 50 class ScopedStyleResolver { |
51 WTF_MAKE_NONCOPYABLE(ScopedStyleResolver); WTF_MAKE_FAST_ALLOCATED; | 51 WTF_MAKE_NONCOPYABLE(ScopedStyleResolver); WTF_MAKE_FAST_ALLOCATED; |
52 public: | 52 public: |
53 static PassOwnPtr<ScopedStyleResolver> create(const ContainerNode& scopingNo
de) { return adoptPtr(new ScopedStyleResolver(scopingNode)); } | 53 static PassOwnPtr<ScopedStyleResolver> create(const ContainerNode& scopingNo
de) { return adoptPtr(new ScopedStyleResolver(scopingNode)); } |
54 | 54 |
55 static const ContainerNode* scopingNodeFor(const CSSStyleSheet*); | 55 static const ContainerNode* scopingNodeFor(const CSSStyleSheet*); |
56 | 56 |
57 const ContainerNode& scopingNode() const { return m_scopingNode; } | 57 const ContainerNode& scopingNode() const { return m_scopingNode; } |
58 const TreeScope& treeScope() const { return m_scopingNode.treeScope(); } | 58 NonNullPtr<const TreeScope> treeScope() const { return m_scopingNode.treeSco
pe(); } |
59 void prepareEmptyRuleSet() { m_authorStyle = RuleSet::create(); } | 59 void prepareEmptyRuleSet() { m_authorStyle = RuleSet::create(); } |
60 void setParent(ScopedStyleResolver* newParent) { m_parent = newParent; } | 60 void setParent(ScopedStyleResolver* newParent) { m_parent = newParent; } |
61 ScopedStyleResolver* parent() { return m_parent; } | 61 ScopedStyleResolver* parent() { return m_parent; } |
62 | 62 |
63 bool hasOnlyEmptyRuleSets() const { return !m_authorStyle->ruleCount() && m_
atHostRules.isEmpty(); } | 63 bool hasOnlyEmptyRuleSets() const { return !m_authorStyle->ruleCount() && m_
atHostRules.isEmpty(); } |
64 | 64 |
65 public: | 65 public: |
66 bool checkRegionStyle(Element*); | 66 bool checkRegionStyle(Element*); |
67 const StyleRuleKeyframes* keyframeStylesForAnimation(const StringImpl* anima
tionName); | 67 const StyleRuleKeyframes* keyframeStylesForAnimation(const StringImpl* anima
tionName); |
68 void addKeyframeStyle(PassRefPtr<StyleRuleKeyframes>); | 68 void addKeyframeStyle(PassRefPtr<StyleRuleKeyframes>); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 { | 153 { |
154 if (!cacheIsValid(element)) | 154 if (!cacheIsValid(element)) |
155 resolveStyleCache(element); | 155 resolveStyleCache(element); |
156 | 156 |
157 return m_cache.scopedResolver; | 157 return m_cache.scopedResolver; |
158 } | 158 } |
159 | 159 |
160 } // namespace WebCore | 160 } // namespace WebCore |
161 | 161 |
162 #endif // ScopedStyleResolver_h | 162 #endif // ScopedStyleResolver_h |
OLD | NEW |