| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2015 Google Inc. All rights reserved. | 2 * Copyright (C) 2015 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 { | 314 { |
| 315 if (!m_slotchangeEventEnqueued) { | 315 if (!m_slotchangeEventEnqueued) { |
| 316 Microtask::enqueueMicrotask(WTF::bind(&HTMLSlotElement::dispatchSlotChan
geEvent, wrapPersistent(this))); | 316 Microtask::enqueueMicrotask(WTF::bind(&HTMLSlotElement::dispatchSlotChan
geEvent, wrapPersistent(this))); |
| 317 m_slotchangeEventEnqueued = true; | 317 m_slotchangeEventEnqueued = true; |
| 318 } | 318 } |
| 319 | 319 |
| 320 ShadowRoot* root = containingShadowRoot(); | 320 ShadowRoot* root = containingShadowRoot(); |
| 321 DCHECK(root); | 321 DCHECK(root); |
| 322 DCHECK(root->isV1()); | 322 DCHECK(root->isV1()); |
| 323 root->owner()->setNeedsDistributionRecalc(); | 323 root->owner()->setNeedsDistributionRecalc(); |
| 324 | 324 // Check slotchange recursively since this slotchange may cause another slot
change. |
| 325 if (ShadowRoot* parentShadowRoot = v1ShadowRootOfParent()) { | 325 checkSlotChange(); |
| 326 if (HTMLSlotElement* next = parentShadowRoot->ensureSlotAssignment().fin
dSlot(*this)) | |
| 327 next->enqueueSlotChangeEvent(); | |
| 328 } | |
| 329 } | 326 } |
| 330 | 327 |
| 331 bool HTMLSlotElement::hasAssignedNodesSlow() const | 328 bool HTMLSlotElement::hasAssignedNodesSlow() const |
| 332 { | 329 { |
| 333 ShadowRoot* root = containingShadowRoot(); | 330 ShadowRoot* root = containingShadowRoot(); |
| 334 DCHECK(root); | 331 DCHECK(root); |
| 335 DCHECK(root->isV1()); | 332 DCHECK(root->isV1()); |
| 336 SlotAssignment& assignment = root->ensureSlotAssignment(); | 333 SlotAssignment& assignment = root->ensureSlotAssignment(); |
| 337 if (assignment.findSlotByName(name()) != this) | 334 if (assignment.findSlotByName(name()) != this) |
| 338 return false; | 335 return false; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 356 DEFINE_TRACE(HTMLSlotElement) | 353 DEFINE_TRACE(HTMLSlotElement) |
| 357 { | 354 { |
| 358 visitor->trace(m_assignedNodes); | 355 visitor->trace(m_assignedNodes); |
| 359 visitor->trace(m_distributedNodes); | 356 visitor->trace(m_distributedNodes); |
| 360 visitor->trace(m_oldDistributedNodes); | 357 visitor->trace(m_oldDistributedNodes); |
| 361 visitor->trace(m_distributedIndices); | 358 visitor->trace(m_distributedIndices); |
| 362 HTMLElement::trace(visitor); | 359 HTMLElement::trace(visitor); |
| 363 } | 360 } |
| 364 | 361 |
| 365 } // namespace blink | 362 } // namespace blink |
| OLD | NEW |