-
tonikitoo@webkit.org authored
Reviewed by David Hyatt. [Qt] REGRESSION:(r50665) QWebFrame::setScrollBarPolicy(Qt::Vertical,Qt::ScrollBarAlwaysOff) has no effect. https://bugs.webkit.org/show_bug.cgi?id=29431 Test: fast/overflow/scrollbar-restored-and-then-locked.html WebCore: Patch introduces a lock scrollbars concept to ScrollView, as in WebDynamicScrollBarsView.mm/h on WebKit/mac. It is needed because in QtWebKit, we have Api for setting both vertical and horizontal scrollbars on/off/auto. When it is set to off, for example, it should remain as such, unless unset. For the locking concept, optional 'lock' parameters were added to setScrollbarModes, setHorizontalScrollbarMode and setVerticalScrollbarMode methods of ScrollView. As these are all optional, any previous code calling them do not need modification. Two optional parameters were also added to Frame's createView method, for horizontal and vertical lock state persistence cross page loads. * WebCore.base.exp: * page/Frame.cpp: (WebCore::Frame::createView): * platform/ScrollView.cpp: (WebCore::ScrollView::ScrollView): (WebCore::ScrollView::setScrollbarModes): (WebCore::ScrollView::setHorizontalScrollbarMode): (WebCore::ScrollView::setVerticalScrollbarMode): * platform/ScrollView.h: (WebCore::ScrollView::setHorizontalScrollbarLock): (WebCore::ScrollView::isHorizontalScrollbarLocked): (WebCore::ScrollView::setVerticalScrollbarLock): (WebCore::ScrollView::isVerticalScrollbarLocked): (WebCore::ScrollView::setScrollingModesLocked): WebKit/qt: Make use of the new lock parameter of set{Vertical,Horizontal}ScrollbarMode. Always added a qt auto test for set scrollbar policy feature. * Api/qwebframe.cpp: (QWebFrame::setScrollBarPolicy): * tests/qwebframe/tst_qwebframe.cpp: * WebCoreSupport/FrameLoaderClientQt.cpp: (FrameLoaderClientQt::transitionToCommittedForNewPage): WebKitTools: Make possible to DRT to set scrollbar policies (on, off or auto). * DumpRenderTree/qt/LayoutTestControllerQt.cpp: (LayoutTestController::setScrollbarPolicy): * DumpRenderTree/qt/LayoutTestControllerQt.h: * QtLauncher/main.cpp: (LauncherWindow::toggleScrollbars): (LauncherWindow::createChrome): LayoutTests: * fast/overflow/scrollbar-restored-and-then-locked-expected.txt: Added. * fast/overflow/scrollbar-restored-and-then-locked.html: Added. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@57277 268f45cc-cd09-0410-ab3c-d52691b4dbfc
18656aea