| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 * * Neither the name of Google Inc. nor the names of its | 10 * * Neither the name of Google Inc. nor the names of its |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 EventPathWalker walker(node); | 46 EventPathWalker walker(node); |
| 47 walker.moveToParent(); | 47 walker.moveToParent(); |
| 48 return walker.node(); | 48 return walker.node(); |
| 49 } | 49 } |
| 50 | 50 |
| 51 void EventPathWalker::moveToParent() | 51 void EventPathWalker::moveToParent() |
| 52 { | 52 { |
| 53 ASSERT(m_node); | 53 ASSERT(m_node); |
| 54 ASSERT(m_distributedNode); | 54 ASSERT(m_distributedNode); |
| 55 if (ElementShadow* shadow = shadowOfParent(m_node)) { | 55 if (ElementShadow* shadow = shadowOfParent(m_node)) { |
| 56 ContentDistributor::ensureDistribution(shadow->youngestShadowRoot()); | 56 shadow->host()->ensureDistribution(); |
| 57 if (InsertionPoint* insertionPoint = shadow->distributor().findInsertion
PointFor(m_distributedNode)) { | 57 if (InsertionPoint* insertionPoint = shadow->distributor().findInsertion
PointFor(m_distributedNode)) { |
| 58 m_node = insertionPoint; | 58 m_node = insertionPoint; |
| 59 m_isVisitingInsertionPointInReprojection = true; | 59 m_isVisitingInsertionPointInReprojection = true; |
| 60 return; | 60 return; |
| 61 } | 61 } |
| 62 } | 62 } |
| 63 if (!m_node->isShadowRoot()) { | 63 if (!m_node->isShadowRoot()) { |
| 64 m_node = m_node->parentNode(); | 64 m_node = m_node->parentNode(); |
| 65 if (!(m_node && m_node->isShadowRoot() && ScopeContentDistribution::assi
gnedTo(toShadowRoot(m_node)))) | 65 if (!(m_node && m_node->isShadowRoot() && ScopeContentDistribution::assi
gnedTo(toShadowRoot(m_node)))) |
| 66 m_distributedNode = m_node; | 66 m_distributedNode = m_node; |
| 67 m_isVisitingInsertionPointInReprojection = false; | 67 m_isVisitingInsertionPointInReprojection = false; |
| 68 return; | 68 return; |
| 69 } | 69 } |
| 70 | 70 |
| 71 const ShadowRoot* shadowRoot = toShadowRoot(m_node); | 71 const ShadowRoot* shadowRoot = toShadowRoot(m_node); |
| 72 if (InsertionPoint* insertionPoint = ScopeContentDistribution::assignedTo(sh
adowRoot)) { | 72 if (InsertionPoint* insertionPoint = ScopeContentDistribution::assignedTo(sh
adowRoot)) { |
| 73 m_node = insertionPoint; | 73 m_node = insertionPoint; |
| 74 m_isVisitingInsertionPointInReprojection = true; | 74 m_isVisitingInsertionPointInReprojection = true; |
| 75 return; | 75 return; |
| 76 } | 76 } |
| 77 m_node = shadowRoot->host(); | 77 m_node = shadowRoot->host(); |
| 78 m_distributedNode = m_node; | 78 m_distributedNode = m_node; |
| 79 m_isVisitingInsertionPointInReprojection = false; | 79 m_isVisitingInsertionPointInReprojection = false; |
| 80 } | 80 } |
| 81 | 81 |
| 82 } // namespace | 82 } // namespace |
| OLD | NEW |