Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(394)

Side by Side Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 2383113003: Refactor ScrollableArea::setScrollPosition. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 3529 matching lines...) Expand 10 before | Expand all | Expand 10 after
3540 if (!scrollbar) { 3540 if (!scrollbar) {
3541 IntSize scrollSize = m_contentsSize - visibleContentRect().size(); 3541 IntSize scrollSize = m_contentsSize - visibleContentRect().size();
3542 scrollSize.clampNegativeToZero(); 3542 scrollSize.clampNegativeToZero();
3543 return orientation == HorizontalScrollbar ? scrollSize.width() 3543 return orientation == HorizontalScrollbar ? scrollSize.width()
3544 : scrollSize.height(); 3544 : scrollSize.height();
3545 } 3545 }
3546 3546
3547 return scrollbar->totalSize() - scrollbar->visibleSize(); 3547 return scrollbar->totalSize() - scrollbar->visibleSize();
3548 } 3548 }
3549 3549
3550 void FrameView::setScrollOffset(const DoublePoint& offset, 3550 void FrameView::updateScrollPosition(const DoublePoint& position,
3551 ScrollType scrollType) { 3551 ScrollType scrollType) {
3552 // TODO(skobes): We shouldn't have to clamp here; instead we should update cal lers 3552 DoublePoint newPosition = clampScrollPosition(position);
3553 // ScrollableArea::scrollPositionChanged to only pass clamped offsets.
3554 DoublePoint newPosition = clampScrollPosition(offset);
3555 3553
3556 DoublePoint oldPosition = m_scrollPosition; 3554 DoublePoint oldPosition = m_scrollPosition;
3557 DoubleSize scrollDelta = newPosition - oldPosition; 3555 DoubleSize scrollDelta = newPosition - oldPosition;
3558 if (scrollDelta.isZero()) 3556 if (scrollDelta.isZero())
3559 return; 3557 return;
3560 3558
3561 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { 3559 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) {
3562 // Don't scroll the FrameView! 3560 // Don't scroll the FrameView!
3563 ASSERT_NOT_REACHED(); 3561 ASSERT_NOT_REACHED();
3564 } 3562 }
(...skipping 940 matching lines...) Expand 10 before | Expand all | Expand 10 after
4505 } 4503 }
4506 4504
4507 bool FrameView::canThrottleRendering() const { 4505 bool FrameView::canThrottleRendering() const {
4508 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) 4506 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled())
4509 return false; 4507 return false;
4510 return m_subtreeThrottled || 4508 return m_subtreeThrottled ||
4511 (m_hiddenForThrottling && m_crossOriginForThrottling); 4509 (m_hiddenForThrottling && m_crossOriginForThrottling);
4512 } 4510 }
4513 4511
4514 } // namespace blink 4512 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698