| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All Rights Reserved. | 2 * Copyright (C) 2011 Google Inc. All Rights Reserved. |
| 3 * Copyright (C) 2012 Apple Inc. All rights reserved. | 3 * Copyright (C) 2012 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 * 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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 HitTestResult hitTestInDocument(const Document* document, int x, int y) | 191 HitTestResult hitTestInDocument(const Document* document, int x, int y) |
| 192 { | 192 { |
| 193 LocalFrame* frame = document->frame(); | 193 LocalFrame* frame = document->frame(); |
| 194 | 194 |
| 195 if (!frame) | 195 if (!frame) |
| 196 return HitTestResult(); | 196 return HitTestResult(); |
| 197 FrameView* frameView = frame->view(); | 197 FrameView* frameView = frame->view(); |
| 198 if (!frameView) | 198 if (!frameView) |
| 199 return HitTestResult(); | 199 return HitTestResult(); |
| 200 | 200 |
| 201 float scaleFactor = frame->pageZoomFactor(); | 201 IntPoint point(x, y); |
| 202 IntPoint point = roundedIntPoint(FloatPoint(x * scaleFactor, y * scaleFactor
)); | |
| 203 | |
| 204 if (!frameView->visibleContentRect().contains(point)) | 202 if (!frameView->visibleContentRect().contains(point)) |
| 205 return HitTestResult(); | 203 return HitTestResult(); |
| 206 | 204 |
| 207 HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active); | 205 HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active); |
| 208 HitTestResult result(point); | 206 HitTestResult result(point); |
| 209 document->renderView()->hitTest(request, result); | 207 document->renderView()->hitTest(request, result); |
| 210 return result; | 208 return result; |
| 211 } | 209 } |
| 212 | 210 |
| 213 Element* TreeScope::elementFromPoint(int x, int y) const | 211 Element* TreeScope::elementFromPoint(int x, int y) const |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 visitor->trace(m_document); | 439 visitor->trace(m_document); |
| 442 visitor->trace(m_parentTreeScope); | 440 visitor->trace(m_parentTreeScope); |
| 443 visitor->trace(m_selection); | 441 visitor->trace(m_selection); |
| 444 visitor->trace(m_elementsById); | 442 visitor->trace(m_elementsById); |
| 445 visitor->trace(m_imageMapsByName); | 443 visitor->trace(m_imageMapsByName); |
| 446 visitor->trace(m_labelsByForAttribute); | 444 visitor->trace(m_labelsByForAttribute); |
| 447 visitor->trace(m_scopedStyleResolver); | 445 visitor->trace(m_scopedStyleResolver); |
| 448 } | 446 } |
| 449 | 447 |
| 450 } // namespace blink | 448 } // namespace blink |
| OLD | NEW |