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

Side by Side Diff: sky/engine/core/rendering/RenderLayer.cpp

Issue 925933004: Prune HitTestResult and stop special-casing links. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: address review comments 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/HitTestResult.cpp ('k') | sky/engine/public/BUILD.gn » ('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) 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 806 matching lines...) Expand 10 before | Expand all | Expand 10 after
817 RenderLayer* insideLayer = hitTestLayer(this, 0, request, result, hitTestAre a, hitTestLocation, false); 817 RenderLayer* insideLayer = hitTestLayer(this, 0, request, result, hitTestAre a, hitTestLocation, false);
818 if (!insideLayer) { 818 if (!insideLayer) {
819 // We didn't hit any layer. If we are the root layer and the mouse is -- or just was -- down, 819 // We didn't hit any layer. If we are the root layer and the mouse is -- or just was -- down,
820 // return ourselves. We do this so mouse events continue getting deliver ed after a drag has 820 // return ourselves. We do this so mouse events continue getting deliver ed after a drag has
821 // exited the WebView, and so hit testing over a scrollbar hits the cont ent document. 821 // exited the WebView, and so hit testing over a scrollbar hits the cont ent document.
822 if ((request.active() || request.release()) && isRootLayer()) { 822 if ((request.active() || request.release()) && isRootLayer()) {
823 renderer()->updateHitTestResult(result, hitTestLocation.point()); 823 renderer()->updateHitTestResult(result, hitTestLocation.point());
824 insideLayer = this; 824 insideLayer = this;
825 } 825 }
826 } 826 }
827
828 // Now determine if the result is inside an anchor - if the urlElement isn't already set.
829 Node* node = result.innerNode();
830 if (node && !result.URLElement())
831 result.setURLElement(node->enclosingLinkEventParentOrSelf());
832
833 // Now return whether we were inside this layer (this will always be true fo r the root
834 // layer).
835 return insideLayer; 827 return insideLayer;
836 } 828 }
837 829
838 Node* RenderLayer::enclosingElement() const 830 Node* RenderLayer::enclosingElement() const
839 { 831 {
840 for (RenderObject* r = renderer(); r; r = r->parent()) { 832 for (RenderObject* r = renderer(); r; r = r->parent()) {
841 if (Node* e = r->node()) 833 if (Node* e = r->node())
842 return e; 834 return e;
843 } 835 }
844 ASSERT_NOT_REACHED(); 836 ASSERT_NOT_REACHED();
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after
1436 } 1428 }
1437 } 1429 }
1438 1430
1439 void showLayerTree(const blink::RenderObject* renderer) 1431 void showLayerTree(const blink::RenderObject* renderer)
1440 { 1432 {
1441 if (!renderer) 1433 if (!renderer)
1442 return; 1434 return;
1443 showLayerTree(renderer->enclosingLayer()); 1435 showLayerTree(renderer->enclosingLayer());
1444 } 1436 }
1445 #endif 1437 #endif
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/HitTestResult.cpp ('k') | sky/engine/public/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698