Changeset 48064 in webkit
- Timestamp:
- Sep 4, 2009 10:59:46 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r48063 r48064 1 2009-09-04 Mark Mentovai <mark@chromium.org> 2 3 Reviewed by Dave Hyatt. 4 5 https://bugs.webkit.org/show_bug.cgi?id=28614 6 7 Account for scrollbar state changes that occur during layout. 8 9 * platform/ScrollView.cpp: 10 (WebCore::ScrollView::updateScrollbars): 11 12 Perform a layout prior to checking whether the scrollbar modes are 13 off, on, or automatic. The modes may change during layout. 14 15 * WebCore.base.exp: 16 * WebCore.order: 17 * page/Frame.cpp: 18 (WebCore::Frame::createView): 19 * page/FrameView.cpp: 20 (WebCore::FrameView::FrameView): 21 (WebCore::FrameView::resetScrollbars): 22 (WebCore::FrameView::layout): 23 * page/FrameView.h: 24 * platform/ScrollView.h: 25 26 Eliminate duplicated (and incorrect) scrollbar mode tracking between 27 FrameView and ScrollView. 28 1 29 2009-09-04 Yael Aharon <yael.aharon@nokia.com> 2 30 -
trunk/WebCore/WebCore.base.exp
r48057 r48064 693 693 __ZN7WebCore9FrameView12setMediaTypeERKNS_6StringE 694 694 __ZN7WebCore9FrameView14adjustViewSizeEv 695 __ZN7WebCore9FrameView14initScrollbarsEv696 695 __ZN7WebCore9FrameView14setMarginWidthEi 697 696 __ZN7WebCore9FrameView14setNeedsLayoutEv -
trunk/WebCore/WebCore.order
r47797 r48064 335 335 __ZN7WebCore6Widget21releasePlatformWidgetEv 336 336 __ZN7WebCore6Widget20retainPlatformWidgetEv 337 __ZN7WebCore9FrameView14initScrollbarsEv338 __ZN7WebCore9FrameView27updateDefaultScrollbarStateEv339 337 __ZNK7WebCore10ScrollView14scrollbarModesERNS_13ScrollbarModeES2_ 340 338 __ZNK7WebCore10ScrollView22platformScrollbarModesERNS_13ScrollbarModeES2_ … … 5760 5758 __ZN7WebCore10ScrollView16platformAddChildEPNS_6WidgetE 5761 5759 __ZN7WebCore16RenderPartObject11viewClearedEv 5762 __ZN7WebCore9FrameView20setCanHaveScrollbarsEb5763 5760 __ZN7WebCore10ScrollView20setCanHaveScrollbarsEb 5764 5761 __ZNK7WebCore14SecurityOrigin9canAccessEPKS0_ -
trunk/WebCore/page/Frame.cpp
r48057 r48064 1794 1794 1795 1795 frameView->setScrollbarModes(horizontalScrollbarMode, verticalScrollbarMode); 1796 frameView->updateDefaultScrollbarState();1797 1796 1798 1797 setView(frameView); -
trunk/WebCore/page/FrameView.cpp
r47835 r48064 94 94 FrameView::FrameView(Frame* frame) 95 95 : m_frame(frame) 96 , m_vmode(ScrollbarAuto)97 , m_hmode(ScrollbarAuto)98 96 , m_slowRepaintObjectCount(0) 99 97 , m_layoutTimer(this, &FrameView::layoutTimerFired) 100 98 , m_layoutRoot(0) 101 99 , m_postLayoutTasksTimer(this, &FrameView::postLayoutTimerFired) 102 , m_needToInitScrollbars(true)103 100 , m_isTransparent(false) 104 101 , m_baseBackgroundColor(Color::white) … … 211 208 m_firstLayout = true; 212 209 setScrollbarsSuppressed(true); 213 setScrollbarModes( m_hmode, m_vmode);210 setScrollbarModes(ScrollbarAuto, ScrollbarAuto); 214 211 setScrollbarsSuppressed(false); 215 212 } … … 285 282 } 286 283 287 void FrameView::initScrollbars()288 {289 if (!m_needToInitScrollbars)290 return;291 m_needToInitScrollbars = false;292 updateDefaultScrollbarState();293 }294 295 void FrameView::updateDefaultScrollbarState()296 {297 m_hmode = horizontalScrollbarMode();298 m_vmode = verticalScrollbarMode();299 setScrollbarModes(m_hmode, m_vmode);300 }301 302 284 void FrameView::invalidateRect(const IntRect& rect) 303 285 { … … 331 313 // make it update the rendering area when set 332 314 m_margins.setHeight(h); 333 }334 335 void FrameView::setCanHaveScrollbars(bool canScroll)336 {337 ScrollView::setCanHaveScrollbars(canScroll);338 scrollbarModes(m_hmode, m_vmode);339 315 } 340 316 … … 578 554 m_nestedLayoutCount++; 579 555 580 ScrollbarMode hMode = m_hmode; 581 ScrollbarMode vMode = m_vmode; 556 ScrollbarMode hMode; 557 ScrollbarMode vMode; 558 scrollbarModes(hMode, vMode); 582 559 583 560 if (!subtree) { -
trunk/WebCore/page/FrameView.h
r47835 r48064 70 70 void setMarginHeight(int); 71 71 72 virtual void setCanHaveScrollbars(bool);73 74 72 virtual PassRefPtr<Scrollbar> createScrollbar(ScrollbarOrientation); 75 73 … … 123 121 124 122 void adjustViewSize(); 125 void initScrollbars();126 void updateDefaultScrollbarState();127 123 128 124 virtual IntRect windowClipRect(bool clipToContents = true) const; … … 252 248 bool m_doFullRepaint; 253 249 254 ScrollbarMode m_vmode;255 ScrollbarMode m_hmode;256 250 bool m_useSlowRepaints; 257 251 bool m_isOverlapped; … … 273 267 274 268 bool m_firstLayout; 275 bool m_needToInitScrollbars;276 269 bool m_isTransparent; 277 270 Color m_baseBackgroundColor; -
trunk/WebCore/platform/ScrollView.cpp
r47909 r48064 330 330 return; 331 331 332 // If we came in here with the view already needing a layout, then go ahead and do that 333 // first. (This will be the common case, e.g., when the page changes due to window resizing for example). 334 // This layout will not re-enter updateScrollbars and does not count towards our max layout pass total. 335 if (!m_scrollbarsSuppressed) { 336 m_inUpdateScrollbars = true; 337 visibleContentsResized(); 338 m_inUpdateScrollbars = false; 339 } 340 332 341 bool hasHorizontalScrollbar = m_horizontalScrollbar; 333 342 bool hasVerticalScrollbar = m_verticalScrollbar; … … 350 359 setHasVerticalScrollbar(newHasVerticalScrollbar); 351 360 } else { 352 // If we came in here with the view already needing a layout, then go ahead and do that353 // first. (This will be the common case, e.g., when the page changes due to window resizing for example).354 // This layout will not re-enter updateScrollers and does not count towards our max layout pass total.355 m_inUpdateScrollbars = true;356 visibleContentsResized();357 m_inUpdateScrollbars = false;358 359 361 bool sendContentResizedNotification = false; 360 362 -
trunk/WebCore/platform/ScrollView.h
r47531 r48064 90 90 ScrollbarMode horizontalScrollbarMode() const { ScrollbarMode horizontal, vertical; scrollbarModes(horizontal, vertical); return horizontal; } 91 91 ScrollbarMode verticalScrollbarMode() const { ScrollbarMode horizontal, vertical; scrollbarModes(horizontal, vertical); return vertical; } 92 v irtual void setCanHaveScrollbars(bool flag);92 void setCanHaveScrollbars(bool flag); 93 93 bool canHaveScrollbars() const { return horizontalScrollbarMode() != ScrollbarAlwaysOff || verticalScrollbarMode() != ScrollbarAlwaysOff; } 94 94 -
trunk/WebKit/mac/ChangeLog
r48057 r48064 1 2009-09-04 Mark Mentovai <mark@chromium.org> 2 3 Reviewed by Dave Hyatt. 4 5 https://bugs.webkit.org/show_bug.cgi?id=28614 6 7 Account for scrollbar state changes that occur during layout. 8 9 * WebView/WebDynamicScrollBarsView.mm: 10 (-[WebDynamicScrollBarsView updateScrollers]): 11 12 Perform a layout prior to checking whether the scrollbar modes are 13 off, on, or automatic. The modes may change during layout. 14 15 * WebView/WebFrameView.mm: 16 (-[WebFrameView _install]): 17 18 Eliminate duplicated (and incorrect) scrollbar mode tracking between 19 FrameView and ScrollView. 20 1 21 2009-09-03 Dave Hyatt <hyatt@apple.com> 2 22 -
trunk/WebKit/mac/WebView/WebDynamicScrollBarsView.mm
r47909 r48064 90 90 - (void)updateScrollers 91 91 { 92 NSView *documentView = [self documentView]; 93 94 // If we came in here with the view already needing a layout, then go ahead and do that 95 // first. (This will be the common case, e.g., when the page changes due to window resizing for example). 96 // This layout will not re-enter updateScrollers and does not count towards our max layout pass total. 97 if (!suppressLayout && !suppressScrollers && [documentView isKindOfClass:[WebHTMLView class]]) { 98 WebHTMLView* htmlView = (WebHTMLView*)documentView; 99 if ([htmlView _needsLayout]) { 100 inUpdateScrollers = YES; 101 [(id <WebDocumentView>)documentView layout]; 102 inUpdateScrollers = NO; 103 } 104 } 105 106 BOOL hasHorizontalScroller = [self hasHorizontalScroller]; 92 107 BOOL hasVerticalScroller = [self hasVerticalScroller]; 93 BOOL hasHorizontalScroller = [self hasHorizontalScroller];94 108 95 109 BOOL newHasHorizontalScroller = hasHorizontalScroller; 96 110 BOOL newHasVerticalScroller = hasVerticalScroller; 97 111 98 BOOL needsLayout = NO;99 100 NSView *documentView = [self documentView];101 112 if (!documentView) { 102 113 newHasHorizontalScroller = NO; … … 123 134 } 124 135 125 needsLayout = NO; 126 127 // If we came in here with the view already needing a layout, then go ahead and do that 128 // first. (This will be the common case, e.g., when the page changes due to window resizing for example). 129 // This layout will not re-enter updateScrollers and does not count towards our max layout pass total. 130 if ([documentView isKindOfClass:[WebHTMLView class]]) { 131 WebHTMLView* htmlView = (WebHTMLView*)documentView; 132 if ([htmlView _needsLayout]) { 133 inUpdateScrollers = YES; 134 [(id <WebDocumentView>)documentView layout]; 135 inUpdateScrollers = NO; 136 } 137 } 136 BOOL needsLayout = NO; 138 137 139 138 NSSize documentSize = [documentView frame].size; -
trunk/WebKit/mac/WebView/WebFrameView.mm
r45386 r48064 274 274 // Now the render part owns the view, so we don't any more. 275 275 } 276 277 view->initScrollbars();278 276 } 279 277 -
trunk/WebKit/qt/Api/qwebframe.cpp
r47963 r48064 802 802 if (d->frame->view()) { 803 803 d->frame->view()->setHorizontalScrollbarMode((ScrollbarMode)policy); 804 d->frame->view()->updateDefaultScrollbarState();805 804 } 806 805 } else { … … 808 807 if (d->frame->view()) { 809 808 d->frame->view()->setVerticalScrollbarMode((ScrollbarMode)policy); 810 d->frame->view()->updateDefaultScrollbarState();811 809 } 812 810 } -
trunk/WebKit/qt/ChangeLog
r48041 r48064 1 2009-09-04 Mark Mentovai <mark@chromium.org> 2 3 Reviewed by Dave Hyatt. 4 5 https://bugs.webkit.org/show_bug.cgi?id=28614 6 7 Account for scrollbar state changes that occur during layout. 8 9 * Api/qwebframe.cpp: 10 (QWebFrame::setScrollBarPolicy): 11 12 Eliminate duplicated (and incorrect) scrollbar mode tracking between 13 FrameView and ScrollView. 14 1 15 2009-09-04 Laszlo Gombos <laszlo.1.gombos@nokia.com> 2 16
Note: See TracChangeset
for help on using the changeset viewer.