| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2013 Apple Inc. All rights reserved. | 3 * Copyright (C) 2013 Apple Inc. All rights reserved. |
| 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 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 970 exceptionState.throwDOMException(InvalidAccessError, "The document provi
ded is invalid."); | 970 exceptionState.throwDOMException(InvalidAccessError, "The document provi
ded is invalid."); |
| 971 return 0; | 971 return 0; |
| 972 } | 972 } |
| 973 | 973 |
| 974 document->updateLayout(); | 974 document->updateLayout(); |
| 975 | 975 |
| 976 IntSize radius(width / 2, height / 2); | 976 IntSize radius(width / 2, height / 2); |
| 977 IntPoint point(x + radius.width(), y + radius.height()); | 977 IntPoint point(x + radius.width(), y + radius.height()); |
| 978 | 978 |
| 979 EventHandler& eventHandler = document->frame()->eventHandler(); | 979 EventHandler& eventHandler = document->frame()->eventHandler(); |
| 980 IntPoint hitTestPoint = document->frame()->view()->windowToContents(point); | 980 IntPoint hitTestPoint = document->frame()->view()->rootFrameToContents(point
); |
| 981 HitTestResult result = eventHandler.hitTestResultAtPoint(hitTestPoint, HitTe
stRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::ListBased, Layout
Size(radius)); | 981 HitTestResult result = eventHandler.hitTestResultAtPoint(hitTestPoint, HitTe
stRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::ListBased, Layout
Size(radius)); |
| 982 | 982 |
| 983 Node* targetNode = 0; | 983 Node* targetNode = 0; |
| 984 IntPoint adjustedPoint; | 984 IntPoint adjustedPoint; |
| 985 | 985 |
| 986 bool foundNode = eventHandler.bestClickableNodeForHitTestResult(result, adju
stedPoint, targetNode); | 986 bool foundNode = eventHandler.bestClickableNodeForHitTestResult(result, adju
stedPoint, targetNode); |
| 987 if (foundNode) | 987 if (foundNode) |
| 988 return DOMPoint::create(adjustedPoint.x(), adjustedPoint.y()); | 988 return DOMPoint::create(adjustedPoint.x(), adjustedPoint.y()); |
| 989 | 989 |
| 990 return 0; | 990 return 0; |
| 991 } | 991 } |
| 992 | 992 |
| 993 Node* Internals::touchNodeAdjustedToBestClickableNode(long x, long y, long width
, long height, Document* document, ExceptionState& exceptionState) | 993 Node* Internals::touchNodeAdjustedToBestClickableNode(long x, long y, long width
, long height, Document* document, ExceptionState& exceptionState) |
| 994 { | 994 { |
| 995 ASSERT(document); | 995 ASSERT(document); |
| 996 if (!document->frame()) { | 996 if (!document->frame()) { |
| 997 exceptionState.throwDOMException(InvalidAccessError, "The document provi
ded is invalid."); | 997 exceptionState.throwDOMException(InvalidAccessError, "The document provi
ded is invalid."); |
| 998 return 0; | 998 return 0; |
| 999 } | 999 } |
| 1000 | 1000 |
| 1001 document->updateLayout(); | 1001 document->updateLayout(); |
| 1002 | 1002 |
| 1003 IntSize radius(width / 2, height / 2); | 1003 IntSize radius(width / 2, height / 2); |
| 1004 IntPoint point(x + radius.width(), y + radius.height()); | 1004 IntPoint point(x + radius.width(), y + radius.height()); |
| 1005 | 1005 |
| 1006 EventHandler& eventHandler = document->frame()->eventHandler(); | 1006 EventHandler& eventHandler = document->frame()->eventHandler(); |
| 1007 IntPoint hitTestPoint = document->frame()->view()->windowToContents(point); | 1007 IntPoint hitTestPoint = document->frame()->view()->rootFrameToContents(point
); |
| 1008 HitTestResult result = eventHandler.hitTestResultAtPoint(hitTestPoint, HitTe
stRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::ListBased, Layout
Size(radius)); | 1008 HitTestResult result = eventHandler.hitTestResultAtPoint(hitTestPoint, HitTe
stRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::ListBased, Layout
Size(radius)); |
| 1009 | 1009 |
| 1010 Node* targetNode = 0; | 1010 Node* targetNode = 0; |
| 1011 IntPoint adjustedPoint; | 1011 IntPoint adjustedPoint; |
| 1012 document->frame()->eventHandler().bestClickableNodeForHitTestResult(result,
adjustedPoint, targetNode); | 1012 document->frame()->eventHandler().bestClickableNodeForHitTestResult(result,
adjustedPoint, targetNode); |
| 1013 return targetNode; | 1013 return targetNode; |
| 1014 } | 1014 } |
| 1015 | 1015 |
| 1016 DOMPoint* Internals::touchPositionAdjustedToBestContextMenuNode(long x, long y,
long width, long height, Document* document, ExceptionState& exceptionState) | 1016 DOMPoint* Internals::touchPositionAdjustedToBestContextMenuNode(long x, long y,
long width, long height, Document* document, ExceptionState& exceptionState) |
| 1017 { | 1017 { |
| 1018 ASSERT(document); | 1018 ASSERT(document); |
| 1019 if (!document->frame()) { | 1019 if (!document->frame()) { |
| 1020 exceptionState.throwDOMException(InvalidAccessError, "The document provi
ded is invalid."); | 1020 exceptionState.throwDOMException(InvalidAccessError, "The document provi
ded is invalid."); |
| 1021 return 0; | 1021 return 0; |
| 1022 } | 1022 } |
| 1023 | 1023 |
| 1024 document->updateLayout(); | 1024 document->updateLayout(); |
| 1025 | 1025 |
| 1026 IntSize radius(width / 2, height / 2); | 1026 IntSize radius(width / 2, height / 2); |
| 1027 IntPoint point(x + radius.width(), y + radius.height()); | 1027 IntPoint point(x + radius.width(), y + radius.height()); |
| 1028 | 1028 |
| 1029 EventHandler& eventHandler = document->frame()->eventHandler(); | 1029 EventHandler& eventHandler = document->frame()->eventHandler(); |
| 1030 IntPoint hitTestPoint = document->frame()->view()->windowToContents(point); | 1030 IntPoint hitTestPoint = document->frame()->view()->rootFrameToContents(point
); |
| 1031 HitTestResult result = eventHandler.hitTestResultAtPoint(hitTestPoint, HitTe
stRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::ListBased, Layout
Size(radius)); | 1031 HitTestResult result = eventHandler.hitTestResultAtPoint(hitTestPoint, HitTe
stRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::ListBased, Layout
Size(radius)); |
| 1032 | 1032 |
| 1033 Node* targetNode = 0; | 1033 Node* targetNode = 0; |
| 1034 IntPoint adjustedPoint; | 1034 IntPoint adjustedPoint; |
| 1035 | 1035 |
| 1036 bool foundNode = eventHandler.bestContextMenuNodeForHitTestResult(result, ad
justedPoint, targetNode); | 1036 bool foundNode = eventHandler.bestContextMenuNodeForHitTestResult(result, ad
justedPoint, targetNode); |
| 1037 if (foundNode) | 1037 if (foundNode) |
| 1038 return DOMPoint::create(adjustedPoint.x(), adjustedPoint.y()); | 1038 return DOMPoint::create(adjustedPoint.x(), adjustedPoint.y()); |
| 1039 | 1039 |
| 1040 return DOMPoint::create(x, y); | 1040 return DOMPoint::create(x, y); |
| 1041 } | 1041 } |
| 1042 | 1042 |
| 1043 Node* Internals::touchNodeAdjustedToBestContextMenuNode(long x, long y, long wid
th, long height, Document* document, ExceptionState& exceptionState) | 1043 Node* Internals::touchNodeAdjustedToBestContextMenuNode(long x, long y, long wid
th, long height, Document* document, ExceptionState& exceptionState) |
| 1044 { | 1044 { |
| 1045 ASSERT(document); | 1045 ASSERT(document); |
| 1046 if (!document->frame()) { | 1046 if (!document->frame()) { |
| 1047 exceptionState.throwDOMException(InvalidAccessError, "The document provi
ded is invalid."); | 1047 exceptionState.throwDOMException(InvalidAccessError, "The document provi
ded is invalid."); |
| 1048 return 0; | 1048 return 0; |
| 1049 } | 1049 } |
| 1050 | 1050 |
| 1051 document->updateLayout(); | 1051 document->updateLayout(); |
| 1052 | 1052 |
| 1053 IntSize radius(width / 2, height / 2); | 1053 IntSize radius(width / 2, height / 2); |
| 1054 IntPoint point(x + radius.width(), y + radius.height()); | 1054 IntPoint point(x + radius.width(), y + radius.height()); |
| 1055 | 1055 |
| 1056 EventHandler& eventHandler = document->frame()->eventHandler(); | 1056 EventHandler& eventHandler = document->frame()->eventHandler(); |
| 1057 IntPoint hitTestPoint = document->frame()->view()->windowToContents(point); | 1057 IntPoint hitTestPoint = document->frame()->view()->rootFrameToContents(point
); |
| 1058 HitTestResult result = eventHandler.hitTestResultAtPoint(hitTestPoint, HitTe
stRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::ListBased, Layout
Size(radius)); | 1058 HitTestResult result = eventHandler.hitTestResultAtPoint(hitTestPoint, HitTe
stRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::ListBased, Layout
Size(radius)); |
| 1059 | 1059 |
| 1060 Node* targetNode = 0; | 1060 Node* targetNode = 0; |
| 1061 IntPoint adjustedPoint; | 1061 IntPoint adjustedPoint; |
| 1062 eventHandler.bestContextMenuNodeForHitTestResult(result, adjustedPoint, targ
etNode); | 1062 eventHandler.bestContextMenuNodeForHitTestResult(result, adjustedPoint, targ
etNode); |
| 1063 return targetNode; | 1063 return targetNode; |
| 1064 } | 1064 } |
| 1065 | 1065 |
| 1066 PassRefPtrWillBeRawPtr<ClientRect> Internals::bestZoomableAreaForTouchPoint(long
x, long y, long width, long height, Document* document, ExceptionState& excepti
onState) | 1066 PassRefPtrWillBeRawPtr<ClientRect> Internals::bestZoomableAreaForTouchPoint(long
x, long y, long width, long height, Document* document, ExceptionState& excepti
onState) |
| 1067 { | 1067 { |
| (...skipping 1257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2325 { | 2325 { |
| 2326 return frame()->selection().selectedTextForClipboard(); | 2326 return frame()->selection().selectedTextForClipboard(); |
| 2327 } | 2327 } |
| 2328 | 2328 |
| 2329 ValueIterable<int>::IterationSource* Internals::startIteration(ScriptState*, Exc
eptionState&) | 2329 ValueIterable<int>::IterationSource* Internals::startIteration(ScriptState*, Exc
eptionState&) |
| 2330 { | 2330 { |
| 2331 return new InternalsIterationSource(); | 2331 return new InternalsIterationSource(); |
| 2332 } | 2332 } |
| 2333 | 2333 |
| 2334 } // namespace blink | 2334 } // namespace blink |
| OLD | NEW |