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

Side by Side Diff: Source/core/page/TouchDisambiguation.cpp

Issue 69543007: Have NodeTraversal::nextSkippingChildren() take a reference (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase on master Created 7 years, 1 month 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
« no previous file with comments | « Source/core/page/FocusController.cpp ('k') | Source/core/rendering/RenderNamedFlowThread.cpp » ('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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 static IntRect boundingBoxForEventNodes(Node* eventNode) 52 static IntRect boundingBoxForEventNodes(Node* eventNode)
53 { 53 {
54 if (!eventNode->document().view()) 54 if (!eventNode->document().view())
55 return IntRect(); 55 return IntRect();
56 56
57 IntRect result; 57 IntRect result;
58 Node* node = eventNode; 58 Node* node = eventNode;
59 while (node) { 59 while (node) {
60 // Skip the whole sub-tree if the node doesn't propagate events. 60 // Skip the whole sub-tree if the node doesn't propagate events.
61 if (node != eventNode && node->willRespondToMouseClickEvents()) { 61 if (node != eventNode && node->willRespondToMouseClickEvents()) {
62 node = NodeTraversal::nextSkippingChildren(node, eventNode); 62 node = NodeTraversal::nextSkippingChildren(*node, eventNode);
63 continue; 63 continue;
64 } 64 }
65 result.unite(node->pixelSnappedBoundingBox()); 65 result.unite(node->pixelSnappedBoundingBox());
66 node = NodeTraversal::next(*node, eventNode); 66 node = NodeTraversal::next(*node, eventNode);
67 } 67 }
68 return eventNode->document().view()->contentsToWindow(result); 68 return eventNode->document().view()->contentsToWindow(result);
69 } 69 }
70 70
71 static float scoreTouchTarget(IntPoint touchPoint, int padding, IntRect bounding Box) 71 static float scoreTouchTarget(IntPoint touchPoint, int padding, IntRect bounding Box)
72 { 72 {
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 // Currently the scoring function uses the overlap area with the fat poi nt as the score. 142 // Currently the scoring function uses the overlap area with the fat poi nt as the score.
143 // We ignore the candidates that has less than 1/2 overlap (we consider not really ambiguous enough) than the best candidate to avoid excessive popups. 143 // We ignore the candidates that has less than 1/2 overlap (we consider not really ambiguous enough) than the best candidate to avoid excessive popups.
144 if (it->value.score < bestScore * 0.5) 144 if (it->value.score < bestScore * 0.5)
145 continue; 145 continue;
146 goodTargets.append(it->value.windowBoundingBox); 146 goodTargets.append(it->value.windowBoundingBox);
147 highlightNodes.append(it->key); 147 highlightNodes.append(it->key);
148 } 148 }
149 } 149 }
150 150
151 } // namespace WebCore 151 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/page/FocusController.cpp ('k') | Source/core/rendering/RenderNamedFlowThread.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698