Changeset 138933 in webkit
- Timestamp:
- Jan 7, 2013 2:09:16 AM (11 years ago)
- Location:
- trunk/Source/WebKit/qt
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/qt/ChangeLog
r138427 r138933 1 2013-01-07 Michael Brüning <michael.bruning@digia.com> 2 3 [Qt] Horizontal scrollbars events are offseted making them difficult to use 4 https://bugs.webkit.org/show_bug.cgi?id=105014 5 6 Reviewed by Allan Sandfeld Jensen. 7 8 Patch co-authored by Simon Hausmann. 9 10 Only copy the layout direction from the facade options if the 11 current option is Qt::LayoutDirectionAuto in order to prevent 12 misinterpretations as different layout direction when hit testing. 13 14 Tests added to tst_qwebview and tst_qgraphicswebview to verify 15 that the view actually is scrolled in the right direction. 16 17 * WidgetSupport/QStyleFacadeImp.cpp: 18 (WebKit::initGenericStyleOption): 19 * tests/qgraphicswebview/resources/scrolltest_page.html: Added. 20 * tests/qgraphicswebview/tst_qgraphicswebview.cpp: 21 (tst_QGraphicsWebView): 22 (tst_QGraphicsWebView::horizontalScrollbarTest): 23 * tests/qgraphicswebview/tst_qgraphicswebview.qrc: 24 * tests/qwebview/resources/scrolltest_page.html: Added. 25 * tests/qwebview/tst_qwebview.cpp: 26 (tst_QWebView): 27 (tst_QWebView::horizontalScrollbarTest): 28 * tests/qwebview/tst_qwebview.qrc: 29 1 30 2012-12-23 Alexey Proskuryakov <ap@apple.com> 2 31 -
trunk/Source/WebKit/qt/WidgetSupport/QStyleFacadeImp.cpp
r136685 r138933 78 78 option->rect = facadeOption.rect; 79 79 option->state = convertToQStyleState(facadeOption.state); 80 option->direction = facadeOption.direction; 80 if (option->direction == Qt::LayoutDirectionAuto) 81 option->direction = facadeOption.direction; 81 82 option->palette = facadeOption.palette; 82 83 } -
trunk/Source/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp
r128158 r138933 43 43 void widgetsRenderingThroughCache(); 44 44 void windowResizeEvent(); 45 void horizontalScrollbarTest(); 45 46 46 47 #if !(defined(WTF_USE_QT_MOBILE_THEME) && WTF_USE_QT_MOBILE_THEME) … … 681 682 } 682 683 684 void tst_QGraphicsWebView::horizontalScrollbarTest() 685 { 686 QWebPage* page = new QWebPage; 687 GraphicsWebView* webView = new GraphicsWebView; 688 webView->setPage(page); 689 webView->setGeometry(QRect(0, 0, 600, 600)); 690 QGraphicsView* view = new QGraphicsView; 691 QGraphicsScene* scene = new QGraphicsScene(view); 692 view->setScene(scene); 693 scene->addItem(webView); 694 695 // Turn off scrolling on the containing QGraphicsView, let the 696 // QGraphicsWebView handle the scrolling by itself. 697 view->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); 698 view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); 699 view->show(); 700 QCoreApplication::processEvents(); 701 702 QUrl url("qrc:///resources/scrolltest_page.html"); 703 page->mainFrame()->load(url); 704 page->mainFrame()->setFocus(); 705 706 QVERIFY(waitForSignal(page, SIGNAL(loadFinished(bool)))); 707 708 QVERIFY(webView->page()->mainFrame()->scrollPosition() == QPoint(0, 0)); 709 710 // Note: The test below assumes that the layout direction is Qt::LeftToRight. 711 webView->fireMouseClick(QPointF(550.0, 590.0)); 712 QVERIFY(page->mainFrame()->scrollPosition().x() > 0); 713 714 // Note: The test below assumes that the layout direction is Qt::LeftToRight. 715 webView->fireMouseClick(QPointF(20.0, 590.0)); 716 QVERIFY(page->mainFrame()->scrollPosition() == QPoint(0, 0)); 717 718 delete webView; 719 delete view; 720 } 721 683 722 QTEST_MAIN(tst_QGraphicsWebView) 684 723 -
trunk/Source/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.qrc
r97945 r138933 5 5 <file>resources/pointing_up.html</file> 6 6 <file>resources/greendiv.html</file> 7 <file>resources/scrolltest_page.html</file> 7 8 </qresource> 8 9 </RCC> -
trunk/Source/WebKit/qt/tests/qwebview/tst_qwebview.cpp
r136235 r138933 53 53 void microFocusCoordinates(); 54 54 void focusInputTypes(); 55 void horizontalScrollbarTest(); 55 56 56 57 void crashTests(); … … 303 304 QVERIFY(webView.testAttribute(Qt::WA_InputMethodEnabled)); 304 305 } 306 307 void tst_QWebView::horizontalScrollbarTest() 308 { 309 QWebView webView; 310 webView.resize(600, 600); 311 webView.show(); 312 QTest::qWaitForWindowExposed(&webView); 313 314 QUrl url("qrc:///resources/scrolltest_page.html"); 315 QWebFrame* const mainFrame = webView.page()->mainFrame(); 316 mainFrame->load(url); 317 mainFrame->setFocus(); 318 319 QVERIFY(waitForSignal(&webView, SIGNAL(loadFinished(bool)))); 320 321 QVERIFY(webView.page()->mainFrame()->scrollPosition() == QPoint(0, 0)); 322 323 // Note: The test below assumes that the layout direction is Qt::LeftToRight. 324 QTest::mouseClick(&webView, Qt::LeftButton, 0, QPoint(550, 595)); 325 QVERIFY(webView.page()->mainFrame()->scrollPosition().x() > 0); 326 327 // Note: The test below assumes that the layout direction is Qt::LeftToRight. 328 QTest::mouseClick(&webView, Qt::LeftButton, 0, QPoint(20, 595)); 329 QVERIFY(webView.page()->mainFrame()->scrollPosition() == QPoint(0, 0)); 330 } 331 305 332 306 333 #if !(defined(WTF_USE_QT_MOBILE_THEME) && WTF_USE_QT_MOBILE_THEME) -
trunk/Source/WebKit/qt/tests/qwebview/tst_qwebview.qrc
r60958 r138933 4 4 <file>resources/frame_a.html</file> 5 5 <file>resources/input_types.html</file> 6 <file>resources/scrolltest_page.html</file> 6 7 </qresource> 7 8 </RCC>
Note: See TracChangeset
for help on using the changeset viewer.