| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. |
| 3 * | 3 * |
| 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
| 5 * | 5 * |
| 6 * Other contributors: | 6 * Other contributors: |
| 7 * Robert O'Callahan <roc+@cs.cmu.edu> | 7 * Robert O'Callahan <roc+@cs.cmu.edu> |
| 8 * David Baron <dbaron@fas.harvard.edu> | 8 * David Baron <dbaron@fas.harvard.edu> |
| 9 * Christian Biesinger <cbiesinger@web.de> | 9 * Christian Biesinger <cbiesinger@web.de> |
| 10 * Randall Jesup <rjesup@wgate.com> | 10 * Randall Jesup <rjesup@wgate.com> |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 layer()->updateLayerPositionsAfterOverflowScroll(); | 371 layer()->updateLayerPositionsAfterOverflowScroll(); |
| 372 // Update regions, scrolling may change the clip of a particular region. | 372 // Update regions, scrolling may change the clip of a particular region. |
| 373 frameView->updateAnnotatedRegions(); | 373 frameView->updateAnnotatedRegions(); |
| 374 // FIXME: We shouldn't call updateWidgetPositions() here since it might
tear down the render tree, | 374 // FIXME: We shouldn't call updateWidgetPositions() here since it might
tear down the render tree, |
| 375 // for now we just crash to avoid allowing an attacker to use after free
. | 375 // for now we just crash to avoid allowing an attacker to use after free
. |
| 376 frameView->updateWidgetPositions(); | 376 frameView->updateWidgetPositions(); |
| 377 RELEASE_ASSERT(frameView->renderView()); | 377 RELEASE_ASSERT(frameView->renderView()); |
| 378 updateCompositingLayersAfterScroll(); | 378 updateCompositingLayersAfterScroll(); |
| 379 } | 379 } |
| 380 | 380 |
| 381 const RenderLayerModelObject* repaintContainer = box().containerForRepaint()
; | 381 const RenderLayerModelObject* repaintContainer = box().containerForPaintInva
lidation(); |
| 382 // The caret rect needs to be invalidated after scrolling | 382 // The caret rect needs to be invalidated after scrolling |
| 383 frame->selection().setCaretRectNeedsUpdate(); | 383 frame->selection().setCaretRectNeedsUpdate(); |
| 384 | 384 |
| 385 FloatQuad quadForFakeMouseMoveEvent; | 385 FloatQuad quadForFakeMouseMoveEvent; |
| 386 if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) | 386 if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) |
| 387 quadForFakeMouseMoveEvent = FloatQuad(layer()->renderer()->previousPaint
InvalidationRect()); | 387 quadForFakeMouseMoveEvent = FloatQuad(layer()->renderer()->previousPaint
InvalidationRect()); |
| 388 else | 388 else |
| 389 quadForFakeMouseMoveEvent = FloatQuad(layer()->repainter().repaintRect()
); | 389 quadForFakeMouseMoveEvent = FloatQuad(layer()->repainter().repaintRect()
); |
| 390 | 390 |
| 391 quadForFakeMouseMoveEvent = repaintContainer->localToAbsoluteQuad(quadForFak
eMouseMoveEvent); | 391 quadForFakeMouseMoveEvent = repaintContainer->localToAbsoluteQuad(quadForFak
eMouseMoveEvent); |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 785 if (Scrollbar* verticalScrollbar = this->verticalScrollbar()) { | 785 if (Scrollbar* verticalScrollbar = this->verticalScrollbar()) { |
| 786 int clientHeight = box().pixelSnappedClientHeight(); | 786 int clientHeight = box().pixelSnappedClientHeight(); |
| 787 verticalScrollbar->setProportion(clientHeight, overflowRect().height()); | 787 verticalScrollbar->setProportion(clientHeight, overflowRect().height()); |
| 788 } | 788 } |
| 789 | 789 |
| 790 bool hasHorizontalOverflow = this->hasHorizontalOverflow(); | 790 bool hasHorizontalOverflow = this->hasHorizontalOverflow(); |
| 791 bool hasVerticalOverflow = this->hasVerticalOverflow(); | 791 bool hasVerticalOverflow = this->hasVerticalOverflow(); |
| 792 bool autoHorizontalScrollBarChanged = box().hasAutoHorizontalScrollbar() &&
(hasHorizontalScrollbar() != hasHorizontalOverflow); | 792 bool autoHorizontalScrollBarChanged = box().hasAutoHorizontalScrollbar() &&
(hasHorizontalScrollbar() != hasHorizontalOverflow); |
| 793 bool autoVerticalScrollBarChanged = box().hasAutoVerticalScrollbar() && (has
VerticalScrollbar() != hasVerticalOverflow); | 793 bool autoVerticalScrollBarChanged = box().hasAutoVerticalScrollbar() && (has
VerticalScrollbar() != hasVerticalOverflow); |
| 794 if (autoHorizontalScrollBarChanged || autoVerticalScrollBarChanged) | 794 if (autoHorizontalScrollBarChanged || autoVerticalScrollBarChanged) |
| 795 box().setNeedsLayoutAndFullRepaint(); | 795 box().setNeedsLayoutAndFullPaintInvalidation(); |
| 796 } | 796 } |
| 797 | 797 |
| 798 IntSize RenderLayerScrollableArea::clampScrollOffset(const IntSize& scrollOffset
) const | 798 IntSize RenderLayerScrollableArea::clampScrollOffset(const IntSize& scrollOffset
) const |
| 799 { | 799 { |
| 800 int maxX = scrollWidth() - box().pixelSnappedClientWidth(); | 800 int maxX = scrollWidth() - box().pixelSnappedClientWidth(); |
| 801 int maxY = scrollHeight() - box().pixelSnappedClientHeight(); | 801 int maxY = scrollHeight() - box().pixelSnappedClientHeight(); |
| 802 | 802 |
| 803 int x = std::max(std::min(scrollOffset.width(), maxX), 0); | 803 int x = std::max(std::min(scrollOffset.width(), maxX), 0); |
| 804 int y = std::max(std::min(scrollOffset.height(), maxY), 0); | 804 int y = std::max(std::min(scrollOffset.height(), maxY), 0); |
| 805 return IntSize(x, y); | 805 return IntSize(x, y); |
| (...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1490 DisableCompositingQueryAsserts disabler; | 1490 DisableCompositingQueryAsserts disabler; |
| 1491 return box().hasCompositedLayerMapping() && box().compositedLayerMapping()->
scrollingLayer(); | 1491 return box().hasCompositedLayerMapping() && box().compositedLayerMapping()->
scrollingLayer(); |
| 1492 } | 1492 } |
| 1493 | 1493 |
| 1494 bool RenderLayerScrollableArea::needsCompositedScrolling() const | 1494 bool RenderLayerScrollableArea::needsCompositedScrolling() const |
| 1495 { | 1495 { |
| 1496 return scrollsOverflow() && box().view()->compositor()->acceleratedCompositi
ngForOverflowScrollEnabled(); | 1496 return scrollsOverflow() && box().view()->compositor()->acceleratedCompositi
ngForOverflowScrollEnabled(); |
| 1497 } | 1497 } |
| 1498 | 1498 |
| 1499 } // Namespace WebCore | 1499 } // Namespace WebCore |
| OLD | NEW |