OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) | 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) |
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) | 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) |
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc.
All rights reserved. | 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc.
All rights reserved. |
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> | 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> |
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. | 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. |
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
(...skipping 11 matching lines...) Expand all Loading... |
22 * | 22 * |
23 * You should have received a copy of the GNU Library General Public License | 23 * You should have received a copy of the GNU Library General Public License |
24 * along with this library; see the file COPYING.LIB. If not, write to | 24 * along with this library; see the file COPYING.LIB. If not, write to |
25 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 25 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
26 * Boston, MA 02110-1301, USA. | 26 * Boston, MA 02110-1301, USA. |
27 */ | 27 */ |
28 | 28 |
29 #include "config.h" | 29 #include "config.h" |
30 #include "core/css/resolver/SharedStyleFinder.h" | 30 #include "core/css/resolver/SharedStyleFinder.h" |
31 | 31 |
32 // FIXME: This include list is way more than we need! | |
33 #include "CSSPropertyNames.h" | |
34 #include "HTMLNames.h" | 32 #include "HTMLNames.h" |
35 #include "RuntimeEnabledFeatures.h" | |
36 #include "SVGNames.h" | |
37 #include "XMLNames.h" | 33 #include "XMLNames.h" |
38 #include "core/animation/AnimatableValue.h" | 34 #include "core/css/RuleFeature.h" |
39 #include "core/animation/Animation.h" | |
40 #include "core/css/CSSCalculationValue.h" | |
41 #include "core/css/CSSCursorImageValue.h" | |
42 #include "core/css/CSSDefaultStyleSheets.h" | |
43 #include "core/css/CSSFontSelector.h" | |
44 #include "core/css/CSSImageSetValue.h" | |
45 #include "core/css/CSSKeyframeRule.h" | |
46 #include "core/css/CSSKeyframesRule.h" | |
47 #include "core/css/CSSLineBoxContainValue.h" | |
48 #include "core/css/CSSParser.h" | |
49 #include "core/css/CSSPrimitiveValueMappings.h" | |
50 #include "core/css/CSSReflectValue.h" | |
51 #include "core/css/CSSSVGDocumentValue.h" | |
52 #include "core/css/CSSSelector.h" | |
53 #include "core/css/CSSSelectorList.h" | |
54 #include "core/css/CSSStyleRule.h" | |
55 #include "core/css/CSSValueList.h" | |
56 #include "core/css/CSSVariableValue.h" | |
57 #include "core/css/MediaQueryEvaluator.h" | |
58 #include "core/css/PageRuleCollector.h" | |
59 #include "core/css/Pair.h" | |
60 #include "core/css/RuleSet.h" | |
61 #include "core/css/StylePropertySet.h" | |
62 #include "core/css/StylePropertyShorthand.h" | |
63 #include "core/css/StyleSheetContents.h" | |
64 #include "core/css/resolver/StyleResolver.h" | 35 #include "core/css/resolver/StyleResolver.h" |
65 #include "core/dom/DocumentStyleSheetCollection.h" | 36 #include "core/css/resolver/StyleResolverState.h" |
| 37 #include "core/dom/ContainerNode.h" |
| 38 #include "core/dom/Document.h" |
| 39 #include "core/dom/Element.h" |
66 #include "core/dom/FullscreenController.h" | 40 #include "core/dom/FullscreenController.h" |
| 41 #include "core/dom/Node.h" |
67 #include "core/dom/NodeRenderStyle.h" | 42 #include "core/dom/NodeRenderStyle.h" |
68 #include "core/dom/NodeRenderingContext.h" | 43 #include "core/dom/QualifiedName.h" |
69 #include "core/dom/Text.h" | 44 #include "core/dom/SpaceSplitString.h" |
70 #include "core/dom/shadow/ShadowRoot.h" | 45 #include "core/html/HTMLElement.h" |
71 #include "core/html/HTMLIFrameElement.h" | |
72 #include "core/html/HTMLInputElement.h" | 46 #include "core/html/HTMLInputElement.h" |
73 #include "core/html/HTMLOptGroupElement.h" | 47 #include "core/html/HTMLOptGroupElement.h" |
74 #include "core/html/HTMLTableElement.h" | |
75 #include "core/html/track/WebVTTElement.h" | 48 #include "core/html/track/WebVTTElement.h" |
76 #include "core/inspector/InspectorInstrumentation.h" | 49 #include "core/rendering/style/RenderStyle.h" |
77 #include "core/page/Frame.h" | |
78 #include "core/page/FrameView.h" | |
79 #include "core/page/Page.h" | |
80 #include "core/page/Settings.h" | |
81 #include "core/platform/LinkHash.h" | |
82 #include "core/platform/graphics/filters/custom/CustomFilterConstants.h" | |
83 #include "core/platform/text/LocaleToScriptMapping.h" | |
84 #include "core/rendering/RenderTheme.h" | |
85 #include "core/rendering/RenderView.h" | |
86 #include "core/rendering/style/ContentData.h" | |
87 #include "core/rendering/style/CursorList.h" | |
88 #include "core/rendering/style/KeyframeList.h" | |
89 #include "core/rendering/style/RenderStyleConstants.h" | |
90 #include "core/rendering/style/StyleCachedImage.h" | |
91 #include "core/rendering/style/StyleCachedImageSet.h" | |
92 #include "core/rendering/style/StyleCustomFilterProgramCache.h" | |
93 #include "core/rendering/style/StyleGeneratedImage.h" | |
94 #include "core/svg/SVGDocumentExtensions.h" | |
95 #include "core/svg/SVGElement.h" | 50 #include "core/svg/SVGElement.h" |
96 #include "core/svg/SVGFontFaceElement.h" | 51 #include "wtf/HashSet.h" |
97 #include "wtf/StdLibExtras.h" | 52 #include "wtf/text/AtomicString.h" |
98 #include "wtf/Vector.h" | |
99 | |
100 | 53 |
101 namespace WebCore { | 54 namespace WebCore { |
102 | 55 |
103 using namespace HTMLNames; | 56 using namespace HTMLNames; |
104 | 57 |
105 static const unsigned cStyleSearchThreshold = 10; | 58 static const unsigned cStyleSearchThreshold = 10; |
106 static const unsigned cStyleSearchLevelThreshold = 10; | 59 static const unsigned cStyleSearchLevelThreshold = 10; |
107 | 60 |
108 static inline bool parentElementPreventsSharing(const Element* parentElement) | 61 static inline bool parentElementPreventsSharing(const Element* parentElement) |
109 { | 62 { |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 // Can't share if attribute rules apply. | 371 // Can't share if attribute rules apply. |
419 if (m_styleResolver->styleSharingCandidateMatchesRuleSet(context, m_uncommon
AttributeRuleSet)) | 372 if (m_styleResolver->styleSharingCandidateMatchesRuleSet(context, m_uncommon
AttributeRuleSet)) |
420 return 0; | 373 return 0; |
421 // Tracking child index requires unique style for each node. This may get se
t by the sibling rule match above. | 374 // Tracking child index requires unique style for each node. This may get se
t by the sibling rule match above. |
422 if (parentElementPreventsSharing(context.element()->parentElement())) | 375 if (parentElementPreventsSharing(context.element()->parentElement())) |
423 return 0; | 376 return 0; |
424 return shareElement->renderStyle(); | 377 return shareElement->renderStyle(); |
425 } | 378 } |
426 | 379 |
427 } | 380 } |
OLD | NEW |