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

Side by Side Diff: third_party/WebKit/Source/core/dom/TreeScope.cpp

Issue 2387883002: Use float for scroll offset. (Closed)
Patch Set: Created 4 years, 2 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) 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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 IntPoint& point) { 213 IntPoint& point) {
214 LocalFrame* frame = document.frame(); 214 LocalFrame* frame = document.frame();
215 if (!frame) 215 if (!frame)
216 return false; 216 return false;
217 FrameView* frameView = frame->view(); 217 FrameView* frameView = frame->view();
218 if (!frameView) 218 if (!frameView)
219 return false; 219 return false;
220 220
221 FloatPoint pointInDocument(point); 221 FloatPoint pointInDocument(point);
222 pointInDocument.scale(frame->pageZoomFactor(), frame->pageZoomFactor()); 222 pointInDocument.scale(frame->pageZoomFactor(), frame->pageZoomFactor());
223 pointInDocument.moveBy(frameView->scrollPosition()); 223 pointInDocument.moveBy(FloatPoint(frameView->scrollOffset()));
bokan 2016/10/02 19:47:50 use move() instead, it takes a FloatSize
szager1 2016/10/05 07:43:36 Done.
224 IntPoint roundedPointInDocument = roundedIntPoint(pointInDocument); 224 IntPoint roundedPointInDocument = roundedIntPoint(pointInDocument);
225 225
226 if (!frameView->visibleContentRect().contains(roundedPointInDocument)) 226 if (!frameView->visibleContentRect().contains(roundedPointInDocument))
227 return false; 227 return false;
228 228
229 point = roundedPointInDocument; 229 point = roundedPointInDocument;
230 return true; 230 return true;
231 } 231 }
232 232
233 HitTestResult hitTestInDocument(const Document* document, 233 HitTestResult hitTestInDocument(const Document* document,
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 visitor->trace(m_parentTreeScope); 538 visitor->trace(m_parentTreeScope);
539 visitor->trace(m_idTargetObserverRegistry); 539 visitor->trace(m_idTargetObserverRegistry);
540 visitor->trace(m_selection); 540 visitor->trace(m_selection);
541 visitor->trace(m_elementsById); 541 visitor->trace(m_elementsById);
542 visitor->trace(m_imageMapsByName); 542 visitor->trace(m_imageMapsByName);
543 visitor->trace(m_scopedStyleResolver); 543 visitor->trace(m_scopedStyleResolver);
544 visitor->trace(m_radioButtonGroupScope); 544 visitor->trace(m_radioButtonGroupScope);
545 } 545 }
546 546
547 } // namespace blink 547 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698