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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLSlotElement.cpp

Issue 2306873002: Make slotchange events bubble (Closed)
Patch Set: fix 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
« no previous file with comments | « third_party/WebKit/LayoutTests/shadow-dom/slotchange.html ('k') | no next file » | 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) 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 147
148 void HTMLSlotElement::saveAndClearDistribution() 148 void HTMLSlotElement::saveAndClearDistribution()
149 { 149 {
150 m_oldDistributedNodes.swap(m_distributedNodes); 150 m_oldDistributedNodes.swap(m_distributedNodes);
151 clearDistribution(); 151 clearDistribution();
152 } 152 }
153 153
154 void HTMLSlotElement::dispatchSlotChangeEvent() 154 void HTMLSlotElement::dispatchSlotChangeEvent()
155 { 155 {
156 m_slotchangeEventEnqueued = false; 156 m_slotchangeEventEnqueued = false;
157 Event* event = Event::create(EventTypeNames::slotchange); 157 Event* event = Event::createBubble(EventTypeNames::slotchange);
158 event->setTarget(this); 158 event->setTarget(this);
159 dispatchScopedEvent(event); 159 dispatchScopedEvent(event);
160 } 160 }
161 161
162 Node* HTMLSlotElement::distributedNodeNextTo(const Node& node) const 162 Node* HTMLSlotElement::distributedNodeNextTo(const Node& node) const
163 { 163 {
164 const auto& it = m_distributedIndices.find(&node); 164 const auto& it = m_distributedIndices.find(&node);
165 if (it == m_distributedIndices.end()) 165 if (it == m_distributedIndices.end())
166 return nullptr; 166 return nullptr;
167 size_t index = it->value; 167 size_t index = it->value;
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 DEFINE_TRACE(HTMLSlotElement) 356 DEFINE_TRACE(HTMLSlotElement)
357 { 357 {
358 visitor->trace(m_assignedNodes); 358 visitor->trace(m_assignedNodes);
359 visitor->trace(m_distributedNodes); 359 visitor->trace(m_distributedNodes);
360 visitor->trace(m_oldDistributedNodes); 360 visitor->trace(m_oldDistributedNodes);
361 visitor->trace(m_distributedIndices); 361 visitor->trace(m_distributedIndices);
362 HTMLElement::trace(visitor); 362 HTMLElement::trace(visitor);
363 } 363 }
364 364
365 } // namespace blink 365 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/shadow-dom/slotchange.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698