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 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 // Update regions, scrolling may change the clip of a particular region. | 386 // Update regions, scrolling may change the clip of a particular region. |
387 frameView->updateAnnotatedRegions(); | 387 frameView->updateAnnotatedRegions(); |
388 frameView->setNeedsUpdateWidgetPositions(); | 388 frameView->setNeedsUpdateWidgetPositions(); |
389 updateCompositingLayersAfterScroll(); | 389 updateCompositingLayersAfterScroll(); |
390 } | 390 } |
391 | 391 |
392 const LayoutBoxModelObject* paintInvalidationContainer = box().containerForP
aintInvalidation(); | 392 const LayoutBoxModelObject* paintInvalidationContainer = box().containerForP
aintInvalidation(); |
393 // The caret rect needs to be invalidated after scrolling | 393 // The caret rect needs to be invalidated after scrolling |
394 frame->selection().setCaretRectNeedsUpdate(); | 394 frame->selection().setCaretRectNeedsUpdate(); |
395 | 395 |
396 FloatQuad quadForFakeMouseMoveEvent = FloatQuad(layer()->renderer()->previou
sPaintInvalidationRect()); | 396 FloatQuad quadForFakeMouseMoveEvent = FloatQuad(layer()->layoutObject()->pre
viousPaintInvalidationRect()); |
397 | 397 |
398 quadForFakeMouseMoveEvent = paintInvalidationContainer->localToAbsoluteQuad(
quadForFakeMouseMoveEvent); | 398 quadForFakeMouseMoveEvent = paintInvalidationContainer->localToAbsoluteQuad(
quadForFakeMouseMoveEvent); |
399 frame->eventHandler().dispatchFakeMouseMoveEventSoonInQuad(quadForFakeMouseM
oveEvent); | 399 frame->eventHandler().dispatchFakeMouseMoveEventSoonInQuad(quadForFakeMouseM
oveEvent); |
400 | 400 |
401 bool requiresPaintInvalidation = true; | 401 bool requiresPaintInvalidation = true; |
402 | 402 |
403 { | 403 { |
404 // FIXME(420741): Since scrolling depends on compositing state, the scro
ll should be | 404 // FIXME(420741): Since scrolling depends on compositing state, the scro
ll should be |
405 // deferred until after the compositing update. | 405 // deferred until after the compositing update. |
406 DisableCompositingQueryAsserts disabler; | 406 DisableCompositingQueryAsserts disabler; |
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
892 | 892 |
893 ASSERT_NOT_REACHED(); | 893 ASSERT_NOT_REACHED(); |
894 return IntSize(); | 894 return IntSize(); |
895 } | 895 } |
896 | 896 |
897 static inline LayoutObject* rendererForScrollbar(LayoutObject& renderer) | 897 static inline LayoutObject* rendererForScrollbar(LayoutObject& renderer) |
898 { | 898 { |
899 if (Node* node = renderer.node()) { | 899 if (Node* node = renderer.node()) { |
900 if (ShadowRoot* shadowRoot = node->containingShadowRoot()) { | 900 if (ShadowRoot* shadowRoot = node->containingShadowRoot()) { |
901 if (shadowRoot->type() == ShadowRoot::ClosedShadowRoot) | 901 if (shadowRoot->type() == ShadowRoot::ClosedShadowRoot) |
902 return shadowRoot->host()->renderer(); | 902 return shadowRoot->host()->layoutObject(); |
903 } | 903 } |
904 } | 904 } |
905 | 905 |
906 return &renderer; | 906 return &renderer; |
907 } | 907 } |
908 | 908 |
909 PassRefPtrWillBeRawPtr<Scrollbar> LayerScrollableArea::createScrollbar(Scrollbar
Orientation orientation) | 909 PassRefPtrWillBeRawPtr<Scrollbar> LayerScrollableArea::createScrollbar(Scrollbar
Orientation orientation) |
910 { | 910 { |
911 RefPtrWillBeRawPtr<Scrollbar> widget = nullptr; | 911 RefPtrWillBeRawPtr<Scrollbar> widget = nullptr; |
912 LayoutObject* actualRenderer = rendererForScrollbar(box()); | 912 LayoutObject* actualRenderer = rendererForScrollbar(box()); |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1302 if (!frame) | 1302 if (!frame) |
1303 return; | 1303 return; |
1304 | 1304 |
1305 FrameView* frameView = frame->view(); | 1305 FrameView* frameView = frame->view(); |
1306 if (!frameView) | 1306 if (!frameView) |
1307 return; | 1307 return; |
1308 | 1308 |
1309 // FIXME: Does this need to be fixed later for OOPI? | 1309 // FIXME: Does this need to be fixed later for OOPI? |
1310 bool isVisibleToHitTest = box().visibleToHitTesting(); | 1310 bool isVisibleToHitTest = box().visibleToHitTesting(); |
1311 if (HTMLFrameOwnerElement* owner = frame->deprecatedLocalOwner()) | 1311 if (HTMLFrameOwnerElement* owner = frame->deprecatedLocalOwner()) |
1312 isVisibleToHitTest &= owner->renderer() && owner->renderer()->visibleToH
itTesting(); | 1312 isVisibleToHitTest &= owner->layoutObject() && owner->layoutObject()->vi
sibleToHitTesting(); |
1313 | 1313 |
1314 bool didScrollOverflow = m_scrollsOverflow; | 1314 bool didScrollOverflow = m_scrollsOverflow; |
1315 | 1315 |
1316 m_scrollsOverflow = hasOverflow && isVisibleToHitTest; | 1316 m_scrollsOverflow = hasOverflow && isVisibleToHitTest; |
1317 if (didScrollOverflow == scrollsOverflow()) | 1317 if (didScrollOverflow == scrollsOverflow()) |
1318 return; | 1318 return; |
1319 | 1319 |
1320 if (m_scrollsOverflow) { | 1320 if (m_scrollsOverflow) { |
1321 ASSERT(canHaveOverflowScrollbars(box())); | 1321 ASSERT(canHaveOverflowScrollbars(box())); |
1322 frameView->addScrollableArea(this); | 1322 frameView->addScrollableArea(this); |
(...skipping 29 matching lines...) Expand all Loading... |
1352 } | 1352 } |
1353 | 1353 |
1354 static bool layerNeedsCompositedScrolling(LayerScrollableArea::LCDTextMode mode,
const Layer* layer) | 1354 static bool layerNeedsCompositedScrolling(LayerScrollableArea::LCDTextMode mode,
const Layer* layer) |
1355 { | 1355 { |
1356 if (mode == LayerScrollableArea::ConsiderLCDText && !layer->compositor()->pr
eferCompositingToLCDTextEnabled()) | 1356 if (mode == LayerScrollableArea::ConsiderLCDText && !layer->compositor()->pr
eferCompositingToLCDTextEnabled()) |
1357 return false; | 1357 return false; |
1358 | 1358 |
1359 return layer->scrollsOverflow() | 1359 return layer->scrollsOverflow() |
1360 && !layer->hasDescendantWithClipPath() | 1360 && !layer->hasDescendantWithClipPath() |
1361 && !layer->hasAncestorWithClipPath() | 1361 && !layer->hasAncestorWithClipPath() |
1362 && !layer->renderer()->style()->hasBorderRadius(); | 1362 && !layer->layoutObject()->style()->hasBorderRadius(); |
1363 } | 1363 } |
1364 | 1364 |
1365 void LayerScrollableArea::updateNeedsCompositedScrolling(LCDTextMode mode) | 1365 void LayerScrollableArea::updateNeedsCompositedScrolling(LCDTextMode mode) |
1366 { | 1366 { |
1367 const bool needsCompositedScrolling = layerNeedsCompositedScrolling(mode, la
yer()); | 1367 const bool needsCompositedScrolling = layerNeedsCompositedScrolling(mode, la
yer()); |
1368 if (static_cast<bool>(m_needsCompositedScrolling) != needsCompositedScrollin
g) { | 1368 if (static_cast<bool>(m_needsCompositedScrolling) != needsCompositedScrollin
g) { |
1369 m_needsCompositedScrolling = needsCompositedScrolling; | 1369 m_needsCompositedScrolling = needsCompositedScrolling; |
1370 layer()->didUpdateNeedsCompositedScrolling(); | 1370 layer()->didUpdateNeedsCompositedScrolling(); |
1371 } | 1371 } |
1372 } | 1372 } |
1373 | 1373 |
1374 void LayerScrollableArea::setTopmostScrollChild(Layer* scrollChild) | 1374 void LayerScrollableArea::setTopmostScrollChild(Layer* scrollChild) |
1375 { | 1375 { |
1376 // We only want to track the topmost scroll child for scrollable areas with | 1376 // We only want to track the topmost scroll child for scrollable areas with |
1377 // overlay scrollbars. | 1377 // overlay scrollbars. |
1378 if (!hasOverlayScrollbars()) | 1378 if (!hasOverlayScrollbars()) |
1379 return; | 1379 return; |
1380 m_nextTopmostScrollChild = scrollChild; | 1380 m_nextTopmostScrollChild = scrollChild; |
1381 } | 1381 } |
1382 | 1382 |
1383 } // namespace blink | 1383 } // namespace blink |
OLD | NEW |