| 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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 | 226 |
| 227 Node::InsertionNotificationRequest HTMLSlotElement::insertedInto(ContainerNode*
insertionPoint) | 227 Node::InsertionNotificationRequest HTMLSlotElement::insertedInto(ContainerNode*
insertionPoint) |
| 228 { | 228 { |
| 229 HTMLElement::insertedInto(insertionPoint); | 229 HTMLElement::insertedInto(insertionPoint); |
| 230 ShadowRoot* root = containingShadowRoot(); | 230 ShadowRoot* root = containingShadowRoot(); |
| 231 if (root) { | 231 if (root) { |
| 232 DCHECK(root->owner()); | 232 DCHECK(root->owner()); |
| 233 root->owner()->setNeedsDistributionRecalc(); | 233 root->owner()->setNeedsDistributionRecalc(); |
| 234 // Relevant DOM Standard: https://dom.spec.whatwg.org/#concept-node-inse
rt | 234 // Relevant DOM Standard: https://dom.spec.whatwg.org/#concept-node-inse
rt |
| 235 // - 6.4: Run assign slotables for a tree with node's tree and a set co
ntaining each inclusive descendant of node that is a slot. | 235 // - 6.4: Run assign slotables for a tree with node's tree and a set co
ntaining each inclusive descendant of node that is a slot. |
| 236 if (!wasInShadowTreeBeforeInserted(*this, *insertionPoint)) | 236 if (root->isV1() && !wasInShadowTreeBeforeInserted(*this, *insertionPoin
t)) |
| 237 root->ensureSlotAssignment().slotAdded(*this); | 237 root->ensureSlotAssignment().slotAdded(*this); |
| 238 } | 238 } |
| 239 | 239 |
| 240 // We could have been distributed into in a detached subtree, make sure to | 240 // We could have been distributed into in a detached subtree, make sure to |
| 241 // clear the distribution when inserted again to avoid cycles. | 241 // clear the distribution when inserted again to avoid cycles. |
| 242 clearDistribution(); | 242 clearDistribution(); |
| 243 | 243 |
| 244 return InsertionDone; | 244 return InsertionDone; |
| 245 } | 245 } |
| 246 | 246 |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| OLD | NEW |