diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2009-07-29 06:43:12 (GMT) |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2009-07-29 06:49:41 (GMT) |
commit | afce2170aae53a93e8fd3e8cbb24d8bb8148ec11 (patch) | |
tree | ad4986fa9ffa4b9ae7bb79351a41c72ea038620c /src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp | |
parent | e06e82f843f671ecbb5d10a2262a5866f79da3d9 (diff) | |
download | Qt-afce2170aae53a93e8fd3e8cbb24d8bb8148ec11.zip Qt-afce2170aae53a93e8fd3e8cbb24d8bb8148ec11.tar.gz Qt-afce2170aae53a93e8fd3e8cbb24d8bb8148ec11.tar.bz2 |
Updated WebKit from /home/shausman/src/webkit/trunk to qtwebkit-4.6-snapshot-29072009 ( 07fbaeddfade72be1d0d7e7f2b947e5d3c183f4a )
Changes in WebKit since the last update:
++ b/WebKit/qt/ChangeLog
2009-07-28 Simon Hausmann <simon.hausmann@nokia.com>
Rubber-stamped by Ariya Hidayat.
Fix compilation with the precompiled header.
* WebKit_pch.h: Don't include JSDOMBinding.h and MathObject.h,
as they include AtomicString.h. AtomicString.cpp needs to enable
a #define before including AtomicString.h, which breaks if the PCH
forces the inclusion beforehand.
2009-07-28 Ariya Hidayat <ariya.hidayat@nokia.com>
Reviewed by Simon Hausmann.
Added tests to ensure that scroll position can be changed
programmatically, even when the scroll bar policy is set to off.
* tests/qwebframe/tst_qwebframe.cpp:
2009-07-28 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
Reviewed by Simon Hausmann.
Fix a few compilation warnings in the QWebFrame tests.
* tests/qwebframe/tst_qwebframe.cpp:
2009-07-28 Andre Pedralho <andre.pedralho@openbossa.org>
Reviewed by Simon Hausmann.
Fixed tst_QWebFrame::hasSetFocus test which was using
an undefined resource.
https://bugs.webkit.org/show_bug.cgi?id=27512
* tests/qwebframe/tst_qwebframe.cpp:
2009-07-28 Simon Hausmann <simon.hausmann@nokia.com>
Reviewed by Ariya Hidayat.
Make it possible to pass relative file names to QtLauncher.
* QtLauncher/main.cpp:
(MainWindow::MainWindow):
2009-07-27 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Darin Adler.
https://bugs.webkit.org/show_bug.cgi?id=27735
Give a helpful name to JSLock constructor argument
* Api/qwebframe.cpp:
(QWebFrame::addToJavaScriptWindowObject):
2009-07-27 Volker Hilsheimer <volker.hilsheimer@nokia.com>
Reviewed by Simon Hausmann.
QWebView's "enabled" parameter should default to true, as with QGraphicsView and
QPainter.
* Api/qwebview.cpp: Add reference to QPainter::renderHints().
* Api/qwebview.h: Add default for enabled argument.
2009-07-26 Kavindra Palaraja <kavindra.palaraja@nokia.com>
Reviewed by Simon Hausmann.
More documentation cleanups in the QWebElement class overview.
* Api/qwebelement.cpp:
2009-07-26 Kavindra Palaraja <kavindra.palaraja@nokia.com>
Reviewed by Simon Hausmann.
Clean up documentation of QWebElement's findFirst and findAll functions,
as well as their QWebFrame counterparts.
* Api/qwebelement.cpp:
* Api/qwebframe.cpp:
2009-07-26 Kavindra Palaraja <kavindra.palaraja@nokia.com>
Reviewed by Simon Hausmann.
Various documentation cleanups
* Fixed qdoc warnings
* Hide QWebNetworkInterface from the class overview
* Mention QWebElement in the module overview
* More cleanups
* Api/qwebframe.cpp:
* Api/qwebnetworkinterface.cpp:
* Api/qwebview.cpp:
* docs/qtwebkit.qdoc:
2009-07-26 Kavindra Palaraja <kavindra.palaraja@nokia.com>
Reviewed by Simon Hausmann.
Added missing class diagram referenced from the docs, taken from the Qt
documentation.
* docs/qtwebkit.qdocconf: Register the image directory with
qdoc.
* docs/qwebview-diagram.png: Added.
2009-07-24 Antonio Gomes <antonio.gomes@openbossa.org>
Reviewed by Adam Treat.
As per discussion on IRC, changed originalUrl by requestedUrl.
* Api/qwebframe.cpp:
(QWebFrame::requestedUrl):
* Api/qwebframe.h:
* tests/qwebframe/tst_qwebframe.cpp:
2009-07-24 Andre Pedralho <andre.pedralho@openbossa.org>
Reviewed by Adam Treat.
Removed void QWebFrame::renderContents(...) and added the Q_PROPERTY
clipRenderToViewport to control whether QWebFrame::render would call
FrameView::paintContents rather than FrameView::paint and do not clip
the frame content to viewport.
* Api/qwebframe.cpp:
(QWebFramePrivate::renderPrivate):
(QWebFrame::clipRenderToViewport):
(QWebFrame::setClipRenderToViewport):
* Api/qwebframe.h:
* Api/qwebframe_p.h:
(QWebFramePrivate::QWebFramePrivate):
* tests/qwebframe/tst_qwebframe.cpp:
2009-07-24 Antonio Gomes <antonio.gomes@openbossa.org>
Reviewed by Simon Hausmann.
[QT] Implement originalUrl getter method to the API
https://bugs.webkit.org/show_bug.cgi?id=25867
* Api/qwebframe.cpp:
(QWebFrame::originalUrl):
* Api/qwebframe.h:
* tests/qwebframe/qwebframe.qrc:
* tests/qwebframe/test1.html: Added.
* tests/qwebframe/test2.html: Added.
* tests/qwebframe/tst_qwebframe.cpp:
2009-07-24 Kenneth Rohde Christiansen <kenneth@webkit.org>
Build fix for Qt.
Fix build issue introduced in 46344
([Bug 22700] ApplicationCache should have size limit)
Remove method only added to the Qt ChromeClient.
* WebCoreSupport/ChromeClientQt.h:
2009-07-24 Andrei Popescu <andreip@google.com>
Reviewed by Anders Carlsson.
ApplicationCache should have size limit
https://bugs.webkit.org/show_bug.cgi?id=22700
* WebCoreSupport/ChromeClientQt.cpp:
(WebCore::ChromeClientQt::reachedMaxAppCacheSize):
Adds empty implementation of the reachedMaxAppCacheSize callback.
* WebCoreSupport/ChromeClientQt.h:
2009-07-23 Laszlo Gombos <laszlo.1.gombos@nokia.com>
Reviewed by Simon Hausmann.
[Qt] Add simple proxy support for QtLauncher
https://bugs.webkit.org/show_bug.cgi?id=27495
Picks up proxy settings from the http_proxy environment
variable.
* QtLauncher/QtLauncher.pro: Add QtNetwork dependency for all
platforms.
* QtLauncher/main.cpp:
(MainWindow::MainWindow):
2009-07-23 Simon Hausmann <simon.hausmann@nokia.com>
Reviewed by Holger Freyther.
Added a testcase to verify that cached methods in the QOBject bindings
remain alife even after garbage collection.
* tests/qwebpage/tst_qwebpage.cpp:
(tst_QWebPage::protectBindingsRuntimeObjectsFromCollector):
2009-07-23 Zoltan Herczeg <zherczeg@inf.u-szeged.hu>
Reviewed by Simon Hausmann.
Fixing two issues related to QtLauncher
- MainWindow objects are not always freed after close
- JavaScript window.close() sometimes crashes
https://bugs.webkit.org/show_bug.cgi?id=27601
* QtLauncher/main.cpp:
(MainWindow::MainWindow):
(main):
2009-07-21 Volker Hilsheimer <volker.hilsheimer@nokia.com>
Reviewed by Simon Hausmann.
Various improvements to the API documentation.
* Updated link to W3c Database spec
* Formatting fixes, cleanups
* Add missing \since 4.6 tags to QWebPage::frameAt
* Extend QWebDatabase and QWebSecurityOrigin docs.
* Api/qwebdatabase.cpp:
* Api/qwebpage.cpp:
* Api/qwebsecurityorigin.cpp:
* Api/qwebview.cpp:
2009-07-21 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
Rubber-stamped by Simon Hausmann.
Remove preliminary-tag from QWebElement
* Api/qwebelement.cpp:
2009-07-20 Kenneth Rohde Christiansen <kenneth@webkit.org>
Reviewed by Eric Seidel.
Fix Qt code to follow the WebKit Coding Style.
* Api/qcookiejar.cpp:
(QCookieJar::setCookieJar):
(QCookieJar::cookieJar):
* Api/qcookiejar.h:
* Api/qwebdatabase.cpp:
(QWebDatabase::QWebDatabase):
(QWebDatabase::removeDatabase):
* Api/qwebdatabase.h:
* Api/qwebdatabase_p.h:
* Api/qwebelement.h:
* Api/qwebframe.cpp:
(QWebFrame::title):
(QWebFrame::print):
* Api/qwebframe.h:
* Api/qwebframe_p.h:
* Api/qwebhistory.cpp:
(QWebHistory::clear):
* Api/qwebhistory.h:
* Api/qwebhistory_p.h:
* Api/qwebhistoryinterface.cpp:
(gCleanupInterface):
(QWebHistoryInterface::setDefaultInterface):
(QWebHistoryInterface::defaultInterface):
(QWebHistoryInterface::QWebHistoryInterface):
* Api/qwebhistoryinterface.h:
* Api/qwebnetworkinterface.cpp:
(QWebNetworkManager::started):
(QWebNetworkManager::finished):
(QWebNetworkInterfacePrivate::parseDataUrl):
(QWebNetworkInterface::addJob):
(WebCoreHttp::onResponseHeaderReceived):
(WebCoreHttp::onReadyRead):
* Api/qwebnetworkinterface.h:
* Api/qwebnetworkinterface_p.h:
* Api/qwebpage.cpp:
(QWebPagePrivate::editorCommandForWebActions):
(QWebPagePrivate::createContextMenu):
(QWebPagePrivate::focusInEvent):
(QWebPage::fixedContentsSize):
(QWebPage::setContentEditable):
(QWebPage::swallowContextMenuEvent):
(QWebPage::findText):
* Api/qwebpage.h:
* Api/qwebpage_p.h:
* Api/qwebpluginfactory.h:
* Api/qwebsecurityorigin.h:
* Api/qwebsecurityorigin_p.h:
* Api/qwebsettings.cpp:
(QWebSettingsPrivate::QWebSettingsPrivate):
(QWebSettingsPrivate::apply):
(QWebSettings::globalSettings):
(QWebSettings::QWebSettings):
(QWebSettings::fontSize):
(QWebSettings::setUserStyleSheetUrl):
(QWebSettings::setDefaultTextEncoding):
(QWebSettings::setIconDatabasePath):
(QWebSettings::iconDatabasePath):
(QWebSettings::iconForUrl):
(QWebSettings::setWebGraphic):
(QWebSettings::setFontFamily):
(QWebSettings::fontFamily):
(QWebSettings::testAttribute):
(qt_websettings_setLocalStorageDatabasePath):
* Api/qwebsettings.h:
* Api/qwebview.cpp:
(QWebView::setPage):
(QWebView::event):
* Api/qwebview.h:
2009-07-20 Holger Hans Peter Freyther <zecke@selfish.org>
Reviewed by Simon Hausmann.
[Qt] Add test for loading webpages...
Performance test for loading webpages. Wait for the loadFinished
signal to be fired. This should include a non empty layout.
* tests/benchmarks/loading/tst_loading.cpp: Added.
(waitForSignal):
(tst_Loading::init):
(tst_Loading::cleanup):
(tst_Loading::load_data):
(tst_Loading::load):
* tests/benchmarks/loading/tst_loading.pro: Added.
* tests/tests.pro:
2009-07-20 Holger Hans Peter Freyther <zecke@selfish.org>
Reviewed by Simon Hausmann.
[Qt] Add a test case for drawing a simple viewrect to a QPixmap
* tests/benchmarks/painting/tst_painting.cpp: Added.
(waitForSignal):
(tst_Painting::init):
(tst_Painting::cleanup):
(tst_Painting::paint_data):
(tst_Painting::paint):
* tests/benchmarks/painting/tst_painting.pro: Added.
* tests/tests.pro:
2009-07-20 Laszlo Gombos <laszlo.1.gombos@nokia.com>
Reviewed by Holger Freyther.
[Qt] Add an option for QtLauncher to build without QtUiTools dependency
https://bugs.webkit.org/show_bug.cgi?id=27438
Based on Norbert Leser's work.
* QtLauncher/main.cpp:
(WebPage::createPlugin):
2009-07-17 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org>
Reviewed by Adam Treat.
Coding style fixes.
* Api/qcookiejar.cpp:
(QCookieJarPrivate::QCookieJarPrivate):
(qHash):
(QCookieJar::cookieJar):
* Api/qwebelement.cpp:
(QWebElement::functions):
(QWebElement::scriptableProperties):
* Api/qwebframe.cpp:
(QWebFrame::metaData):
(QWebFrame::scrollBarValue):
(QWebFrame::scroll):
(QWebFrame::scrollPosition):
(QWebFrame::print):
* Api/qwebnetworkinterface.cpp:
(decodePercentEncoding):
(QWebNetworkRequestPrivate::init):
(QWebNetworkRequestPrivate::setURL):
(QWebNetworkRequest::QWebNetworkRequest):
(QWebNetworkRequest::operator=):
(QWebNetworkRequest::setUrl):
(QWebNetworkRequest::setHttpHeader):
(QWebNetworkRequest::httpHeaderField):
(QWebNetworkRequest::setHttpHeaderField):
(QWebNetworkRequest::setPostData):
(QWebNetworkJob::setResponse):
(QWebNetworkJob::frame):
(QWebNetworkManager::add):
(QWebNetworkManager::cancel):
(QWebNetworkManager::started):
(QWebNetworkManager::data):
(QWebNetworkManager::finished):
(QWebNetworkManager::addHttpJob):
(QWebNetworkManager::cancelHttpJob):
(QWebNetworkManager::httpConnectionClosed):
(QWebNetworkInterfacePrivate::sendFileData):
(QWebNetworkInterfacePrivate::parseDataUrl):
(QWebNetworkManager::doWork):
(QWebNetworkInterface::setDefaultInterface):
(QWebNetworkInterface::defaultInterface):
(QWebNetworkInterface::QWebNetworkInterface):
(QWebNetworkInterface::addJob):
(QWebNetworkInterface::cancelJob):
(WebCoreHttp::WebCoreHttp):
(WebCoreHttp::request):
(WebCoreHttp::scheduleNextRequest):
(WebCoreHttp::getConnection):
(WebCoreHttp::onResponseHeaderReceived):
(WebCoreHttp::onReadyRead):
(WebCoreHttp::onRequestFinished):
(WebCoreHttp::onAuthenticationRequired):
(WebCoreHttp::onProxyAuthenticationRequired):
* Api/qwebpage.cpp:
(QWebPagePrivate::QWebPagePrivate):
(QWebPagePrivate::mouseReleaseEvent):
(QWebPagePrivate::inputMethodEvent):
(QWebPagePrivate::shortcutOverrideEvent):
(QWebPage::inputMethodQuery):
(QWebPage::javaScriptPrompt):
(QWebPage::updatePositionDependentActions):
(QWebPage::userAgentForUrl):
(QWebPagePrivate::_q_onLoadProgressChanged):
(QWebPage::totalBytes):
(QWebPage::bytesReceived):
* Api/qwebsettings.cpp:
(QWebSettings::iconForUrl):
(QWebSettings::setObjectCacheCapacities):
* Api/qwebview.cpp:
(QWebView::paintEvent):
(QWebView::changeEvent):
2009-07-17 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org>
Reviewed by Simon Hausmann.
Overwrite the plugin directories for the DRT.
Part of https://bugs.webkit.org/show_bug.cgi?id=27215
* Api/qwebpage.cpp:
(qt_drt_overwritePluginDirectories): Only set the plugin directories
to the ones in the QTWEBKIT_PLUGIN_PATH environment variable.
2009-07-16 Xiaomei Ji <xji@chromium.org>
Reviewed by Dan Bernstein.
This is the 2nd part of fixing "RTL: tooltip does not get its directionlity from its element's."
https://bugs.webkit.org/show_bug.cgi?id=24187
Add one extra parameter to the callee of HitTestResult::title() due to the signature change.
* Api/qwebframe.cpp:
(QWebHitTestResultPrivate::QWebHitTestResultPrivate): Add direction as a parameter to the callee of HitTestResult::title().
* WebCoreSupport/ChromeClientQt.cpp:
(WebCore::ChromeClientQt::mouseDidMoveOverElement): Add direction as a parameter to the callee of HitTestResult::title().
2009-07-16 Benjamin C Meyer <benjamin.meyer@torchmobile.com>
Reviewed by Adam Treat.
Add new action to qwebpage to reload without cache.
* Api/qwebpage.cpp:
(QWebPagePrivate::updateAction):
(QWebPagePrivate::updateNavigationActions):
(QWebPage::triggerAction):
* Api/qwebpage.h:
2009-07-16 Xiaomei Ji <xji@chromium.org>
Reviewed by Darin Adler.
Fix tooltip does not get its directionality from its element's directionality.
https://bugs.webkit.org/show_bug.cgi?id=24187
Per mitz's suggestion in comment #6, while getting the plain-text
title, we also get the directionality of the title. How to handle
the directionality is up to clients. Clients could ignore it,
or use attribute or unicode control characters to display the title
as what they want.
* WebCoreSupport/ChromeClientQt.cpp:
(WebCore::ChromeClientQt::setToolTip): Add directionality as 2nd parameter to setToopTip() (without handling it yet).
* WebCoreSupport/ChromeClientQt.h: Add directionality as 2nd parameter to setToolTip().
2009-07-15 Yael Aharon <yael.aharon@nokia.com>
Reviewed by Simon Hausmann.
https://bugs.webkit.org/show_bug.cgi?id=27285
When the user clicks a link with a target attribute, the newly created window should be visible.
Make new windows created in Qtlauncher visible.
* QtLauncher/main.cpp:
(WebPage::createWindow):
2009-07-14 Adam Treat <adam.treat@torchmobile.com>
Reviewed by Zack Rusin.
https://bugs.webkit.org/show_bug.cgi?id=26983
The default constructed values for QSize and WebCore::IntSize are different. The former
produces an invalid size whereas the latter produces a size of zero. This was causing
a layout to be triggered when constructing a view and an assert to be hit. This patch fixes
the crash by taking care not to cause an unnecessary layout triggered by ScrollView::setFixedLayoutSize.
* WebCoreSupport/FrameLoaderClientQt.cpp:
(WebCore::FrameLoaderClientQt::transitionToCommittedForNewPage):
Diffstat (limited to 'src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp')
-rw-r--r-- | src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp | 100 |
1 files changed, 55 insertions, 45 deletions
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp index 3c2151b..1a45fe6 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp @@ -59,6 +59,7 @@ #include "Scrollbar.h" #include "PlatformKeyboardEvent.h" #include "PlatformWheelEvent.h" +#include "PluginDatabase.h" #include "ProgressTracker.h" #include "RefPtr.h" #include "HashMap.h" @@ -99,6 +100,18 @@ using namespace WebCore; +void QWEBKIT_EXPORT qt_drt_overwritePluginDirectories() +{ + PluginDatabase* db = PluginDatabase::installedPlugins(/* populate */ false); + + Vector<String> paths; + String qtPath(getenv("QTWEBKIT_PLUGIN_PATH")); + qtPath.split(UChar(':'), /* allowEmptyEntries */ false, paths); + + db->setPluginDirectories(paths); + db->refresh(); +} + bool QWebPagePrivate::drtRun = false; void QWEBKIT_EXPORT qt_drt_run(bool b) { @@ -116,29 +129,29 @@ QString QWEBKIT_EXPORT qt_webpage_groupName(QWebPage* page) } // Lookup table mapping QWebPage::WebActions to the associated Editor commands -static const char* editorCommandWebActions[] = +static const char* editorCommandWebActions[] = { 0, // OpenLink, 0, // OpenLinkInNewWindow, 0, // OpenFrameInNewWindow, - + 0, // DownloadLinkToDisk, 0, // CopyLinkToClipboard, - + 0, // OpenImageInNewWindow, 0, // DownloadImageToDisk, 0, // CopyImageToClipboard, - + 0, // Back, 0, // Forward, 0, // Stop, 0, // Reload, - + "Cut", // Cut, "Copy", // Copy, "Paste", // Paste, - + "Undo", // Undo, "Redo", // Redo, "MoveForward", // MoveToNextChar, @@ -167,21 +180,22 @@ static const char* editorCommandWebActions[] = "MoveToEndOfDocumentAndModifySelection", // SelectEndOfDocument, "DeleteWordBackward", // DeleteStartOfWord, "DeleteWordForward", // DeleteEndOfWord, - + 0, // SetTextDirectionDefault, 0, // SetTextDirectionLeftToRight, 0, // SetTextDirectionRightToLeft, - + "ToggleBold", // ToggleBold, "ToggleItalic", // ToggleItalic, "ToggleUnderline", // ToggleUnderline, - + 0, // InspectElement, "InsertNewline", // InsertParagraphSeparator "InsertLineBreak", // InsertLineSeparator "SelectAll", // SelectAll + 0, // ReloadAndBypassCache, "PasteAndMatchStyle", // PasteAndMatchStyle "RemoveFormat", // RemoveFormat @@ -206,7 +220,6 @@ const char* QWebPagePrivate::editorCommandForWebActions(QWebPage::WebAction acti { if ((action > QWebPage::NoWebAction) && (action < int(sizeof(editorCommandWebActions) / sizeof(const char*)))) return editorCommandWebActions[action]; - return 0; } @@ -252,7 +265,7 @@ static inline Qt::DropAction dragOpToDropAction(unsigned actions) QWebPagePrivate::QWebPagePrivate(QWebPage *qq) : q(qq) , view(0) - , viewportSize(QSize(0,0)) + , viewportSize(QSize(0, 0)) { WebCore::InitializeLoggingChannelsIfNecessary(); JSC::initializeThreading(); @@ -405,9 +418,8 @@ QMenu *QWebPagePrivate::createContextMenu(const WebCore::ContextMenu *webcoreMen if (anyEnabledAction) { subMenu->setTitle(item.title()); menu->addAction(subMenu->menuAction()); - } else { + } else delete subMenu; - } break; } } @@ -456,6 +468,7 @@ void QWebPagePrivate::updateAction(QWebPage::WebAction action) enabled = loader->isLoading(); break; case QWebPage::Reload: + case QWebPage::ReloadAndBypassCache: enabled = !loader->isLoading(); break; #ifndef QT_NO_UNDOSTACK @@ -501,6 +514,7 @@ void QWebPagePrivate::updateNavigationActions() updateAction(QWebPage::Forward); updateAction(QWebPage::Stop); updateAction(QWebPage::Reload); + updateAction(QWebPage::ReloadAndBypassCache); } void QWebPagePrivate::updateEditorActions() @@ -647,12 +661,12 @@ void QWebPagePrivate::mouseReleaseEvent(QMouseEvent *ev) Pasteboard::generalPasteboard()->setSelectionMode(true); WebCore::Frame* focusFrame = page->focusController()->focusedOrMainFrame(); if (ev->button() == Qt::LeftButton) { - if(focusFrame && (focusFrame->editor()->canCopy() || focusFrame->editor()->canDHTMLCopy())) { + if (focusFrame && (focusFrame->editor()->canCopy() || focusFrame->editor()->canDHTMLCopy())) { focusFrame->editor()->copy(); ev->setAccepted(true); } } else if (ev->button() == Qt::MidButton) { - if(focusFrame && (focusFrame->editor()->canPaste() || focusFrame->editor()->canDHTMLPaste())) { + if (focusFrame && (focusFrame->editor()->canPaste() || focusFrame->editor()->canDHTMLPaste())) { focusFrame->editor()->paste(); ev->setAccepted(true); } @@ -822,11 +836,10 @@ void QWebPagePrivate::focusInEvent(QFocusEvent *ev) FocusController *focusController = page->focusController(); Frame *frame = focusController->focusedFrame(); focusController->setActive(true); - if (frame) { + if (frame) focusController->setFocused(true); - } else { + else focusController->setFocusedFrame(QWebFramePrivate::core(mainFrame)); - } } void QWebPagePrivate::focusOutEvent(QFocusEvent *ev) @@ -932,7 +945,7 @@ void QWebPagePrivate::inputMethodEvent(QInputMethodEvent *ev) QString preedit = ev->preeditString(); // ### FIXME: use the provided QTextCharFormat (use color at least) Vector<CompositionUnderline> underlines; - underlines.append(CompositionUnderline(0, preedit.length(), Color(0,0,0), false)); + underlines.append(CompositionUnderline(0, preedit.length(), Color(0, 0, 0), false)); editor->setComposition(preedit, underlines, preedit.length(), 0); } ev->accept(); @@ -968,9 +981,8 @@ void QWebPagePrivate::shortcutOverrideEvent(QKeyEvent* event) } } #ifndef QT_NO_SHORTCUT - else if (editorActionForKeyEvent(event) != QWebPage::NoWebAction) { + else if (editorActionForKeyEvent(event) != QWebPage::NoWebAction) event->accept(); - } #endif } } @@ -1036,12 +1048,11 @@ bool QWebPagePrivate::handleScrolling(QKeyEvent *ev, Frame *frame) */ QVariant QWebPage::inputMethodQuery(Qt::InputMethodQuery property) const { - switch(property) { + switch (property) { case Qt::ImMicroFocus: { Frame *frame = d->page->focusController()->focusedFrame(); - if (frame) { + if (frame) return QVariant(frame->selection()->absoluteCaretBounds()); - } return QVariant(); } case Qt::ImFont: { @@ -1054,9 +1065,8 @@ QVariant QWebPage::inputMethodQuery(Qt::InputMethodQuery property) const Frame *frame = d->page->focusController()->focusedFrame(); if (frame) { VisibleSelection selection = frame->selection()->selection(); - if (selection.isCaret()) { + if (selection.isCaret()) return QVariant(selection.start().deprecatedEditingOffset()); - } } return QVariant(); } @@ -1064,9 +1074,8 @@ QVariant QWebPage::inputMethodQuery(Qt::InputMethodQuery property) const Frame *frame = d->page->focusController()->focusedFrame(); if (frame) { Document *document = frame->document(); - if (document->focusedNode()) { + if (document->focusedNode()) return QVariant(document->focusedNode()->nodeValue()); - } } return QVariant(); } @@ -1142,6 +1151,7 @@ QVariant QWebPage::inputMethodQuery(Qt::InputMethodQuery property) const \value Forward Navigate forward in the history of navigated links. \value Stop Stop loading the current page. \value Reload Reload the current page. + \value ReloadAndBypassCache Reload the current page, but do not use any local cache. (Added in Qt 4.6) \value Cut Cut the content currently selected into the clipboard. \value Copy Copy the content currently selected into the clipboard. \value Paste Paste content from the clipboard. @@ -1415,9 +1425,8 @@ bool QWebPage::javaScriptPrompt(QWebFrame *frame, const QString& msg, const QStr bool ok = false; #ifndef QT_NO_INPUTDIALOG QString x = QInputDialog::getText(d->view, tr("JavaScript Prompt - %1").arg(mainFrame()->url().host()), msg, QLineEdit::Normal, defaultValue, &ok); - if (ok && result) { + if (ok && result) *result = x; - } #endif return ok; } @@ -1568,7 +1577,10 @@ void QWebPage::triggerAction(WebAction action, bool checked) mainFrame()->d->frame->loader()->stopForUserCancel(); break; case Reload: - mainFrame()->d->frame->loader()->reload(); + mainFrame()->d->frame->loader()->reload(/*endtoendreload*/false); + break; + case ReloadAndBypassCache: + mainFrame()->d->frame->loader()->reload(/*endtoendreload*/true); break; case SetTextDirectionDefault: editor->setBaseWritingDirection(NaturalWritingDirection); @@ -1630,9 +1642,8 @@ QSize QWebPage::fixedContentsSize() const QWebFrame* frame = d->mainFrame; if (frame) { WebCore::FrameView* view = frame->d->frame->view(); - if (view && view->useFixedLayout()) { + if (view && view->useFixedLayout()) return d->mainFrame->d->frame->view()->fixedLayoutSize(); - } } return d->fixedLayoutSize; @@ -2140,9 +2151,8 @@ void QWebPage::setContentEditable(bool editable) frame->applyEditingStyleToBodyElement(); // FIXME: mac port calls this if there is no selectedDOMRange //frame->setSelectionFromNone(); - } else { + } else frame->removeEditingStyleFromBodyElement(); - } } d->updateEditorActions(); @@ -2210,9 +2220,8 @@ bool QWebPage::swallowContextMenuEvent(QContextMenuEvent *event) if (QWebFrame* webFrame = frameAt(event->pos())) { Frame* frame = QWebFramePrivate::core(webFrame); - if (Scrollbar* scrollbar = frame->view()->scrollbarAtPoint(PlatformMouseEvent(event, 1).pos())) { + if (Scrollbar* scrollbar = frame->view()->scrollbarAtPoint(PlatformMouseEvent(event, 1).pos())) return scrollbar->contextMenu(PlatformMouseEvent(event, 1)); - } } WebCore::Frame* focusedFrame = d->page->focusController()->focusedOrMainFrame(); @@ -2267,9 +2276,8 @@ void QWebPage::updatePositionDependentActions(const QPoint &pos) originallyEnabledWebActions &= ~visitedWebActions; // Mask out visited actions (they're part of the menu) for (int i = 0; i < QWebPage::WebActionCount; ++i) { if (originallyEnabledWebActions.at(i)) { - if (QAction *a = this->action(QWebPage::WebAction(i))) { + if (QAction *a = this->action(QWebPage::WebAction(i))) a->setEnabled(true); - } } } @@ -2392,9 +2400,8 @@ bool QWebPage::findText(const QString &subString, FindFlags options) if (subString.isEmpty()) { d->page->unmarkAllTextMatches(); return true; - } else { + } else return d->page->markAllMatchesForText(subString, caseSensitivity, true, 0); - } } else { ::FindDirection direction = ::FindDirectionForward; if (options & FindBackward) @@ -2635,7 +2642,7 @@ QString QWebPage::userAgentForUrl(const QUrl& url) const #if defined Q_OS_WIN32 QString ver; - switch(QSysInfo::WindowsVersion) { + switch (QSysInfo::WindowsVersion) { case QSysInfo::WV_32s: ver = "Windows 3.1"; break; @@ -2709,7 +2716,8 @@ QString QWebPage::userAgentForUrl(const QUrl& url) const } -void QWebPagePrivate::_q_onLoadProgressChanged(int) { +void QWebPagePrivate::_q_onLoadProgressChanged(int) +{ m_totalBytes = page->progress()->totalPageAndResourceBytesToLoad(); m_bytesReceived = page->progress()->totalBytesReceived(); } @@ -2721,7 +2729,8 @@ void QWebPagePrivate::_q_onLoadProgressChanged(int) { \sa bytesReceived() */ -quint64 QWebPage::totalBytes() const { +quint64 QWebPage::totalBytes() const +{ return d->m_totalBytes; } @@ -2731,7 +2740,8 @@ quint64 QWebPage::totalBytes() const { \sa totalBytes() */ -quint64 QWebPage::bytesReceived() const { +quint64 QWebPage::bytesReceived() const +{ return d->m_bytesReceived; } |