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

Side by Side Diff: Source/core/dom/shadow/ShadowRoot.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/dom/shadow/ElementShadow.cpp ('k') | Source/core/editing/ApplyStyleCommand.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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Neither the name of Google Inc. nor the names of its 10 * * Neither the name of Google Inc. nor the names of its
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 394
395 if (m_shadowRootRareData && m_descendantInsertionPointsIsValid) 395 if (m_shadowRootRareData && m_descendantInsertionPointsIsValid)
396 return m_shadowRootRareData->descendantInsertionPoints(); 396 return m_shadowRootRareData->descendantInsertionPoints();
397 397
398 m_descendantInsertionPointsIsValid = true; 398 m_descendantInsertionPointsIsValid = true;
399 399
400 if (!containsInsertionPoints()) 400 if (!containsInsertionPoints())
401 return emptyList; 401 return emptyList;
402 402
403 Vector<RefPtr<InsertionPoint> > insertionPoints; 403 Vector<RefPtr<InsertionPoint> > insertionPoints;
404 for (Element* element = ElementTraversal::firstWithin(this); element; elemen t = ElementTraversal::next(element, this)) { 404 for (Element* element = ElementTraversal::firstWithin(this); element; elemen t = ElementTraversal::next(*element, this)) {
405 if (element->isInsertionPoint()) 405 if (element->isInsertionPoint())
406 insertionPoints.append(toInsertionPoint(element)); 406 insertionPoints.append(toInsertionPoint(element));
407 } 407 }
408 408
409 ensureShadowRootRareData()->setDescendantInsertionPoints(insertionPoints); 409 ensureShadowRootRareData()->setDescendantInsertionPoints(insertionPoints);
410 410
411 return m_shadowRootRareData->descendantInsertionPoints(); 411 return m_shadowRootRareData->descendantInsertionPoints();
412 } 412 }
413 413
414 StyleSheetList* ShadowRoot::styleSheets() 414 StyleSheetList* ShadowRoot::styleSheets()
415 { 415 {
416 if (!ensureShadowRootRareData()->styleSheets()) 416 if (!ensureShadowRootRareData()->styleSheets())
417 m_shadowRootRareData->setStyleSheets(StyleSheetList::create(this)); 417 m_shadowRootRareData->setStyleSheets(StyleSheetList::create(this));
418 418
419 return m_shadowRootRareData->styleSheets(); 419 return m_shadowRootRareData->styleSheets();
420 } 420 }
421 421
422 } 422 }
OLDNEW
« no previous file with comments | « Source/core/dom/shadow/ElementShadow.cpp ('k') | Source/core/editing/ApplyStyleCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698