Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(331)

Side by Side Diff: Source/core/dom/NodeRenderingTraversal.cpp

Issue 622253004: Use a composed tree based traversal in computing quads in LinkHighlight::computeQuads(). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: no pixel test Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/NodeRenderingTraversal.h ('k') | Source/web/LinkHighlight.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « Source/core/dom/NodeRenderingTraversal.h ('k') | Source/web/LinkHighlight.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698