| 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 1343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1354 FloatSize size(layoutSize(IncludeScrollbars)); | 1354 FloatSize size(layoutSize(IncludeScrollbars)); |
| 1355 | 1355 |
| 1356 // We use the layoutSize rather than frameRect to calculate viewport units | 1356 // We use the layoutSize rather than frameRect to calculate viewport units |
| 1357 // so that we get correct results on mobile where the page is laid out into | 1357 // so that we get correct results on mobile where the page is laid out into |
| 1358 // a rect that may be larger than the viewport (e.g. the 980px fallback | 1358 // a rect that may be larger than the viewport (e.g. the 980px fallback |
| 1359 // width for desktop pages). Since the layout height is statically set to | 1359 // width for desktop pages). Since the layout height is statically set to |
| 1360 // be the viewport with browser controls showing, we add the browser controls | 1360 // be the viewport with browser controls showing, we add the browser controls |
| 1361 // height, compensating for page scale as well, since we want to use the | 1361 // height, compensating for page scale as well, since we want to use the |
| 1362 // viewport with browser controls hidden for vh (to match Safari). | 1362 // viewport with browser controls hidden for vh (to match Safari). |
| 1363 BrowserControls& browserControls = m_frame->host()->browserControls(); | 1363 BrowserControls& browserControls = m_frame->host()->browserControls(); |
| 1364 if (m_frame->isMainFrame() && size.width()) { | 1364 int viewportWidth = m_frame->host()->visualViewport().size().width(); |
| 1365 float pageScaleAtLayoutWidth = | 1365 if (m_frame->isMainFrame() && size.width() && viewportWidth) { |
| 1366 m_frame->host()->visualViewport().size().width() / size.width(); | 1366 float pageScaleAtLayoutWidth = viewportWidth / size.width(); |
| 1367 size.expand(0, browserControls.height() / pageScaleAtLayoutWidth); | 1367 size.expand(0, browserControls.height() / pageScaleAtLayoutWidth); |
| 1368 } | 1368 } |
| 1369 | 1369 |
| 1370 size.scale(1 / zoom); | 1370 size.scale(1 / zoom); |
| 1371 return size; | 1371 return size; |
| 1372 } | 1372 } |
| 1373 | 1373 |
| 1374 DocumentLifecycle& FrameView::lifecycle() const { | 1374 DocumentLifecycle& FrameView::lifecycle() const { |
| 1375 return m_frame->document()->lifecycle(); | 1375 return m_frame->document()->lifecycle(); |
| 1376 } | 1376 } |
| (...skipping 3249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4626 DCHECK(m_frame->isMainFrame()); | 4626 DCHECK(m_frame->isMainFrame()); |
| 4627 return m_initialViewportSize.width(); | 4627 return m_initialViewportSize.width(); |
| 4628 } | 4628 } |
| 4629 | 4629 |
| 4630 int FrameView::initialViewportHeight() const { | 4630 int FrameView::initialViewportHeight() const { |
| 4631 DCHECK(m_frame->isMainFrame()); | 4631 DCHECK(m_frame->isMainFrame()); |
| 4632 return m_initialViewportSize.height(); | 4632 return m_initialViewportSize.height(); |
| 4633 } | 4633 } |
| 4634 | 4634 |
| 4635 } // namespace blink | 4635 } // namespace blink |
| OLD | NEW |