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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 return m_distributedNodes[index - 1].get(); | 177 return m_distributedNodes[index - 1].get(); |
178 } | 178 } |
179 | 179 |
180 AtomicString HTMLSlotElement::name() const { | 180 AtomicString HTMLSlotElement::name() const { |
181 return normalizeSlotName(fastGetAttribute(HTMLNames::nameAttr)); | 181 return normalizeSlotName(fastGetAttribute(HTMLNames::nameAttr)); |
182 } | 182 } |
183 | 183 |
184 void HTMLSlotElement::attachLayoutTree(const AttachContext& context) { | 184 void HTMLSlotElement::attachLayoutTree(const AttachContext& context) { |
185 if (supportsDistribution()) { | 185 if (supportsDistribution()) { |
186 for (auto& node : m_distributedNodes) { | 186 for (auto& node : m_distributedNodes) { |
187 if (node->needsAttach()) | 187 if (node->needsReattachLayoutTree()) |
188 node->attachLayoutTree(context); | 188 node->attachLayoutTree(context); |
189 } | 189 } |
190 } | 190 } |
191 HTMLElement::attachLayoutTree(context); | 191 HTMLElement::attachLayoutTree(context); |
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(); |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 | 361 |
362 DEFINE_TRACE(HTMLSlotElement) { | 362 DEFINE_TRACE(HTMLSlotElement) { |
363 visitor->trace(m_assignedNodes); | 363 visitor->trace(m_assignedNodes); |
364 visitor->trace(m_distributedNodes); | 364 visitor->trace(m_distributedNodes); |
365 visitor->trace(m_oldDistributedNodes); | 365 visitor->trace(m_oldDistributedNodes); |
366 visitor->trace(m_distributedIndices); | 366 visitor->trace(m_distributedIndices); |
367 HTMLElement::trace(visitor); | 367 HTMLElement::trace(visitor); |
368 } | 368 } |
369 | 369 |
370 } // namespace blink | 370 } // namespace blink |
OLD | NEW |