| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> | 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> |
| 3 * 1999 Lars Knoll <knoll@kde.org> | 3 * 1999 Lars Knoll <knoll@kde.org> |
| 4 * 1999 Antti Koivisto <koivisto@kde.org> | 4 * 1999 Antti Koivisto <koivisto@kde.org> |
| 5 * 2000 Dirk Mueller <mueller@kde.org> | 5 * 2000 Dirk Mueller <mueller@kde.org> |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
| 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
| 9 * Copyright (C) 2009 Google Inc. All rights reserved. | 9 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 10 * | 10 * |
| (...skipping 1513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1524 void FrameView::scrollElementToRect(Element* element, const IntRect& rect) | 1524 void FrameView::scrollElementToRect(Element* element, const IntRect& rect) |
| 1525 { | 1525 { |
| 1526 // FIXME(http://crbug.com/371896) - This method shouldn't be manually doing | 1526 // FIXME(http://crbug.com/371896) - This method shouldn't be manually doing |
| 1527 // coordinate transformations to the PinchViewport. | 1527 // coordinate transformations to the PinchViewport. |
| 1528 IntRect targetRect(rect); | 1528 IntRect targetRect(rect); |
| 1529 | 1529 |
| 1530 m_frame->document()->updateLayoutIgnorePendingStylesheets(); | 1530 m_frame->document()->updateLayoutIgnorePendingStylesheets(); |
| 1531 | 1531 |
| 1532 bool pinchVirtualViewportEnabled = m_frame->settings()->pinchVirtualViewport
Enabled(); | 1532 bool pinchVirtualViewportEnabled = m_frame->settings()->pinchVirtualViewport
Enabled(); |
| 1533 | 1533 |
| 1534 // FIXME: This needs an isMainFrame() check as well. crbug.com/378776. |
| 1534 if (pinchVirtualViewportEnabled) { | 1535 if (pinchVirtualViewportEnabled) { |
| 1535 PinchViewport& pinchViewport = m_frame->page()->frameHost().pinchViewpor
t(); | 1536 PinchViewport& pinchViewport = m_frame->page()->frameHost().pinchViewpor
t(); |
| 1536 | 1537 |
| 1537 IntSize pinchViewportSize = expandedIntSize(pinchViewport.visibleRect().
size()); | 1538 IntSize pinchViewportSize = expandedIntSize(pinchViewport.visibleRect().
size()); |
| 1538 targetRect.moveBy(ceiledIntPoint(pinchViewport.visibleRect().location())
); | 1539 targetRect.moveBy(ceiledIntPoint(pinchViewport.visibleRect().location())
); |
| 1539 targetRect.setSize(pinchViewportSize.shrunkTo(targetRect.size())); | 1540 targetRect.setSize(pinchViewportSize.shrunkTo(targetRect.size())); |
| 1540 } | 1541 } |
| 1541 | 1542 |
| 1542 LayoutRect bounds = element->boundingBox(); | 1543 LayoutRect bounds = element->boundingBox(); |
| 1543 int centeringOffsetX = (targetRect.width() - bounds.width()) / 2; | 1544 int centeringOffsetX = (targetRect.width() - bounds.width()) / 2; |
| (...skipping 2453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3997 return; | 3998 return; |
| 3998 | 3999 |
| 3999 ScrollableArea::setScrollOrigin(origin); | 4000 ScrollableArea::setScrollOrigin(origin); |
| 4000 | 4001 |
| 4001 // Update if the scroll origin changes, since our position will be different
if the content size did not change. | 4002 // Update if the scroll origin changes, since our position will be different
if the content size did not change. |
| 4002 if (updatePositionAtAll && updatePositionSynchronously) | 4003 if (updatePositionAtAll && updatePositionSynchronously) |
| 4003 updateScrollbars(scrollOffsetDouble()); | 4004 updateScrollbars(scrollOffsetDouble()); |
| 4004 } | 4005 } |
| 4005 | 4006 |
| 4006 } // namespace blink | 4007 } // namespace blink |
| OLD | NEW |