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

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: Created 6 years, 5 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
« 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 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 391
392 int RenderBox::pixelSnappedScrollHeight() const 392 int RenderBox::pixelSnappedScrollHeight() const
393 { 393 {
394 if (hasOverflowClip()) 394 if (hasOverflowClip())
395 return layer()->scrollableArea()->scrollHeight(); 395 return layer()->scrollableArea()->scrollHeight();
396 // For objects with visible overflow, this matches IE. 396 // For objects with visible overflow, this matches IE.
397 // FIXME: Need to work right with writing modes. 397 // FIXME: Need to work right with writing modes.
398 return snapSizeToPixel(scrollHeight(), y() + clientTop()); 398 return snapSizeToPixel(scrollHeight(), y() + clientTop());
399 } 399 }
400 400
401 void RenderBox::setScrollLeft(LayoutUnit newLeft) 401 void RenderBox::setScrollLeft(LayoutUnit newLeft, ScrollBehavior scrollBehavior)
402 { 402 {
403 // This doesn't hit in any tests, but since the equivalent code in setScroll Top 403 // This doesn't hit in any tests, but since the equivalent code in setScroll Top
404 // does, presumably this code does as well. 404 // does, presumably this code does as well.
405 DisableCompositingQueryAsserts disabler; 405 DisableCompositingQueryAsserts disabler;
406 406
407 if (hasOverflowClip()) 407 if (hasOverflowClip())
408 layer()->scrollableArea()->scrollToXOffset(newLeft, ScrollOffsetClamped) ; 408 layer()->scrollableArea()->scrollToXOffset(newLeft, ScrollOffsetClamped, scrollBehavior);
409 } 409 }
410 410
411 void RenderBox::setScrollTop(LayoutUnit newTop) 411 void RenderBox::setScrollTop(LayoutUnit newTop, ScrollBehavior scrollBehavior)
412 { 412 {
413 // Hits in compositing/overflow/do-not-assert-on-invisible-composited-layers .html 413 // Hits in compositing/overflow/do-not-assert-on-invisible-composited-layers .html
414 DisableCompositingQueryAsserts disabler; 414 DisableCompositingQueryAsserts disabler;
415 415
416 if (hasOverflowClip()) 416 if (hasOverflowClip())
417 layer()->scrollableArea()->scrollToYOffset(newTop, ScrollOffsetClamped); 417 layer()->scrollableArea()->scrollToYOffset(newTop, ScrollOffsetClamped, scrollBehavior);
418 } 418 }
419 419
420 void RenderBox::scrollToOffset(const IntSize& offset) 420 void RenderBox::scrollToOffset(const IntSize& offset)
421 { 421 {
422 ASSERT(hasOverflowClip()); 422 ASSERT(hasOverflowClip());
423 423
424 // This doesn't hit in any tests, but since the equivalent code in setScroll Top 424 // This doesn't hit in any tests, but since the equivalent code in setScroll Top
425 // does, presumably this code does as well. 425 // does, presumably this code does as well.
426 DisableCompositingQueryAsserts disabler; 426 DisableCompositingQueryAsserts disabler;
427 layer()->scrollableArea()->scrollToOffset(offset, ScrollOffsetClamped); 427 layer()->scrollableArea()->scrollToOffset(offset, ScrollOffsetClamped);
(...skipping 4211 matching lines...) Expand 10 before | Expand all | Expand 10 after
4639 4639
4640 // We need the old border box size only when the box has background or b ox decorations. 4640 // We need the old border box size only when the box has background or b ox decorations.
4641 if (!style()->hasBackground() && !style()->hasBoxDecorations()) 4641 if (!style()->hasBackground() && !style()->hasBoxDecorations())
4642 return; 4642 return;
4643 } 4643 }
4644 4644
4645 ensureRareData().m_previousBorderBoxSize = size(); 4645 ensureRareData().m_previousBorderBoxSize = size();
4646 } 4646 }
4647 4647
4648 } // namespace WebCore 4648 } // namespace WebCore
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