| 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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 } | 334 } |
| 335 | 335 |
| 336 int RenderLayerScrollableArea::scrollSize(ScrollbarOrientation orientation) cons
t | 336 int RenderLayerScrollableArea::scrollSize(ScrollbarOrientation orientation) cons
t |
| 337 { | 337 { |
| 338 IntSize scrollDimensions = maximumScrollPosition() - minimumScrollPosition()
; | 338 IntSize scrollDimensions = maximumScrollPosition() - minimumScrollPosition()
; |
| 339 return (orientation == HorizontalScrollbar) ? scrollDimensions.width() : scr
ollDimensions.height(); | 339 return (orientation == HorizontalScrollbar) ? scrollDimensions.width() : scr
ollDimensions.height(); |
| 340 } | 340 } |
| 341 | 341 |
| 342 void RenderLayerScrollableArea::setScrollOffset(const IntPoint& newScrollOffset) | 342 void RenderLayerScrollableArea::setScrollOffset(const IntPoint& newScrollOffset) |
| 343 { | 343 { |
| 344 LayoutRectRecorder recorder(*m_box); |
| 345 |
| 344 if (!m_box->isMarquee()) { | 346 if (!m_box->isMarquee()) { |
| 345 // Ensure that the dimensions will be computed if they need to be (for o
verflow:hidden blocks). | 347 // Ensure that the dimensions will be computed if they need to be (for o
verflow:hidden blocks). |
| 346 if (m_scrollDimensionsDirty) | 348 if (m_scrollDimensionsDirty) |
| 347 computeScrollDimensions(); | 349 computeScrollDimensions(); |
| 348 } | 350 } |
| 349 | 351 |
| 350 if (scrollOffset() == toIntSize(newScrollOffset)) | 352 if (scrollOffset() == toIntSize(newScrollOffset)) |
| 351 return; | 353 return; |
| 352 | 354 |
| 353 setScrollOffset(toIntSize(newScrollOffset)); | 355 setScrollOffset(toIntSize(newScrollOffset)); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 370 // for now we just crash to avoid allowing an attacker to use after free
. | 372 // for now we just crash to avoid allowing an attacker to use after free
. |
| 371 frameView->updateWidgetPositions(); | 373 frameView->updateWidgetPositions(); |
| 372 RELEASE_ASSERT(frameView->renderView()); | 374 RELEASE_ASSERT(frameView->renderView()); |
| 373 updateCompositingLayersAfterScroll(); | 375 updateCompositingLayersAfterScroll(); |
| 374 } | 376 } |
| 375 | 377 |
| 376 RenderLayerModelObject* repaintContainer = m_box->containerForRepaint(); | 378 RenderLayerModelObject* repaintContainer = m_box->containerForRepaint(); |
| 377 // The caret rect needs to be invalidated after scrolling | 379 // The caret rect needs to be invalidated after scrolling |
| 378 frame->selection().setCaretRectNeedsUpdate(); | 380 frame->selection().setCaretRectNeedsUpdate(); |
| 379 | 381 |
| 380 FloatQuad quadForFakeMouseMoveEvent = FloatQuad(layer()->repainter().repaint
Rect()); | 382 FloatQuad quadForFakeMouseMoveEvent; |
| 383 if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) |
| 384 quadForFakeMouseMoveEvent = FloatQuad(layer()->renderer()->newRepaintRec
t()); |
| 385 else |
| 386 quadForFakeMouseMoveEvent = FloatQuad(layer()->repainter().repaintRect()
); |
| 387 |
| 381 if (repaintContainer) | 388 if (repaintContainer) |
| 382 quadForFakeMouseMoveEvent = repaintContainer->localToAbsoluteQuad(quadFo
rFakeMouseMoveEvent); | 389 quadForFakeMouseMoveEvent = repaintContainer->localToAbsoluteQuad(quadFo
rFakeMouseMoveEvent); |
| 383 frame->eventHandler().dispatchFakeMouseMoveEventSoonInQuad(quadForFakeMouseM
oveEvent); | 390 frame->eventHandler().dispatchFakeMouseMoveEventSoonInQuad(quadForFakeMouseM
oveEvent); |
| 384 | 391 |
| 385 bool requiresRepaint = true; | 392 bool requiresRepaint = true; |
| 386 | 393 |
| 387 if (m_box->view()->compositor()->inCompositingMode()) { | 394 if (m_box->view()->compositor()->inCompositingMode()) { |
| 388 bool onlyScrolledCompositedLayers = scrollsOverflow() | 395 bool onlyScrolledCompositedLayers = scrollsOverflow() |
| 389 && !layer()->hasVisibleNonLayerContent() | 396 && !layer()->hasVisibleNonLayerContent() |
| 390 && !layer()->hasNonCompositedChild() | 397 && !layer()->hasNonCompositedChild() |
| 391 && !layer()->hasBlockSelectionGapBounds() | 398 && !layer()->hasBlockSelectionGapBounds() |
| 392 && !m_box->isMarquee(); | 399 && !m_box->isMarquee(); |
| 393 | 400 |
| 394 if (usesCompositedScrolling() || onlyScrolledCompositedLayers) | 401 if (usesCompositedScrolling() || onlyScrolledCompositedLayers) |
| 395 requiresRepaint = false; | 402 requiresRepaint = false; |
| 396 } | 403 } |
| 397 | 404 |
| 398 // Just schedule a full repaint of our object. | 405 // Just schedule a full repaint of our object. |
| 399 if (requiresRepaint) { | 406 if (requiresRepaint) { |
| 400 if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled() && m_box->frameV
iew()->isInPerformLayout()) | 407 if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) { |
| 401 m_box->setShouldDoFullRepaintAfterLayout(true); | 408 if (m_box->frameView()->isInPerformLayout()) |
| 402 else | 409 m_box->setShouldDoFullRepaintAfterLayout(true); |
| 410 else |
| 411 m_box->repaintUsingContainer(repaintContainer, pixelSnappedIntRe
ct(layer()->renderer()->newRepaintRect())); |
| 412 } else { |
| 403 m_box->repaintUsingContainer(repaintContainer, pixelSnappedIntRect(l
ayer()->repainter().repaintRect())); | 413 m_box->repaintUsingContainer(repaintContainer, pixelSnappedIntRect(l
ayer()->repainter().repaintRect())); |
| 414 } |
| 404 } | 415 } |
| 405 | 416 |
| 406 // Schedule the scroll DOM event. | 417 // Schedule the scroll DOM event. |
| 407 if (m_box->node()) | 418 if (m_box->node()) |
| 408 m_box->node()->document().enqueueScrollEventForNode(m_box->node()); | 419 m_box->node()->document().enqueueScrollEventForNode(m_box->node()); |
| 409 | 420 |
| 410 if (AXObjectCache* cache = m_box->document().existingAXObjectCache()) | 421 if (AXObjectCache* cache = m_box->document().existingAXObjectCache()) |
| 411 cache->handleScrollPositionChanged(m_box); | 422 cache->handleScrollPositionChanged(m_box); |
| 412 | 423 |
| 413 InspectorInstrumentation::didScrollLayer(m_box); | 424 InspectorInstrumentation::didScrollLayer(m_box); |
| (...skipping 1120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1534 void RenderLayerScrollableArea::setForceNeedsCompositedScrolling(ForceNeedsCompo
sitedScrollingMode mode) | 1545 void RenderLayerScrollableArea::setForceNeedsCompositedScrolling(ForceNeedsCompo
sitedScrollingMode mode) |
| 1535 { | 1546 { |
| 1536 if (m_forceNeedsCompositedScrolling == mode) | 1547 if (m_forceNeedsCompositedScrolling == mode) |
| 1537 return; | 1548 return; |
| 1538 | 1549 |
| 1539 m_forceNeedsCompositedScrolling = mode; | 1550 m_forceNeedsCompositedScrolling = mode; |
| 1540 layer()->didUpdateNeedsCompositedScrolling(); | 1551 layer()->didUpdateNeedsCompositedScrolling(); |
| 1541 } | 1552 } |
| 1542 | 1553 |
| 1543 } // Namespace WebCore | 1554 } // Namespace WebCore |
| OLD | NEW |