LEFT | RIGHT |
1 /* | 1 /* |
2 * Copyright (C) 2006-2017 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006-2017 Apple Inc. All rights reserved. |
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
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 1248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1259 { | 1259 { |
1260 if (!m_frame) | 1260 if (!m_frame) |
1261 return 0; | 1261 return 0; |
1262 | 1262 |
1263 FrameView* view = m_frame->view(); | 1263 FrameView* view = m_frame->view(); |
1264 if (!view) | 1264 if (!view) |
1265 return 0; | 1265 return 0; |
1266 | 1266 |
1267 if (m_frame->settings().visualViewportEnabled()) { | 1267 if (m_frame->settings().visualViewportEnabled()) { |
1268 m_frame->document()->updateLayoutIgnorePendingStylesheets(Document::RunP
ostLayoutTasks::Synchronously); | 1268 m_frame->document()->updateLayoutIgnorePendingStylesheets(Document::RunP
ostLayoutTasks::Synchronously); |
1269 float scrollbarHeight = view->platformWidget() ? view->platformWidgetVer
ticalScrollbarIntrusion() : view->verticalScrollbarIntrusion(); | 1269 float heightIncludingScrollbar = view->layoutViewportRect().height() + v
iew->verticalScrollbarIntrusion(ScrollableArea::IncludePlatformWidgetScrollbars)
; |
1270 return static_cast<int>((view->layoutViewportRect().height() + scrollbar
Height) * view->layoutViewportToClientScaleFactor()); | 1270 return static_cast<int>(heightIncludingScrollbar * view->layoutViewportT
oClientScaleFactor()); |
1271 } | 1271 } |
1272 | 1272 |
1273 return view->mapFromLayoutToCSSUnits(static_cast<int>(view->unobscuredConten
tRectIncludingScrollbars().height())); | 1273 return view->mapFromLayoutToCSSUnits(static_cast<int>(view->unobscuredConten
tRectIncludingScrollbars().height())); |
1274 } | 1274 } |
1275 | 1275 |
1276 int DOMWindow::innerWidth() const | 1276 int DOMWindow::innerWidth() const |
1277 { | 1277 { |
1278 if (!m_frame) | 1278 if (!m_frame) |
1279 return 0; | 1279 return 0; |
1280 | 1280 |
1281 FrameView* view = m_frame->view(); | 1281 FrameView* view = m_frame->view(); |
1282 if (!view) | 1282 if (!view) |
1283 return 0; | 1283 return 0; |
1284 | 1284 |
1285 if (m_frame->settings().visualViewportEnabled()) { | 1285 if (m_frame->settings().visualViewportEnabled()) { |
1286 m_frame->document()->updateLayoutIgnorePendingStylesheets(Document::RunP
ostLayoutTasks::Synchronously); | 1286 m_frame->document()->updateLayoutIgnorePendingStylesheets(Document::RunP
ostLayoutTasks::Synchronously); |
1287 float scrollbarWidth = view->platformWidget() ? view->platformWidgetHori
zontalScrollbarIntrusion() : view->horizontalScrollbarIntrusion(); | 1287 float widthIncludingScrollbar = view->layoutViewportRect().width() + vie
w->horizontalScrollbarIntrusion(ScrollableArea::IncludePlatformWidgetScrollbars)
; |
1288 return static_cast<int>((view->layoutViewportRect().width() + scrollbarW
idth) * view->layoutViewportToClientScaleFactor()); | 1288 return static_cast<int>(widthIncludingScrollbar * view->layoutViewportTo
ClientScaleFactor()); |
1289 } | 1289 } |
1290 | 1290 |
1291 return view->mapFromLayoutToCSSUnits(static_cast<int>(view->unobscuredConten
tRectIncludingScrollbars().width())); | 1291 return view->mapFromLayoutToCSSUnits(static_cast<int>(view->unobscuredConten
tRectIncludingScrollbars().width())); |
1292 } | 1292 } |
1293 | 1293 |
1294 int DOMWindow::screenX() const | 1294 int DOMWindow::screenX() const |
1295 { | 1295 { |
1296 if (!m_frame) | 1296 if (!m_frame) |
1297 return 0; | 1297 return 0; |
1298 | 1298 |
(...skipping 1076 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2375 page->chrome().enableSuddenTermination(); | 2375 page->chrome().enableSuddenTermination(); |
2376 } | 2376 } |
2377 | 2377 |
2378 void DOMWindow::disableSuddenTermination() | 2378 void DOMWindow::disableSuddenTermination() |
2379 { | 2379 { |
2380 if (Page* page = this->page()) | 2380 if (Page* page = this->page()) |
2381 page->chrome().disableSuddenTermination(); | 2381 page->chrome().disableSuddenTermination(); |
2382 } | 2382 } |
2383 | 2383 |
2384 } // namespace WebCore | 2384 } // namespace WebCore |
LEFT | RIGHT |