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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 , m_features(features) | 44 , m_features(features) |
45 , m_siblingRuleSet(siblingRuleSet) | 45 , m_siblingRuleSet(siblingRuleSet) |
46 , m_uncommonAttributeRuleSet(uncommonAttributeRuleSet) | 46 , m_uncommonAttributeRuleSet(uncommonAttributeRuleSet) |
47 , m_styleResolver(styleResolver) | 47 , m_styleResolver(styleResolver) |
48 { } | 48 { } |
49 | 49 |
50 // 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. |
51 RenderStyle* locateSharedStyle(const ElementResolveContext&, RenderStyle* ne
wStyle); | 51 RenderStyle* locateSharedStyle(const ElementResolveContext&, RenderStyle* ne
wStyle); |
52 | 52 |
53 private: | 53 private: |
54 Element* findElementForStyleSharing(const ElementResolveContext&) const; | 54 Node* locateCousinList(Element* parent, unsigned& visitedNodeCount) const; |
| 55 Element* findSiblingForStyleSharing(const ElementResolveContext&, Node*, uns
igned& count) const; |
55 | 56 |
56 // Only used when we're collecting stats on styles | 57 // Only used when we're collecting stats on styles |
57 Element* searchDocumentForSharedStyle(const ElementResolveContext&) const; | 58 Element* searchDocumentForSharedStyle(const ElementResolveContext&) const; |
58 | 59 |
59 bool classNamesAffectedByRules(const SpaceSplitString&) const; | 60 bool classNamesAffectedByRules(const SpaceSplitString&) const; |
60 | 61 |
61 bool canShareStyleWithElement(const ElementResolveContext&, Element*) const; | 62 bool canShareStyleWithElement(const ElementResolveContext&, Element*) const; |
62 bool canShareStyleWithControl(const ElementResolveContext&, Element*) const; | 63 bool canShareStyleWithControl(const ElementResolveContext&, Element*) const; |
63 bool sharingCandidateHasIdenticalStyleAffectingAttributes(const ElementResol
veContext&, Element*) const; | 64 bool sharingCandidateHasIdenticalStyleAffectingAttributes(const ElementResol
veContext&, Element*) const; |
64 | 65 |
65 bool m_elementAffectedByClassRules; | 66 bool m_elementAffectedByClassRules; |
66 const RuleFeatureSet& m_features; | 67 const RuleFeatureSet& m_features; |
67 RuleSet* m_siblingRuleSet; | 68 RuleSet* m_siblingRuleSet; |
68 RuleSet* m_uncommonAttributeRuleSet; | 69 RuleSet* m_uncommonAttributeRuleSet; |
69 StyleResolver* m_styleResolver; | 70 StyleResolver* m_styleResolver; |
70 }; | 71 }; |
71 | 72 |
72 } // namespace WebCore | 73 } // namespace WebCore |
73 | 74 |
74 #endif // SharedStyleFinder_h | 75 #endif // SharedStyleFinder_h |
OLD | NEW |