Chromium Code Reviews

Unified Diff: Source/core/rendering/RenderObject.h

Issue 220343002: Update touch-action hit-testing to match latest spec changes. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Move logic to RenderObject Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « Source/core/rendering/RenderBlock.h ('k') | Source/core/rendering/svg/RenderSVGRoot.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderObject.h
diff --git a/Source/core/rendering/RenderObject.h b/Source/core/rendering/RenderObject.h
index 45b2272f8db88d82fc1cacd671e0be52ac20b358..9db231a1b91dfd34c02d62af5969a8bdce035279 100644
--- a/Source/core/rendering/RenderObject.h
+++ b/Source/core/rendering/RenderObject.h
@@ -947,7 +947,21 @@ public:
void remove() { if (parent()) parent()->removeChild(this); }
bool isInert() const;
- virtual bool visibleForTouchAction() const { return false; }
+
+ // touch-action applies to all elements with both width AND height properties.
+ // According to the CSS Box Model Spec (http://dev.w3.org/csswg/css-box/#the-width-and-height-properties)
+ // width applies to all elements but non-replaced inline elements, table rows, and row groups and
+ // height applies to all elements but non-replaced inline elements, table columns, and column groups.
+ bool visibleForTouchAction() const
ojan 2014/04/09 22:20:13 This function body is long for a header file. Can
+ {
+ if (isInline() && !isReplaced())
ojan 2014/04/09 22:20:13 Makes me a little sad that we can't use inheritanc
+ return false;
+ if (isTableRow() || isRenderTableCol())
+ return false;
+
+ return true;
+ }
+
bool visibleToHitTestRequest(const HitTestRequest& request) const
{
if (request.touchAction() && !visibleForTouchAction())
« no previous file with comments | « Source/core/rendering/RenderBlock.h ('k') | Source/core/rendering/svg/RenderSVGRoot.h » ('j') | no next file with comments »

Powered by Google App Engine