Changeset 651 for trunk/src/3rdparty/webkit/WebKit
- Timestamp:
- Mar 8, 2010, 12:52:58 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.6.2 (added) merged: 650 /branches/vendor/nokia/qt/current merged: 649 /branches/vendor/nokia/qt/4.6.1 removed
- Property svn:mergeinfo changed
-
trunk/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
r561 r651 1370 1370 fromPage = qMax(1, fromPage); 1371 1371 toPage = qMin(printContext.pageCount(), toPage); 1372 if (toPage < fromPage) { 1373 // if the user entered a page range outside the actual number 1374 // of printable pages, just return 1375 return; 1376 } 1372 1377 1373 1378 if (printer->pageOrder() == QPrinter::LastPageFirst) { -
trunk/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
r561 r651 1709 1709 if (loader) 1710 1710 loader->detachFromParent(); 1711 if (d->inspector) 1712 d->inspector->setPage(0); 1711 if (d->inspector) { 1712 // Since we have to delete an internal inspector, 1713 // call setInspector(0) directly to prevent potential crashes 1714 if (d->inspectorIsInternalOnly) 1715 d->setInspector(0); 1716 else 1717 d->inspector->setPage(0); 1718 } 1713 1719 delete d; 1714 1720 } -
trunk/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp
r561 r651 57 57 view->setPage(0); 58 58 } 59 60 #ifdef Q_WS_MAEMO_5 61 #include "qabstractkineticscroller.h" 62 63 class QWebViewKineticScroller : public QAbstractKineticScroller { 64 public: 65 QWebViewKineticScroller() : QAbstractKineticScroller() {} 66 // remember the frame where the button was pressed 67 bool eventFilter(QObject* o, QEvent* ev) 68 { 69 switch (ev->type()) { 70 case QEvent::MouseButtonPress: { 71 QWebFrame* hitFrame = scrollingFrameAt(static_cast<QMouseEvent*>(ev)->pos()); 72 if (hitFrame) 73 m_frame = hitFrame; 74 break; 75 } 76 default: 77 break; 78 } 79 return QAbstractKineticScroller::eventFilter(o, ev); 80 } 81 82 protected: 83 QWebFrame* currentFrame() const 84 { 85 if (!m_frame.isNull()) 86 return m_frame.data(); 87 88 QWebView* view = static_cast<QWebView*>(widget()); 89 QWebFrame* frame = view->page()->mainFrame(); 90 return frame; 91 } 92 93 // Returns the innermost frame at the given position that can scroll. 94 QWebFrame* scrollingFrameAt(const QPoint& pos) const 95 { 96 QWebView* view = static_cast<QWebView*>(widget()); 97 QWebFrame* mainFrame = view->page()->mainFrame(); 98 QWebFrame* hitFrame = mainFrame->hitTestContent(pos).frame(); 99 QSize range = hitFrame->contentsSize() - hitFrame->geometry().size(); 100 101 while (hitFrame && range.width() <= 1 && range.height() <= 1) 102 hitFrame = hitFrame->parentFrame(); 103 104 return hitFrame; 105 } 106 107 void attachToWidget() 108 { 109 QWebView* view = static_cast<QWebView*>(widget()); 110 QWebFrame* mainFrame = view->page()->mainFrame(); 111 m_oldHorizontalScrollBarPolicy = mainFrame->scrollBarPolicy(Qt::Horizontal); 112 m_oldVerticalScrollBarPolicy = mainFrame->scrollBarPolicy(Qt::Vertical); 113 mainFrame->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff); 114 mainFrame->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff); 115 view->installEventFilter(this); 116 } 117 118 void removeFromWidget() 119 { 120 QWebView* view = static_cast<QWebView*>(widget()); 121 view->removeEventFilter(this); 122 QWebFrame* mainFrame = view->page()->mainFrame(); 123 mainFrame->setScrollBarPolicy(Qt::Vertical, m_oldVerticalScrollBarPolicy); 124 mainFrame->setScrollBarPolicy(Qt::Horizontal, m_oldHorizontalScrollBarPolicy); 125 } 126 127 QRect positionRange() const 128 { 129 QRect r; 130 QWebFrame* frame = currentFrame(); 131 r.setSize(frame->contentsSize() - frame->geometry().size()); 132 return r; 133 } 134 135 QPoint position() const 136 { 137 QWebFrame* frame = currentFrame(); 138 return frame->scrollPosition(); 139 } 140 141 QSize viewportSize() const 142 { 143 return static_cast<QWebView*>(widget())->page()->viewportSize(); 144 } 145 146 void setPosition(const QPoint& point, const QPoint& /* overShootDelta */) 147 { 148 QWebFrame* frame = currentFrame(); 149 frame->setScrollPosition(point); 150 } 151 152 QPointer<QWebFrame> m_frame; 153 Qt::ScrollBarPolicy m_oldVerticalScrollBarPolicy; 154 Qt::ScrollBarPolicy m_oldHorizontalScrollBarPolicy; 155 }; 156 157 #endif // Q_WS_MAEMO_5 158 59 159 60 160 /*! … … 154 254 #endif 155 255 256 #if defined(Q_WS_MAEMO_5) 257 QAbstractKineticScroller* scroller = new QWebViewKineticScroller(); 258 scroller->setWidget(this); 259 #endif 156 260 setAcceptDrops(true); 157 261 -
trunk/src/3rdparty/webkit/WebKit/qt/ChangeLog
r561 r651 1 2010-01-28 Kenneth Rohde Christiansen <kenneth@webkit.org> 2 3 Reviewed by Simon Hausmann. 4 5 Do not set the combobox font on Maemo5 and S60; use the 6 default instead. 7 8 * WebCoreSupport/QtFallbackWebPopup.cpp: 9 (WebCore::QtFallbackWebPopup::populate): 10 11 2010-01-28 Andreas Kling <andreas.kling@nokia.com> 12 13 Reviewed by Kenneth Rohde Christiansen. 14 15 [Qt] Support kinetic scrolling on Maemo 5 16 17 https://bugs.webkit.org/show_bug.cgi?id=34267 18 19 Patch by Ralf Engels <ralf.engels@nokia.com> and 20 Robert Griebl <rgriebl@trolltech.com> 21 22 * Api/qwebview.cpp: 23 (QWebViewKineticScroller::QWebViewKineticScroller): 24 (QWebViewKineticScroller::eventFilter): 25 (QWebViewKineticScroller::currentFrame): 26 (QWebViewKineticScroller::scrollingFrameAt): 27 (QWebViewKineticScroller::attachToWidget): 28 (QWebViewKineticScroller::removeFromWidget): 29 (QWebViewKineticScroller::positionRange): 30 (QWebViewKineticScroller::position): 31 (QWebViewKineticScroller::viewportSize): 32 (QWebViewKineticScroller::setPosition): 33 (QWebView::QWebView): 34 35 2010-01-29 Kenneth Rohde Christiansen <kenneth@webkit.org> 36 37 Reviewed by Simon Hausmann 38 39 Disable auto-uppercase and predictive text on Maemo5, just like the 40 build-in MicroB Browser. 41 42 * WebCoreSupport/EditorClientQt.cpp: 43 (WebCore::EditorClientQt::setInputMethodState): 44 45 2010-01-28 Trond Kjernåsen <trond@trolltech.com> 46 47 Reviewed by Simon Hausmann. 48 49 [Qt] Fix for endless print loop when printing web pages 50 51 * Api/qwebframe.cpp: 52 (QWebFrame::print): 53 54 2010-01-26 Simon Hausmann <simon.hausmann@nokia.com> 55 56 Reviewed by Kenneth Rohde Christiansen. 57 58 [Qt] Show comboboxes on Maemo 5 59 https://bugs.webkit.org/show_bug.cgi?id=34088 60 61 Don't try to show the combobox by simulating a mouse event from QCursor::pos() to 62 get the combobox position right. The position on Maemo 5 is independent from the mouse 63 and there's no QCursor::pos(). 64 65 * WebCoreSupport/QtFallbackWebPopup.cpp: 66 (WebCore::QtFallbackWebPopup::show): 67 68 2010-01-26 Holger Hans Peter Freyther <zecke@selfish.org> 69 70 Reviewed by Simon Hausmann. 71 72 [Qt] JavaScript prompt is currently broken 73 https://bugs.webkit.org/show_bug.cgi?id=30914 74 75 In r52152 a patch was landed to convert a null QString 76 to an empty WebCore::String in case the prompt was accepted 77 but the default implementation returned the null QString. 78 79 The patch tried to avoid assign to result twice and 80 was not checking the QString if it is null but the default 81 value. This lead to always returning an empty string on 82 successful prompts. Fix it by checking the variable 'x' 83 for isNull. 84 85 The manual test case used didn't cover the case of non 86 empty input, replace it with an automatic test case that 87 should cover all cases. 88 89 * WebCoreSupport/ChromeClientQt.cpp: 90 (WebCore::ChromeClientQt::runJavaScriptPrompt): Fix the bug. 91 * tests/qwebpage/tst_qwebpage.cpp: Add automatic test case 92 (JSPromptPage::JSPromptPage): 93 (JSPromptPage::javaScriptPrompt): 94 (tst_QWebPage::testJSPrompt): 95 96 2010-01-25 Janne Koskinen <janne.p.koskinen@digia.com> 97 98 Reviewed by Simon Hausmann. 99 100 [Qt] Phone backup support for QtWebkit for Symbian devices. 101 https://bugs.webkit.org/show_bug.cgi?id=34077 102 103 * symbian/backup_registration.xml: Added. 104 105 2009-11-19 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> 106 107 Reviewed by Kenneth Rohde Christiansen. 108 109 [Qt] Fix QWebInspector destruction problem. 110 https://bugs.webkit.org/show_bug.cgi?id=31664 111 112 * Api/qwebpage.cpp: 113 (QWebPage::~QWebPage): 114 1 115 2010-01-14 Simon Hausmann <simon.hausmann@nokia.com> 2 116 -
trunk/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
r561 r651 282 282 // Fix up a quirk in the QInputDialog class. If no input happened the string should be empty 283 283 // but it is null. See https://bugs.webkit.org/show_bug.cgi?id=30914. 284 if (rc && result.isNull())284 if (rc && x.isNull()) 285 285 result = String(""); 286 286 else -
trunk/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
r561 r651 616 616 } 617 617 webPageClient->setInputMethodHint(Qt::ImhHiddenText, isPasswordField); 618 #endif 618 #ifdef Q_WS_MAEMO_5 619 // Maemo 5 MicroB Browser disables auto-uppercase and predictive text, thus, so do we. 620 webPageClient->setInputMethodHint(Qt::ImhNoAutoUppercase, true); 621 webPageClient->setInputMethodHint(Qt::ImhNoPredictiveText, true); 622 #endif // Q_WS_MAEMO_5 623 #endif // QT_VERSION check 619 624 webPageClient->setInputMethodEnabled(active); 620 625 } -
trunk/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
r561 r651 2 2 Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 3 3 Copyright (C) 2009 Girish Ramakrishnan <girish@forwardbias.in> 4 Copyright (C) 2010 Holger Hans Peter Freyther 4 5 5 6 This library is free software; you can redistribute it and/or … … 155 156 156 157 void originatingObjectInNetworkRequests(); 158 void testJSPrompt(); 157 159 158 160 private: … … 1782 1784 } 1783 1785 1786 /** 1787 * Test fixups for https://bugs.webkit.org/show_bug.cgi?id=30914 1788 * 1789 * From JS we test the following conditions. 1790 * 1791 * OK + QString() => SUCCESS, empty string (but not null) 1792 * OK + "text" => SUCCESS, "text" 1793 * CANCEL + QString() => CANCEL, null string 1794 * CANCEL + "text" => CANCEL, null string 1795 */ 1796 class JSPromptPage : public QWebPage { 1797 Q_OBJECT 1798 public: 1799 JSPromptPage() 1800 {} 1801 1802 bool javaScriptPrompt(QWebFrame* frame, const QString& msg, const QString& defaultValue, QString* result) 1803 { 1804 if (msg == QLatin1String("test1")) { 1805 *result = QString(); 1806 return true; 1807 } else if (msg == QLatin1String("test2")) { 1808 *result = QLatin1String("text"); 1809 return true; 1810 } else if (msg == QLatin1String("test3")) { 1811 *result = QString(); 1812 return false; 1813 } else if (msg == QLatin1String("test4")) { 1814 *result = QLatin1String("text"); 1815 return false; 1816 } 1817 1818 qFatal("Unknown msg."); 1819 return QWebPage::javaScriptPrompt(frame, msg, defaultValue, result); 1820 } 1821 }; 1822 1823 void tst_QWebPage::testJSPrompt() 1824 { 1825 JSPromptPage page; 1826 bool res; 1827 1828 // OK + QString() 1829 res = page.mainFrame()->evaluateJavaScript( 1830 "var retval = prompt('test1');" 1831 "retval=='' && retval.length == 0;").toBool(); 1832 QVERIFY(res); 1833 1834 // OK + "text" 1835 res = page.mainFrame()->evaluateJavaScript( 1836 "var retval = prompt('test2');" 1837 "retval=='text' && retval.length == 4;").toBool(); 1838 QVERIFY(res); 1839 1840 // Cancel + QString() 1841 res = page.mainFrame()->evaluateJavaScript( 1842 "var retval = prompt('test3');" 1843 "retval===null;").toBool(); 1844 QVERIFY(res); 1845 1846 // Cancel + "text" 1847 res = page.mainFrame()->evaluateJavaScript( 1848 "var retval = prompt('test4');" 1849 "retval===null;").toBool(); 1850 QVERIFY(res); 1851 } 1852 1784 1853 QTEST_MAIN(tst_QWebPage) 1785 1854 #include "tst_qwebpage.moc"
Note:
See TracChangeset
for help on using the changeset viewer.