| 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 20 matching lines...) Expand all Loading... |
| 31 class RuleFeatureSet; | 31 class RuleFeatureSet; |
| 32 class RuleSet; | 32 class RuleSet; |
| 33 class SpaceSplitString; | 33 class SpaceSplitString; |
| 34 class StyleResolver; | 34 class StyleResolver; |
| 35 | 35 |
| 36 class SharedStyleFinder { | 36 class SharedStyleFinder { |
| 37 public: | 37 public: |
| 38 // RuleSets are passed non-const as the act of matching against them can cau
se them | 38 // RuleSets are passed non-const as the act of matching against them can cau
se them |
| 39 // to be compacted. :( | 39 // to be compacted. :( |
| 40 SharedStyleFinder(const RuleFeatureSet& features, RuleSet* siblingRuleSet, | 40 SharedStyleFinder(const RuleFeatureSet& features, RuleSet* siblingRuleSet, |
| 41 RuleSet* uncommonAttributeRuleSet, StyleResolver* styleResolver) | 41 RuleSet* uncommonAttributeRuleSet, RuleSet* descendantRuleSet, StyleReso
lver* styleResolver) |
| 42 : m_elementAffectedByClassRules(false) | 42 : m_elementAffectedByClassRules(false) |
| 43 , m_features(features) | 43 , m_features(features) |
| 44 , m_siblingRuleSet(siblingRuleSet) | 44 , m_siblingRuleSet(siblingRuleSet) |
| 45 , m_uncommonAttributeRuleSet(uncommonAttributeRuleSet) | 45 , m_uncommonAttributeRuleSet(uncommonAttributeRuleSet) |
| 46 , m_descendantRuleSet(descendantRuleSet) |
| 46 , m_styleResolver(styleResolver) | 47 , m_styleResolver(styleResolver) |
| 47 { } | 48 { } |
| 48 | 49 |
| 49 // FIXME: It is not necessarily safe to call this method more than once. | 50 // FIXME: It is not necessarily safe to call this method more than once. |
| 50 RenderStyle* locateSharedStyle(const ElementResolveContext&); | 51 RenderStyle* locateSharedStyle(const ElementResolveContext&); |
| 51 | 52 |
| 52 private: | 53 private: |
| 53 Element* findElementForStyleSharing(const ElementResolveContext&) const; | 54 Element* findElementForStyleSharing(const ElementResolveContext&) const; |
| 54 | 55 |
| 55 // Only used when we're collecting stats on styles | 56 // Only used when we're collecting stats on styles |
| 56 Element* searchDocumentForSharedStyle(const ElementResolveContext&) const; | 57 Element* searchDocumentForSharedStyle(const ElementResolveContext&) const; |
| 57 | 58 |
| 58 bool classNamesAffectedByRules(const SpaceSplitString&) const; | 59 bool classNamesAffectedByRules(const SpaceSplitString&) const; |
| 59 | 60 |
| 60 bool canShareStyleWithElement(const ElementResolveContext&, Element*) const; | 61 bool canShareStyleWithElement(const ElementResolveContext&, Element*) const; |
| 61 bool canShareStyleWithControl(const ElementResolveContext&, Element*) const; | 62 bool canShareStyleWithControl(const ElementResolveContext&, Element*) const; |
| 62 bool sharingCandidateHasIdenticalStyleAffectingAttributes(const ElementResol
veContext&, Element*) const; | 63 bool sharingCandidateHasIdenticalStyleAffectingAttributes(const ElementResol
veContext&, Element*) const; |
| 63 bool matchesRuleSet(const ElementResolveContext&, RuleSet*); | 64 bool matchesRuleSet(const ElementResolveContext&, RuleSet*); |
| 65 bool candidateMatchesDescendantRules(const ElementResolveContext&, Element*)
const; |
| 64 | 66 |
| 65 bool m_elementAffectedByClassRules; | 67 bool m_elementAffectedByClassRules; |
| 66 const RuleFeatureSet& m_features; | 68 const RuleFeatureSet& m_features; |
| 67 RuleSet* m_siblingRuleSet; | 69 RuleSet* m_siblingRuleSet; |
| 68 RuleSet* m_uncommonAttributeRuleSet; | 70 RuleSet* m_uncommonAttributeRuleSet; |
| 71 RuleSet* m_descendantRuleSet; |
| 69 StyleResolver* m_styleResolver; | 72 StyleResolver* m_styleResolver; |
| 70 }; | 73 }; |
| 71 | 74 |
| 72 } // namespace WebCore | 75 } // namespace WebCore |
| 73 | 76 |
| 74 #endif // SharedStyleFinder_h | 77 #endif // SharedStyleFinder_h |
| OLD | NEW |