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

Side by Side Diff: third_party/WebKit/Source/core/layout/ScrollAnchor.cpp

Issue 1950243005: Communicate MT changes to impl-only scroll offset animations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: attempt to fix rebase issue Created 4 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/layout/ScrollAnchor.h" 5 #include "core/layout/ScrollAnchor.h"
6 6
7 #include "core/frame/FrameView.h" 7 #include "core/frame/FrameView.h"
8 #include "core/frame/UseCounter.h" 8 #include "core/frame/UseCounter.h"
9 #include "core/layout/LayoutView.h" 9 #include "core/layout/LayoutView.h"
10 #include "core/layout/line/InlineTextBox.h" 10 #include "core/layout/line/InlineTextBox.h"
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 } 239 }
240 adjust(adjustment); 240 adjust(adjustment);
241 } 241 }
242 242
243 void ScrollAnchor::adjust(IntSize adjustment) 243 void ScrollAnchor::adjust(IntSize adjustment)
244 { 244 {
245 DoublePoint desiredPos = m_scroller->scrollPositionDouble() + adjustment; 245 DoublePoint desiredPos = m_scroller->scrollPositionDouble() + adjustment;
246 ScrollAnimatorBase* animator = m_scroller->existingScrollAnimator(); 246 ScrollAnimatorBase* animator = m_scroller->existingScrollAnimator();
247 if (!animator || !animator->hasRunningAnimation()) { 247 if (!animator || !animator->hasRunningAnimation()) {
248 m_scroller->setScrollPosition(desiredPos, AnchoringScroll); 248 m_scroller->setScrollPosition(desiredPos, AnchoringScroll);
249 animator->updateImplOnlyScrollOffsetAnimation(FloatSize(adjustment));
249 } else { 250 } else {
250 // If in the middle of a scroll animation, stop the animation, make 251 // If in the middle of a scroll animation, stop the animation, make
251 // the adjustment, and continue the animation on the pending delta. 252 // the adjustment, and continue the animation on the pending delta.
252 // TODO(skobes): This is not quite right, we are starting a new curve wi thout 253 // TODO(skobes): This is not quite right, we are starting a new curve wi thout
253 // saving our progress on the existing curve. 254 // saving our progress on the existing curve.
254 FloatSize pendingDelta = animator->desiredTargetPosition() - 255 FloatSize pendingDelta = animator->desiredTargetPosition() -
255 FloatPoint(m_scroller->scrollPositionDouble()); 256 FloatPoint(m_scroller->scrollPositionDouble());
256 animator->cancelAnimation(); 257 animator->cancelAnimation();
257 m_scroller->setScrollPosition(desiredPos, AnchoringScroll); 258 m_scroller->setScrollPosition(desiredPos, AnchoringScroll);
258 animator->userScroll(ScrollByPixel, pendingDelta); 259 animator->userScroll(ScrollByPixel, pendingDelta);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 295
295 void ScrollAnchor::notifyRemoved(LayoutObject* layoutObject) 296 void ScrollAnchor::notifyRemoved(LayoutObject* layoutObject)
296 { 297 {
297 if (m_current.m_anchorObject == layoutObject) 298 if (m_current.m_anchorObject == layoutObject)
298 m_current.clear(); 299 m_current.clear();
299 if (m_lastAdjusted.m_anchorObject == layoutObject) 300 if (m_lastAdjusted.m_anchorObject == layoutObject)
300 m_lastAdjusted.clear(); 301 m_lastAdjusted.clear();
301 } 302 }
302 303
303 } // namespace blink 304 } // namespace blink
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_unittest_animation.cc ('k') | third_party/WebKit/Source/platform/animation/CompositorAnimationHost.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698