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

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

Issue 150273003: Don't allow style sharing between top layer and non-top layer elements (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « LayoutTests/fast/dom/HTMLDialogElement/dont-share-style-to-top-layer-expected.html ('k') | 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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 if (!sharingCandidateHasIdenticalStyleAffectingAttributes(candidate)) 202 if (!sharingCandidateHasIdenticalStyleAffectingAttributes(candidate))
203 return false; 203 return false;
204 if (candidate.additionalPresentationAttributeStyle() != element().additional PresentationAttributeStyle()) 204 if (candidate.additionalPresentationAttributeStyle() != element().additional PresentationAttributeStyle())
205 return false; 205 return false;
206 if (candidate.hasID() && m_features.hasSelectorForId(candidate.idForStyleRes olution())) 206 if (candidate.hasID() && m_features.hasSelectorForId(candidate.idForStyleRes olution()))
207 return false; 207 return false;
208 if (candidate.hasScopedHTMLStyleChild()) 208 if (candidate.hasScopedHTMLStyleChild())
209 return false; 209 return false;
210 if (candidate.shadow() && candidate.shadow()->containsActiveStyles() && !sha ringCandidateShadowHasSharedStyleSheetContents(candidate)) 210 if (candidate.shadow() && candidate.shadow()->containsActiveStyles() && !sha ringCandidateShadowHasSharedStyleSheetContents(candidate))
211 return false; 211 return false;
212 if (candidate.isInTopLayer() != element().isInTopLayer())
213 return false;
212 214
213 bool isControl = candidate.isFormControlElement(); 215 bool isControl = candidate.isFormControlElement();
214 216
215 if (isControl != element().isFormControlElement()) 217 if (isControl != element().isFormControlElement())
216 return false; 218 return false;
217 219
218 if (isControl && !canShareStyleWithControl(candidate)) 220 if (isControl && !canShareStyleWithControl(candidate))
219 return false; 221 return false;
220 222
221 // FIXME: This line is surprisingly hot, we may wish to inline hasDirectionA uto into StyleResolver. 223 // FIXME: This line is surprisingly hot, we may wish to inline hasDirectionA uto into StyleResolver.
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 // Tracking child index requires unique style for each node. This may get se t by the sibling rule match above. 316 // Tracking child index requires unique style for each node. This may get se t by the sibling rule match above.
315 if (!element().parentOrShadowHostElement()->childrenSupportStyleSharing()) { 317 if (!element().parentOrShadowHostElement()->childrenSupportStyleSharing()) {
316 INCREMENT_STYLE_STATS_COUNTER(m_styleResolver, sharedStyleRejectedByPare nt); 318 INCREMENT_STYLE_STATS_COUNTER(m_styleResolver, sharedStyleRejectedByPare nt);
317 return 0; 319 return 0;
318 } 320 }
319 321
320 return shareElement->renderStyle(); 322 return shareElement->renderStyle();
321 } 323 }
322 324
323 } 325 }
OLDNEW
« no previous file with comments | « LayoutTests/fast/dom/HTMLDialogElement/dont-share-style-to-top-layer-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698