Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Side by Side Diff: Source/core/css/resolver/SharedStyleFinder.h

Issue 24106007: Replace style sharing cousin list search with LRU (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updating with esprehn's changes Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/css/resolver/SharedStyleFinder.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 Node* locateCousinList(Element* parent, unsigned& visitedNodeCount) const; 54 Element* findElementForStyleSharing(const ElementResolveContext&) const;
55 Element* findSiblingForStyleSharing(const ElementResolveContext&, Node*, uns igned& count) const;
56 55
57 // Only used when we're collecting stats on styles 56 // Only used when we're collecting stats on styles
58 Element* searchDocumentForSharedStyle(const ElementResolveContext&) const; 57 Element* searchDocumentForSharedStyle(const ElementResolveContext&) const;
59 58
60 bool classNamesAffectedByRules(const SpaceSplitString&) const; 59 bool classNamesAffectedByRules(const SpaceSplitString&) const;
61 60
62 bool canShareStyleWithElement(const ElementResolveContext&, Element*) const; 61 bool canShareStyleWithElement(const ElementResolveContext&, Element*) const;
63 bool canShareStyleWithControl(const ElementResolveContext&, Element*) const; 62 bool canShareStyleWithControl(const ElementResolveContext&, Element*) const;
64 bool sharingCandidateHasIdenticalStyleAffectingAttributes(const ElementResol veContext&, Element*) const; 63 bool sharingCandidateHasIdenticalStyleAffectingAttributes(const ElementResol veContext&, Element*) const;
65 64
66 bool m_elementAffectedByClassRules; 65 bool m_elementAffectedByClassRules;
67 const RuleFeatureSet& m_features; 66 const RuleFeatureSet& m_features;
68 RuleSet* m_siblingRuleSet; 67 RuleSet* m_siblingRuleSet;
69 RuleSet* m_uncommonAttributeRuleSet; 68 RuleSet* m_uncommonAttributeRuleSet;
70 StyleResolver* m_styleResolver; 69 StyleResolver* m_styleResolver;
71 }; 70 };
72 71
73 } // namespace WebCore 72 } // namespace WebCore
74 73
75 #endif // SharedStyleFinder_h 74 #endif // SharedStyleFinder_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/css/resolver/SharedStyleFinder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698