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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 74
75 if (!m_frameView->visibleContentRect().contains(location.roundedPoint())) 75 if (!m_frameView->visibleContentRect().contains(location.roundedPoint()))
76 return false; 76 return false;
77 77
78 // We have to recursively update layout/style here because otherwise, when t he hit test recurses 78 // We have to recursively update layout/style here because otherwise, when t he hit test recurses
79 // into a child document, it could trigger a layout on the parent document, which can destroy RenderLayers 79 // into a child document, it could trigger a layout on the parent document, which can destroy RenderLayers
80 // that are higher up in the call stack, leading to crashes. 80 // that are higher up in the call stack, leading to crashes.
81 // Note that Document::updateLayout calls its parent's updateLayout. 81 // Note that Document::updateLayout calls its parent's updateLayout.
82 // FIXME: It should be the caller's responsibility to ensure an up-to-date l ayout. 82 // FIXME: It should be the caller's responsibility to ensure an up-to-date l ayout.
83 frameView()->updateLayoutAndStyleIfNeededRecursive(); 83 frameView()->updateLayoutAndStyleIfNeededRecursive();
84 return layer()->hitTest(request, location, result); 84
85 // RenderView should make sure to update layout before entering hit testing
86 ASSERT(!frame()->view()->layoutPending());
87 ASSERT(!document().renderView()->needsLayout());
88
89 // TODO(ojan): Does any of this intersection stuff make sense for Sky?
90 LayoutRect hitTestArea = view()->documentRect();
91 if (!request.ignoreClipping())
92 hitTestArea.intersect(frame()->view()->visibleContentRect());
93
94 RenderLayer* insideLayer = layer()->hitTestLayer(layer(), 0, request, result , hitTestArea, location);
95 if (!insideLayer) {
96 // TODO(ojan): Is this code needed for Sky?
97
98 // We didn't hit any layer. If we are the root layer and the mouse is -- or just was -- down,
99 // return ourselves. We do this so mouse events continue getting deliver ed after a drag has
100 // exited the WebView, and so hit testing over a scrollbar hits the cont ent document.
101 if (request.active() || request.release()) {
102 updateHitTestResult(result, location.point());
103 insideLayer = layer();
104 }
105 }
106 return insideLayer;
85 } 107 }
86 108
87 void RenderView::computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit, Logi calExtentComputedValues& computedValues) const 109 void RenderView::computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit, Logi calExtentComputedValues& computedValues) const
88 { 110 {
89 computedValues.m_extent = m_frameView ? LayoutUnit(viewLogicalHeight()) : lo gicalHeight; 111 computedValues.m_extent = m_frameView ? LayoutUnit(viewLogicalHeight()) : lo gicalHeight;
90 } 112 }
91 113
92 void RenderView::updateLogicalWidth() 114 void RenderView::updateLogicalWidth()
93 { 115 {
94 if (m_frameView) 116 if (m_frameView)
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 m_iframes.remove(iframe); 440 m_iframes.remove(iframe);
419 } 441 }
420 442
421 void RenderView::updateIFramesAfterLayout() 443 void RenderView::updateIFramesAfterLayout()
422 { 444 {
423 for (auto& iframe: m_iframes) 445 for (auto& iframe: m_iframes)
424 iframe->updateWidgetBounds(); 446 iframe->updateWidgetBounds();
425 } 447 }
426 448
427 } // namespace blink 449 } // namespace blink
OLDNEW
« 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