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

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

Issue 420193007: Use new Traversal<> API more in the code base (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Take feedback into consideration Created 6 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
« no previous file with comments | « Source/core/css/AffectedByFocusTest.cpp ('k') | Source/core/html/HTMLFieldSetElement.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 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 DEFINE_STATIC_LOCAL(WillBePersistentHeapVector<RefPtrWillBeMember<InsertionP oint> >, emptyList, ()); 309 DEFINE_STATIC_LOCAL(WillBePersistentHeapVector<RefPtrWillBeMember<InsertionP oint> >, emptyList, ());
310 if (m_shadowRootRareData && m_descendantInsertionPointsIsValid) 310 if (m_shadowRootRareData && m_descendantInsertionPointsIsValid)
311 return m_shadowRootRareData->descendantInsertionPoints(); 311 return m_shadowRootRareData->descendantInsertionPoints();
312 312
313 m_descendantInsertionPointsIsValid = true; 313 m_descendantInsertionPointsIsValid = true;
314 314
315 if (!containsInsertionPoints()) 315 if (!containsInsertionPoints())
316 return emptyList; 316 return emptyList;
317 317
318 WillBeHeapVector<RefPtrWillBeMember<InsertionPoint> > insertionPoints; 318 WillBeHeapVector<RefPtrWillBeMember<InsertionPoint> > insertionPoints;
319 for (Element* element = ElementTraversal::firstWithin(*this); element; eleme nt = ElementTraversal::next(*element, this)) { 319 for (InsertionPoint* insertionPoint = Traversal<InsertionPoint>::firstWithin (*this); insertionPoint; insertionPoint = Traversal<InsertionPoint>::next(*inser tionPoint, this))
320 if (element->isInsertionPoint()) 320 insertionPoints.append(insertionPoint);
321 insertionPoints.append(toInsertionPoint(element));
322 }
323 321
324 ensureShadowRootRareData()->setDescendantInsertionPoints(insertionPoints); 322 ensureShadowRootRareData()->setDescendantInsertionPoints(insertionPoints);
325 323
326 return m_shadowRootRareData->descendantInsertionPoints(); 324 return m_shadowRootRareData->descendantInsertionPoints();
327 } 325 }
328 326
329 StyleSheetList* ShadowRoot::styleSheets() 327 StyleSheetList* ShadowRoot::styleSheets()
330 { 328 {
331 if (!ensureShadowRootRareData()->styleSheets()) 329 if (!ensureShadowRootRareData()->styleSheets())
332 m_shadowRootRareData->setStyleSheets(StyleSheetList::create(this)); 330 m_shadowRootRareData->setStyleSheets(StyleSheetList::create(this));
333 331
334 return m_shadowRootRareData->styleSheets(); 332 return m_shadowRootRareData->styleSheets();
335 } 333 }
336 334
337 void ShadowRoot::trace(Visitor* visitor) 335 void ShadowRoot::trace(Visitor* visitor)
338 { 336 {
339 visitor->trace(m_prev); 337 visitor->trace(m_prev);
340 visitor->trace(m_next); 338 visitor->trace(m_next);
341 visitor->trace(m_shadowRootRareData); 339 visitor->trace(m_shadowRootRareData);
342 TreeScope::trace(visitor); 340 TreeScope::trace(visitor);
343 DocumentFragment::trace(visitor); 341 DocumentFragment::trace(visitor);
344 } 342 }
345 343
346 } 344 }
OLDNEW
« no previous file with comments | « Source/core/css/AffectedByFocusTest.cpp ('k') | Source/core/html/HTMLFieldSetElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698