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

Side by Side Diff: Source/core/rendering/RenderBox.cpp

Issue 792513004: Implement CSSOM smooth scroll for Elements (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/RenderBox.h ('k') | Source/core/rendering/RenderLayerScrollableArea.h » ('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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 return snapSizeToPixel(scrollHeight(), location().y() + clientTop()); 395 return snapSizeToPixel(scrollHeight(), location().y() + clientTop());
396 } 396 }
397 397
398 void RenderBox::setScrollLeft(LayoutUnit newLeft) 398 void RenderBox::setScrollLeft(LayoutUnit newLeft)
399 { 399 {
400 // This doesn't hit in any tests, but since the equivalent code in setScroll Top 400 // This doesn't hit in any tests, but since the equivalent code in setScroll Top
401 // does, presumably this code does as well. 401 // does, presumably this code does as well.
402 DisableCompositingQueryAsserts disabler; 402 DisableCompositingQueryAsserts disabler;
403 403
404 if (hasOverflowClip()) 404 if (hasOverflowClip())
405 layer()->scrollableArea()->scrollToXOffset(newLeft, ScrollOffsetClamped) ; 405 layer()->scrollableArea()->scrollToXOffset(newLeft, ScrollOffsetClamped, ScrollBehaviorAuto);
406 } 406 }
407 407
408 void RenderBox::setScrollTop(LayoutUnit newTop) 408 void RenderBox::setScrollTop(LayoutUnit newTop)
409 { 409 {
410 // Hits in compositing/overflow/do-not-assert-on-invisible-composited-layers .html 410 // Hits in compositing/overflow/do-not-assert-on-invisible-composited-layers .html
411 DisableCompositingQueryAsserts disabler; 411 DisableCompositingQueryAsserts disabler;
412 412
413 if (hasOverflowClip()) 413 if (hasOverflowClip())
414 layer()->scrollableArea()->scrollToYOffset(newTop, ScrollOffsetClamped); 414 layer()->scrollableArea()->scrollToYOffset(newTop, ScrollOffsetClamped, ScrollBehaviorAuto);
415 } 415 }
416 416
417 void RenderBox::scrollToOffset(const DoubleSize& offset) 417 void RenderBox::scrollToOffset(const DoubleSize& offset, ScrollBehavior scrollBe havior)
418 { 418 {
419 ASSERT(hasOverflowClip()); 419 ASSERT(hasOverflowClip());
420 420
421 // This doesn't hit in any tests, but since the equivalent code in setScroll Top 421 // This doesn't hit in any tests, but since the equivalent code in setScroll Top
422 // does, presumably this code does as well. 422 // does, presumably this code does as well.
423 DisableCompositingQueryAsserts disabler; 423 DisableCompositingQueryAsserts disabler;
424 layer()->scrollableArea()->scrollToOffset(offset, ScrollOffsetClamped); 424 layer()->scrollableArea()->scrollToOffset(offset, ScrollOffsetClamped, scrol lBehavior);
425 } 425 }
426 426
427 static inline bool frameElementAndViewPermitScroll(HTMLFrameElementBase* frameEl ementBase, FrameView* frameView) 427 static inline bool frameElementAndViewPermitScroll(HTMLFrameElementBase* frameEl ementBase, FrameView* frameView)
428 { 428 {
429 // If scrollbars aren't explicitly forbidden, permit scrolling. 429 // If scrollbars aren't explicitly forbidden, permit scrolling.
430 if (frameElementBase && frameElementBase->scrollingMode() != ScrollbarAlways Off) 430 if (frameElementBase && frameElementBase->scrollingMode() != ScrollbarAlways Off)
431 return true; 431 return true;
432 432
433 // If scrollbars are forbidden, user initiated scrolls should obviously be i gnored. 433 // If scrollbars are forbidden, user initiated scrolls should obviously be i gnored.
434 if (frameView->wasScrolledByUser()) 434 if (frameView->wasScrolledByUser())
(...skipping 4057 matching lines...) Expand 10 before | Expand all | Expand 10 after
4492 computedValues.m_margins.m_end = marginEnd(); 4492 computedValues.m_margins.m_end = marginEnd();
4493 4493
4494 setLogicalTop(oldLogicalTop); 4494 setLogicalTop(oldLogicalTop);
4495 setLogicalWidth(oldLogicalWidth); 4495 setLogicalWidth(oldLogicalWidth);
4496 setLogicalLeft(oldLogicalLeft); 4496 setLogicalLeft(oldLogicalLeft);
4497 setMarginLeft(oldMarginLeft); 4497 setMarginLeft(oldMarginLeft);
4498 setMarginRight(oldMarginRight); 4498 setMarginRight(oldMarginRight);
4499 } 4499 }
4500 4500
4501 } // namespace blink 4501 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderBox.h ('k') | Source/core/rendering/RenderLayerScrollableArea.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698