Chromium Code Reviews| 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 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 322 } | 322 } |
| 323 | 323 |
| 324 int RenderLayerScrollableArea::scrollSize(ScrollbarOrientation orientation) cons t | 324 int RenderLayerScrollableArea::scrollSize(ScrollbarOrientation orientation) cons t |
| 325 { | 325 { |
| 326 IntSize scrollDimensions = maximumScrollPosition() - minimumScrollPosition() ; | 326 IntSize scrollDimensions = maximumScrollPosition() - minimumScrollPosition() ; |
| 327 return (orientation == HorizontalScrollbar) ? scrollDimensions.width() : scr ollDimensions.height(); | 327 return (orientation == HorizontalScrollbar) ? scrollDimensions.width() : scr ollDimensions.height(); |
| 328 } | 328 } |
| 329 | 329 |
| 330 void RenderLayerScrollableArea::setScrollOffset(const IntPoint& newScrollOffset) | 330 void RenderLayerScrollableArea::setScrollOffset(const IntPoint& newScrollOffset) |
| 331 { | 331 { |
| 332 LayoutRectRecorder recorder(*m_box); | |
| 333 | |
| 332 if (!m_box->isMarquee()) { | 334 if (!m_box->isMarquee()) { |
| 333 // Ensure that the dimensions will be computed if they need to be (for o verflow:hidden blocks). | 335 // Ensure that the dimensions will be computed if they need to be (for o verflow:hidden blocks). |
| 334 if (m_scrollDimensionsDirty) | 336 if (m_scrollDimensionsDirty) |
| 335 computeScrollDimensions(); | 337 computeScrollDimensions(); |
| 336 } | 338 } |
| 337 | 339 |
| 338 if (scrollOffset() == toIntSize(newScrollOffset)) | 340 if (scrollOffset() == toIntSize(newScrollOffset)) |
| 339 return; | 341 return; |
| 340 | 342 |
| 341 setScrollOffset(toIntSize(newScrollOffset)); | 343 setScrollOffset(toIntSize(newScrollOffset)); |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 358 // for now we just crash to avoid allowing an attacker to use after free . | 360 // for now we just crash to avoid allowing an attacker to use after free . |
| 359 frameView->updateWidgetPositions(); | 361 frameView->updateWidgetPositions(); |
| 360 RELEASE_ASSERT(frameView->renderView()); | 362 RELEASE_ASSERT(frameView->renderView()); |
| 361 updateCompositingLayersAfterScroll(); | 363 updateCompositingLayersAfterScroll(); |
| 362 } | 364 } |
| 363 | 365 |
| 364 RenderLayerModelObject* repaintContainer = m_box->containerForRepaint(); | 366 RenderLayerModelObject* repaintContainer = m_box->containerForRepaint(); |
| 365 // The caret rect needs to be invalidated after scrolling | 367 // The caret rect needs to be invalidated after scrolling |
| 366 frame->selection().setCaretRectNeedsUpdate(); | 368 frame->selection().setCaretRectNeedsUpdate(); |
| 367 | 369 |
| 368 FloatQuad quadForFakeMouseMoveEvent = FloatQuad(layer()->repainter().repaint Rect()); | 370 FloatQuad quadForFakeMouseMoveEvent; |
| 371 if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) | |
| 372 quadForFakeMouseMoveEvent = FloatQuad(layer()->renderer()->newRepaintRec t()); | |
| 373 else | |
| 374 quadForFakeMouseMoveEvent = FloatQuad(layer()->repainter().repaintRect() ); | |
| 375 | |
| 369 if (repaintContainer) | 376 if (repaintContainer) |
| 370 quadForFakeMouseMoveEvent = repaintContainer->localToAbsoluteQuad(quadFo rFakeMouseMoveEvent); | 377 quadForFakeMouseMoveEvent = repaintContainer->localToAbsoluteQuad(quadFo rFakeMouseMoveEvent); |
| 371 frame->eventHandler().dispatchFakeMouseMoveEventSoonInQuad(quadForFakeMouseM oveEvent); | 378 frame->eventHandler().dispatchFakeMouseMoveEventSoonInQuad(quadForFakeMouseM oveEvent); |
| 372 | 379 |
| 373 bool requiresRepaint = true; | 380 bool requiresRepaint = true; |
| 374 | 381 |
| 375 if (m_box->view()->compositor()->inCompositingMode()) { | 382 if (m_box->view()->compositor()->inCompositingMode()) { |
| 376 bool onlyScrolledCompositedLayers = scrollsOverflow() | 383 bool onlyScrolledCompositedLayers = scrollsOverflow() |
| 377 && !layer()->hasVisibleNonLayerContent() | 384 && !layer()->hasVisibleNonLayerContent() |
| 378 && !layer()->hasNonCompositedChild() | 385 && !layer()->hasNonCompositedChild() |
| 379 && !layer()->hasBlockSelectionGapBounds() | 386 && !layer()->hasBlockSelectionGapBounds() |
| 380 && !m_box->isMarquee(); | 387 && !m_box->isMarquee(); |
| 381 | 388 |
| 382 if (usesCompositedScrolling() || onlyScrolledCompositedLayers) | 389 if (usesCompositedScrolling() || onlyScrolledCompositedLayers) |
| 383 requiresRepaint = false; | 390 requiresRepaint = false; |
| 384 } | 391 } |
| 385 | 392 |
| 386 // Just schedule a full repaint of our object. | 393 // Just schedule a full repaint of our object. |
| 387 if (requiresRepaint) { | 394 if (requiresRepaint) { |
| 388 if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled() && m_box->frameV iew()->isInPerformLayout()) | 395 if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) { |
| 389 m_box->setShouldDoFullRepaintAfterLayout(true); | 396 if (m_box->frameView()->isInPerformLayout()) |
|
Julien - ping for review
2014/03/04 18:22:10
Why do we need to check isInPerformLayout() and wh
dsinclair
2014/03/04 19:21:52
This code can be executed outside of layout. As fa
| |
| 390 else | 397 m_box->setShouldDoFullRepaintAfterLayout(true); |
| 398 else | |
| 399 m_box->repaintUsingContainer(repaintContainer, pixelSnappedIntRe ct(layer()->renderer()->newRepaintRect())); | |
| 400 } else { | |
| 391 m_box->repaintUsingContainer(repaintContainer, pixelSnappedIntRect(l ayer()->repainter().repaintRect())); | 401 m_box->repaintUsingContainer(repaintContainer, pixelSnappedIntRect(l ayer()->repainter().repaintRect())); |
| 402 } | |
| 392 } | 403 } |
| 393 | 404 |
| 394 // Schedule the scroll DOM event. | 405 // Schedule the scroll DOM event. |
| 395 if (m_box->node()) | 406 if (m_box->node()) |
| 396 m_box->node()->document().enqueueScrollEventForNode(m_box->node()); | 407 m_box->node()->document().enqueueScrollEventForNode(m_box->node()); |
| 397 | 408 |
| 398 if (AXObjectCache* cache = m_box->document().existingAXObjectCache()) | 409 if (AXObjectCache* cache = m_box->document().existingAXObjectCache()) |
| 399 cache->handleScrollPositionChanged(m_box); | 410 cache->handleScrollPositionChanged(m_box); |
| 400 | 411 |
| 401 InspectorInstrumentation::didScrollLayer(m_box); | 412 InspectorInstrumentation::didScrollLayer(m_box); |
| (...skipping 1109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1511 void RenderLayerScrollableArea::setForceNeedsCompositedScrolling(ForceNeedsCompo sitedScrollingMode mode) | 1522 void RenderLayerScrollableArea::setForceNeedsCompositedScrolling(ForceNeedsCompo sitedScrollingMode mode) |
| 1512 { | 1523 { |
| 1513 if (m_forceNeedsCompositedScrolling == mode) | 1524 if (m_forceNeedsCompositedScrolling == mode) |
| 1514 return; | 1525 return; |
| 1515 | 1526 |
| 1516 m_forceNeedsCompositedScrolling = mode; | 1527 m_forceNeedsCompositedScrolling = mode; |
| 1517 layer()->didUpdateNeedsCompositedScrolling(); | 1528 layer()->didUpdateNeedsCompositedScrolling(); |
| 1518 } | 1529 } |
| 1519 | 1530 |
| 1520 } // Namespace WebCore | 1531 } // Namespace WebCore |
| OLD | NEW |