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

Side by Side Diff: third_party/WebKit/Source/core/dom/shadow/ElementShadow.cpp

Issue 2322223002: Make ElementShadow::oldestShadowRoot() return a reference (Closed)
Patch Set: Created 4 years, 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 result.storedValue->value = new DestinationInsertionPoints; 325 result.storedValue->value = new DestinationInsertionPoints;
326 result.storedValue->value->append(insertionPoint); 326 result.storedValue->value->append(insertionPoint);
327 } 327 }
328 328
329 const SelectRuleFeatureSet& ElementShadow::ensureSelectFeatureSet() 329 const SelectRuleFeatureSet& ElementShadow::ensureSelectFeatureSet()
330 { 330 {
331 if (!m_needsSelectFeatureSet) 331 if (!m_needsSelectFeatureSet)
332 return m_selectFeatures; 332 return m_selectFeatures;
333 333
334 m_selectFeatures.clear(); 334 m_selectFeatures.clear();
335 for (ShadowRoot* root = oldestShadowRoot(); root; root = root->youngerShadow Root()) 335 for (ShadowRoot* root = &oldestShadowRoot(); root; root = root->youngerShado wRoot())
336 collectSelectFeatureSetFrom(*root); 336 collectSelectFeatureSetFrom(*root);
337 m_needsSelectFeatureSet = false; 337 m_needsSelectFeatureSet = false;
338 return m_selectFeatures; 338 return m_selectFeatures;
339 } 339 }
340 340
341 void ElementShadow::collectSelectFeatureSetFrom(ShadowRoot& root) 341 void ElementShadow::collectSelectFeatureSetFrom(ShadowRoot& root)
342 { 342 {
343 if (!root.containsShadowRoots() && !root.containsContentElements()) 343 if (!root.containsShadowRoots() && !root.containsContentElements())
344 return; 344 return;
345 345
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 visitor->trace(m_selectFeatures); 377 visitor->trace(m_selectFeatures);
378 visitor->trace(m_shadowRoot); 378 visitor->trace(m_shadowRoot);
379 } 379 }
380 380
381 DEFINE_TRACE_WRAPPERS(ElementShadow) 381 DEFINE_TRACE_WRAPPERS(ElementShadow)
382 { 382 {
383 visitor->traceWrappers(m_shadowRoot); 383 visitor->traceWrappers(m_shadowRoot);
384 } 384 }
385 385
386 } // namespace blink 386 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/shadow/ElementShadow.h ('k') | third_party/WebKit/Source/core/testing/Internals.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698