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

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

Issue 1270313002: Handle closed mode shadow for /deep/ and ::shadow selectors (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix for comment29 Created 5 years, 4 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
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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 if (parent->inlineStyle()) 259 if (parent->inlineStyle())
260 return false; 260 return false;
261 if (parent->isSVGElement() && toSVGElement(parent)->animatedSMILStylePro perties()) 261 if (parent->isSVGElement() && toSVGElement(parent)->animatedSMILStylePro perties())
262 return false; 262 return false;
263 if (parent->hasID() && m_features.hasSelectorForId(parent->idForStyleRes olution())) 263 if (parent->hasID() && m_features.hasSelectorForId(parent->idForStyleRes olution()))
264 return false; 264 return false;
265 if (!parent->childrenSupportStyleSharing()) 265 if (!parent->childrenSupportStyleSharing())
266 return false; 266 return false;
267 } 267 }
268 268
269 ShadowRoot* root1 = element().containingShadowRoot();
270 ShadowRoot* root2 = candidate.containingShadowRoot();
271 if (root1 && root2 && root1->type() != root2->type())
272 return false;
273
269 if (document().containsValidityStyleRules()) { 274 if (document().containsValidityStyleRules()) {
270 if (candidate.isValidElement() != element().isValidElement()) 275 if (candidate.isValidElement() != element().isValidElement())
271 return false; 276 return false;
272 } 277 }
273 278
274 return true; 279 return true;
275 } 280 }
276 281
277 bool SharedStyleFinder::documentContainsValidCandidate() const 282 bool SharedStyleFinder::documentContainsValidCandidate() const
278 { 283 {
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 // Tracking child index requires unique style for each node. This may get se t by the sibling rule match above. 347 // Tracking child index requires unique style for each node. This may get se t by the sibling rule match above.
343 if (!element().parentElementOrShadowRoot()->childrenSupportStyleSharing()) { 348 if (!element().parentElementOrShadowRoot()->childrenSupportStyleSharing()) {
344 INCREMENT_STYLE_STATS_COUNTER(*m_styleResolver, sharedStyleRejectedByPar ent, 1); 349 INCREMENT_STYLE_STATS_COUNTER(*m_styleResolver, sharedStyleRejectedByPar ent, 1);
345 return 0; 350 return 0;
346 } 351 }
347 352
348 return shareElement->mutableComputedStyle(); 353 return shareElement->mutableComputedStyle();
349 } 354 }
350 355
351 } 356 }
OLDNEW
« Source/core/css/SelectorChecker.cpp ('K') | « Source/core/css/SelectorChecker.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698