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 1485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1496 if (!insideLayer) { | 1496 if (!insideLayer) { |
1497 // We didn't hit any layer. If we are the root layer and the mouse is -- or just was -- down, | 1497 // We didn't hit any layer. If we are the root layer and the mouse is -- or just was -- down, |
1498 // return ourselves. We do this so mouse events continue getting deliver ed after a drag has | 1498 // return ourselves. We do this so mouse events continue getting deliver ed after a drag has |
1499 // exited the WebView, and so hit testing over a scrollbar hits the cont ent document. | 1499 // exited the WebView, and so hit testing over a scrollbar hits the cont ent document. |
1500 // In addtion, it is possible for the mouse to stay in the document but there is no element. | 1500 // In addtion, it is possible for the mouse to stay in the document but there is no element. |
1501 // At that time, the events of the mouse should be fired. | 1501 // At that time, the events of the mouse should be fired. |
1502 // TODO(majidvp): This should apply more consistently across different e vent types and we | 1502 // TODO(majidvp): This should apply more consistently across different e vent types and we |
1503 // should not use RequestType for it. Perhaps best for it to be done at a higher level. See | 1503 // should not use RequestType for it. Perhaps best for it to be done at a higher level. See |
1504 // http://crbug.com/505825 | 1504 // http://crbug.com/505825 |
1505 LayoutPoint hitPoint = hitTestLocation.point(); | 1505 LayoutPoint hitPoint = hitTestLocation.point(); |
1506 if (!request.isChildFrameHitTest() && ((request.active() || request.rele ase()) || (request.move() && hitTestArea.contains(hitPoint.x(), hitPoint.y()))) && isRootLayer()) { | 1506 bool fallback = false; |
1507 if (!request.isChildFrameHitTest()) { | |
1508 if (((request.active() || request.release()) || (request.move() && h itTestArea.contains(hitPoint.x(), hitPoint.y()))) && isRootLayer()) | |
1509 fallback = true; | |
1510 } else { | |
1511 // Falling back to iframe's root layer is more restrict: | |
1512 // 1) It can't be rect based test. Rect based test is list based hit -testing, which should search | |
1513 // all the elements overlapping the test rect. If we set iframe i s hit due to fallback, main frame | |
1514 // will stop hit testing search, and the result list will be inco mplete. | |
Rick Byers
2015/08/17 15:18:29
So what does this mean for a tap that occurs entir
Yufeng Shen (Slow to review)
2015/08/18 16:05:21
ah, right, if the hit-rect (for tap) is totally wi
| |
1515 // 2) The hitPoint must be within the visible rect of the iframe. | |
1516 if (!hitTestLocation.isRectBasedTest() && (request.active() || reque st.release() || request.move()) && hitTestArea.contains(hitPoint.x(), hitPoint.y ()) && isRootLayer()) | |
Rick Byers
2015/08/17 15:18:29
Can you just avoid checking the hit test flags (re
Yufeng Shen (Slow to review)
2015/08/18 16:05:21
Done.
| |
1517 fallback = true; | |
1518 } | |
Rick Byers
2015/08/17 15:18:29
I think you could more clearly separate the confus
Yufeng Shen (Slow to review)
2015/08/18 16:05:21
done.
Rick Byers
2015/08/19 19:23:19
I don't think part of the test is important, in fa
majidvp
2015/08/19 21:02:30
Actually, it is there for cases where the event is
majidvp
2015/08/20 16:29:35
I took a second look and I think Rick is correct a
| |
1519 if (fallback) { | |
1507 layoutObject()->updateHitTestResult(result, toLayoutView(layoutObjec t())->flipForWritingMode(hitTestLocation.point())); | 1520 layoutObject()->updateHitTestResult(result, toLayoutView(layoutObjec t())->flipForWritingMode(hitTestLocation.point())); |
1508 insideLayer = this; | 1521 insideLayer = this; |
1509 | 1522 |
1510 // Don't cache this result since it really wasn't a true hit. | 1523 // Don't cache this result since it really wasn't a true hit. |
1511 result.setCacheable(false); | 1524 result.setCacheable(false); |
1512 } | 1525 } |
1513 } | 1526 } |
1514 | 1527 |
1515 // Now determine if the result is inside an anchor - if the urlElement isn't already set. | 1528 // Now determine if the result is inside an anchor - if the urlElement isn't already set. |
1516 Node* node = result.innerNode(); | 1529 Node* node = result.innerNode(); |
(...skipping 1143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2660 | 2673 |
2661 void showLayerTree(const blink::LayoutObject* layoutObject) | 2674 void showLayerTree(const blink::LayoutObject* layoutObject) |
2662 { | 2675 { |
2663 if (!layoutObject) { | 2676 if (!layoutObject) { |
2664 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); | 2677 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); |
2665 return; | 2678 return; |
2666 } | 2679 } |
2667 showLayerTree(layoutObject->enclosingLayer()); | 2680 showLayerTree(layoutObject->enclosingLayer()); |
2668 } | 2681 } |
2669 #endif | 2682 #endif |
OLD | NEW |