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

Side by Side Diff: Source/core/dom/shadow/ShadowRoot.cpp

Issue 65303008: Have ElementTraversal::firstWithin() take a reference (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase 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/markup.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 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 390
391 if (m_shadowRootRareData && m_descendantInsertionPointsIsValid) 391 if (m_shadowRootRareData && m_descendantInsertionPointsIsValid)
392 return m_shadowRootRareData->descendantInsertionPoints(); 392 return m_shadowRootRareData->descendantInsertionPoints();
393 393
394 m_descendantInsertionPointsIsValid = true; 394 m_descendantInsertionPointsIsValid = true;
395 395
396 if (!containsInsertionPoints()) 396 if (!containsInsertionPoints())
397 return emptyList; 397 return emptyList;
398 398
399 Vector<RefPtr<InsertionPoint> > insertionPoints; 399 Vector<RefPtr<InsertionPoint> > insertionPoints;
400 for (Element* element = ElementTraversal::firstWithin(this); element; elemen t = ElementTraversal::next(*element, this)) { 400 for (Element* element = ElementTraversal::firstWithin(*this); element; eleme nt = ElementTraversal::next(*element, this)) {
401 if (element->isInsertionPoint()) 401 if (element->isInsertionPoint())
402 insertionPoints.append(toInsertionPoint(element)); 402 insertionPoints.append(toInsertionPoint(element));
403 } 403 }
404 404
405 ensureShadowRootRareData()->setDescendantInsertionPoints(insertionPoints); 405 ensureShadowRootRareData()->setDescendantInsertionPoints(insertionPoints);
406 406
407 return m_shadowRootRareData->descendantInsertionPoints(); 407 return m_shadowRootRareData->descendantInsertionPoints();
408 } 408 }
409 409
410 StyleSheetList* ShadowRoot::styleSheets() 410 StyleSheetList* ShadowRoot::styleSheets()
411 { 411 {
412 if (!ensureShadowRootRareData()->styleSheets()) 412 if (!ensureShadowRootRareData()->styleSheets())
413 m_shadowRootRareData->setStyleSheets(StyleSheetList::create(this)); 413 m_shadowRootRareData->setStyleSheets(StyleSheetList::create(this));
414 414
415 return m_shadowRootRareData->styleSheets(); 415 return m_shadowRootRareData->styleSheets();
416 } 416 }
417 417
418 } 418 }
OLDNEW
« no previous file with comments | « Source/core/dom/shadow/ElementShadow.cpp ('k') | Source/core/editing/markup.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698