| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 } | 50 } |
| 51 } | 51 } |
| 52 | 52 |
| 53 inline static void assertPseudoElementParent( | 53 inline static void assertPseudoElementParent( |
| 54 const PseudoElement& pseudoElement) { | 54 const PseudoElement& pseudoElement) { |
| 55 DCHECK(pseudoElement.parentNode()); | 55 DCHECK(pseudoElement.parentNode()); |
| 56 DCHECK(pseudoElement.parentNode()->canParticipateInFlatTree()); | 56 DCHECK(pseudoElement.parentNode()->canParticipateInFlatTree()); |
| 57 } | 57 } |
| 58 | 58 |
| 59 ContainerNode* parent(const Node& node, ParentDetails* details) { | 59 ContainerNode* parent(const Node& node, ParentDetails* details) { |
| 60 // TODO(hayato): Uncomment this once we can be sure LayoutTreeBuilderTraversal
::parent() is used only for a node which is connected. | 60 // TODO(hayato): Uncomment this once we can be sure |
| 61 // LayoutTreeBuilderTraversal::parent() is used only for a node which is |
| 62 // connected. |
| 61 // DCHECK(node.isConnected()); | 63 // DCHECK(node.isConnected()); |
| 62 if (node.isPseudoElement()) { | 64 if (node.isPseudoElement()) { |
| 63 assertPseudoElementParent(toPseudoElement(node)); | 65 assertPseudoElementParent(toPseudoElement(node)); |
| 64 return node.parentNode(); | 66 return node.parentNode(); |
| 65 } | 67 } |
| 66 return FlatTreeTraversal::parent(node, details); | 68 return FlatTreeTraversal::parent(node, details); |
| 67 } | 69 } |
| 68 | 70 |
| 69 Node* nextSibling(const Node& node) { | 71 Node* nextSibling(const Node& node) { |
| 70 if (node.isBeforePseudoElement()) { | 72 if (node.isBeforePseudoElement()) { |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 for (size_t i = position + 1; i < topLayerElements.size(); ++i) { | 245 for (size_t i = position + 1; i < topLayerElements.size(); ++i) { |
| 244 if (LayoutObject* layoutObject = topLayerElements[i]->layoutObject()) | 246 if (LayoutObject* layoutObject = topLayerElements[i]->layoutObject()) |
| 245 return layoutObject; | 247 return layoutObject; |
| 246 } | 248 } |
| 247 return 0; | 249 return 0; |
| 248 } | 250 } |
| 249 | 251 |
| 250 } // namespace LayoutTreeBuilderTraversal | 252 } // namespace LayoutTreeBuilderTraversal |
| 251 | 253 |
| 252 } // namespace blink | 254 } // namespace blink |
| OLD | NEW |