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

Side by Side Diff: third_party/WebKit/Source/core/input/TouchActionUtil.cpp

Issue 2397723004: reflow comments in core/input (Closed)
Patch Set: Created 4 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/input/TouchActionUtil.h" 5 #include "core/input/TouchActionUtil.h"
6 6
7 #include "core/dom/Node.h" 7 #include "core/dom/Node.h"
8 #include "core/html/HTMLFrameOwnerElement.h" 8 #include "core/html/HTMLFrameOwnerElement.h"
9 #include "core/layout/LayoutBox.h" 9 #include "core/layout/LayoutBox.h"
10 #include "core/layout/LayoutObject.h" 10 #include "core/layout/LayoutObject.h"
11 11
12 namespace blink { 12 namespace blink {
13 namespace TouchActionUtil { 13 namespace TouchActionUtil {
14 14
15 namespace { 15 namespace {
16 16
17 // touch-action applies to all elements with both width AND height properties. 17 // touch-action applies to all elements with both width AND height properties.
18 // According to the CSS Box Model Spec (http://dev.w3.org/csswg/css-box/#the-wid th-and-height-properties) 18 // According to the CSS Box Model Spec
19 // width applies to all elements but non-replaced inline elements, table rows, a nd row groups and 19 // (http://dev.w3.org/csswg/css-box/#the-width-and-height-properties)
20 // height applies to all elements but non-replaced inline elements, table column s, and column groups. 20 // width applies to all elements but non-replaced inline elements, table rows,
21 // and row groups and height applies to all elements but non-replaced inline
22 // elements, table columns, and column groups.
21 bool supportsTouchAction(const LayoutObject& object) { 23 bool supportsTouchAction(const LayoutObject& object) {
22 if (object.isInline() && !object.isAtomicInlineLevel()) 24 if (object.isInline() && !object.isAtomicInlineLevel())
23 return false; 25 return false;
24 if (object.isTableRow() || object.isLayoutTableCol()) 26 if (object.isTableRow() || object.isLayoutTableCol())
25 return false; 27 return false;
26 28
27 return true; 29 return true;
28 } 30 }
29 31
30 const Node* parentNodeAcrossFrames(const Node* curNode) { 32 const Node* parentNodeAcrossFrames(const Node* curNode) {
(...skipping 23 matching lines...) Expand all
54 curNode = parentNodeAcrossFrames(curNode)) { 56 curNode = parentNodeAcrossFrames(curNode)) {
55 if (LayoutObject* layoutObject = curNode->layoutObject()) { 57 if (LayoutObject* layoutObject = curNode->layoutObject()) {
56 if (supportsTouchAction(*layoutObject)) { 58 if (supportsTouchAction(*layoutObject)) {
57 TouchAction action = layoutObject->style()->getTouchAction(); 59 TouchAction action = layoutObject->style()->getTouchAction();
58 action |= handledTouchActions; 60 action |= handledTouchActions;
59 effectiveTouchAction &= action; 61 effectiveTouchAction &= action;
60 if (effectiveTouchAction == TouchActionNone) 62 if (effectiveTouchAction == TouchActionNone)
61 break; 63 break;
62 } 64 }
63 65
64 // If we've reached an ancestor that supports panning, stop allowing panni ng to be disabled. 66 // If we've reached an ancestor that supports panning, stop allowing
67 // panning to be disabled.
65 if ((layoutObject->isBox() && 68 if ((layoutObject->isBox() &&
66 toLayoutBox(layoutObject)->scrollsOverflow()) || 69 toLayoutBox(layoutObject)->scrollsOverflow()) ||
67 layoutObject->isLayoutView()) 70 layoutObject->isLayoutView())
68 handledTouchActions |= TouchActionPan; 71 handledTouchActions |= TouchActionPan;
69 } 72 }
70 } 73 }
71 return effectiveTouchAction; 74 return effectiveTouchAction;
72 } 75 }
73 76
74 } // namespace TouchActionUtil 77 } // namespace TouchActionUtil
75 } // namespace blink 78 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/input/ScrollManager.cpp ('k') | third_party/WebKit/Source/core/input/TouchEventManager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698