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

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

Issue 495163002: Touch adjustment: don't treat iframes as clickable by default (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update hit test counts Created 6 years, 4 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 | « LayoutTests/fast/events/touch/gesture/gesture-tap-near-iframe-expected.txt ('k') | no next file » | 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 Nokia Corporation and/or its subsidiary(-ies) 2 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 typedef void (*AppendSubtargetsForNode)(Node*, SubtargetGeometryList&); 78 typedef void (*AppendSubtargetsForNode)(Node*, SubtargetGeometryList&);
79 typedef float (*DistanceFunction)(const IntPoint&, const IntRect&, const Subtarg etGeometry&); 79 typedef float (*DistanceFunction)(const IntPoint&, const IntRect&, const Subtarg etGeometry&);
80 80
81 // Takes non-const Node* because isContentEditable is a non-const function. 81 // Takes non-const Node* because isContentEditable is a non-const function.
82 bool nodeRespondsToTapGesture(Node* node) 82 bool nodeRespondsToTapGesture(Node* node)
83 { 83 {
84 if (node->willRespondToMouseClickEvents() || node->willRespondToMouseMoveEve nts()) 84 if (node->willRespondToMouseClickEvents() || node->willRespondToMouseMoveEve nts())
85 return true; 85 return true;
86 if (node->isElementNode()) { 86 if (node->isElementNode()) {
87 Element* element = toElement(node); 87 Element* element = toElement(node);
88 if (element->isMouseFocusable()) 88 // Tapping on a text field or other focusable item should trigger adjust ment, except
89 // that iframe elements are hard-coded to support focus but the effect i s often invisible
90 // so they should be excluded.
91 if (element->isMouseFocusable() && !isHTMLIFrameElement(element))
89 return true; 92 return true;
90 // Accept nodes that has a CSS effect when touched. 93 // Accept nodes that has a CSS effect when touched.
91 if (element->childrenOrSiblingsAffectedByActive() || element->childrenOr SiblingsAffectedByHover()) 94 if (element->childrenOrSiblingsAffectedByActive() || element->childrenOr SiblingsAffectedByHover())
92 return true; 95 return true;
93 } 96 }
94 if (RenderStyle* renderStyle = node->renderStyle()) { 97 if (RenderStyle* renderStyle = node->renderStyle()) {
95 if (renderStyle->affectedByActive() || renderStyle->affectedByHover()) 98 if (renderStyle->affectedByActive() || renderStyle->affectedByHover())
96 return true; 99 return true;
97 } 100 }
98 return false; 101 return false;
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 507
505 bool findBestZoomableArea(Node*& targetNode, IntRect& targetArea, const IntPoint & touchHotspot, const IntRect& touchArea, const WillBeHeapVector<RefPtrWillBeMem ber<Node> >& nodes) 508 bool findBestZoomableArea(Node*& targetNode, IntRect& targetArea, const IntPoint & touchHotspot, const IntRect& touchArea, const WillBeHeapVector<RefPtrWillBeMem ber<Node> >& nodes)
506 { 509 {
507 IntPoint targetPoint; 510 IntPoint targetPoint;
508 TouchAdjustment::SubtargetGeometryList subtargets; 511 TouchAdjustment::SubtargetGeometryList subtargets;
509 TouchAdjustment::compileZoomableSubtargets(nodes, subtargets); 512 TouchAdjustment::compileZoomableSubtargets(nodes, subtargets);
510 return TouchAdjustment::findNodeWithLowestDistanceMetric(targetNode, targetP oint, targetArea, touchHotspot, touchArea, subtargets, TouchAdjustment::zoomable IntersectionQuotient); 513 return TouchAdjustment::findNodeWithLowestDistanceMetric(targetNode, targetP oint, targetArea, touchHotspot, touchArea, subtargets, TouchAdjustment::zoomable IntersectionQuotient);
511 } 514 }
512 515
513 } // namespace blink 516 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/fast/events/touch/gesture/gesture-tap-near-iframe-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698