| 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 , m_verticalScrollbarLock(false) | 160 , m_verticalScrollbarLock(false) |
| 161 , m_scrollbarsAvoidingResizer(0) | 161 , m_scrollbarsAvoidingResizer(0) |
| 162 , m_scrollbarsSuppressed(false) | 162 , m_scrollbarsSuppressed(false) |
| 163 , m_inUpdateScrollbars(false) | 163 , m_inUpdateScrollbars(false) |
| 164 , m_frameTimingRequestsDirty(true) | 164 , m_frameTimingRequestsDirty(true) |
| 165 , m_viewportIntersectionValid(false) | 165 , m_viewportIntersectionValid(false) |
| 166 , m_hiddenForThrottling(false) | 166 , m_hiddenForThrottling(false) |
| 167 , m_crossOriginForThrottling(false) | 167 , m_crossOriginForThrottling(false) |
| 168 , m_subtreeThrottled(false) | 168 , m_subtreeThrottled(false) |
| 169 , m_currentUpdateLifecyclePhasesTargetState(DocumentLifecycle::Uninitialized
) | 169 , m_currentUpdateLifecyclePhasesTargetState(DocumentLifecycle::Uninitialized
) |
| 170 , m_needsScrollbarsUpdate(false) |
| 170 , m_suppressAdjustViewSize(false) | 171 , m_suppressAdjustViewSize(false) |
| 171 , m_allowsLayoutInvalidationAfterLayoutClean(true) | 172 , m_allowsLayoutInvalidationAfterLayoutClean(true) |
| 172 { | 173 { |
| 173 ASSERT(m_frame); | 174 ASSERT(m_frame); |
| 174 init(); | 175 init(); |
| 175 } | 176 } |
| 176 | 177 |
| 177 FrameView* FrameView::create(LocalFrame* frame) | 178 FrameView* FrameView::create(LocalFrame* frame) |
| 178 { | 179 { |
| 179 FrameView* view = new FrameView(frame); | 180 FrameView* view = new FrameView(frame); |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 layoutItem.invalidatePaintRectangle(LayoutRect(paintInvalidationRect)); | 386 layoutItem.invalidatePaintRectangle(LayoutRect(paintInvalidationRect)); |
| 386 } | 387 } |
| 387 | 388 |
| 388 void FrameView::setFrameRect(const IntRect& newRect) | 389 void FrameView::setFrameRect(const IntRect& newRect) |
| 389 { | 390 { |
| 390 IntRect oldRect = frameRect(); | 391 IntRect oldRect = frameRect(); |
| 391 if (newRect == oldRect) | 392 if (newRect == oldRect) |
| 392 return; | 393 return; |
| 393 | 394 |
| 394 Widget::setFrameRect(newRect); | 395 Widget::setFrameRect(newRect); |
| 395 frameRectsChanged(); | |
| 396 | 396 |
| 397 if (oldRect.size() == newRect.size()) | 397 const bool frameSizeChanged = oldRect.size() != newRect.size(); |
| 398 return; | |
| 399 | 398 |
| 399 m_needsScrollbarsUpdate = frameSizeChanged; |
| 400 // TODO(wjmaclean): find out why scrollbars fail to resize for complex | 400 // TODO(wjmaclean): find out why scrollbars fail to resize for complex |
| 401 // subframes after changing the zoom level. For now always calling | 401 // subframes after changing the zoom level. For now always calling |
| 402 // updateScrollbarsIfNeeded() here fixes the issue, but it would be good to | 402 // updateScrollbarsIfNeeded() here fixes the issue, but it would be good to |
| 403 // discover the deeper cause of this. http://crbug.com/607987. | 403 // discover the deeper cause of this. http://crbug.com/607987. |
| 404 updateScrollbars(); | 404 updateScrollbarsIfNeeded(); |
| 405 |
| 406 frameRectsChanged(); |
| 405 | 407 |
| 406 updateScrollableAreaSet(); | 408 updateScrollableAreaSet(); |
| 407 | 409 |
| 408 if (LayoutViewItem layoutView = this->layoutViewItem()) { | 410 if (LayoutViewItem layoutView = this->layoutViewItem()) { |
| 411 // TODO(majidvp): It seems that this only needs to be called when size |
| 412 // is updated ignoring any change in the location. |
| 409 if (layoutView.usesCompositing()) | 413 if (layoutView.usesCompositing()) |
| 410 layoutView.compositor()->frameViewDidChangeSize(); | 414 layoutView.compositor()->frameViewDidChangeSize(); |
| 411 } | 415 } |
| 412 | 416 |
| 413 viewportSizeChanged(newRect.width() != oldRect.width(), newRect.height() !=
oldRect.height()); | 417 if (frameSizeChanged) { |
| 418 viewportSizeChanged(newRect.width() != oldRect.width(), newRect.height()
!= oldRect.height()); |
| 414 | 419 |
| 415 if (m_frame->isMainFrame()) | 420 if (m_frame->isMainFrame()) |
| 416 m_frame->host()->visualViewport().mainFrameDidChangeSize(); | 421 m_frame->host()->visualViewport().mainFrameDidChangeSize(); |
| 417 frame().loader().restoreScrollPositionAndViewState(); | 422 frame().loader().restoreScrollPositionAndViewState(); |
| 423 } |
| 418 } | 424 } |
| 419 | 425 |
| 420 Page* FrameView::page() const | 426 Page* FrameView::page() const |
| 421 { | 427 { |
| 422 return frame().page(); | 428 return frame().page(); |
| 423 } | 429 } |
| 424 | 430 |
| 425 LayoutView* FrameView::layoutView() const | 431 LayoutView* FrameView::layoutView() const |
| 426 { | 432 { |
| 427 return frame().contentLayoutObject(); | 433 return frame().contentLayoutObject(); |
| (...skipping 3155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3583 return hasAnyScrollbar && (shouldUseCustom != hasCustom); | 3589 return hasAnyScrollbar && (shouldUseCustom != hasCustom); |
| 3584 } | 3590 } |
| 3585 | 3591 |
| 3586 bool FrameView::shouldIgnoreOverflowHidden() const | 3592 bool FrameView::shouldIgnoreOverflowHidden() const |
| 3587 { | 3593 { |
| 3588 return m_frame->settings()->ignoreMainFrameOverflowHiddenQuirk() && m_frame-
>isMainFrame(); | 3594 return m_frame->settings()->ignoreMainFrameOverflowHiddenQuirk() && m_frame-
>isMainFrame(); |
| 3589 } | 3595 } |
| 3590 | 3596 |
| 3591 void FrameView::updateScrollbarsIfNeeded() | 3597 void FrameView::updateScrollbarsIfNeeded() |
| 3592 { | 3598 { |
| 3593 if (needsScrollbarReconstruction() || scrollOriginChanged()) | 3599 if (m_needsScrollbarsUpdate || needsScrollbarReconstruction() || scrollOrigi
nChanged()) |
| 3594 updateScrollbars(); | 3600 updateScrollbars(); |
| 3595 } | 3601 } |
| 3596 | 3602 |
| 3597 void FrameView::updateScrollbars() | 3603 void FrameView::updateScrollbars() |
| 3598 { | 3604 { |
| 3605 m_needsScrollbarsUpdate = false; |
| 3606 |
| 3599 if (m_frame->settings() && m_frame->settings()->rootLayerScrolls()) | 3607 if (m_frame->settings() && m_frame->settings()->rootLayerScrolls()) |
| 3600 return; | 3608 return; |
| 3601 | 3609 |
| 3602 // Avoid drawing two sets of scrollbars when visual viewport is enabled. | 3610 // Avoid drawing two sets of scrollbars when visual viewport is enabled. |
| 3603 if (visualViewportSuppliesScrollbars()) { | 3611 if (visualViewportSuppliesScrollbars()) { |
| 3604 setHasHorizontalScrollbar(false); | 3612 setHasHorizontalScrollbar(false); |
| 3605 setHasVerticalScrollbar(false); | 3613 setHasVerticalScrollbar(false); |
| 3606 adjustScrollPositionFromUpdateScrollbars(); | 3614 adjustScrollPositionFromUpdateScrollbars(); |
| 3607 return; | 3615 return; |
| 3608 } | 3616 } |
| (...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4259 } | 4267 } |
| 4260 | 4268 |
| 4261 bool FrameView::canThrottleRendering() const | 4269 bool FrameView::canThrottleRendering() const |
| 4262 { | 4270 { |
| 4263 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) | 4271 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) |
| 4264 return false; | 4272 return false; |
| 4265 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot
tling); | 4273 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot
tling); |
| 4266 } | 4274 } |
| 4267 | 4275 |
| 4268 } // namespace blink | 4276 } // namespace blink |
| OLD | NEW |