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

Side by Side Diff: Source/core/frame/PinchViewport.cpp

Issue 1178273008: Fix PinchViewport::visibleRectInDocument (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « no previous file | Source/web/tests/PinchViewportTest.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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 { 139 {
140 return FloatRect(location(), visibleSize()); 140 return FloatRect(location(), visibleSize());
141 } 141 }
142 142
143 FloatRect PinchViewport::visibleRectInDocument() const 143 FloatRect PinchViewport::visibleRectInDocument() const
144 { 144 {
145 if (!mainFrame() || !mainFrame()->view()) 145 if (!mainFrame() || !mainFrame()->view())
146 return FloatRect(); 146 return FloatRect();
147 147
148 FloatPoint viewLocation = FloatPoint(mainFrame()->view()->scrollableArea()-> scrollPositionDouble()); 148 FloatPoint viewLocation = FloatPoint(mainFrame()->view()->scrollableArea()-> scrollPositionDouble());
149 FloatRect pinchRect = visibleRect(); 149 return FloatRect(viewLocation, visibleSize());
150 pinchRect.moveBy(viewLocation);
151 return pinchRect;
152 } 150 }
153 151
154 FloatRect PinchViewport::mainViewToViewportCSSPixels(const FloatRect& rect) cons t 152 FloatRect PinchViewport::mainViewToViewportCSSPixels(const FloatRect& rect) cons t
155 { 153 {
156 // Note, this is in CSS Pixels so we don't apply scale. 154 // Note, this is in CSS Pixels so we don't apply scale.
157 FloatRect rectInViewport = rect; 155 FloatRect rectInViewport = rect;
158 rectInViewport.moveBy(-location()); 156 rectInViewport.moveBy(-location());
159 return rectInViewport; 157 return rectInViewport;
160 } 158 }
161 159
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 } else if (graphicsLayer == m_rootTransformLayer) { 650 } else if (graphicsLayer == m_rootTransformLayer) {
653 name = "Root Transform Layer"; 651 name = "Root Transform Layer";
654 } else { 652 } else {
655 ASSERT_NOT_REACHED(); 653 ASSERT_NOT_REACHED();
656 } 654 }
657 655
658 return name; 656 return name;
659 } 657 }
660 658
661 } // namespace blink 659 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/web/tests/PinchViewportTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698