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

Side by Side Diff: Source/core/testing/Internals.cpp

Issue 967213004: Removed FrameView's windowToContents and contentsToWindow methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Addressed rbyers@ feedback (minus tests) Created 5 years, 9 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
OLDNEW
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 961 matching lines...) Expand 10 before | Expand all | Expand 10 after
972 exceptionState.throwDOMException(InvalidAccessError, "The document provi ded is invalid."); 972 exceptionState.throwDOMException(InvalidAccessError, "The document provi ded is invalid.");
973 return 0; 973 return 0;
974 } 974 }
975 975
976 document->updateLayout(); 976 document->updateLayout();
977 977
978 IntSize radius(width / 2, height / 2); 978 IntSize radius(width / 2, height / 2);
979 IntPoint point(x + radius.width(), y + radius.height()); 979 IntPoint point(x + radius.width(), y + radius.height());
980 980
981 EventHandler& eventHandler = document->frame()->eventHandler(); 981 EventHandler& eventHandler = document->frame()->eventHandler();
982 IntPoint hitTestPoint = document->frame()->view()->windowToContents(point); 982 IntPoint hitTestPoint = document->frame()->view()->rootFrameToContents(point );
983 HitTestResult result = eventHandler.hitTestResultAtPoint(hitTestPoint, HitTe stRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::ListBased, Layout Size(radius)); 983 HitTestResult result = eventHandler.hitTestResultAtPoint(hitTestPoint, HitTe stRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::ListBased, Layout Size(radius));
984 984
985 Node* targetNode = 0; 985 Node* targetNode = 0;
986 IntPoint adjustedPoint; 986 IntPoint adjustedPoint;
987 987
988 bool foundNode = eventHandler.bestClickableNodeForHitTestResult(result, adju stedPoint, targetNode); 988 bool foundNode = eventHandler.bestClickableNodeForHitTestResult(result, adju stedPoint, targetNode);
989 if (foundNode) 989 if (foundNode)
990 return DOMPoint::create(adjustedPoint.x(), adjustedPoint.y()); 990 return DOMPoint::create(adjustedPoint.x(), adjustedPoint.y());
991 991
992 return 0; 992 return 0;
993 } 993 }
994 994
995 Node* Internals::touchNodeAdjustedToBestClickableNode(long x, long y, long width , long height, Document* document, ExceptionState& exceptionState) 995 Node* Internals::touchNodeAdjustedToBestClickableNode(long x, long y, long width , long height, Document* document, ExceptionState& exceptionState)
996 { 996 {
997 ASSERT(document); 997 ASSERT(document);
998 if (!document->frame()) { 998 if (!document->frame()) {
999 exceptionState.throwDOMException(InvalidAccessError, "The document provi ded is invalid."); 999 exceptionState.throwDOMException(InvalidAccessError, "The document provi ded is invalid.");
1000 return 0; 1000 return 0;
1001 } 1001 }
1002 1002
1003 document->updateLayout(); 1003 document->updateLayout();
1004 1004
1005 IntSize radius(width / 2, height / 2); 1005 IntSize radius(width / 2, height / 2);
1006 IntPoint point(x + radius.width(), y + radius.height()); 1006 IntPoint point(x + radius.width(), y + radius.height());
1007 1007
1008 EventHandler& eventHandler = document->frame()->eventHandler(); 1008 EventHandler& eventHandler = document->frame()->eventHandler();
1009 IntPoint hitTestPoint = document->frame()->view()->windowToContents(point); 1009 IntPoint hitTestPoint = document->frame()->view()->rootFrameToContents(point );
1010 HitTestResult result = eventHandler.hitTestResultAtPoint(hitTestPoint, HitTe stRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::ListBased, Layout Size(radius)); 1010 HitTestResult result = eventHandler.hitTestResultAtPoint(hitTestPoint, HitTe stRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::ListBased, Layout Size(radius));
1011 1011
1012 Node* targetNode = 0; 1012 Node* targetNode = 0;
1013 IntPoint adjustedPoint; 1013 IntPoint adjustedPoint;
1014 document->frame()->eventHandler().bestClickableNodeForHitTestResult(result, adjustedPoint, targetNode); 1014 document->frame()->eventHandler().bestClickableNodeForHitTestResult(result, adjustedPoint, targetNode);
1015 return targetNode; 1015 return targetNode;
1016 } 1016 }
1017 1017
1018 DOMPoint* Internals::touchPositionAdjustedToBestContextMenuNode(long x, long y, long width, long height, Document* document, ExceptionState& exceptionState) 1018 DOMPoint* Internals::touchPositionAdjustedToBestContextMenuNode(long x, long y, long width, long height, Document* document, ExceptionState& exceptionState)
1019 { 1019 {
1020 ASSERT(document); 1020 ASSERT(document);
1021 if (!document->frame()) { 1021 if (!document->frame()) {
1022 exceptionState.throwDOMException(InvalidAccessError, "The document provi ded is invalid."); 1022 exceptionState.throwDOMException(InvalidAccessError, "The document provi ded is invalid.");
1023 return 0; 1023 return 0;
1024 } 1024 }
1025 1025
1026 document->updateLayout(); 1026 document->updateLayout();
1027 1027
1028 IntSize radius(width / 2, height / 2); 1028 IntSize radius(width / 2, height / 2);
1029 IntPoint point(x + radius.width(), y + radius.height()); 1029 IntPoint point(x + radius.width(), y + radius.height());
1030 1030
1031 EventHandler& eventHandler = document->frame()->eventHandler(); 1031 EventHandler& eventHandler = document->frame()->eventHandler();
1032 IntPoint hitTestPoint = document->frame()->view()->windowToContents(point); 1032 IntPoint hitTestPoint = document->frame()->view()->rootFrameToContents(point );
1033 HitTestResult result = eventHandler.hitTestResultAtPoint(hitTestPoint, HitTe stRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::ListBased, Layout Size(radius)); 1033 HitTestResult result = eventHandler.hitTestResultAtPoint(hitTestPoint, HitTe stRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::ListBased, Layout Size(radius));
1034 1034
1035 Node* targetNode = 0; 1035 Node* targetNode = 0;
1036 IntPoint adjustedPoint; 1036 IntPoint adjustedPoint;
1037 1037
1038 bool foundNode = eventHandler.bestContextMenuNodeForHitTestResult(result, ad justedPoint, targetNode); 1038 bool foundNode = eventHandler.bestContextMenuNodeForHitTestResult(result, ad justedPoint, targetNode);
1039 if (foundNode) 1039 if (foundNode)
1040 return DOMPoint::create(adjustedPoint.x(), adjustedPoint.y()); 1040 return DOMPoint::create(adjustedPoint.x(), adjustedPoint.y());
1041 1041
1042 return DOMPoint::create(x, y); 1042 return DOMPoint::create(x, y);
1043 } 1043 }
1044 1044
1045 Node* Internals::touchNodeAdjustedToBestContextMenuNode(long x, long y, long wid th, long height, Document* document, ExceptionState& exceptionState) 1045 Node* Internals::touchNodeAdjustedToBestContextMenuNode(long x, long y, long wid th, long height, Document* document, ExceptionState& exceptionState)
1046 { 1046 {
1047 ASSERT(document); 1047 ASSERT(document);
1048 if (!document->frame()) { 1048 if (!document->frame()) {
1049 exceptionState.throwDOMException(InvalidAccessError, "The document provi ded is invalid."); 1049 exceptionState.throwDOMException(InvalidAccessError, "The document provi ded is invalid.");
1050 return 0; 1050 return 0;
1051 } 1051 }
1052 1052
1053 document->updateLayout(); 1053 document->updateLayout();
1054 1054
1055 IntSize radius(width / 2, height / 2); 1055 IntSize radius(width / 2, height / 2);
1056 IntPoint point(x + radius.width(), y + radius.height()); 1056 IntPoint point(x + radius.width(), y + radius.height());
1057 1057
1058 EventHandler& eventHandler = document->frame()->eventHandler(); 1058 EventHandler& eventHandler = document->frame()->eventHandler();
1059 IntPoint hitTestPoint = document->frame()->view()->windowToContents(point); 1059 IntPoint hitTestPoint = document->frame()->view()->rootFrameToContents(point );
1060 HitTestResult result = eventHandler.hitTestResultAtPoint(hitTestPoint, HitTe stRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::ListBased, Layout Size(radius)); 1060 HitTestResult result = eventHandler.hitTestResultAtPoint(hitTestPoint, HitTe stRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::ListBased, Layout Size(radius));
1061 1061
1062 Node* targetNode = 0; 1062 Node* targetNode = 0;
1063 IntPoint adjustedPoint; 1063 IntPoint adjustedPoint;
1064 eventHandler.bestContextMenuNodeForHitTestResult(result, adjustedPoint, targ etNode); 1064 eventHandler.bestContextMenuNodeForHitTestResult(result, adjustedPoint, targ etNode);
1065 return targetNode; 1065 return targetNode;
1066 } 1066 }
1067 1067
1068 PassRefPtrWillBeRawPtr<ClientRect> Internals::bestZoomableAreaForTouchPoint(long x, long y, long width, long height, Document* document, ExceptionState& excepti onState) 1068 PassRefPtrWillBeRawPtr<ClientRect> Internals::bestZoomableAreaForTouchPoint(long x, long y, long width, long height, Document* document, ExceptionState& excepti onState)
1069 { 1069 {
(...skipping 1247 matching lines...) Expand 10 before | Expand all | Expand 10 after
2317 { 2317 {
2318 ThreadState::current()->setGCState(ThreadState::GCScheduledForTesting); 2318 ThreadState::current()->setGCState(ThreadState::GCScheduledForTesting);
2319 } 2319 }
2320 2320
2321 ValueIterable<int>::IterationSource* Internals::startIteration(ScriptState*, Exc eptionState&) 2321 ValueIterable<int>::IterationSource* Internals::startIteration(ScriptState*, Exc eptionState&)
2322 { 2322 {
2323 return new InternalsIterationSource(); 2323 return new InternalsIterationSource();
2324 } 2324 }
2325 2325
2326 } // namespace blink 2326 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698