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

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

Issue 67473002: Have ElementTraversal / NodeTraversal's next() methods take a reference (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase on master Created 7 years, 1 month 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 | « Source/core/css/StyleInvalidationAnalysis.cpp ('k') | Source/core/dom/ContainerNode.cpp » ('j') | 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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 return false; 232 return false;
233 if (!parent->childrenSupportStyleSharing()) 233 if (!parent->childrenSupportStyleSharing())
234 return false; 234 return false;
235 } 235 }
236 236
237 return true; 237 return true;
238 } 238 }
239 239
240 bool SharedStyleFinder::documentContainsValidCandidate() const 240 bool SharedStyleFinder::documentContainsValidCandidate() const
241 { 241 {
242 for (Element* element = document().documentElement(); element; element = Ele mentTraversal::next(element)) { 242 for (Element* element = document().documentElement(); element; element = Ele mentTraversal::next(*element)) {
243 if (canShareStyleWithElement(*element)) 243 if (canShareStyleWithElement(*element))
244 return true; 244 return true;
245 } 245 }
246 return false; 246 return false;
247 } 247 }
248 248
249 inline Element* SharedStyleFinder::findElementForStyleSharing() const 249 inline Element* SharedStyleFinder::findElementForStyleSharing() const
250 { 250 {
251 StyleSharingList& styleSharingList = m_styleResolver.styleSharingList(); 251 StyleSharingList& styleSharingList = m_styleResolver.styleSharingList();
252 for (StyleSharingList::iterator it = styleSharingList.begin(); it != styleSh aringList.end(); ++it) { 252 for (StyleSharingList::iterator it = styleSharingList.begin(); it != styleSh aringList.end(); ++it) {
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 if (matchesRuleSet(m_siblingRuleSet) || matchesRuleSet(m_uncommonAttributeRu leSet)) 303 if (matchesRuleSet(m_siblingRuleSet) || matchesRuleSet(m_uncommonAttributeRu leSet))
304 return 0; 304 return 0;
305 // Tracking child index requires unique style for each node. This may get se t by the sibling rule match above. 305 // Tracking child index requires unique style for each node. This may get se t by the sibling rule match above.
306 if (!element().parentElement()->childrenSupportStyleSharing()) 306 if (!element().parentElement()->childrenSupportStyleSharing())
307 return 0; 307 return 0;
308 STYLE_STATS_ADD_STYLE_SHARED(); 308 STYLE_STATS_ADD_STYLE_SHARED();
309 return shareElement->renderStyle(); 309 return shareElement->renderStyle();
310 } 310 }
311 311
312 } 312 }
OLDNEW
« no previous file with comments | « Source/core/css/StyleInvalidationAnalysis.cpp ('k') | Source/core/dom/ContainerNode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698