Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 93 for (HTMLSlotElement* next = slot->assignedSlot(); next; next = next->assign edSlot()) { | 93 for (HTMLSlotElement* next = slot->assignedSlot(); next; next = next->assign edSlot()) { |
| 94 slot = next; | 94 slot = next; |
| 95 } | 95 } |
| 96 return slot; | 96 return slot; |
| 97 } | 97 } |
| 98 | 98 |
| 99 // TODO(hayato): This may return a wrong result for a node which is not in a | 99 // TODO(hayato): This may return a wrong result for a node which is not in a |
| 100 // document flat tree. See FlatTreeTraversalTest's redistribution test for deta ils. | 100 // document flat tree. See FlatTreeTraversalTest's redistribution test for deta ils. |
| 101 Node* FlatTreeTraversal::traverseSiblings(const Node& node, TraversalDirection d irection) | 101 Node* FlatTreeTraversal::traverseSiblings(const Node& node, TraversalDirection d irection) |
| 102 { | 102 { |
| 103 // TODO(hayato): Stop this hack for a pseudo element because a pseudo elemen t should not be in a document flat tree. | |
| 104 if (node.isPseudoElement()) | |
| 105 return direction == TraversalDirectionForward ? node.nextSibling() : nod e.previousSibling(); | |
|
rune
2016/08/18 23:54:54
Shouldn't LayoutTreeBuilderTraversal handle pseudo
hayato
2016/08/19 03:58:47
Good point! I missed LayoutTreeBuilderTraversal.
| |
| 106 | |
| 103 if (node.isChildOfV1ShadowHost()) | 107 if (node.isChildOfV1ShadowHost()) |
| 104 return traverseSiblingsForV1HostChild(node, direction); | 108 return traverseSiblingsForV1HostChild(node, direction); |
| 105 | 109 |
| 106 if (shadowWhereNodeCanBeDistributed(node)) | 110 if (shadowWhereNodeCanBeDistributed(node)) |
| 107 return traverseSiblingsForV0Distribution(node, direction); | 111 return traverseSiblingsForV0Distribution(node, direction); |
| 108 | 112 |
| 109 if (Node* found = resolveDistributionStartingAt(direction == TraversalDirect ionForward ? node.nextSibling() : node.previousSibling(), direction)) | 113 if (Node* found = resolveDistributionStartingAt(direction == TraversalDirect ionForward ? node.nextSibling() : node.previousSibling(), direction)) |
| 110 return found; | 114 return found; |
| 111 | 115 |
| 112 if (!node.isInV0ShadowTree()) | 116 if (!node.isInV0ShadowTree()) |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 352 Node& FlatTreeTraversal::lastWithinOrSelf(const Node& node) | 356 Node& FlatTreeTraversal::lastWithinOrSelf(const Node& node) |
| 353 { | 357 { |
| 354 assertPrecondition(node); | 358 assertPrecondition(node); |
| 355 Node* lastDescendant = lastWithin(node); | 359 Node* lastDescendant = lastWithin(node); |
| 356 Node& result = lastDescendant ? *lastDescendant : const_cast<Node&>(node); | 360 Node& result = lastDescendant ? *lastDescendant : const_cast<Node&>(node); |
| 357 assertPostcondition(&result); | 361 assertPostcondition(&result); |
| 358 return result; | 362 return result; |
| 359 } | 363 } |
| 360 | 364 |
| 361 } // namespace blink | 365 } // namespace blink |
| OLD | NEW |