| 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 STACK_ALLOCATED(); | 39 STACK_ALLOCATED(); |
| 40 public: | 40 public: |
| 41 // RuleSets are passed non-const as the act of matching against them can cau
se them | 41 // RuleSets are passed non-const as the act of matching against them can cau
se them |
| 42 // to be compacted. :( | 42 // to be compacted. :( |
| 43 SharedStyleFinder(const ElementResolveContext& context, | 43 SharedStyleFinder(const ElementResolveContext& context, |
| 44 const RuleFeatureSet& features, StyleResolver& styleResolver) | 44 const RuleFeatureSet& features, StyleResolver& styleResolver) |
| 45 : m_elementAffectedByClassRules(false) | 45 : m_elementAffectedByClassRules(false) |
| 46 , m_features(features) | 46 , m_features(features) |
| 47 , m_styleResolver(styleResolver) | 47 , m_styleResolver(styleResolver) |
| 48 , m_context(context) | 48 , m_context(context) |
| 49 , m_renderingParent(nullptr) |
| 49 { } | 50 { } |
| 50 | 51 |
| 51 RenderStyle* findSharedStyle(); | 52 RenderStyle* findSharedStyle(); |
| 52 | 53 |
| 53 private: | 54 private: |
| 54 Element* findElementForStyleSharing() const; | 55 Element* findElementForStyleSharing() const; |
| 55 | 56 |
| 56 // Only used when we're collecting stats on styles. | 57 // Only used when we're collecting stats on styles. |
| 57 bool documentContainsValidCandidate() const; | 58 bool documentContainsValidCandidate() const; |
| 58 | 59 |
| 59 bool classNamesAffectedByRules(const Element&) const; | 60 bool classNamesAffectedByRules(const Element&) const; |
| 60 bool attributesAffectedByRules(const Element&) const; | 61 bool attributesAffectedByRules(const Element&) const; |
| 61 | 62 |
| 62 bool canShareStyleWithElement(Element& candidate) const; | 63 bool canShareStyleWithElement(Element& candidate) const; |
| 63 bool sharingCandidateHasIdenticalStyleAffectingAttributes(Element& candidate
) const; | 64 bool sharingCandidateHasIdenticalStyleAffectingAttributes(Element& candidate
) const; |
| 64 bool sharingCandidateCanShareHostStyles(Element& candidate) const; | 65 bool sharingCandidateCanShareHostStyles(Element& candidate) const; |
| 65 bool sharingCandidateDistributedToSameInsertionPoint(Element& candidate) con
st; | 66 bool sharingCandidateDistributedToSameInsertionPoint(Element& candidate) con
st; |
| 66 | 67 |
| 67 Element& element() const { return *m_context.element(); } | 68 Element& element() const { return *m_context.element(); } |
| 68 Document& document() const { return element().document(); } | 69 Document& document() const { return element().document(); } |
| 69 | 70 |
| 70 bool m_elementAffectedByClassRules; | 71 bool m_elementAffectedByClassRules; |
| 71 const RuleFeatureSet& m_features; | 72 const RuleFeatureSet& m_features; |
| 72 StyleResolver& m_styleResolver; | 73 StyleResolver& m_styleResolver; |
| 73 const ElementResolveContext& m_context; | 74 const ElementResolveContext& m_context; |
| 75 ContainerNode* m_renderingParent; |
| 74 }; | 76 }; |
| 75 | 77 |
| 76 } // namespace blink | 78 } // namespace blink |
| 77 | 79 |
| 78 #endif // SKY_ENGINE_CORE_CSS_RESOLVER_SHAREDSTYLEFINDER_H_ | 80 #endif // SKY_ENGINE_CORE_CSS_RESOLVER_SHAREDSTYLEFINDER_H_ |
| OLD | NEW |