| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2010 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 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1024 if (!host) | 1024 if (!host) |
| 1025 return 0; | 1025 return 0; |
| 1026 | 1026 |
| 1027 frame()->document()->updateStyleAndLayoutIgnorePendingStylesheets(); | 1027 frame()->document()->updateStyleAndLayoutIgnorePendingStylesheets(); |
| 1028 | 1028 |
| 1029 ScrollableArea* viewport = host->settings().inertVisualViewport() ? view->la
youtViewportScrollableArea() : view->getScrollableArea(); | 1029 ScrollableArea* viewport = host->settings().inertVisualViewport() ? view->la
youtViewportScrollableArea() : view->getScrollableArea(); |
| 1030 double viewportY = viewport->scrollPositionDouble().y(); | 1030 double viewportY = viewport->scrollPositionDouble().y(); |
| 1031 return adjustScrollForAbsoluteZoom(viewportY, frame()->pageZoomFactor()); | 1031 return adjustScrollForAbsoluteZoom(viewportY, frame()->pageZoomFactor()); |
| 1032 } | 1032 } |
| 1033 | 1033 |
| 1034 VisualViewport* LocalDOMWindow::visualViewport() |
| 1035 { |
| 1036 if (!frame()) |
| 1037 return nullptr; |
| 1038 |
| 1039 FrameHost* host = frame()->host(); |
| 1040 if (!host) |
| 1041 return nullptr; |
| 1042 |
| 1043 return &host->visualViewport(); |
| 1044 } |
| 1045 |
| 1034 const AtomicString& LocalDOMWindow::name() const | 1046 const AtomicString& LocalDOMWindow::name() const |
| 1035 { | 1047 { |
| 1036 if (!isCurrentlyDisplayedInFrame()) | 1048 if (!isCurrentlyDisplayedInFrame()) |
| 1037 return nullAtom; | 1049 return nullAtom; |
| 1038 | 1050 |
| 1039 return frame()->tree().name(); | 1051 return frame()->tree().name(); |
| 1040 } | 1052 } |
| 1041 | 1053 |
| 1042 void LocalDOMWindow::setName(const AtomicString& name) | 1054 void LocalDOMWindow::setName(const AtomicString& name) |
| 1043 { | 1055 { |
| (...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1538 { | 1550 { |
| 1539 // If the LocalDOMWindow still has a frame reference, that frame must point | 1551 // If the LocalDOMWindow still has a frame reference, that frame must point |
| 1540 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation | 1552 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation |
| 1541 // where script execution leaks between different LocalDOMWindows. | 1553 // where script execution leaks between different LocalDOMWindows. |
| 1542 if (m_frameObserver->frame()) | 1554 if (m_frameObserver->frame()) |
| 1543 ASSERT_WITH_SECURITY_IMPLICATION(m_frameObserver->frame()->domWindow() =
= this); | 1555 ASSERT_WITH_SECURITY_IMPLICATION(m_frameObserver->frame()->domWindow() =
= this); |
| 1544 return m_frameObserver->frame(); | 1556 return m_frameObserver->frame(); |
| 1545 } | 1557 } |
| 1546 | 1558 |
| 1547 } // namespace blink | 1559 } // namespace blink |
| OLD | NEW |