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

Unified Diff: Source/core/rendering/RenderView.cpp

Issue 17471008: Rework compositor touch hit testing (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix lifetime issue with Internals::m_currentTouchEventRects Created 7 years, 5 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
Index: Source/core/rendering/RenderView.cpp
diff --git a/Source/core/rendering/RenderView.cpp b/Source/core/rendering/RenderView.cpp
index 22e2250ec140247464cb550bb924b517aa295554..d9c98ad91fa6eb0a16a0748334438a1a8685ec38 100644
--- a/Source/core/rendering/RenderView.cpp
+++ b/Source/core/rendering/RenderView.cpp
@@ -301,9 +301,6 @@ void RenderView::layout()
void RenderView::mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState& transformState, MapCoordinatesFlags mode, bool* wasFixed) const
{
- // If a container was specified, and was not 0 or the RenderView,
- // then we should have found it by now.
- ASSERT_ARG(repaintContainer, !repaintContainer || repaintContainer == this);
ASSERT_UNUSED(wasFixed, !wasFixed || *wasFixed == (mode & IsFixed));
if (!repaintContainer && mode & UseTransforms && shouldUseTransformFromContainer(0)) {
@@ -314,6 +311,23 @@ void RenderView::mapLocalToContainer(const RenderLayerModelObject* repaintContai
if (mode & IsFixed && m_frameView)
transformState.move(m_frameView->scrollOffsetForFixedPosition());
+
+ if (repaintContainer == this)
+ return;
+
+ if (mode & TraverseDocumentBoundaries) {
+ if (RenderObject* parentDocRenderer = frame()->ownerRenderer()) {
+ transformState.move(-frame()->view()->scrollOffset());
+ if (parentDocRenderer->isBox())
+ transformState.move(toLayoutSize(toRenderBox(parentDocRenderer)->contentBoxRect().location()));
+ parentDocRenderer->mapLocalToContainer(repaintContainer, transformState, mode, wasFixed);
+ return;
+ }
+ }
+
+ // If a container was specified, and was not 0 or the RenderView,
+ // then we should have found it by now.
+ ASSERT_ARG(repaintContainer, !repaintContainer);
}
const RenderObject* RenderView::pushMappingToContainer(const RenderLayerModelObject* ancestorToStopAt, RenderGeometryMap& geometryMap) const
@@ -349,6 +363,14 @@ void RenderView::mapAbsoluteToLocalPoint(MapCoordinatesFlags mode, TransformStat
}
}
+void RenderView::computeOwnHitTestRects(Vector<IntRect>& rects, const LayoutPoint&) const
+{
+ // Record the entire size of the contents of the frame. Note that we don't just
+ // use the viewport size (containing block) here because we want to ensure this includes
+ // all children (so we can avoid walking them explicitly).
+ rects.append(IntRect(IntPoint::zero(), frameView()->contentsSize()));
+}
+
bool RenderView::requiresColumns(int desiredColumnCount) const
{
if (m_frameView)

Powered by Google App Engine
This is Rietveld 408576698