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

Side by Side Diff: Source/core/frame/SmartClip.cpp

Issue 171773008: Rename childNodeCount() / childNode() methods for clarity (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Further renaming for consistency Created 6 years, 10 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/editing/markup.cpp ('k') | Source/core/html/HTMLHRElement.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) 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 104
105 if (Node* nodeFromFrame = nodeInsideFrame(bestNode)) { 105 if (Node* nodeFromFrame = nodeInsideFrame(bestNode)) {
106 // FIXME: This code only hit-tests a single iframe. It seems like we oug ht support nested frames. 106 // FIXME: This code only hit-tests a single iframe. It seems like we oug ht support nested frames.
107 if (Node* bestNodeInFrame = findBestOverlappingNode(nodeFromFrame, resiz edCropRect)) 107 if (Node* bestNodeInFrame = findBestOverlappingNode(nodeFromFrame, resiz edCropRect))
108 bestNode = bestNodeInFrame; 108 bestNode = bestNodeInFrame;
109 } 109 }
110 110
111 Vector<Node*> hitNodes; 111 Vector<Node*> hitNodes;
112 collectOverlappingChildNodes(bestNode, resizedCropRect, hitNodes); 112 collectOverlappingChildNodes(bestNode, resizedCropRect, hitNodes);
113 113
114 if (hitNodes.isEmpty() || hitNodes.size() == bestNode->childNodeCount()) { 114 if (hitNodes.isEmpty() || hitNodes.size() == bestNode->countChildren()) {
115 hitNodes.clear(); 115 hitNodes.clear();
116 hitNodes.append(bestNode); 116 hitNodes.append(bestNode);
117 } 117 }
118 118
119 // Unite won't work with the empty rect, so we initialize to the first rect. 119 // Unite won't work with the empty rect, so we initialize to the first rect.
120 IntRect unitedRects = hitNodes[0]->pixelSnappedBoundingBox(); 120 IntRect unitedRects = hitNodes[0]->pixelSnappedBoundingBox();
121 StringBuilder collectedText; 121 StringBuilder collectedText;
122 for (size_t i = 0; i < hitNodes.size(); ++i) { 122 for (size_t i = 0; i < hitNodes.size(); ++i) {
123 collectedText.append(extractTextFromNode(hitNodes[i])); 123 collectedText.append(extractTextFromNode(hitNodes[i]));
124 unitedRects.unite(hitNodes[i]->pixelSnappedBoundingBox()); 124 unitedRects.unite(hitNodes[i]->pixelSnappedBoundingBox());
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 285
286 result.append(nodeValue); 286 result.append(nodeValue);
287 } 287 }
288 } 288 }
289 } 289 }
290 290
291 return result.toString(); 291 return result.toString();
292 } 292 }
293 293
294 } // namespace WebCore 294 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/editing/markup.cpp ('k') | Source/core/html/HTMLHRElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698