| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google, Inc. | 2 * Copyright (C) 2013 Google, Inc. |
| 3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. | 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 public: | 39 public: |
| 40 // RuleSets are passed non-const as the act of matching against them can cau
se them | 40 // RuleSets are passed non-const as the act of matching against them can cau
se them |
| 41 // to be compacted. :( | 41 // to be compacted. :( |
| 42 SharedStyleFinder(const ElementResolveContext& context, | 42 SharedStyleFinder(const ElementResolveContext& context, |
| 43 const RuleFeatureSet& features, RuleSet* siblingRuleSet, | 43 const RuleFeatureSet& features, RuleSet* siblingRuleSet, |
| 44 RuleSet* uncommonAttributeRuleSet, StyleResolver& styleResolver) | 44 RuleSet* uncommonAttributeRuleSet, StyleResolver& styleResolver) |
| 45 : m_elementAffectedByClassRules(false) | 45 : m_elementAffectedByClassRules(false) |
| 46 , m_features(features) | 46 , m_features(features) |
| 47 , m_siblingRuleSet(siblingRuleSet) | 47 , m_siblingRuleSet(siblingRuleSet) |
| 48 , m_uncommonAttributeRuleSet(uncommonAttributeRuleSet) | 48 , m_uncommonAttributeRuleSet(uncommonAttributeRuleSet) |
| 49 , m_styleResolver(styleResolver) | 49 , m_styleResolver(&styleResolver) |
| 50 , m_context(context) | 50 , m_context(context) |
| 51 { } | 51 { } |
| 52 | 52 |
| 53 ComputedStyle* findSharedStyle(); | 53 ComputedStyle* findSharedStyle(); |
| 54 | 54 |
| 55 private: | 55 private: |
| 56 Element* findElementForStyleSharing() const; | 56 Element* findElementForStyleSharing() const; |
| 57 | 57 |
| 58 // Only used when we're collecting stats on styles. | 58 // Only used when we're collecting stats on styles. |
| 59 bool documentContainsValidCandidate() const; | 59 bool documentContainsValidCandidate() const; |
| 60 | 60 |
| 61 bool classNamesAffectedByRules(const SpaceSplitString&) const; | 61 bool classNamesAffectedByRules(const SpaceSplitString&) const; |
| 62 | 62 |
| 63 bool canShareStyleWithElement(Element& candidate) const; | 63 bool canShareStyleWithElement(Element& candidate) const; |
| 64 bool canShareStyleWithControl(Element& candidate) const; | 64 bool canShareStyleWithControl(Element& candidate) const; |
| 65 bool sharingCandidateHasIdenticalStyleAffectingAttributes(Element& candidate
) const; | 65 bool sharingCandidateHasIdenticalStyleAffectingAttributes(Element& candidate
) const; |
| 66 bool sharingCandidateCanShareHostStyles(Element& candidate) const; | 66 bool sharingCandidateCanShareHostStyles(Element& candidate) const; |
| 67 bool sharingCandidateDistributedToSameInsertionPoint(Element& candidate) con
st; | 67 bool sharingCandidateDistributedToSameInsertionPoint(Element& candidate) con
st; |
| 68 bool matchesRuleSet(RuleSet*); | 68 bool matchesRuleSet(RuleSet*); |
| 69 | 69 |
| 70 Element& element() const { return *m_context.element(); } | 70 Element& element() const { return *m_context.element(); } |
| 71 Document& document() const { return element().document(); } | 71 Document& document() const { return element().document(); } |
| 72 | 72 |
| 73 bool m_elementAffectedByClassRules; | 73 bool m_elementAffectedByClassRules; |
| 74 const RuleFeatureSet& m_features; | 74 const RuleFeatureSet& m_features; |
| 75 RawPtrWillBeMember<RuleSet> m_siblingRuleSet; | 75 RawPtrWillBeMember<RuleSet> m_siblingRuleSet; |
| 76 RawPtrWillBeMember<RuleSet> m_uncommonAttributeRuleSet; | 76 RawPtrWillBeMember<RuleSet> m_uncommonAttributeRuleSet; |
| 77 StyleResolver& m_styleResolver; | 77 RawPtrWillBeMember<StyleResolver> m_styleResolver; |
| 78 const ElementResolveContext& m_context; | 78 const ElementResolveContext& m_context; |
| 79 }; | 79 }; |
| 80 | 80 |
| 81 } // namespace blink | 81 } // namespace blink |
| 82 | 82 |
| 83 #endif // SharedStyleFinder_h | 83 #endif // SharedStyleFinder_h |
| OLD | NEW |