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 3544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3555 if (!scrollbar) { | 3555 if (!scrollbar) { |
3556 IntSize scrollSize = m_contentsSize - visibleContentRect().size(); | 3556 IntSize scrollSize = m_contentsSize - visibleContentRect().size(); |
3557 scrollSize.clampNegativeToZero(); | 3557 scrollSize.clampNegativeToZero(); |
3558 return orientation == HorizontalScrollbar ? scrollSize.width() | 3558 return orientation == HorizontalScrollbar ? scrollSize.width() |
3559 : scrollSize.height(); | 3559 : scrollSize.height(); |
3560 } | 3560 } |
3561 | 3561 |
3562 return scrollbar->totalSize() - scrollbar->visibleSize(); | 3562 return scrollbar->totalSize() - scrollbar->visibleSize(); |
3563 } | 3563 } |
3564 | 3564 |
3565 void FrameView::setScrollOffset(const DoublePoint& offset, | 3565 void FrameView::setScrollOffset(const DoublePoint& position, |
bokan
2016/10/04 22:17:25
This param renaming was probably meant for the sec
szager1
2016/10/04 22:54:13
Indeed, fixed.
| |
3566 ScrollType scrollType) { | 3566 ScrollType scrollType) { |
3567 // TODO(skobes): We shouldn't have to clamp here; instead we should update cal lers | |
3568 // ScrollableArea::scrollPositionChanged to only pass clamped offsets. | |
3569 DoublePoint newPosition = clampScrollPosition(offset); | |
3570 | |
3571 DoublePoint oldPosition = m_scrollPosition; | 3567 DoublePoint oldPosition = m_scrollPosition; |
3572 DoubleSize scrollDelta = newPosition - oldPosition; | 3568 DoubleSize scrollDelta = position - oldPosition; |
3573 if (scrollDelta.isZero()) | 3569 if (scrollDelta.isZero()) |
3574 return; | 3570 return; |
3575 | 3571 |
3576 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { | 3572 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { |
3577 // Don't scroll the FrameView! | 3573 // Don't scroll the FrameView! |
3578 ASSERT_NOT_REACHED(); | 3574 ASSERT_NOT_REACHED(); |
3579 } | 3575 } |
3580 | 3576 |
3581 m_scrollPosition = newPosition; | 3577 m_scrollPosition = position; |
3582 | 3578 |
3583 if (!scrollbarsSuppressed()) | 3579 if (!scrollbarsSuppressed()) |
3584 m_pendingScrollDelta += scrollDelta; | 3580 m_pendingScrollDelta += scrollDelta; |
3585 | 3581 |
3586 clearFragmentAnchor(); | 3582 clearFragmentAnchor(); |
3587 updateLayersAndCompositingAfterScrollIfNeeded(scrollDelta); | 3583 updateLayersAndCompositingAfterScrollIfNeeded(scrollDelta); |
3588 | 3584 |
3589 Document* document = m_frame->document(); | 3585 Document* document = m_frame->document(); |
3590 document->enqueueScrollEventForNode(document); | 3586 document->enqueueScrollEventForNode(document); |
3591 | 3587 |
(...skipping 928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4520 } | 4516 } |
4521 | 4517 |
4522 bool FrameView::canThrottleRendering() const { | 4518 bool FrameView::canThrottleRendering() const { |
4523 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) | 4519 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) |
4524 return false; | 4520 return false; |
4525 return m_subtreeThrottled || | 4521 return m_subtreeThrottled || |
4526 (m_hiddenForThrottling && m_crossOriginForThrottling); | 4522 (m_hiddenForThrottling && m_crossOriginForThrottling); |
4527 } | 4523 } |
4528 | 4524 |
4529 } // namespace blink | 4525 } // namespace blink |
OLD | NEW |