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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 } | 109 } |
110 | 110 |
111 static inline const AtomicString& typeAttributeValue(const Element& element) | 111 static inline const AtomicString& typeAttributeValue(const Element& element) |
112 { | 112 { |
113 // type is animatable in SVG so we need to go down the slow path here. | 113 // type is animatable in SVG so we need to go down the slow path here. |
114 return element.isSVGElement() ? element.getAttribute(typeAttr) : element.fas
tGetAttribute(typeAttr); | 114 return element.isSVGElement() ? element.getAttribute(typeAttr) : element.fas
tGetAttribute(typeAttr); |
115 } | 115 } |
116 | 116 |
117 bool SharedStyleFinder::sharingCandidateHasIdenticalStyleAffectingAttributes(Ele
ment& candidate) const | 117 bool SharedStyleFinder::sharingCandidateHasIdenticalStyleAffectingAttributes(Ele
ment& candidate) const |
118 { | 118 { |
119 if (element().elementData() == candidate.elementData()) | 119 if (element().sharesSameElementData(candidate)) |
120 return true; | 120 return true; |
121 if (element().fastGetAttribute(XMLNames::langAttr) != candidate.fastGetAttri
bute(XMLNames::langAttr)) | 121 if (element().fastGetAttribute(XMLNames::langAttr) != candidate.fastGetAttri
bute(XMLNames::langAttr)) |
122 return false; | 122 return false; |
123 if (element().fastGetAttribute(langAttr) != candidate.fastGetAttribute(langA
ttr)) | 123 if (element().fastGetAttribute(langAttr) != candidate.fastGetAttribute(langA
ttr)) |
124 return false; | 124 return false; |
125 | 125 |
126 // These two checks must be here since RuleSet has a special case to allow s
tyle sharing between elements | 126 // These two checks must be here since RuleSet has a special case to allow s
tyle sharing between elements |
127 // with type and readonly attributes whereas other attribute selectors preve
nt sharing. | 127 // with type and readonly attributes whereas other attribute selectors preve
nt sharing. |
128 if (typeAttributeValue(element()) != typeAttributeValue(candidate)) | 128 if (typeAttributeValue(element()) != typeAttributeValue(candidate)) |
129 return false; | 129 return false; |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 // Tracking child index requires unique style for each node. This may get se
t by the sibling rule match above. | 337 // Tracking child index requires unique style for each node. This may get se
t by the sibling rule match above. |
338 if (!element().parentElementOrShadowRoot()->childrenSupportStyleSharing()) { | 338 if (!element().parentElementOrShadowRoot()->childrenSupportStyleSharing()) { |
339 INCREMENT_STYLE_STATS_COUNTER(m_styleResolver, sharedStyleRejectedByPare
nt); | 339 INCREMENT_STYLE_STATS_COUNTER(m_styleResolver, sharedStyleRejectedByPare
nt); |
340 return 0; | 340 return 0; |
341 } | 341 } |
342 | 342 |
343 return shareElement->renderStyle(); | 343 return shareElement->renderStyle(); |
344 } | 344 } |
345 | 345 |
346 } | 346 } |
OLD | NEW |