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

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

Issue 134443003: Implement CSSOM Smooth Scroll API (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 6 years, 10 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 | Annotate | Revision Log
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 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 int RenderBox::scrollLeft() const 480 int RenderBox::scrollLeft() const
481 { 481 {
482 return hasOverflowClip() ? layer()->scrollableArea()->scrollXOffset() : 0; 482 return hasOverflowClip() ? layer()->scrollableArea()->scrollXOffset() : 0;
483 } 483 }
484 484
485 int RenderBox::scrollTop() const 485 int RenderBox::scrollTop() const
486 { 486 {
487 return hasOverflowClip() ? layer()->scrollableArea()->scrollYOffset() : 0; 487 return hasOverflowClip() ? layer()->scrollableArea()->scrollYOffset() : 0;
488 } 488 }
489 489
490 void RenderBox::setScrollLeft(int newLeft) 490 void RenderBox::setScrollLeft(int newLeft, ScrollBehavior scrollBehavior)
491 { 491 {
492 if (hasOverflowClip()) 492 if (hasOverflowClip())
493 layer()->scrollableArea()->scrollToXOffset(newLeft, ScrollOffsetClamped) ; 493 layer()->scrollableArea()->scrollToXOffset(newLeft, ScrollOffsetClamped, scrollBehavior);
494 } 494 }
495 495
496 void RenderBox::setScrollTop(int newTop) 496 void RenderBox::setScrollTop(int newTop, ScrollBehavior scrollBehavior)
497 { 497 {
498 if (hasOverflowClip()) 498 if (hasOverflowClip())
499 layer()->scrollableArea()->scrollToYOffset(newTop, ScrollOffsetClamped); 499 layer()->scrollableArea()->scrollToYOffset(newTop, ScrollOffsetClamped, scrollBehavior);
500 } 500 }
501 501
502 void RenderBox::scrollToOffset(const IntSize& offset) 502 void RenderBox::scrollToOffset(const IntSize& offset)
503 { 503 {
504 ASSERT(hasOverflowClip()); 504 ASSERT(hasOverflowClip());
505 layer()->scrollableArea()->scrollToOffset(offset, ScrollOffsetClamped); 505 layer()->scrollableArea()->scrollToOffset(offset, ScrollOffsetClamped);
506 } 506 }
507 507
508 static inline bool frameElementAndViewPermitScroll(HTMLFrameElementBase* frameEl ementBase, FrameView* frameView) 508 static inline bool frameElementAndViewPermitScroll(HTMLFrameElementBase* frameEl ementBase, FrameView* frameView)
509 { 509 {
(...skipping 4406 matching lines...) Expand 10 before | Expand all | Expand 10 after
4916 return 0; 4916 return 0;
4917 4917
4918 if (!layoutState && !flowThreadContainingBlock()) 4918 if (!layoutState && !flowThreadContainingBlock())
4919 return 0; 4919 return 0;
4920 4920
4921 RenderBlock* containerBlock = containingBlock(); 4921 RenderBlock* containerBlock = containingBlock();
4922 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop(); 4922 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop();
4923 } 4923 }
4924 4924
4925 } // namespace WebCore 4925 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698