| 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 22 matching lines...) Expand all Loading... |
| 33 #include "bindings/core/v8/Microtask.h" | 33 #include "bindings/core/v8/Microtask.h" |
| 34 #include "core/HTMLNames.h" | 34 #include "core/HTMLNames.h" |
| 35 #include "core/dom/NodeTraversal.h" | 35 #include "core/dom/NodeTraversal.h" |
| 36 #include "core/dom/StyleChangeReason.h" | 36 #include "core/dom/StyleChangeReason.h" |
| 37 #include "core/dom/StyleEngine.h" | 37 #include "core/dom/StyleEngine.h" |
| 38 #include "core/dom/shadow/ElementShadow.h" | 38 #include "core/dom/shadow/ElementShadow.h" |
| 39 #include "core/dom/shadow/InsertionPoint.h" | 39 #include "core/dom/shadow/InsertionPoint.h" |
| 40 #include "core/dom/shadow/SlotAssignment.h" | 40 #include "core/dom/shadow/SlotAssignment.h" |
| 41 #include "core/events/Event.h" | 41 #include "core/events/Event.h" |
| 42 #include "core/html/AssignedNodesOptions.h" | 42 #include "core/html/AssignedNodesOptions.h" |
| 43 #include "core/inspector/InspectorInstrumentation.h" |
| 43 | 44 |
| 44 namespace blink { | 45 namespace blink { |
| 45 | 46 |
| 46 using namespace HTMLNames; | 47 using namespace HTMLNames; |
| 47 | 48 |
| 48 inline HTMLSlotElement::HTMLSlotElement(Document& document) | 49 inline HTMLSlotElement::HTMLSlotElement(Document& document) |
| 49 : HTMLElement(slotTag, document) | 50 : HTMLElement(slotTag, document) |
| 50 { | 51 { |
| 51 setHasCustomStyleCallbacks(); | 52 setHasCustomStyleCallbacks(); |
| 52 } | 53 } |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 } | 300 } |
| 300 | 301 |
| 301 void HTMLSlotElement::lazyReattachDistributedNodesIfNeeded() | 302 void HTMLSlotElement::lazyReattachDistributedNodesIfNeeded() |
| 302 { | 303 { |
| 303 // TODO(hayato): Figure out an exact condition where reattach is required | 304 // TODO(hayato): Figure out an exact condition where reattach is required |
| 304 if (m_oldDistributedNodes != m_distributedNodes) { | 305 if (m_oldDistributedNodes != m_distributedNodes) { |
| 305 for (auto& node : m_oldDistributedNodes) | 306 for (auto& node : m_oldDistributedNodes) |
| 306 node->lazyReattachIfAttached(); | 307 node->lazyReattachIfAttached(); |
| 307 for (auto& node : m_distributedNodes) | 308 for (auto& node : m_distributedNodes) |
| 308 node->lazyReattachIfAttached(); | 309 node->lazyReattachIfAttached(); |
| 310 InspectorInstrumentation::didPerformSlotDistribution(this); |
| 309 } | 311 } |
| 310 m_oldDistributedNodes.clear(); | 312 m_oldDistributedNodes.clear(); |
| 311 } | 313 } |
| 312 | 314 |
| 313 void HTMLSlotElement::enqueueSlotChangeEvent() | 315 void HTMLSlotElement::enqueueSlotChangeEvent() |
| 314 { | 316 { |
| 315 if (!m_slotchangeEventEnqueued) { | 317 if (!m_slotchangeEventEnqueued) { |
| 316 Microtask::enqueueMicrotask(WTF::bind(&HTMLSlotElement::dispatchSlotChan
geEvent, wrapPersistent(this))); | 318 Microtask::enqueueMicrotask(WTF::bind(&HTMLSlotElement::dispatchSlotChan
geEvent, wrapPersistent(this))); |
| 317 m_slotchangeEventEnqueued = true; | 319 m_slotchangeEventEnqueued = true; |
| 318 } | 320 } |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 DEFINE_TRACE(HTMLSlotElement) | 355 DEFINE_TRACE(HTMLSlotElement) |
| 354 { | 356 { |
| 355 visitor->trace(m_assignedNodes); | 357 visitor->trace(m_assignedNodes); |
| 356 visitor->trace(m_distributedNodes); | 358 visitor->trace(m_distributedNodes); |
| 357 visitor->trace(m_oldDistributedNodes); | 359 visitor->trace(m_oldDistributedNodes); |
| 358 visitor->trace(m_distributedIndices); | 360 visitor->trace(m_distributedIndices); |
| 359 HTMLElement::trace(visitor); | 361 HTMLElement::trace(visitor); |
| 360 } | 362 } |
| 361 | 363 |
| 362 } // namespace blink | 364 } // namespace blink |
| OLD | NEW |