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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 if (candidate.shadowPseudoId() != element().shadowPseudoId()) | 213 if (candidate.shadowPseudoId() != element().shadowPseudoId()) |
214 return false; | 214 return false; |
215 if (candidate == document().cssTarget()) | 215 if (candidate == document().cssTarget()) |
216 return false; | 216 return false; |
217 if (!sharingCandidateHasIdenticalStyleAffectingAttributes(candidate)) | 217 if (!sharingCandidateHasIdenticalStyleAffectingAttributes(candidate)) |
218 return false; | 218 return false; |
219 if (candidate.additionalPresentationAttributeStyle() != element().additional
PresentationAttributeStyle()) | 219 if (candidate.additionalPresentationAttributeStyle() != element().additional
PresentationAttributeStyle()) |
220 return false; | 220 return false; |
221 if (candidate.hasID() && m_features.hasSelectorForId(candidate.idForStyleRes
olution())) | 221 if (candidate.hasID() && m_features.hasSelectorForId(candidate.idForStyleRes
olution())) |
222 return false; | 222 return false; |
223 if (candidate.hasScopedHTMLStyleChild()) | |
224 return false; | |
225 if (candidate.shadow() && candidate.shadow()->containsActiveStyles() && !sha
ringCandidateShadowHasSharedStyleSheetContents(candidate)) | 223 if (candidate.shadow() && candidate.shadow()->containsActiveStyles() && !sha
ringCandidateShadowHasSharedStyleSheetContents(candidate)) |
226 return false; | 224 return false; |
227 if (!sharingCandidateDistributedToSameInsertionPoint(candidate)) | 225 if (!sharingCandidateDistributedToSameInsertionPoint(candidate)) |
228 return false; | 226 return false; |
229 if (candidate.isInTopLayer() != element().isInTopLayer()) | 227 if (candidate.isInTopLayer() != element().isInTopLayer()) |
230 return false; | 228 return false; |
231 | 229 |
232 bool isControl = candidate.isFormControlElement(); | 230 bool isControl = candidate.isFormControlElement(); |
233 | 231 |
234 if (isControl != element().isFormControlElement()) | 232 if (isControl != element().isFormControlElement()) |
235 return false; | 233 return false; |
236 | 234 |
237 if (isControl && !canShareStyleWithControl(candidate)) | 235 if (isControl && !canShareStyleWithControl(candidate)) |
238 return false; | 236 return false; |
239 | 237 |
240 // FIXME: This line is surprisingly hot, we may wish to inline hasDirectionA
uto into StyleResolver. | 238 // FIXME: This line is surprisingly hot, we may wish to inline hasDirectionA
uto into StyleResolver. |
241 if (candidate.isHTMLElement() && toHTMLElement(candidate).hasDirectionAuto()
) | 239 if (candidate.isHTMLElement() && toHTMLElement(candidate).hasDirectionAuto()
) |
242 return false; | 240 return false; |
243 | 241 |
244 if (candidate.isLink() && m_context.elementLinkState() != style->insideLink(
)) | 242 if (candidate.isLink() && m_context.elementLinkState() != style->insideLink(
)) |
245 return false; | 243 return false; |
246 | 244 |
247 if (candidate.isUnresolvedCustomElement() != element().isUnresolvedCustomEle
ment()) | 245 if (candidate.isUnresolvedCustomElement() != element().isUnresolvedCustomEle
ment()) |
248 return false; | 246 return false; |
249 | 247 |
250 if (element().parentOrShadowHostElement() != parent) { | 248 if (element().parentOrShadowHostElement() != parent) { |
251 if (!parent->isStyledElement()) | 249 if (!parent->isStyledElement()) |
252 return false; | 250 return false; |
253 if (parent->hasScopedHTMLStyleChild()) | |
254 return false; | |
255 if (parent->inlineStyle()) | 251 if (parent->inlineStyle()) |
256 return false; | 252 return false; |
257 if (parent->isSVGElement() && toSVGElement(parent)->animatedSMILStylePro
perties()) | 253 if (parent->isSVGElement() && toSVGElement(parent)->animatedSMILStylePro
perties()) |
258 return false; | 254 return false; |
259 if (parent->hasID() && m_features.hasSelectorForId(parent->idForStyleRes
olution())) | 255 if (parent->hasID() && m_features.hasSelectorForId(parent->idForStyleRes
olution())) |
260 return false; | 256 return false; |
261 if (!parent->childrenSupportStyleSharing()) | 257 if (!parent->childrenSupportStyleSharing()) |
262 return false; | 258 return false; |
263 } | 259 } |
264 | 260 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 // Tracking child index requires unique style for each node. This may get se
t by the sibling rule match above. | 329 // Tracking child index requires unique style for each node. This may get se
t by the sibling rule match above. |
334 if (!element().parentElementOrShadowRoot()->childrenSupportStyleSharing()) { | 330 if (!element().parentElementOrShadowRoot()->childrenSupportStyleSharing()) { |
335 INCREMENT_STYLE_STATS_COUNTER(m_styleResolver, sharedStyleRejectedByPare
nt); | 331 INCREMENT_STYLE_STATS_COUNTER(m_styleResolver, sharedStyleRejectedByPare
nt); |
336 return 0; | 332 return 0; |
337 } | 333 } |
338 | 334 |
339 return shareElement->renderStyle(); | 335 return shareElement->renderStyle(); |
340 } | 336 } |
341 | 337 |
342 } | 338 } |
OLD | NEW |