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

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

Issue 889563002: Make RenderObject::style() return a const object (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated change after Doug's review. Created 5 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/page/EventHandler.cpp ('k') | Source/core/rendering/RenderBlock.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 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 Element* element = toElement(node); 87 Element* element = toElement(node);
88 // Tapping on a text field or other focusable item should trigger adjust ment, except 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 89 // that iframe elements are hard-coded to support focus but the effect i s often invisible
90 // so they should be excluded. 90 // so they should be excluded.
91 if (element->isMouseFocusable() && !isHTMLIFrameElement(element)) 91 if (element->isMouseFocusable() && !isHTMLIFrameElement(element))
92 return true; 92 return true;
93 // Accept nodes that has a CSS effect when touched. 93 // Accept nodes that has a CSS effect when touched.
94 if (element->childrenOrSiblingsAffectedByActive() || element->childrenOr SiblingsAffectedByHover()) 94 if (element->childrenOrSiblingsAffectedByActive() || element->childrenOr SiblingsAffectedByHover())
95 return true; 95 return true;
96 } 96 }
97 if (LayoutStyle* layoutStyle = node->layoutStyle()) { 97 if (const LayoutStyle* layoutStyle = node->layoutStyle()) {
98 if (layoutStyle->affectedByActive() || layoutStyle->affectedByHover()) 98 if (layoutStyle->affectedByActive() || layoutStyle->affectedByHover())
99 return true; 99 return true;
100 } 100 }
101 return false; 101 return false;
102 } 102 }
103 103
104 bool nodeIsZoomTarget(Node* node) 104 bool nodeIsZoomTarget(Node* node)
105 { 105 {
106 if (node->isTextNode() || node->isShadowRoot()) 106 if (node->isTextNode() || node->isShadowRoot())
107 return false; 107 return false;
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 507
508 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)
509 { 509 {
510 IntPoint targetPoint; 510 IntPoint targetPoint;
511 TouchAdjustment::SubtargetGeometryList subtargets; 511 TouchAdjustment::SubtargetGeometryList subtargets;
512 TouchAdjustment::compileZoomableSubtargets(nodes, subtargets); 512 TouchAdjustment::compileZoomableSubtargets(nodes, subtargets);
513 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);
514 } 514 }
515 515
516 } // namespace blink 516 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/page/EventHandler.cpp ('k') | Source/core/rendering/RenderBlock.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698