OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |