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

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

Issue 2387393003: Revert of 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/forms/TextFieldInputType.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3546 matching lines...) Expand 10 before | Expand all | Expand 10 after
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& offset,
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
3567 DoublePoint oldPosition = m_scrollPosition; 3571 DoublePoint oldPosition = m_scrollPosition;
3568 DoubleSize scrollDelta = offset - oldPosition; 3572 DoubleSize scrollDelta = newPosition - oldPosition;
3569 if (scrollDelta.isZero()) 3573 if (scrollDelta.isZero())
3570 return; 3574 return;
3571 3575
3572 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { 3576 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) {
3573 // Don't scroll the FrameView! 3577 // Don't scroll the FrameView!
3574 ASSERT_NOT_REACHED(); 3578 ASSERT_NOT_REACHED();
3575 } 3579 }
3576 3580
3577 m_scrollPosition = offset; 3581 m_scrollPosition = newPosition;
3578 3582
3579 if (!scrollbarsSuppressed()) 3583 if (!scrollbarsSuppressed())
3580 m_pendingScrollDelta += scrollDelta; 3584 m_pendingScrollDelta += scrollDelta;
3581 3585
3582 clearFragmentAnchor(); 3586 clearFragmentAnchor();
3583 updateLayersAndCompositingAfterScrollIfNeeded(scrollDelta); 3587 updateLayersAndCompositingAfterScrollIfNeeded(scrollDelta);
3584 3588
3585 Document* document = m_frame->document(); 3589 Document* document = m_frame->document();
3586 document->enqueueScrollEventForNode(document); 3590 document->enqueueScrollEventForNode(document);
3587 3591
(...skipping 928 matching lines...) Expand 10 before | Expand all | Expand 10 after
4516 } 4520 }
4517 4521
4518 bool FrameView::canThrottleRendering() const { 4522 bool FrameView::canThrottleRendering() const {
4519 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) 4523 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled())
4520 return false; 4524 return false;
4521 return m_subtreeThrottled || 4525 return m_subtreeThrottled ||
4522 (m_hiddenForThrottling && m_crossOriginForThrottling); 4526 (m_hiddenForThrottling && m_crossOriginForThrottling);
4523 } 4527 }
4524 4528
4525 } // namespace blink 4529 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/forms/TextFieldInputType.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698