OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. |
3 * | 3 * |
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
5 * | 5 * |
6 * Other contributors: | 6 * Other contributors: |
7 * Robert O'Callahan <roc+@cs.cmu.edu> | 7 * Robert O'Callahan <roc+@cs.cmu.edu> |
8 * David Baron <dbaron@fas.harvard.edu> | 8 * David Baron <dbaron@fas.harvard.edu> |
9 * Christian Biesinger <cbiesinger@web.de> | 9 * Christian Biesinger <cbiesinger@web.de> |
10 * Randall Jesup <rjesup@wgate.com> | 10 * Randall Jesup <rjesup@wgate.com> |
(...skipping 4310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4321 | 4321 |
4322 bool RenderLayer::hitTest(const HitTestRequest& request, HitTestResult& result) | 4322 bool RenderLayer::hitTest(const HitTestRequest& request, HitTestResult& result) |
4323 { | 4323 { |
4324 return hitTest(request, result.hitTestLocation(), result); | 4324 return hitTest(request, result.hitTestLocation(), result); |
4325 } | 4325 } |
4326 | 4326 |
4327 bool RenderLayer::hitTest(const HitTestRequest& request, const HitTestLocation&
hitTestLocation, HitTestResult& result) | 4327 bool RenderLayer::hitTest(const HitTestRequest& request, const HitTestLocation&
hitTestLocation, HitTestResult& result) |
4328 { | 4328 { |
4329 ASSERT(isSelfPaintingLayer() || hasSelfPaintingLayerDescendant()); | 4329 ASSERT(isSelfPaintingLayer() || hasSelfPaintingLayerDescendant()); |
4330 | 4330 |
4331 renderer()->document()->updateLayout(); | 4331 // RenderView should make sure to update layout before entering hit testing |
4332 | 4332 ASSERT(!renderer()->frame()->view()->layoutPending()); |
| 4333 ASSERT(!renderer()->document()->renderer()->needsLayout()); |
| 4334 |
4333 LayoutRect hitTestArea = isOutOfFlowRenderFlowThread() ? toRenderFlowThread(
renderer())->borderBoxRect() : renderer()->view()->documentRect(); | 4335 LayoutRect hitTestArea = isOutOfFlowRenderFlowThread() ? toRenderFlowThread(
renderer())->borderBoxRect() : renderer()->view()->documentRect(); |
4334 if (!request.ignoreClipping()) | 4336 if (!request.ignoreClipping()) |
4335 hitTestArea.intersect(frameVisibleRect(renderer())); | 4337 hitTestArea.intersect(frameVisibleRect(renderer())); |
4336 | 4338 |
4337 RenderLayer* insideLayer = hitTestLayer(this, 0, request, result, hitTestAre
a, hitTestLocation, false); | 4339 RenderLayer* insideLayer = hitTestLayer(this, 0, request, result, hitTestAre
a, hitTestLocation, false); |
4338 if (!insideLayer) { | 4340 if (!insideLayer) { |
4339 // We didn't hit any layer. If we are the root layer and the mouse is --
or just was -- down, | 4341 // We didn't hit any layer. If we are the root layer and the mouse is --
or just was -- down, |
4340 // return ourselves. We do this so mouse events continue getting deliver
ed after a drag has | 4342 // return ourselves. We do this so mouse events continue getting deliver
ed after a drag has |
4341 // exited the WebView, and so hit testing over a scrollbar hits the cont
ent document. | 4343 // exited the WebView, and so hit testing over a scrollbar hits the cont
ent document. |
4342 if (!request.isChildFrameHitTest() && (request.active() || request.relea
se()) && isRootLayer()) { | 4344 if (!request.isChildFrameHitTest() && (request.active() || request.relea
se()) && isRootLayer()) { |
(...skipping 2123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6466 } | 6468 } |
6467 } | 6469 } |
6468 | 6470 |
6469 void showLayerTree(const WebCore::RenderObject* renderer) | 6471 void showLayerTree(const WebCore::RenderObject* renderer) |
6470 { | 6472 { |
6471 if (!renderer) | 6473 if (!renderer) |
6472 return; | 6474 return; |
6473 showLayerTree(renderer->enclosingLayer()); | 6475 showLayerTree(renderer->enclosingLayer()); |
6474 } | 6476 } |
6475 #endif | 6477 #endif |
OLD | NEW |