Changeset 156201 in webkit
- Timestamp:
- Sep 20, 2013, 2:47:47 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 7 edited
-
ChangeLog (modified) (1 diff)
-
page/FrameView.cpp (modified) (1 diff)
-
page/FrameView.h (modified) (1 diff)
-
platform/ScrollView.cpp (modified) (10 diffs)
-
platform/ScrollView.h (modified) (1 diff)
-
rendering/RenderLayerCompositor.cpp (modified) (2 diffs)
-
rendering/RenderLayerCompositor.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r156200 r156201 1 2013-09-20 Simon Fraser <simon.fraser@apple.com> 2 3 Scrollbars don't appear on long pages after r155660 4 https://bugs.webkit.org/show_bug.cgi?id=121714 5 <rdar://problem/15042478> 6 7 Reviewed by Beth Dakin. 8 9 After r155660, we don't do any additional layouts when scrollbars are 10 added or removed. That caused us to not enter the code that creates or 11 destroys composting layers for scrollbars in RenderLayerCompositor, resulting 12 in missing scrollbars. 13 14 Fix by having ScrollView::updateScrollbars() call addedOrRemovedScrollbar() 15 when a scrollbar was added or removed, which is overridden in FrameView 16 to call through to RenderLayerCompositor::frameViewDidAddOrRemoveScrollbars(). 17 18 Not testable since scrollbar layers aren't contained in layer tree dumps 19 (to reduce diffs between platforms). 20 21 * page/FrameView.cpp: 22 (WebCore::FrameView::addedOrRemovedScrollbar): New function to tell the compositor 23 that scrollbars changed. 24 * page/FrameView.h: 25 * platform/ScrollView.cpp: 26 (WebCore::ScrollView::setHasHorizontalScrollbar): Change the meaning of the return 27 value to say if the scrollbar was added or removed. Add an out param that indicates 28 whether the scrollbar change affects content size (not true for overlay scrollbars). 29 (WebCore::ScrollView::setHasVerticalScrollbar): Ditto. 30 (WebCore::ScrollView::updateScrollbars): Keep track of whether scrollbars were 31 added or removed, and call addedOrRemovedScrollbar() if true. 32 * platform/ScrollView.h: 33 * rendering/RenderLayerCompositor.cpp: 34 (WebCore::RenderLayerCompositor::frameViewDidAddOrRemoveScrollbars): Call updateOverflowControlsLayers(). 35 (WebCore::RenderLayerCompositor::updateOverflowControlsLayers): 36 * rendering/RenderLayerCompositor.h: 37 1 38 2013-09-20 Simon Fraser <simon.fraser@apple.com> 2 39 -
trunk/Source/WebCore/page/FrameView.cpp
r155894 r156201 2182 2182 } 2183 2183 2184 void FrameView::addedOrRemovedScrollbar() 2185 { 2186 #if USE(ACCELERATED_COMPOSITING) 2187 if (RenderView* renderView = this->renderView()) { 2188 if (renderView->usesCompositing()) 2189 renderView->compositor().frameViewDidAddOrRemoveScrollbars(); 2190 } 2191 #endif 2192 } 2193 2184 2194 void FrameView::beginDeferredRepaints() 2185 2195 { -
trunk/Source/WebCore/page/FrameView.h
r155798 r156201 484 484 virtual void contentsResized() OVERRIDE; 485 485 virtual void visibleContentsResized() OVERRIDE; 486 virtual void addedOrRemovedScrollbar() OVERRIDE; 486 487 virtual void fixedLayoutSizeChanged() OVERRIDE; 487 488 -
trunk/Source/WebCore/platform/ScrollView.cpp
r155660 r156201 85 85 } 86 86 87 bool ScrollView::setHasHorizontalScrollbar(bool hasBar )87 bool ScrollView::setHasHorizontalScrollbar(bool hasBar, bool* contentSizeAffected) 88 88 { 89 89 ASSERT(!hasBar || !avoidScrollbarCreation()); … … 93 93 didAddScrollbar(m_horizontalScrollbar.get(), HorizontalScrollbar); 94 94 m_horizontalScrollbar->styleChanged(); 95 return !m_horizontalScrollbar->isOverlayScrollbar(); 95 if (contentSizeAffected) 96 *contentSizeAffected = !m_horizontalScrollbar->isOverlayScrollbar(); 97 return true; 96 98 } 97 99 … … 101 103 removeChild(m_horizontalScrollbar.get()); 102 104 m_horizontalScrollbar = 0; 103 return !wasOverlayScrollbar; 105 if (contentSizeAffected) 106 *contentSizeAffected = !wasOverlayScrollbar; 107 return true; 104 108 } 105 109 … … 107 111 } 108 112 109 bool ScrollView::setHasVerticalScrollbar(bool hasBar )113 bool ScrollView::setHasVerticalScrollbar(bool hasBar, bool* contentSizeAffected) 110 114 { 111 115 ASSERT(!hasBar || !avoidScrollbarCreation()); … … 115 119 didAddScrollbar(m_verticalScrollbar.get(), VerticalScrollbar); 116 120 m_verticalScrollbar->styleChanged(); 117 return !m_verticalScrollbar->isOverlayScrollbar(); 121 if (contentSizeAffected) 122 *contentSizeAffected = !m_verticalScrollbar->isOverlayScrollbar(); 123 return true; 118 124 } 119 125 … … 123 129 removeChild(m_verticalScrollbar.get()); 124 130 m_verticalScrollbar = 0; 125 return !wasOverlayScrollbar; 131 if (contentSizeAffected) 132 *contentSizeAffected = !wasOverlayScrollbar; 133 return true; 126 134 } 127 135 … … 523 531 newHasVerticalScrollbar = (vScroll == ScrollbarAlwaysOn); 524 532 533 bool scrollbarAddedOrRemoved = false; 534 525 535 if (m_scrollbarsSuppressed || (hScroll != ScrollbarAuto && vScroll != ScrollbarAuto)) { 526 if (hasHorizontalScrollbar != newHasHorizontalScrollbar && (hasHorizontalScrollbar || !avoidScrollbarCreation())) 527 setHasHorizontalScrollbar(newHasHorizontalScrollbar); 528 if (hasVerticalScrollbar != newHasVerticalScrollbar && (hasVerticalScrollbar || !avoidScrollbarCreation())) 529 setHasVerticalScrollbar(newHasVerticalScrollbar); 536 if (hasHorizontalScrollbar != newHasHorizontalScrollbar && (hasHorizontalScrollbar || !avoidScrollbarCreation())) { 537 if (setHasHorizontalScrollbar(newHasHorizontalScrollbar)) 538 scrollbarAddedOrRemoved = true; 539 } 540 541 if (hasVerticalScrollbar != newHasVerticalScrollbar && (hasVerticalScrollbar || !avoidScrollbarCreation())) { 542 if (setHasVerticalScrollbar(newHasVerticalScrollbar)) 543 scrollbarAddedOrRemoved = true; 544 } 530 545 } else { 531 546 bool sendContentResizedNotification = false; … … 558 573 m_horizontalScrollbar->invalidate(); 559 574 560 sendContentResizedNotification = setHasHorizontalScrollbar(newHasHorizontalScrollbar); 575 bool changeAffectsContentSize = false; 576 if (setHasHorizontalScrollbar(newHasHorizontalScrollbar, &changeAffectsContentSize)) { 577 scrollbarAddedOrRemoved = true; 578 sendContentResizedNotification |= changeAffectsContentSize; 579 } 561 580 } 562 581 … … 567 586 m_verticalScrollbar->invalidate(); 568 587 569 sendContentResizedNotification = setHasVerticalScrollbar(newHasVerticalScrollbar); 588 bool changeAffectsContentSize = false; 589 if (setHasVerticalScrollbar(newHasVerticalScrollbar, &changeAffectsContentSize)) { 590 scrollbarAddedOrRemoved = true; 591 sendContentResizedNotification |= changeAffectsContentSize; 592 } 570 593 } 571 594 … … 583 606 m_updateScrollbarsPass--; 584 607 } 608 609 if (scrollbarAddedOrRemoved) 610 addedOrRemovedScrollbar(); 585 611 } 586 612 -
trunk/Source/WebCore/platform/ScrollView.h
r155660 r156201 312 312 313 313 virtual void visibleContentsResized() = 0; 314 virtual void addedOrRemovedScrollbar() = 0; 314 315 virtual void delegatesScrollingDidChange() { } 315 316 virtual void fixedLayoutSizeChanged(); 316 317 317 318 // These functions are used to create/destroy scrollbars. 318 // They return true if the s pace taken up by the scrollbar changed.319 bool setHasHorizontalScrollbar(bool );320 bool setHasVerticalScrollbar(bool );319 // They return true if the scrollbar was added or removed. 320 bool setHasHorizontalScrollbar(bool, bool* contentSizeAffected = 0); 321 bool setHasVerticalScrollbar(bool, bool* contentSizeAffected = 0); 321 322 322 323 virtual void updateScrollCorner(); -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r156200 r156201 1341 1341 } 1342 1342 1343 void RenderLayerCompositor::frameViewDidAddOrRemoveScrollbars() 1344 { 1345 updateOverflowControlsLayers(); 1346 } 1347 1343 1348 void RenderLayerCompositor::frameViewDidLayout() 1344 1349 { … … 2741 2746 #endif 2742 2747 #if PLATFORM(MAC) && USE(CA) 2743 m_layerForVerticalScrollbar->setAcceleratesDrawing(acceleratedDrawingEnabled());2748 m_layerForVerticalScrollbar->setAcceleratesDrawing(acceleratedDrawingEnabled()); 2744 2749 #endif 2745 2750 m_overflowControlsHostLayer->addChild(m_layerForVerticalScrollbar.get()); -
trunk/Source/WebCore/rendering/RenderLayerCompositor.h
r155591 r156201 236 236 void frameViewDidChangeSize(); 237 237 void frameViewDidScroll(); 238 void frameViewDidAddOrRemoveScrollbars(); 238 239 void frameViewDidLayout(); 239 240 void rootFixedBackgroundsChanged();
Note:
See TracChangeset
for help on using the changeset viewer.