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

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

Issue 2623513005: Introduce Element::AttributeModificationParams (Closed)
Patch Set: Created 3 years, 11 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) 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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 } 192 }
193 193
194 void HTMLSlotElement::detachLayoutTree(const AttachContext& context) { 194 void HTMLSlotElement::detachLayoutTree(const AttachContext& context) {
195 if (supportsDistribution()) { 195 if (supportsDistribution()) {
196 for (auto& node : m_distributedNodes) 196 for (auto& node : m_distributedNodes)
197 node->lazyReattachIfAttached(); 197 node->lazyReattachIfAttached();
198 } 198 }
199 HTMLElement::detachLayoutTree(context); 199 HTMLElement::detachLayoutTree(context);
200 } 200 }
201 201
202 void HTMLSlotElement::attributeChanged(const QualifiedName& name, 202 void HTMLSlotElement::attributeChanged(
203 const AtomicString& oldValue, 203 const AttributeModificationParams& params) {
204 const AtomicString& newValue, 204 if (params.name == nameAttr) {
205 AttributeModificationReason reason) {
206 if (name == nameAttr) {
207 if (ShadowRoot* root = containingShadowRoot()) { 205 if (ShadowRoot* root = containingShadowRoot()) {
208 if (root->isV1() && oldValue != newValue) 206 if (root->isV1() && params.oldValue != params.newValue) {
209 root->ensureSlotAssignment().slotRenamed(normalizeSlotName(oldValue), 207 root->ensureSlotAssignment().slotRenamed(
210 *this); 208 normalizeSlotName(params.oldValue), *this);
209 }
211 } 210 }
212 } 211 }
213 HTMLElement::attributeChanged(name, oldValue, newValue, reason); 212 HTMLElement::attributeChanged(params);
214 } 213 }
215 214
216 static bool wasInShadowTreeBeforeInserted(HTMLSlotElement& slot, 215 static bool wasInShadowTreeBeforeInserted(HTMLSlotElement& slot,
217 ContainerNode& insertionPoint) { 216 ContainerNode& insertionPoint) {
218 ShadowRoot* root1 = slot.containingShadowRoot(); 217 ShadowRoot* root1 = slot.containingShadowRoot();
219 ShadowRoot* root2 = insertionPoint.containingShadowRoot(); 218 ShadowRoot* root2 = insertionPoint.containingShadowRoot();
220 if (root1 && root2 && root1 == root2) 219 if (root1 && root2 && root1 == root2)
221 return false; 220 return false;
222 return root1; 221 return root1;
223 } 222 }
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 360
362 DEFINE_TRACE(HTMLSlotElement) { 361 DEFINE_TRACE(HTMLSlotElement) {
363 visitor->trace(m_assignedNodes); 362 visitor->trace(m_assignedNodes);
364 visitor->trace(m_distributedNodes); 363 visitor->trace(m_distributedNodes);
365 visitor->trace(m_oldDistributedNodes); 364 visitor->trace(m_oldDistributedNodes);
366 visitor->trace(m_distributedIndices); 365 visitor->trace(m_distributedIndices);
367 HTMLElement::trace(visitor); 366 HTMLElement::trace(visitor);
368 } 367 }
369 368
370 } // namespace blink 369 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLSlotElement.h ('k') | third_party/WebKit/Source/core/html/HTMLSourceElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698