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

Side by Side Diff: sky/engine/core/dom/TreeScope.cpp

Issue 714013002: Remove some more zoom-related code. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: merge to ToT Created 6 years, 1 month 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
« no previous file with comments | « sky/engine/core/dom/Touch.cpp ('k') | sky/engine/core/events/MouseRelatedEvent.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « sky/engine/core/dom/Touch.cpp ('k') | sky/engine/core/events/MouseRelatedEvent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698