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

Unified Diff: sky/engine/core/rendering/RenderView.cpp

Issue 939483005: Merge RenderLayer::hitTest into RenderView::hitTest. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: add TODOs and remove redundant isRootLayer check 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/engine/core/rendering/RenderLayer.cpp ('k') | sky/engine/web/WebLocalFrameImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/rendering/RenderView.cpp
diff --git a/sky/engine/core/rendering/RenderView.cpp b/sky/engine/core/rendering/RenderView.cpp
index 312b654e0fe45efe03235045c82d1fb90b2fe6bc..64d53d8bedc42b0c96bb397e162a7847044434d9 100644
--- a/sky/engine/core/rendering/RenderView.cpp
+++ b/sky/engine/core/rendering/RenderView.cpp
@@ -81,7 +81,29 @@ bool RenderView::hitTest(const HitTestRequest& request, const HitTestLocation& l
// Note that Document::updateLayout calls its parent's updateLayout.
// FIXME: It should be the caller's responsibility to ensure an up-to-date layout.
frameView()->updateLayoutAndStyleIfNeededRecursive();
- return layer()->hitTest(request, location, result);
+
+ // RenderView should make sure to update layout before entering hit testing
+ ASSERT(!frame()->view()->layoutPending());
+ ASSERT(!document().renderView()->needsLayout());
+
+ // TODO(ojan): Does any of this intersection stuff make sense for Sky?
+ LayoutRect hitTestArea = view()->documentRect();
+ if (!request.ignoreClipping())
+ hitTestArea.intersect(frame()->view()->visibleContentRect());
+
+ RenderLayer* insideLayer = layer()->hitTestLayer(layer(), 0, request, result, hitTestArea, location);
+ if (!insideLayer) {
+ // TODO(ojan): Is this code needed for Sky?
+
+ // We didn't hit any layer. If we are the root layer and the mouse is -- or just was -- down,
+ // return ourselves. We do this so mouse events continue getting delivered after a drag has
+ // exited the WebView, and so hit testing over a scrollbar hits the content document.
+ if (request.active() || request.release()) {
+ updateHitTestResult(result, location.point());
+ insideLayer = layer();
+ }
+ }
+ return insideLayer;
}
void RenderView::computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit, LogicalExtentComputedValues& computedValues) const
« no previous file with comments | « sky/engine/core/rendering/RenderLayer.cpp ('k') | sky/engine/web/WebLocalFrameImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698