OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 1168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1179 IntPoint point = mainFrameImpl()->frameView()->rootFrameToContents(IntPoint(
pointInRootFrame.x, pointInRootFrame.y)); | 1179 IntPoint point = mainFrameImpl()->frameView()->rootFrameToContents(IntPoint(
pointInRootFrame.x, pointInRootFrame.y)); |
1180 HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitT
estRequest::Active | (ignoreClipping ? HitTestRequest::IgnoreClipping : 0); | 1180 HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitT
estRequest::Active | (ignoreClipping ? HitTestRequest::IgnoreClipping : 0); |
1181 HitTestResult result = mainFrameImpl()->frame()->eventHandler().hitTestResul
tAtPoint(point, hitType); | 1181 HitTestResult result = mainFrameImpl()->frame()->eventHandler().hitTestResul
tAtPoint(point, hitType); |
1182 result.setToShadowHostIfInUserAgentShadowRoot(); | 1182 result.setToShadowHostIfInUserAgentShadowRoot(); |
1183 | 1183 |
1184 Node* node = result.innerNodeOrImageMapImage(); | 1184 Node* node = result.innerNodeOrImageMapImage(); |
1185 if (!node) | 1185 if (!node) |
1186 return WebRect(); | 1186 return WebRect(); |
1187 | 1187 |
1188 // Find the block type node based on the hit node. | 1188 // Find the block type node based on the hit node. |
1189 // FIXME: This wants to walk composed tree with LayoutTreeBuilderTraversal::
parent(). | 1189 // FIXME: This wants to walk flat tree with LayoutTreeBuilderTraversal::pare
nt(). |
1190 while (node && (!node->layoutObject() || node->layoutObject()->isInline())) | 1190 while (node && (!node->layoutObject() || node->layoutObject()->isInline())) |
1191 node = LayoutTreeBuilderTraversal::parent(*node); | 1191 node = LayoutTreeBuilderTraversal::parent(*node); |
1192 | 1192 |
1193 // Return the bounding box in the root frame's coordinate space. | 1193 // Return the bounding box in the root frame's coordinate space. |
1194 if (node) { | 1194 if (node) { |
1195 IntRect pointInRootFrame = node->Node::pixelSnappedBoundingBox(); | 1195 IntRect pointInRootFrame = node->Node::pixelSnappedBoundingBox(); |
1196 LocalFrame* frame = node->document().frame(); | 1196 LocalFrame* frame = node->document().frame(); |
1197 return frame->view()->contentsToRootFrame(pointInRootFrame); | 1197 return frame->view()->contentsToRootFrame(pointInRootFrame); |
1198 } | 1198 } |
1199 return WebRect(); | 1199 return WebRect(); |
(...skipping 3363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4563 { | 4563 { |
4564 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa
ctor rather than | 4564 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa
ctor rather than |
4565 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. | 4565 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. |
4566 if (!page()) | 4566 if (!page()) |
4567 return 1; | 4567 return 1; |
4568 | 4568 |
4569 return page()->deviceScaleFactor(); | 4569 return page()->deviceScaleFactor(); |
4570 } | 4570 } |
4571 | 4571 |
4572 } // namespace blink | 4572 } // namespace blink |
OLD | NEW |