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

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

Issue 1899653002: Support slotchange event (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Bug fix Created 4 years, 8 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) 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 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 DCHECK(m_shadowRootRareData); 337 DCHECK(m_shadowRootRareData);
338 HeapVector<Member<HTMLSlotElement>> slots; 338 HeapVector<Member<HTMLSlotElement>> slots;
339 slots.reserveCapacity(descendantSlotCount()); 339 slots.reserveCapacity(descendantSlotCount());
340 for (HTMLSlotElement& slot : Traversal<HTMLSlotElement>::descendantsOf(rootN ode())) 340 for (HTMLSlotElement& slot : Traversal<HTMLSlotElement>::descendantsOf(rootN ode()))
341 slots.append(&slot); 341 slots.append(&slot);
342 m_shadowRootRareData->setDescendantSlots(slots); 342 m_shadowRootRareData->setDescendantSlots(slots);
343 m_descendantSlotsIsValid = true; 343 m_descendantSlotsIsValid = true;
344 return m_shadowRootRareData->descendantSlots(); 344 return m_shadowRootRareData->descendantSlots();
345 } 345 }
346 346
347 void ShadowRoot::assignV1()
348 {
349 if (!m_slotAssignment)
350 m_slotAssignment = SlotAssignment::create();
351 m_slotAssignment->resolveAssignment(*this);
352 }
353
347 void ShadowRoot::distributeV1() 354 void ShadowRoot::distributeV1()
348 { 355 {
349 if (!m_slotAssignment) 356 if (!m_slotAssignment)
350 m_slotAssignment = SlotAssignment::create(); 357 m_slotAssignment = SlotAssignment::create();
351 m_slotAssignment->resolveAssignment(*this); 358 m_slotAssignment->resolveDistribution(*this);
352 } 359 }
353 360
354 DEFINE_TRACE(ShadowRoot) 361 DEFINE_TRACE(ShadowRoot)
355 { 362 {
356 visitor->trace(m_prev); 363 visitor->trace(m_prev);
357 visitor->trace(m_next); 364 visitor->trace(m_next);
358 visitor->trace(m_shadowRootRareData); 365 visitor->trace(m_shadowRootRareData);
359 visitor->trace(m_shadowRootRareDataV0); 366 visitor->trace(m_shadowRootRareDataV0);
360 visitor->trace(m_slotAssignment); 367 visitor->trace(m_slotAssignment);
361 TreeScope::trace(visitor); 368 TreeScope::trace(visitor);
(...skipping 13 matching lines...) Expand all
375 ostream << "ShadowRootType::Open"; 382 ostream << "ShadowRootType::Open";
376 break; 383 break;
377 case ShadowRootType::Closed: 384 case ShadowRootType::Closed:
378 ostream << "ShadowRootType::Closed"; 385 ostream << "ShadowRootType::Closed";
379 break; 386 break;
380 } 387 }
381 return ostream; 388 return ostream;
382 } 389 }
383 390
384 } // namespace blink 391 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/shadow/ShadowRoot.h ('k') | third_party/WebKit/Source/core/dom/shadow/SlotAssignment.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698