OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. |
3 * Copyright (C) 2008 Nuanti Ltd. | 3 * Copyright (C) 2008 Nuanti Ltd. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
748 | 748 |
749 if (candidate.isOffscreenAfterScrolling && candidate.alignment < Full) | 749 if (candidate.isOffscreenAfterScrolling && candidate.alignment < Full) |
750 return; | 750 return; |
751 | 751 |
752 if (closest.isNull()) { | 752 if (closest.isNull()) { |
753 closest = candidate; | 753 closest = candidate; |
754 return; | 754 return; |
755 } | 755 } |
756 | 756 |
757 LayoutRect intersectionRect = intersection(candidate.rect, closest.rect); | 757 LayoutRect intersectionRect = intersection(candidate.rect, closest.rect); |
758 if (!intersectionRect.isEmpty() && !areElementsOnSameLine(closest, candidate
)) { | 758 if (!intersectionRect.isEmpty() && !areElementsOnSameLine(closest, candidate
) |
| 759 && intersectionRect == candidate.rect) { |
759 // If 2 nodes are intersecting, do hit test to find which node in on top
. | 760 // If 2 nodes are intersecting, do hit test to find which node in on top
. |
760 LayoutUnit x = intersectionRect.x() + intersectionRect.width() / 2; | 761 LayoutUnit x = intersectionRect.x() + intersectionRect.width() / 2; |
761 LayoutUnit y = intersectionRect.y() + intersectionRect.height() / 2; | 762 LayoutUnit y = intersectionRect.y() + intersectionRect.height() / 2; |
762 HitTestResult result = candidate.visibleNode->document().page()->mainFra
me()->eventHandler().hitTestResultAtPoint(IntPoint(x, y), HitTestRequest::ReadOn
ly | HitTestRequest::Active | HitTestRequest::IgnoreClipping | HitTestRequest::C
onfusingAndOftenMisusedDisallowShadowContent); | 763 HitTestResult result = candidate.visibleNode->document().page()->mainFra
me()->eventHandler().hitTestResultAtPoint(IntPoint(x, y), HitTestRequest::ReadOn
ly | HitTestRequest::Active | HitTestRequest::IgnoreClipping | HitTestRequest::C
onfusingAndOftenMisusedDisallowShadowContent); |
763 if (candidate.visibleNode->contains(result.innerNode())) { | 764 if (candidate.visibleNode->contains(result.innerNode())) { |
764 closest = candidate; | 765 closest = candidate; |
765 return; | 766 return; |
766 } | 767 } |
767 if (closest.visibleNode->contains(result.innerNode())) | 768 if (closest.visibleNode->contains(result.innerNode())) |
768 return; | 769 return; |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
913 startingRect = nodeRectInAbsoluteCoordinates(container, true /* ignore b
order */); | 914 startingRect = nodeRectInAbsoluteCoordinates(container, true /* ignore b
order */); |
914 container = scrollableEnclosingBoxOrParentFrameForNodeInDirection(type,
container); | 915 container = scrollableEnclosingBoxOrParentFrameForNodeInDirection(type,
container); |
915 if (container && container->isDocumentNode()) | 916 if (container && container->isDocumentNode()) |
916 toDocument(container)->updateLayoutIgnorePendingStylesheets(); | 917 toDocument(container)->updateLayoutIgnorePendingStylesheets(); |
917 } while (!consumed && container); | 918 } while (!consumed && container); |
918 | 919 |
919 return consumed; | 920 return consumed; |
920 } | 921 } |
921 | 922 |
922 } // namespace WebCore | 923 } // namespace WebCore |
OLD | NEW |