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

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

Issue 2841763002: Rename ScrollType helper and combine some redundant checks. (Closed)
Patch Set: Created 3 years, 7 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/paint/PaintLayerScrollableArea.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 4092 matching lines...) Expand 10 before | Expand all | Expand 10 after
4103 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { 4103 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) {
4104 // Don't scroll the FrameView! 4104 // Don't scroll the FrameView!
4105 ASSERT_NOT_REACHED(); 4105 ASSERT_NOT_REACHED();
4106 } 4106 }
4107 4107
4108 scroll_offset_ = offset; 4108 scroll_offset_ = offset;
4109 4109
4110 if (!ScrollbarsSuppressed()) 4110 if (!ScrollbarsSuppressed())
4111 pending_scroll_delta_ += scroll_delta; 4111 pending_scroll_delta_ += scroll_delta;
4112 4112
4113 if (ScrollTypeClearsFragmentAnchor(scroll_type))
4114 ClearFragmentAnchor();
4115 UpdateLayersAndCompositingAfterScrollIfNeeded(); 4113 UpdateLayersAndCompositingAfterScrollIfNeeded();
4116 4114
4117 Document* document = frame_->GetDocument(); 4115 Document* document = frame_->GetDocument();
4118 document->EnqueueScrollEventForNode(document); 4116 document->EnqueueScrollEventForNode(document);
4119 4117
4120 frame_->GetEventHandler().DispatchFakeMouseMoveEventSoon(); 4118 frame_->GetEventHandler().DispatchFakeMouseMoveEventSoon();
4121 if (scroll_type == kUserScroll || scroll_type == kCompositorScroll) { 4119 if (scroll_type == kUserScroll || scroll_type == kCompositorScroll) {
4122 Page* page = GetFrame().GetPage(); 4120 Page* page = GetFrame().GetPage();
4123 if (page) 4121 if (page)
4124 page->GetChromeClient().ClearToolTip(*frame_); 4122 page->GetChromeClient().ClearToolTip(*frame_);
(...skipping 13 matching lines...) Expand all
4138 cache->HandleScrollPositionChanged(this); 4136 cache->HandleScrollPositionChanged(this);
4139 4137
4140 GetFrame().Loader().SaveScrollState(); 4138 GetFrame().Loader().SaveScrollState();
4141 DidChangeScrollOffset(); 4139 DidChangeScrollOffset();
4142 4140
4143 if (scroll_type == kCompositorScroll && frame_->IsMainFrame()) { 4141 if (scroll_type == kCompositorScroll && frame_->IsMainFrame()) {
4144 if (DocumentLoader* document_loader = frame_->Loader().GetDocumentLoader()) 4142 if (DocumentLoader* document_loader = frame_->Loader().GetDocumentLoader())
4145 document_loader->GetInitialScrollState().was_scrolled_by_user = true; 4143 document_loader->GetInitialScrollState().was_scrolled_by_user = true;
4146 } 4144 }
4147 4145
4148 if (scroll_type != kAnchoringScroll && scroll_type != kClampingScroll) 4146 if (IsExplicitScrollType(scroll_type)) {
4147 ClearFragmentAnchor();
4149 ClearScrollAnchor(); 4148 ClearScrollAnchor();
4149 }
4150 } 4150 }
4151 4151
4152 void FrameView::DidChangeScrollOffset() { 4152 void FrameView::DidChangeScrollOffset() {
4153 GetFrame().Loader().Client()->DidChangeScrollOffset(); 4153 GetFrame().Loader().Client()->DidChangeScrollOffset();
4154 if (GetFrame().IsMainFrame()) 4154 if (GetFrame().IsMainFrame())
4155 GetFrame().GetPage()->GetChromeClient().MainFrameScrollOffsetChanged(); 4155 GetFrame().GetPage()->GetChromeClient().MainFrameScrollOffsetChanged();
4156 } 4156 }
4157 4157
4158 void FrameView::ClearScrollAnchor() { 4158 void FrameView::ClearScrollAnchor() {
4159 if (!RuntimeEnabledFeatures::scrollAnchoringEnabled()) 4159 if (!RuntimeEnabledFeatures::scrollAnchoringEnabled())
(...skipping 1214 matching lines...) Expand 10 before | Expand all | Expand 10 after
5374 void FrameView::SetAnimationHost( 5374 void FrameView::SetAnimationHost(
5375 std::unique_ptr<CompositorAnimationHost> host) { 5375 std::unique_ptr<CompositorAnimationHost> host) {
5376 animation_host_ = std::move(host); 5376 animation_host_ = std::move(host);
5377 } 5377 }
5378 5378
5379 LayoutUnit FrameView::CaretWidth() const { 5379 LayoutUnit FrameView::CaretWidth() const {
5380 return LayoutUnit(GetChromeClient()->WindowToViewportScalar(1)); 5380 return LayoutUnit(GetChromeClient()->WindowToViewportScalar(1));
5381 } 5381 }
5382 5382
5383 } // namespace blink 5383 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698