| 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 return 0; | 156 return 0; |
| 157 | 157 |
| 158 if (Node* previousNode = pseudoAwarePreviousSibling(node)) { | 158 if (Node* previousNode = pseudoAwarePreviousSibling(node)) { |
| 159 while (Node* previousLastChild = pseudoAwareLastChild(previousNode)) | 159 while (Node* previousLastChild = pseudoAwareLastChild(previousNode)) |
| 160 previousNode = previousLastChild; | 160 previousNode = previousLastChild; |
| 161 return previousNode; | 161 return previousNode; |
| 162 } | 162 } |
| 163 return parent(node); | 163 return parent(node); |
| 164 } | 164 } |
| 165 | 165 |
| 166 static Node* firstChild(const Node* node) | 166 Node* firstChild(const Node* node) |
| 167 { | 167 { |
| 168 ComposedTreeWalker walker(node); | 168 ComposedTreeWalker walker(node); |
| 169 walker.firstChild(); | 169 walker.firstChild(); |
| 170 return walker.get(); | 170 return walker.get(); |
| 171 } | 171 } |
| 172 | 172 |
| 173 static Node* pseudoAwareNextSibling(const Node* node) | 173 static Node* pseudoAwareNextSibling(const Node* node) |
| 174 { | 174 { |
| 175 Node* parentNode = parent(node); | 175 Node* parentNode = parent(node); |
| 176 Node* nextNode = nextSibling(node); | 176 Node* nextNode = nextSibling(node); |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 for (size_t i = position + 1; i < topLayerElements.size(); ++i) { | 249 for (size_t i = position + 1; i < topLayerElements.size(); ++i) { |
| 250 if (RenderObject* renderer = topLayerElements[i]->renderer()) | 250 if (RenderObject* renderer = topLayerElements[i]->renderer()) |
| 251 return renderer; | 251 return renderer; |
| 252 } | 252 } |
| 253 return 0; | 253 return 0; |
| 254 } | 254 } |
| 255 | 255 |
| 256 } | 256 } |
| 257 | 257 |
| 258 } // namespace | 258 } // namespace |
| OLD | NEW |