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

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

Issue 418573003: Remove check from SharedStyleFinder::canShareStyleWithElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 5 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
« no previous file with comments | « no previous file | no next file » | 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) 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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 if (candidate.hasID() && m_features.hasSelectorForId(candidate.idForStyleRes olution())) 227 if (candidate.hasID() && m_features.hasSelectorForId(candidate.idForStyleRes olution()))
228 return false; 228 return false;
229 if (!sharingCandidateCanShareHostStyles(candidate)) 229 if (!sharingCandidateCanShareHostStyles(candidate))
230 return false; 230 return false;
231 if (!sharingCandidateDistributedToSameInsertionPoint(candidate)) 231 if (!sharingCandidateDistributedToSameInsertionPoint(candidate))
232 return false; 232 return false;
233 if (candidate.isInTopLayer() != element().isInTopLayer()) 233 if (candidate.isInTopLayer() != element().isInTopLayer())
234 return false; 234 return false;
235 235
236 bool isControl = candidate.isFormControlElement(); 236 bool isControl = candidate.isFormControlElement();
237 237 ASSERT(isControl == element().isFormControlElement());
238 if (isControl != element().isFormControlElement())
239 return false;
240
241 if (isControl && !canShareStyleWithControl(candidate)) 238 if (isControl && !canShareStyleWithControl(candidate))
242 return false; 239 return false;
243 240
244 if (isHTMLOptionElement(candidate) && isHTMLOptionElement(element()) 241 if (isHTMLOptionElement(candidate) && isHTMLOptionElement(element())
245 && (toHTMLOptionElement(candidate).selected() != toHTMLOptionElement(ele ment()).selected() 242 && (toHTMLOptionElement(candidate).selected() != toHTMLOptionElement(ele ment()).selected()
246 || toHTMLOptionElement(candidate).spatialNavigationFocused() != toHTMLOp tionElement(element()).spatialNavigationFocused())) 243 || toHTMLOptionElement(candidate).spatialNavigationFocused() != toHTMLOp tionElement(element()).spatialNavigationFocused()))
247 return false; 244 return false;
248 245
249 // FIXME: This line is surprisingly hot, we may wish to inline hasDirectionA uto into StyleResolver. 246 // FIXME: This line is surprisingly hot, we may wish to inline hasDirectionA uto into StyleResolver.
250 if (candidate.isHTMLElement() && toHTMLElement(candidate).hasDirectionAuto() ) 247 if (candidate.isHTMLElement() && toHTMLElement(candidate).hasDirectionAuto() )
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 // 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.
341 if (!element().parentElementOrShadowRoot()->childrenSupportStyleSharing()) { 338 if (!element().parentElementOrShadowRoot()->childrenSupportStyleSharing()) {
342 INCREMENT_STYLE_STATS_COUNTER(m_styleResolver, sharedStyleRejectedByPare nt); 339 INCREMENT_STYLE_STATS_COUNTER(m_styleResolver, sharedStyleRejectedByPare nt);
343 return 0; 340 return 0;
344 } 341 }
345 342
346 return shareElement->renderStyle(); 343 return shareElement->renderStyle();
347 } 344 }
348 345
349 } 346 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698