summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/WebKit
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/webkit/WebKit')
-rw-r--r--src/3rdparty/webkit/WebKit/ChangeLog524
-rw-r--r--src/3rdparty/webkit/WebKit/LICENSE22
-rw-r--r--src/3rdparty/webkit/WebKit/StringsNotToBeLocalized.txt65
-rw-r--r--src/3rdparty/webkit/WebKit/mac/Configurations/Version.xcconfig58
-rw-r--r--src/3rdparty/webkit/WebKit/mac/Workers/WebWorkersPrivate.h37
-rw-r--r--src/3rdparty/webkit/WebKit/mac/Workers/WebWorkersPrivate.mm46
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/headers.pri5
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp1010
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.h142
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebdatabase.cpp2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebelement.cpp1079
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebelement.h142
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp195
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebframe.h19
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebframe_p.h9
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.cpp196
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.h15
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebhistory_p.h33
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebhistoryinterface.cpp2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebinspector.cpp186
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebinspector.h55
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebinspector_p.h46
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebkitversion.cpp58
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebkitversion.h32
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp753
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h39
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h61
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebplugindatabase.cpp389
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebplugindatabase_p.h98
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebpluginfactory.cpp30
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebpluginfactory.h4
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.cpp51
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.h3
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp206
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h21
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp210
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebview.h9
-rw-r--r--src/3rdparty/webkit/WebKit/qt/ChangeLog3590
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Plugins/ICOHandler.cpp460
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Plugins/ICOHandler.h52
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Plugins/Plugins.pro14
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp24
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.h3
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ContextMenuClientQt.cpp2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/DragClientQt.cpp2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.cpp43
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp252
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h6
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp211
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.h7
-rw-r--r--src/3rdparty/webkit/WebKit/qt/docs/docs.pri4
-rw-r--r--src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc118
-rw-r--r--src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/qtwebkit_qwebinspector_snippet.cpp17
-rw-r--r--src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/simple/main.cpp2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/webelement/main.cpp4
-rw-r--r--src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/webelement/webelement.pro3
-rw-r--r--src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/webpage/main.cpp2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/benchmarks/loading/tst_loading.pro5
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/benchmarks/painting/tst_painting.pro5
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/qgraphicswebview.pro10
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp130
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebelement/image.pngbin0 -> 14743 bytes
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebelement/qwebelement.pro5
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebelement/qwebelement.qrc1
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp381
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro6
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebframe/resources/image2.pngbin0 -> 14743 bytes
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp311
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/qwebhistory.pro5
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp108
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebhistoryinterface/qwebhistoryinterface.pro5
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro6
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp655
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebplugindatabase/qwebplugindatabase.pro11
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebplugindatabase/tst_qwebplugindatabase.cpp437
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebview/data/frame_a.html2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebview/data/index.html4
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebview/qwebview.pro7
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.cpp143
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.qrc7
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/resources/test.swfbin0 -> 10085 bytes
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/tests.pro4
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/util.h48
-rw-r--r--src/3rdparty/webkit/WebKit/scripts/generate-webkitversion.pl136
84 files changed, 11116 insertions, 1984 deletions
diff --git a/src/3rdparty/webkit/WebKit/ChangeLog b/src/3rdparty/webkit/WebKit/ChangeLog
index c7913d26f..5006da7f6 100644
--- a/src/3rdparty/webkit/WebKit/ChangeLog
+++ b/src/3rdparty/webkit/WebKit/ChangeLog
@@ -1,3 +1,527 @@
+2009-10-27 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Updated license
+
+ * LICENSE:
+
+2009-10-26 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Move some WebView event handling code into its own file, WebViewEventHandling.mm
+
+ * WebKit.xcodeproj/project.pbxproj:
+
+2009-10-19 John Gregg <johnnyg@google.com>
+
+ Reviewed by Dimitri Glazkov.
+
+ set ENABLE_NOTIFICATIONS=1 for Chromium
+ https://bugs.webkit.org/show_bug.cgi?id=29949
+
+ * chromium/features.gypi:
+
+2009-10-13 Drew Wilson <atwilson@atwilson-macpro.local>
+
+ Reviewed by David Levin.
+
+ Enable SHARED_WORKERS for Chromium
+ https://bugs.webkit.org/show_bug.cgi?id=30289
+
+ * chromium/features.gypi:
+ Turned on ENABLE_SHARED_WORKERS by default. This doesn't actually turn on
+ SharedWorkers yet, as Chromium overrides this flag in its feature_overrides.gypi.
+
+2009-10-12 Yaar Schnitman <yaar@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Chromium Port - Windows
+ https://bugs.webkit.org/show_bug.cgi?id=29969
+
+ * chromium/DEPS: Added gtest dep required by windows and incremented some of the deps revisions.
+
+2009-10-06 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Mark Rowe.
+
+ accessibility/media-element.html crashes (and has incorrect result)
+ https://bugs.webkit.org/show_bug.cgi?id=30108
+
+ Fix up the accessibilty label for the newly added fullscreen button,
+ and update the test result accordingly.
+
+ * English.lproj/Localizable.strings:
+
+2009-10-05 Kevin Decker <kdecker@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ * WebKit.xcodeproj/project.pbxproj: Add WebPluginHalterClient to the project.
+
+2009-10-05 Yaar Schnitman <yaar@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ One of the dependencies' SVN url was missing a @ before the revision number.
+
+ https://bugs.webkit.org/show_bug.cgi?id=30101
+
+ * chromium/DEPS:
+
+2009-10-05 Pierre d'Herbemont <pdherbemont@webkit.org>
+
+ Reviewed by Simon Fraser
+
+ Support fullscreen in MediaPlayer (Mac)
+ https://bugs.webkit.org/show_bug.cgi?id=26742
+
+ Add new files for video fullscreen.
+
+ * WebKit.xcodeproj/project.pbxproj:
+
+2009-10-05 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Timothy Hatcher.
+
+ Web Inspector: add testing harness for Web Inspector.
+
+ https://bugs.webkit.org/show_bug.cgi?id=30010
+
+ * WebKit.xcodeproj/project.pbxproj:
+
+2009-10-04 Fumitoshi Ukai <ukai@chromium.org>
+
+ Reviewed by Eric Seidel
+
+ Enable Web Sockets in chromium build.
+ https://bugs.webkit.org/show_bug.cgi?id=29917
+
+ * chromium/features.gypi:
+
+2009-10-02 Yaar Schnitman <yaar@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Added gyp_webkit that does a subset of the things gyp_chromium does
+ plus some specialization for an upstream chromium build.
+
+ https://bugs.webkit.org/show_bug.cgi?id=29986
+
+ * chromium/DEPS: Points to gyp_webkit instead of gyp_chromium.
+ * chromium/gyp_webkit: A new python file.
+
+2009-10-01 Yaar Schnitman <yaar@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Make it possible to override the list of feature defines when building
+ downstream.
+
+ https://bugs.webkit.org/show_bug.cgi?id=29979
+
+ * chromium/features.gypi:
+
+2009-10-01 Yaar Schnitman <yaar@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Added windows-specific dependencies, updated some revisions and
+ re-organized file to make revision tracking easier. Also removed
+ extensions/v8 dependency that is no longer needed upstream.
+
+ https://bugs.webkit.org/show_bug.cgi?id=29973
+
+ * chromium/DEPS:
+
+2009-09-30 Yaar Schnitman <yaar@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ 1. Keeping up with downstream revisions.
+ 2. Turning off v8 snapshot build step.
+
+ https://bugs.webkit.org/show_bug.cgi?id=29928
+
+ * chromium/DEPS
+
+2009-09-29 Brady Eidson <beidson@apple.com>
+
+ Reviewed by John Sullivan.
+
+ WebKit Mac API should provide a delegate interface for global history.
+ <rdar://problem/7042773> and https://webkit.org/b/29904
+
+ * WebKit.xcodeproj/project.pbxproj:
+
+2009-09-28 Yaar Schnitman <yaar@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ https://bugs.webkit.org/show_bug.cgi?id=29722
+
+ * chromium/DEPS: Describes the chromium port's dependencies and
+ is used by gclient to fetch them.
+ * chromium/webkit.gyp: Currently only builds webcore but in
+ the future will also build the webkit api.
+
+2009-09-26 David Kilzer <ddkilzer@apple.com>
+
+ Part 2 of 2: <http://webkit.org/b/29753> DerivedSources.make broken for non-Mac targets
+
+ Reviewed by Darin Adler.
+
+ Fix ENABLE_ORIENTATION_EVENTS for non-Mac platforms.
+
+ * chromium/features.gypi: Added 'ENABLE_ORIENTATION_EVENTS=0' to
+ disable this feature by default.
+
+2009-09-22 Yaar Schnitman <yaar@chromium.org>
+
+ Reviewed by David Levin.
+
+ Create chromium directory and ported chromium.org's features.gypi for
+ the webkit chromium port.
+
+ https://bugs.webkit.org/show_bug.cgi?id=29617
+
+ * chromium/features.gypi: Added.
+
+2009-09-21 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Anders Carlsson.
+
+ <rdar://problem/4137135> iFrame with PDF not being handled correctly on
+ usps.com
+ https://bugs.webkit.org/show_bug.cgi?id=4151
+
+ * WebKit.xcodeproj/project.pbxproj: Added WebPDFDocumentExtras.{h,mm}
+ and WebJSPDFDoc.{h,mm} and changed WebPDFRepresentation to
+ Objective-C++.
+
+2009-09-07 Steve Block <steveblock@google.com>
+
+ Reviewed by Adam Barth.
+
+ Adds a mock Geolocation service. This will be used to provide predictable behavior of the
+ Geolocation API for use in LayoutTests. Later changes will integrate the the mock
+ Geolocation service with DumpRenderTree.
+ https://bugs.webkit.org/show_bug.cgi?id=28264
+
+ * WebKit.xcodeproj/project.pbxproj: Modified. Adds WebGeolocationMock.
+
+2009-09-03 John Sullivan <sullivan@apple.com>
+
+ Reviewed by Adam Roben
+
+ * StringsNotToBeLocalized.txt:
+ Brought this file up to date.
+
+2009-08-31 Mark Rowe <mrowe@apple.com>
+
+ Rubber-stamped by Beth Dakin.
+
+ Remove WebViewEditingContextMenu.nib and WebViewEditingContextMenuOld.nib.
+ We stopped using these back in r18592 when we switched over to context menus
+ driven by WebCore.
+
+ * English.lproj/WebViewEditingContextMenu.nib/classes.nib: Removed.
+ * English.lproj/WebViewEditingContextMenu.nib/info.nib: Removed.
+ * English.lproj/WebViewEditingContextMenu.nib/objects.nib: Removed.
+ * English.lproj/WebViewEditingContextMenuOld.nib/classes.nib: Removed.
+ * English.lproj/WebViewEditingContextMenuOld.nib/info.nib: Removed.
+ * English.lproj/WebViewEditingContextMenuOld.nib/objects.nib: Removed.
+ * WebKit.xcodeproj/project.pbxproj:
+
+2009-08-28 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by John Sullivan.
+
+ update-webkit-localizable-strings script can no longer complete
+ https://bugs.webkit.org/show_bug.cgi?id=28792
+
+ * English.lproj/Localizable.strings:
+
+2009-08-27 John Sullivan <sullivan@apple.com>
+
+ * StringsNotToBeLocalized.txt:
+ Brought up to date, other than the problem mentioned in https://bugs.webkit.org/show_bug.cgi?id=28792
+
+2009-08-25 Eric Carlson <eric.carlson@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ <video> and <audio> controller should be accessible
+ https://bugs.webkit.org/show_bug.cgi?id=28081
+
+ Add localized strings for media controller accessiblility.
+
+ * English.lproj/Localizable.strings:
+
+2009-08-20 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Enable various "grouping" ARIA roles
+ https://bugs.webkit.org/show_bug.cgi?id=28486
+
+ * English.lproj/Localizable.strings:
+
+2009-08-18 Drew Wilson <atwilson@google.com>
+
+ Reviewed by Eric Seidel.
+
+ Need to extend DumpRenderTree to expose number of worker threads.
+ https://bugs.webkit.org/show_bug.cgi?id=28292
+
+ * WebKit.xcodeproj/project.pbxproj:
+ Added WebWorkersPrivate APIs to mac WebKit to expose workerThreadCount() for DumpRenderTree.
+
+2009-08-06 Mark Rowe <mrowe@apple.com>
+
+ Rubber-stamped by Sam Weinig.
+
+ Add explicit dependencies for our build verification scripts to ensure that they always run after linking has completed.
+
+ * WebKit.xcodeproj/project.pbxproj:
+
+2009-08-06 Mark Rowe <mrowe@apple.com>
+
+ Bring a little order to our otherwise out of control lives.
+
+ * WebKit.xcodeproj/project.pbxproj:
+
+2009-08-06 Mark Rowe <mrowe@apple.com>
+
+ Build fix.
+
+ Don't attempt to build a file that Anders just deleted.
+
+ * WebKit.xcodeproj/project.pbxproj:
+
+2009-07-29 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/27788> Don't export WebPluginController.h as a private header
+
+ Reviewed by Mark Rowe.
+
+ WebPluginController.h includes WebPluginContainerCheck.h, which
+ is not a private header. Since WebPluginController.h doesn't
+ appear to be used anywhere, remove its private header status.
+
+ * WebKit.xcodeproj/project.pbxproj: Remove private header
+ attribute from WebPluginController.h.
+
+2009-07-28 Maxime Simon <simon.maxime@gmail.com>
+
+ Reviewed by David Levin.
+
+ Added FrameLoaderClient for Haiku WebCore support.
+ https://bugs.webkit.org/show_bug.cgi?id=26952
+
+ * haiku/WebCoreSupport/FrameLoaderClientHaiku.cpp: Added.
+ (WebCore::FrameLoaderClientHaiku::FrameLoaderClientHaiku):
+ (WebCore::FrameLoaderClientHaiku::setFrame):
+ (WebCore::FrameLoaderClientHaiku::setWebView):
+ (WebCore::FrameLoaderClientHaiku::detachFrameLoader):
+ (WebCore::FrameLoaderClientHaiku::hasWebView):
+ (WebCore::FrameLoaderClientHaiku::hasBackForwardList):
+ (WebCore::FrameLoaderClientHaiku::resetBackForwardList):
+ (WebCore::FrameLoaderClientHaiku::provisionalItemIsTarget):
+ (WebCore::FrameLoaderClientHaiku::makeRepresentation):
+ (WebCore::FrameLoaderClientHaiku::forceLayout):
+ (WebCore::FrameLoaderClientHaiku::forceLayoutForNonHTML):
+ (WebCore::FrameLoaderClientHaiku::updateHistoryForCommit):
+ (WebCore::FrameLoaderClientHaiku::updateHistoryForBackForwardNavigation):
+ (WebCore::FrameLoaderClientHaiku::updateHistoryForReload):
+ (WebCore::FrameLoaderClientHaiku::updateHistoryForStandardLoad):
+ (WebCore::FrameLoaderClientHaiku::updateHistoryForInternalLoad):
+ (WebCore::FrameLoaderClientHaiku::updateHistoryAfterClientRedirect):
+ (WebCore::FrameLoaderClientHaiku::setCopiesOnScroll):
+ (WebCore::FrameLoaderClientHaiku::tokenForLoadErrorReset):
+ (WebCore::FrameLoaderClientHaiku::resetAfterLoadError):
+ (WebCore::FrameLoaderClientHaiku::doNotResetAfterLoadError):
+ (WebCore::FrameLoaderClientHaiku::willCloseDocument):
+ (WebCore::FrameLoaderClientHaiku::detachedFromParent2):
+ (WebCore::FrameLoaderClientHaiku::detachedFromParent3):
+ (WebCore::FrameLoaderClientHaiku::dispatchDidHandleOnloadEvents):
+ (WebCore::FrameLoaderClientHaiku::dispatchDidReceiveServerRedirectForProvisionalLoad):
+ (WebCore::FrameLoaderClientHaiku::dispatchDidCancelClientRedirect):
+ (WebCore::FrameLoaderClientHaiku::dispatchWillPerformClientRedirect):
+ (WebCore::FrameLoaderClientHaiku::dispatchDidChangeLocationWithinPage):
+ (WebCore::FrameLoaderClientHaiku::dispatchWillClose):
+ (WebCore::FrameLoaderClientHaiku::dispatchDidStartProvisionalLoad):
+ (WebCore::FrameLoaderClientHaiku::dispatchDidReceiveTitle):
+ (WebCore::FrameLoaderClientHaiku::dispatchDidCommitLoad):
+ (WebCore::FrameLoaderClientHaiku::dispatchDidFinishDocumentLoad):
+ (WebCore::FrameLoaderClientHaiku::dispatchDidFinishLoad):
+ (WebCore::FrameLoaderClientHaiku::dispatchDidFirstLayout):
+ (WebCore::FrameLoaderClientHaiku::dispatchDidFirstVisuallyNonEmptyLayout):
+ (WebCore::FrameLoaderClientHaiku::dispatchShow):
+ (WebCore::FrameLoaderClientHaiku::cancelPolicyCheck):
+ (WebCore::FrameLoaderClientHaiku::dispatchWillSubmitForm):
+ (WebCore::FrameLoaderClientHaiku::dispatchDidLoadMainResource):
+ (WebCore::FrameLoaderClientHaiku::revertToProvisionalState):
+ (WebCore::FrameLoaderClientHaiku::postProgressStartedNotification):
+ (WebCore::FrameLoaderClientHaiku::postProgressEstimateChangedNotification):
+ (WebCore::FrameLoaderClientHaiku::postProgressFinishedNotification):
+ (WebCore::FrameLoaderClientHaiku::progressStarted):
+ (WebCore::FrameLoaderClientHaiku::progressCompleted):
+ (WebCore::FrameLoaderClientHaiku::setMainFrameDocumentReady):
+ (WebCore::FrameLoaderClientHaiku::willChangeTitle):
+ (WebCore::FrameLoaderClientHaiku::didChangeTitle):
+ (WebCore::FrameLoaderClientHaiku::finishedLoading):
+ (WebCore::FrameLoaderClientHaiku::canShowMIMEType):
+ (WebCore::FrameLoaderClientHaiku::representationExistsForURLScheme):
+ (WebCore::FrameLoaderClientHaiku::generatedMIMETypeForURLScheme):
+ (WebCore::FrameLoaderClientHaiku::frameLoadCompleted):
+ (WebCore::FrameLoaderClientHaiku::saveViewStateToItem):
+ (WebCore::FrameLoaderClientHaiku::restoreViewState):
+ (WebCore::FrameLoaderClientHaiku::restoreScrollPositionAndViewState):
+ (WebCore::FrameLoaderClientHaiku::provisionalLoadStarted):
+ (WebCore::FrameLoaderClientHaiku::shouldTreatURLAsSameAsCurrent):
+ (WebCore::FrameLoaderClientHaiku::addHistoryItemForFragmentScroll):
+ (WebCore::FrameLoaderClientHaiku::didFinishLoad):
+ (WebCore::FrameLoaderClientHaiku::prepareForDataSourceReplacement):
+ (WebCore::FrameLoaderClientHaiku::setTitle):
+ (WebCore::FrameLoaderClientHaiku::userAgent):
+ (WebCore::FrameLoaderClientHaiku::dispatchDidReceiveIcon):
+ (WebCore::FrameLoaderClientHaiku::frameLoaderDestroyed):
+ (WebCore::FrameLoaderClientHaiku::canHandleRequest):
+ (WebCore::FrameLoaderClientHaiku::partClearedInBegin):
+ (WebCore::FrameLoaderClientHaiku::updateGlobalHistory):
+ (WebCore::FrameLoaderClientHaiku::updateGlobalHistoryRedirectLinks):
+ (WebCore::FrameLoaderClientHaiku::shouldGoToHistoryItem):
+ (WebCore::FrameLoaderClientHaiku::saveScrollPositionAndViewStateToItem):
+ (WebCore::FrameLoaderClientHaiku::canCachePage):
+ (WebCore::FrameLoaderClientHaiku::setMainDocumentError):
+ (WebCore::FrameLoaderClientHaiku::committedLoad):
+ (WebCore::FrameLoaderClientHaiku::cancelledError):
+ (WebCore::FrameLoaderClientHaiku::blockedError):
+ (WebCore::FrameLoaderClientHaiku::cannotShowURLError):
+ (WebCore::FrameLoaderClientHaiku::interruptForPolicyChangeError):
+ (WebCore::FrameLoaderClientHaiku::cannotShowMIMETypeError):
+ (WebCore::FrameLoaderClientHaiku::fileDoesNotExistError):
+ (WebCore::FrameLoaderClientHaiku::shouldFallBack):
+ (WebCore::FrameLoaderClientHaiku::createDocumentLoader):
+ (WebCore::FrameLoaderClientHaiku::download):
+ (WebCore::FrameLoaderClientHaiku::assignIdentifierToInitialRequest):
+ (WebCore::FrameLoaderClientHaiku::dispatchWillSendRequest):
+ (WebCore::FrameLoaderClientHaiku::shouldUseCredentialStorage):
+ (WebCore::FrameLoaderClientHaiku::dispatchDidReceiveAuthenticationChallenge):
+ (WebCore::FrameLoaderClientHaiku::dispatchDidCancelAuthenticationChallenge):
+ (WebCore::FrameLoaderClientHaiku::dispatchDidReceiveResponse):
+ (WebCore::FrameLoaderClientHaiku::dispatchDidReceiveContentLength):
+ (WebCore::FrameLoaderClientHaiku::dispatchDidFinishLoading):
+ (WebCore::FrameLoaderClientHaiku::dispatchDidFailLoading):
+ (WebCore::FrameLoaderClientHaiku::dispatchDidLoadResourceFromMemoryCache):
+ (WebCore::FrameLoaderClientHaiku::dispatchDidLoadResourceByXMLHttpRequest):
+ (WebCore::FrameLoaderClientHaiku::dispatchDidFailProvisionalLoad):
+ (WebCore::FrameLoaderClientHaiku::dispatchDidFailLoad):
+ (WebCore::FrameLoaderClientHaiku::dispatchCreatePage):
+ (WebCore::FrameLoaderClientHaiku::dispatchDecidePolicyForMIMEType):
+ (WebCore::FrameLoaderClientHaiku::dispatchDecidePolicyForNewWindowAction):
+ (WebCore::FrameLoaderClientHaiku::dispatchDecidePolicyForNavigationAction):
+ (WebCore::FrameLoaderClientHaiku::dispatchUnableToImplementPolicy):
+ (WebCore::FrameLoaderClientHaiku::startDownload):
+ (WebCore::FrameLoaderClientHaiku::createFrame):
+ (WebCore::FrameLoaderClientHaiku::objectContentType):
+ (WebCore::FrameLoaderClientHaiku::createPlugin):
+ (WebCore::FrameLoaderClientHaiku::redirectDataToPlugin):
+ (WebCore::FrameLoaderClientHaiku::pluginWillHandleLoadError):
+ (WebCore::FrameLoaderClientHaiku::createJavaAppletWidget):
+ (WebCore::FrameLoaderClientHaiku::overrideMediaType):
+ (WebCore::FrameLoaderClientHaiku::windowObjectCleared):
+ (WebCore::FrameLoaderClientHaiku::documentElementAvailable):
+ (WebCore::FrameLoaderClientHaiku::didPerformFirstNavigation):
+ (WebCore::FrameLoaderClientHaiku::registerForIconNotification):
+ (WebCore::FrameLoaderClientHaiku::savePlatformDataToCachedFrame):
+ (WebCore::FrameLoaderClientHaiku::transitionToCommittedFromCachedFrame):
+ (WebCore::FrameLoaderClientHaiku::transitionToCommittedForNewPage):
+ * haiku/WebCoreSupport/FrameLoaderClientHaiku.h: Added.
+ (WebCore::FrameLoaderClientHaiku::~FrameLoaderClientHaiku):
+
+2009-07-28 Maxime Simon <simon.maxime@gmail.com>
+
+ Reviewed by David Levin.
+
+ Added ChromeClient for Haiku WebCore support.
+ https://bugs.webkit.org/show_bug.cgi?id=26952
+
+ * haiku/WebCoreSupport/ChromeClientHaiku.cpp: Added.
+ (WebCore::ChromeClientHaiku::ChromeClientHaiku):
+ (WebCore::ChromeClientHaiku::~ChromeClientHaiku):
+ (WebCore::ChromeClientHaiku::chromeDestroyed):
+ (WebCore::ChromeClientHaiku::setWindowRect):
+ (WebCore::ChromeClientHaiku::windowRect):
+ (WebCore::ChromeClientHaiku::pageRect):
+ (WebCore::ChromeClientHaiku::scaleFactor):
+ (WebCore::ChromeClientHaiku::focus):
+ (WebCore::ChromeClientHaiku::unfocus):
+ (WebCore::ChromeClientHaiku::canTakeFocus):
+ (WebCore::ChromeClientHaiku::takeFocus):
+ (WebCore::ChromeClientHaiku::createWindow):
+ (WebCore::ChromeClientHaiku::createModalDialog):
+ (WebCore::ChromeClientHaiku::show):
+ (WebCore::ChromeClientHaiku::canRunModal):
+ (WebCore::ChromeClientHaiku::runModal):
+ (WebCore::ChromeClientHaiku::setToolbarsVisible):
+ (WebCore::ChromeClientHaiku::toolbarsVisible):
+ (WebCore::ChromeClientHaiku::setStatusbarVisible):
+ (WebCore::ChromeClientHaiku::statusbarVisible):
+ (WebCore::ChromeClientHaiku::setScrollbarsVisible):
+ (WebCore::ChromeClientHaiku::scrollbarsVisible):
+ (WebCore::ChromeClientHaiku::setMenubarVisible):
+ (WebCore::ChromeClientHaiku::menubarVisible):
+ (WebCore::ChromeClientHaiku::setResizable):
+ (WebCore::ChromeClientHaiku::addMessageToConsole):
+ (WebCore::ChromeClientHaiku::canRunBeforeUnloadConfirmPanel):
+ (WebCore::ChromeClientHaiku::runBeforeUnloadConfirmPanel):
+ (WebCore::ChromeClientHaiku::closeWindowSoon):
+ (WebCore::ChromeClientHaiku::runJavaScriptAlert):
+ (WebCore::ChromeClientHaiku::runJavaScriptConfirm):
+ (WebCore::ChromeClientHaiku::runJavaScriptPrompt):
+ (WebCore::ChromeClientHaiku::setStatusbarText):
+ (WebCore::ChromeClientHaiku::shouldInterruptJavaScript):
+ (WebCore::ChromeClientHaiku::tabsToLinks):
+ (WebCore::ChromeClientHaiku::windowResizerRect):
+ (WebCore::ChromeClientHaiku::repaint):
+ (WebCore::ChromeClientHaiku::scroll):
+ (WebCore::ChromeClientHaiku::screenToWindow):
+ (WebCore::ChromeClientHaiku::windowToScreen):
+ (WebCore::ChromeClientHaiku::platformWindow):
+ (WebCore::ChromeClientHaiku::contentsSizeChanged):
+ (WebCore::ChromeClientHaiku::scrollRectIntoView):
+ (WebCore::ChromeClientHaiku::addToDirtyRegion):
+ (WebCore::ChromeClientHaiku::scrollBackingStore):
+ (WebCore::ChromeClientHaiku::updateBackingStore):
+ (WebCore::ChromeClientHaiku::mouseDidMoveOverElement):
+ (WebCore::ChromeClientHaiku::setToolTip):
+ (WebCore::ChromeClientHaiku::print):
+ (WebCore::ChromeClientHaiku::exceededDatabaseQuota):
+ (WebCore::ChromeClientWx::reachedMaxAppCacheSize):
+ (WebCore::ChromeClientHaiku::requestGeolocationPermissionForFrame):
+ (WebCore::ChromeClientHaiku::runOpenPanel):
+ (WebCore::ChromeClientHaiku::setCursor):
+ (WebCore::ChromeClientHaiku::formStateDidChange):
+ (WebCore::ChromeClientHaiku::createHTMLParserQuirks):
+ * haiku/WebCoreSupport/ChromeClientHaiku.h: Added.
+
+2009-07-28 Robert Hogan <robert@roberthogan.net>
+
+ Reviewed by Simon Hausmann.
+
+ Add WebKit version API to Qt.
+
+ Get the current version of WebKit from WebKit/mac/Configurations/Version.xcconfig
+ at compile time and make it available to webkit ports through WebKitVersion.h.
+
+ https://bugs.webkit.org/show_bug.cgi?id=27158
+
+ * scripts/generate-webkitversion.pl: Added
+
2009-07-24 Andrei Popescu <andreip@google.com>
ApplicationCache should have size limit
diff --git a/src/3rdparty/webkit/WebKit/LICENSE b/src/3rdparty/webkit/WebKit/LICENSE
index 47dee862e..f29b41c3b 100644
--- a/src/3rdparty/webkit/WebKit/LICENSE
+++ b/src/3rdparty/webkit/WebKit/LICENSE
@@ -1,25 +1,21 @@
-Copyright (C) 2005 Apple Computer, Inc. All rights reserved.
+Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
-
1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
+ notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- its contributors may be used to endorse or promote products derived
- from this software without specific prior written permission.
+ documentation and/or other materials provided with the distribution.
-THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/src/3rdparty/webkit/WebKit/StringsNotToBeLocalized.txt b/src/3rdparty/webkit/WebKit/StringsNotToBeLocalized.txt
index 7e593cab5..3f1964d47 100644
--- a/src/3rdparty/webkit/WebKit/StringsNotToBeLocalized.txt
+++ b/src/3rdparty/webkit/WebKit/StringsNotToBeLocalized.txt
@@ -8,7 +8,6 @@
" Mac OS X %@; %@) AppleWebKit/%@ (KHTML, like Gecko) %@"
" Mac OS X %@; %@) AppleWebKit/%@ (KHTML, like Gecko)"
" Version/3.2.1"
-" webViewDrawResizer delegate call"
"#"
"%"
"%.0f"
@@ -49,12 +48,12 @@
"._"
".download"
".html"
+".jpg"
".svg"
".xhtml"
"/"
"/Frameworks/PDFKit.framework"
"/Library/Internet Plug-Ins"
-"/System/Library/Frameworks/Accelerate.framework/Accelerate"
"/System/Library/Frameworks/ApplicationServices.framework/Frameworks/LangAnalysis.framework/LangAnalysis"
"/System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/HIToolbox"
"/Volumes"
@@ -74,6 +73,7 @@
"5CACD637-F82F-491F-947A-5DCA38AA0FEA"
"6EB8D98F-2723-4472-88D3-5936F9D6E631"
"7"
+"7.1"
"9"
":"
"://"
@@ -96,6 +96,22 @@
"@"
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-."
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+.-"
+"ARIAApplicationLog"
+"ARIAApplicationMarquee"
+"ARIAApplicationStatus"
+"ARIAApplicationTimer"
+"ARIADocument"
+"ARIADocumentArticle"
+"ARIADocumentNote"
+"ARIADocumentRegion"
+"ARIALandmarkApplication"
+"ARIALandmarkBanner"
+"ARIALandmarkComplementary"
+"ARIALandmarkContentInfo"
+"ARIALandmarkMain"
+"ARIALandmarkNavigation"
+"ARIALandmarkSearch"
+"ARIAUserInterfaceTooltip"
"AXEnhancedUserInterface"
"AccessibleBase"
"AccessibleObjectFromWindow"
@@ -104,6 +120,7 @@
"AppleKeyboardUIMode"
"AppleLanguages"
"AppleTextDirection"
+"AudioElement"
"BEGIN:VCALENDAR"
"BEGIN:VCARD"
"BP_CreatePluginMIMETypesPreferences"
@@ -113,6 +130,7 @@
"Content-Encoding"
"Content-Length"
"Content-Type"
+"CurrentTimeDisplay"
"D"
"DCMDictionaryServiceWindowShow"
"DELEGATE METHODS"
@@ -133,12 +151,14 @@
"FastMallocHeapSize"
"FastMallocReturnedSize"
"FrameName"
+"FullscreenButton"
"GEN_DOMObject"
"GET"
"GroupName"
"HIDictionaryWindowShow"
"HTTP "
"Helvetica"
+"HostedNetscapePluginStream"
"IDNScriptWhiteList"
"IDNScriptWhiteList.txt"
"IMM32.DLL"
@@ -167,7 +187,6 @@
"Library/Caches"
"Library/Internet Plug-Ins"
"LresultFromObject"
-"Lucida Grande"
"MIME\\Database\\Content Type"
"MainPageJavaScript.js"
"MemoryStream"
@@ -198,9 +217,8 @@
"MoveWordRight"
"MoveWordRightAndModifySelection"
"Mozilla/5.0 (Macintosh; U; "
-"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_7; en-us) AppleWebKit/525.28.3 (KHTML, like Gecko) Version/3.2.3 Safari/525.28.3"
"Mozilla/5.0 (Windows; U; %s; %s) AppleWebKit/%s (KHTML, like Gecko)%s%s"
-"Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/525.28.3 (KHTML, like Gecko) Version/3.2.3 Safari/525.29"
+"MuteButton"
"NP_GetEntryPoints"
"NP_Initialize"
"NP_Shutdown"
@@ -213,6 +231,7 @@
"NSEvent"
"NSView"
"NeXT smart paste pasteboard type"
+"NetscapePluginInstanceProxy"
"PDFDocument"
"PDFPreviewView"
"PDFView"
@@ -222,21 +241,33 @@
"PNG"
"POST"
"PPC"
+"PauseButton"
+"PlayButton"
"Quartz.framework"
"RTL"
"Referer"
+"ReturnToRealtimeButton"
+"RewindButton"
"SAMILang"
"SAMIStyle"
"Safari.exe"
+"SeekBackButton"
+"SeekForwardButton"
"SelectAll"
+"Slider"
+"SliderThumb"
+"StatusDisplay"
+"TimeRemainingDisplay"
"Times"
"ToggleBold"
"ToggleItalic"
"U+0009"
"U+001B"
"UTF-8"
+"UnMuteButton"
"UseBackForwardList"
"User-Agent"
+"VideoElement"
"Volumes"
"W"
"WEBKIT_UNSET_DYLD_FRAMEWORK_PATH"
@@ -285,7 +316,14 @@
"WebElementTitle"
"WebError"
"WebFrame"
+"WebFrameCanSuspendActiveDOMObjectsKey"
+"WebFrameHasPluginsKey"
+"WebFrameHasUnloadListenerKey"
+"WebFrameMainDocumentErrorKey"
"WebFramePolicyListener"
+"WebFrameUsesApplicationCacheKey"
+"WebFrameUsesDatabasesKey"
+"WebFrameUsesGeolocationKey"
"WebHTMLRepresentation"
"WebHistory"
"WebHistoryAllItemsRemovedNotification"
@@ -321,8 +359,6 @@
"WebKitErrorPlugInPageURLStringKey"
"WebKitHistoryAgeInDaysLimit"
"WebKitHistoryItemLimit"
-"WebKitInspectorAttached"
-"WebKitInspectorAttachedViewHeight"
"WebKitInspectorHiddenPanels"
"WebKitLocalCache"
"WebKitLogLevel"
@@ -402,6 +438,7 @@
"WebViewDidChangeTypingStyleNotification"
"WebViewDidEndEditingNotification"
"WebViewWindowClass"
+"WebWorkersPrivate"
"Windows %d.%d"
"Windows 95"
"Windows 98"
@@ -429,7 +466,8 @@
"a"
"ab"
"about:"
-"ads.pointroll.com"
+"actions"
+"anchorPoint"
"applewebdata"
"applewebdata://%@"
"application.pdf"
@@ -446,6 +484,7 @@
"attributeValues"
"b"
"basefont"
+"bounds"
"bundlePath"
"c"
"canGoBack"
@@ -517,6 +556,8 @@
"com.sunrisebrowser.Sunrise"
"com.thinkmac.NewsLife"
"com.yahoo.messenger3"
+"contents"
+"contentsRect"
"cp949"
"cpuType"
"de.codingmonkeys.SubEthaEdit"
@@ -552,11 +593,11 @@
"img"
"info.colloquy"
"insertText:"
+"inspectorStartsAttached"
"isLoading"
"isindex"
"javascript:"
"jpeg"
-"jpg"
"js"
"kioskmode"
"ks_c_5601-1987"
@@ -581,6 +622,7 @@
"nullPlugin"
"nullplugin"
"oleacc.dll"
+"opacity"
"org.xlife.NewsFire"
"panEastCursor"
"panIcon"
@@ -593,6 +635,7 @@
"panWestCursor"
"pluginHostPath"
"pluginspage"
+"position"
"public.url"
"public.url-name"
"r"
@@ -608,6 +651,8 @@
"sourceURL"
"src"
"sub"
+"sublayerTransform"
+"sublayers"
"text/calendar"
"text/directory"
"text/html"
@@ -626,13 +671,13 @@
"text/x-vcf"
"textAreaResizeCorner"
"tiff"
+"transform"
"txt"
"u"
"uk.co.opencommunity.vienna2"
"userAgent"
"userInfo"
"utf-16"
-"vImagePermuteChannels_ARGB8888"
"verticalTextCursor"
"visibleName"
"visitCount"
diff --git a/src/3rdparty/webkit/WebKit/mac/Configurations/Version.xcconfig b/src/3rdparty/webkit/WebKit/mac/Configurations/Version.xcconfig
new file mode 100644
index 000000000..fabc00986
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/mac/Configurations/Version.xcconfig
@@ -0,0 +1,58 @@
+// Copyright (C) 2009 Apple Inc. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+MAJOR_VERSION = 532;
+MINOR_VERSION = 4;
+TINY_VERSION = 0;
+FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION);
+
+// The bundle version and short version string are set based on the current build configuration, see below.
+BUNDLE_VERSION = $(BUNDLE_VERSION_$(CONFIGURATION));
+SHORT_VERSION_STRING = $(SHORT_VERSION_STRING_$(CONFIGURATION))
+
+// The system version prefix is based on the current system version.
+SYSTEM_VERSION_PREFIX = $(SYSTEM_VERSION_PREFIX_$(MAC_OS_X_VERSION_MAJOR));
+SYSTEM_VERSION_PREFIX_ = 4; // Some Tiger versions of Xcode don't set MAC_OS_X_VERSION_MAJOR.
+SYSTEM_VERSION_PREFIX_1040 = 4;
+SYSTEM_VERSION_PREFIX_1050 = 5;
+SYSTEM_VERSION_PREFIX_1060 = 6;
+SYSTEM_VERSION_PREFIX_1070 = 7;
+
+// The production build always uses the full version with a system version prefix.
+BUNDLE_VERSION_Production = $(SYSTEM_VERSION_PREFIX)$(FULL_VERSION);
+BUNDLE_VERSION_ = $(BUNDLE_VERSION_Production);
+
+// The production build always uses the major version with a system version prefix
+SHORT_VERSION_STRING_Production = $(SYSTEM_VERSION_PREFIX)$(MAJOR_VERSION);
+SHORT_VERSION_STRING_ = $(SHORT_VERSION_STRING_Production);
+
+// Local builds are the full version with a plus suffix.
+BUNDLE_VERSION_Release = $(FULL_VERSION)+;
+BUNDLE_VERSION_Debug = $(BUNDLE_VERSION_Release);
+
+// Local builds use the major version with a plus suffix
+SHORT_VERSION_STRING_Release = $(MAJOR_VERSION)+;
+SHORT_VERSION_STRING_Debug = $(SHORT_VERSION_STRING_Release);
+
+DYLIB_COMPATIBILITY_VERSION = 1;
+DYLIB_CURRENT_VERSION = $(FULL_VERSION);
diff --git a/src/3rdparty/webkit/WebKit/mac/Workers/WebWorkersPrivate.h b/src/3rdparty/webkit/WebKit/mac/Workers/WebWorkersPrivate.h
new file mode 100644
index 000000000..0ff60d5de
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/mac/Workers/WebWorkersPrivate.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+@interface WebWorkersPrivate : NSObject {
+}
+
+// Returns the total number of currently executing worker threads (shared + dedicated).
++ (unsigned) workerThreadCount;
+
+@end
diff --git a/src/3rdparty/webkit/WebKit/mac/Workers/WebWorkersPrivate.mm b/src/3rdparty/webkit/WebKit/mac/Workers/WebWorkersPrivate.mm
new file mode 100644
index 000000000..2c14ad1b6
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/mac/Workers/WebWorkersPrivate.mm
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "WebWorkersPrivate.h"
+
+#import <WebCore/WorkerThread.h>
+
+@implementation WebWorkersPrivate
+
++ (unsigned) workerThreadCount
+{
+#if ENABLE_WORKERS
+ return WebCore::WorkerThread::workerThreadCount();
+#else
+ return 0;
+#endif
+}
+
+@end
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/headers.pri b/src/3rdparty/webkit/WebKit/qt/Api/headers.pri
index d92eb1cf7..1a4259733 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/headers.pri
+++ b/src/3rdparty/webkit/WebKit/qt/Api/headers.pri
@@ -1,4 +1,5 @@
WEBKIT_API_HEADERS = $$PWD/qwebframe.h \
+ $$PWD/qgraphicswebview.h \
$$PWD/qwebkitglobal.h \
$$PWD/qwebpage.h \
$$PWD/qwebview.h \
@@ -8,4 +9,6 @@ WEBKIT_API_HEADERS = $$PWD/qwebframe.h \
$$PWD/qwebsecurityorigin.h \
$$PWD/qwebelement.h \
$$PWD/qwebpluginfactory.h \
- $$PWD/qwebhistory.h
+ $$PWD/qwebhistory.h \
+ $$PWD/qwebinspector.h \
+ $$PWD/qwebkitversion.h
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp
new file mode 100644
index 000000000..ceb5ee1f0
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp
@@ -0,0 +1,1010 @@
+/*
+ Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
+ Copyright (C) 2009 Girish Ramakrishnan <girish@forwardbias.in>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include "qgraphicswebview.h"
+
+#include "qwebframe.h"
+#include "qwebpage.h"
+#include "qwebpage_p.h"
+#include "QWebPageClient.h"
+#include <QtGui/QGraphicsScene>
+#include <QtGui/QGraphicsView>
+#include <QtGui/qapplication.h>
+#include <QtGui/qgraphicssceneevent.h>
+#include <QtGui/qstyleoption.h>
+#if defined(Q_WS_X11)
+#include <QX11Info>
+#endif
+
+class QGraphicsWebViewPrivate : public QWebPageClient {
+public:
+ QGraphicsWebViewPrivate(QGraphicsWebView* parent)
+ : q(parent)
+ , page(0)
+ {}
+
+ virtual ~QGraphicsWebViewPrivate();
+ virtual void scroll(int dx, int dy, const QRect&);
+ virtual void update(const QRect& dirtyRect);
+ virtual void setInputMethodEnabled(bool enable);
+ virtual bool inputMethodEnabled() const;
+#if QT_VERSION >= 0x040600
+ virtual void setInputMethodHint(Qt::InputMethodHint hint, bool enable);
+#endif
+
+#ifndef QT_NO_CURSOR
+ virtual QCursor cursor() const;
+ virtual void updateCursor(const QCursor& cursor);
+#endif
+
+ virtual QPalette palette() const;
+ virtual int screenNumber() const;
+ virtual QWidget* ownerWidget() const;
+
+ virtual QObject* pluginParent() const;
+
+ void _q_doLoadFinished(bool success);
+
+ QGraphicsWebView* q;
+ QWebPage* page;
+};
+
+QGraphicsWebViewPrivate::~QGraphicsWebViewPrivate()
+{
+}
+
+void QGraphicsWebViewPrivate::_q_doLoadFinished(bool success)
+{
+ // If the page had no title, still make sure it gets the signal
+ if (q->title().isEmpty())
+ emit q->urlChanged(q->url());
+
+ emit q->loadFinished(success);
+}
+
+void QGraphicsWebViewPrivate::scroll(int dx, int dy, const QRect& rectToScroll)
+{
+ q->scroll(qreal(dx), qreal(dy), QRectF(rectToScroll));
+}
+
+void QGraphicsWebViewPrivate::update(const QRect & dirtyRect)
+{
+ q->update(QRectF(dirtyRect));
+}
+
+
+void QGraphicsWebViewPrivate::setInputMethodEnabled(bool enable)
+{
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+ q->setFlag(QGraphicsItem::ItemAcceptsInputMethod, enable);
+#endif
+}
+
+bool QGraphicsWebViewPrivate::inputMethodEnabled() const
+{
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+ return q->flags() & QGraphicsItem::ItemAcceptsInputMethod;
+#else
+ return false;
+#endif
+}
+
+#if QT_VERSION >= 0x040600
+void QGraphicsWebViewPrivate::setInputMethodHint(Qt::InputMethodHint hint, bool enable)
+{
+ if (enable)
+ q->setInputMethodHints(q->inputMethodHints() | hint);
+ else
+ q->setInputMethodHints(q->inputMethodHints() & ~hint);
+}
+#endif
+#ifndef QT_NO_CURSOR
+QCursor QGraphicsWebViewPrivate::cursor() const
+{
+ return q->cursor();
+}
+
+void QGraphicsWebViewPrivate::updateCursor(const QCursor& cursor)
+{
+ q->setCursor(cursor);
+}
+#endif
+
+QPalette QGraphicsWebViewPrivate::palette() const
+{
+ return q->palette();
+}
+
+int QGraphicsWebViewPrivate::screenNumber() const
+{
+#if defined(Q_WS_X11)
+ const QList<QGraphicsView*> views = q->scene()->views();
+
+ if (!views.isEmpty())
+ return views.at(0)->x11Info().screen();
+#endif
+
+ return 0;
+}
+
+QWidget* QGraphicsWebViewPrivate::ownerWidget() const
+{
+ const QList<QGraphicsView*> views = q->scene()->views();
+ return views.value(0);
+}
+
+QObject* QGraphicsWebViewPrivate::pluginParent() const
+{
+ return q;
+}
+
+/*!
+ \class QGraphicsWebView
+ \brief The QGraphicsWebView class allows Web content to be added to a GraphicsView.
+ \since 4.6
+
+ An instance of this class renders Web content from a URL or supplied as data, using
+ features of the QtWebKit module.
+
+ If the width and height of the item are not set, they will default to 800 and 600,
+ respectively. If the Web page contents is larger than that, scrollbars will be shown
+ if not disabled explicitly.
+
+ \section1 Browser Features
+
+ Many of the functions, signals and properties provided by QWebView are also available
+ for this item, making it simple to adapt existing code to use QGraphicsWebView instead
+ of QWebView.
+
+ The item uses a QWebPage object to perform the rendering of Web content, and this can
+ be obtained with the page() function, enabling the document itself to be accessed and
+ modified.
+
+ As with QWebView, the item records the browsing history using a QWebHistory object,
+ accessible using the history() function. The QWebSettings object that defines the
+ configuration of the browser can be obtained with the settings() function, enabling
+ features like plugin support to be customized for each item.
+
+ \sa QWebView, QGraphicsTextItem
+*/
+
+/*!
+ \fn void QGraphicsWebView::titleChanged(const QString &title)
+
+ This signal is emitted whenever the \a title of the main frame changes.
+
+ \sa title()
+*/
+
+/*!
+ \fn void QGraphicsWebView::urlChanged(const QUrl &url)
+
+ This signal is emitted when the \a url of the view changes.
+
+ \sa url(), load()
+*/
+
+/*!
+ \fn void QGraphicsWebView::iconChanged()
+
+ This signal is emitted whenever the icon of the page is loaded or changes.
+
+ In order for icons to be loaded, you will need to set an icon database path
+ using QWebSettings::setIconDatabasePath().
+
+ \sa icon(), QWebSettings::setIconDatabasePath()
+*/
+
+/*!
+ \fn void QGraphicsWebView::loadStarted()
+
+ This signal is emitted when a new load of the page is started.
+
+ \sa loadProgress(), loadFinished()
+*/
+
+/*!
+ \fn void QGraphicsWebView::loadFinished(bool ok)
+
+ This signal is emitted when a load of the page is finished.
+ \a ok will indicate whether the load was successful or any error occurred.
+
+ \sa loadStarted()
+*/
+
+/*!
+ Constructs an empty QGraphicsWebView with parent \a parent.
+
+ \sa load()
+*/
+QGraphicsWebView::QGraphicsWebView(QGraphicsItem* parent)
+ : QGraphicsWidget(parent)
+ , d(new QGraphicsWebViewPrivate(this))
+{
+#if QT_VERSION >= 0x040600
+ setFlag(QGraphicsItem::ItemUsesExtendedStyleOption, true);
+#endif
+ setAcceptHoverEvents(true);
+ setFocusPolicy(Qt::StrongFocus);
+}
+
+/*!
+ Destroys the item.
+*/
+QGraphicsWebView::~QGraphicsWebView()
+{
+ if (d->page) {
+#if QT_VERSION >= 0x040600
+ d->page->d->view.clear();
+#else
+ d->page->d->view = 0;
+#endif
+ d->page->d->client = 0; // unset the page client
+ }
+
+ if (d->page && d->page->parent() == this)
+ delete d->page;
+
+ delete d;
+}
+
+/*!
+ Returns a pointer to the underlying web page.
+
+ \sa setPage()
+*/
+QWebPage* QGraphicsWebView::page() const
+{
+ if (!d->page) {
+ QGraphicsWebView* that = const_cast<QGraphicsWebView*>(this);
+ QWebPage* page = new QWebPage(that);
+
+ // Default to not having a background, in the case
+ // the page doesn't provide one.
+ QPalette palette = QApplication::palette();
+ palette.setBrush(QPalette::Base, QColor::fromRgbF(0, 0, 0, 0));
+ page->setPalette(palette);
+
+ that->setPage(page);
+ }
+
+ return d->page;
+}
+
+/*! \reimp
+*/
+void QGraphicsWebView::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget*)
+{
+ page()->mainFrame()->render(painter, option->exposedRect.toRect());
+}
+
+/*! \reimp
+*/
+bool QGraphicsWebView::sceneEvent(QEvent* event)
+{
+ // Re-implemented in order to allows fixing event-related bugs in patch releases.
+ return QGraphicsWidget::sceneEvent(event);
+}
+
+/*! \reimp
+*/
+QVariant QGraphicsWebView::itemChange(GraphicsItemChange change, const QVariant& value)
+{
+ switch (change) {
+ // Differently from QWebView, it is interesting to QGraphicsWebView to handle
+ // post mouse cursor change notifications. Reason: 'ItemCursorChange' is sent
+ // as the first action in QGraphicsItem::setCursor implementation, and at that
+ // item widget's cursor has not been effectively changed yet.
+ // After cursor is properly set (at 'ItemCursorHasChanged' emission time), we
+ // fire 'CursorChange'.
+ case ItemCursorChange:
+ return value;
+ case ItemCursorHasChanged:
+ QEvent event(QEvent::CursorChange);
+ QApplication::sendEvent(this, &event);
+ return value;
+ }
+
+ return QGraphicsWidget::itemChange(change, value);
+}
+
+/*! \reimp
+*/
+QSizeF QGraphicsWebView::sizeHint(Qt::SizeHint which, const QSizeF& constraint) const
+{
+ if (which == Qt::PreferredSize)
+ return QSizeF(800, 600); // ###
+ return QGraphicsWidget::sizeHint(which, constraint);
+}
+
+/*! \reimp
+*/
+QVariant QGraphicsWebView::inputMethodQuery(Qt::InputMethodQuery query) const
+{
+ if (d->page)
+ return d->page->inputMethodQuery(query);
+ return QVariant();
+}
+
+/*! \reimp
+*/
+bool QGraphicsWebView::event(QEvent* event)
+{
+ // Re-implemented in order to allows fixing event-related bugs in patch releases.
+
+ if (d->page) {
+#ifndef QT_NO_CONTEXTMENU
+ if (event->type() == QEvent::GraphicsSceneContextMenu) {
+ if (!isEnabled())
+ return false;
+
+ QGraphicsSceneContextMenuEvent* ev = static_cast<QGraphicsSceneContextMenuEvent*>(event);
+ QContextMenuEvent fakeEvent(QContextMenuEvent::Reason(ev->reason()), ev->pos().toPoint());
+ if (d->page->swallowContextMenuEvent(&fakeEvent)) {
+ event->accept();
+ return true;
+ }
+ d->page->updatePositionDependentActions(fakeEvent.pos());
+ } else
+#endif // QT_NO_CONTEXTMENU
+ {
+#ifndef QT_NO_CURSOR
+#if QT_VERSION >= 0x040400
+ if (event->type() == QEvent::CursorChange) {
+ // An unsetCursor will set the cursor to Qt::ArrowCursor.
+ // Thus this cursor change might be a QWidget::unsetCursor()
+ // If this is not the case and it came from WebCore, the
+ // QWebPageClient already has set its cursor internally
+ // to Qt::ArrowCursor, so updating the cursor is always
+ // right, as it falls back to the last cursor set by
+ // WebCore.
+ // FIXME: Add a QEvent::CursorUnset or similar to Qt.
+ if (cursor().shape() == Qt::ArrowCursor)
+ d->resetCursor();
+ }
+#endif
+#endif
+ }
+ }
+ return QGraphicsWidget::event(event);
+}
+
+/*!
+ Makes \a page the new web page of the web graphicsitem.
+
+ The parent QObject of the provided page remains the owner
+ of the object. If the current document is a child of the web
+ view, it will be deleted.
+
+ \sa page()
+*/
+void QGraphicsWebView::setPage(QWebPage* page)
+{
+ if (d->page == page)
+ return;
+
+ if (d->page) {
+ d->page->d->client = 0; // unset the page client
+ if (d->page->parent() == this)
+ delete d->page;
+ else
+ d->page->disconnect(this);
+ }
+
+ d->page = page;
+ if (!d->page)
+ return;
+ d->page->d->client = d; // set the page client
+
+ QSize size = geometry().size().toSize();
+ page->setViewportSize(size);
+
+ QWebFrame* mainFrame = d->page->mainFrame();
+
+ connect(mainFrame, SIGNAL(titleChanged(QString)),
+ this, SIGNAL(titleChanged(QString)));
+ connect(mainFrame, SIGNAL(iconChanged()),
+ this, SIGNAL(iconChanged()));
+ connect(mainFrame, SIGNAL(urlChanged(QUrl)),
+ this, SIGNAL(urlChanged(QUrl)));
+ connect(d->page, SIGNAL(loadStarted()),
+ this, SIGNAL(loadStarted()));
+ connect(d->page, SIGNAL(loadProgress(int)),
+ this, SIGNAL(loadProgress(int)));
+ connect(d->page, SIGNAL(loadFinished(bool)),
+ this, SLOT(_q_doLoadFinished(bool)));
+ connect(d->page, SIGNAL(statusBarMessage(QString)),
+ this, SIGNAL(statusBarMessage(QString)));
+ connect(d->page, SIGNAL(linkClicked(QUrl)),
+ this, SIGNAL(linkClicked(QUrl)));
+}
+
+/*!
+ \property QGraphicsWebView::url
+ \brief the url of the web page currently viewed
+
+ Setting this property clears the view and loads the URL.
+
+ By default, this property contains an empty, invalid URL.
+
+ \sa load(), urlChanged()
+*/
+
+void QGraphicsWebView::setUrl(const QUrl &url)
+{
+ page()->mainFrame()->setUrl(url);
+}
+
+QUrl QGraphicsWebView::url() const
+{
+ if (d->page)
+ return d->page->mainFrame()->url();
+
+ return QUrl();
+}
+
+/*!
+ \property QGraphicsWebView::title
+ \brief the title of the web page currently viewed
+
+ By default, this property contains an empty string.
+
+ \sa titleChanged()
+*/
+QString QGraphicsWebView::title() const
+{
+ if (d->page)
+ return d->page->mainFrame()->title();
+
+ return QString();
+}
+
+/*!
+ \property QGraphicsWebView::icon
+ \brief the icon associated with the web page currently viewed
+
+ By default, this property contains a null icon.
+
+ \sa iconChanged(), QWebSettings::iconForUrl()
+*/
+QIcon QGraphicsWebView::icon() const
+{
+ if (d->page)
+ return d->page->mainFrame()->icon();
+
+ return QIcon();
+}
+
+/*!
+ \property QGraphicsWebView::zoomFactor
+ \since 4.5
+ \brief the zoom factor for the view
+*/
+
+void QGraphicsWebView::setZoomFactor(qreal factor)
+{
+ if (factor == page()->mainFrame()->zoomFactor())
+ return;
+
+ page()->mainFrame()->setZoomFactor(factor);
+}
+
+qreal QGraphicsWebView::zoomFactor() const
+{
+ return page()->mainFrame()->zoomFactor();
+}
+
+/*! \reimp
+*/
+void QGraphicsWebView::updateGeometry()
+{
+ QGraphicsWidget::updateGeometry();
+
+ if (!d->page)
+ return;
+
+ QSize size = geometry().size().toSize();
+ d->page->setViewportSize(size);
+}
+
+/*! \reimp
+*/
+void QGraphicsWebView::setGeometry(const QRectF& rect)
+{
+ QGraphicsWidget::setGeometry(rect);
+
+ if (!d->page)
+ return;
+
+ // NOTE: call geometry() as setGeometry ensures that
+ // the geometry is within legal bounds (minimumSize, maximumSize)
+ QSize size = geometry().size().toSize();
+ d->page->setViewportSize(size);
+}
+
+/*!
+ Convenience slot that stops loading the document.
+
+ \sa reload(), loadFinished()
+*/
+void QGraphicsWebView::stop()
+{
+ if (d->page)
+ d->page->triggerAction(QWebPage::Stop);
+}
+
+/*!
+ Convenience slot that loads the previous document in the list of documents
+ built by navigating links. Does nothing if there is no previous document.
+
+ \sa forward()
+*/
+void QGraphicsWebView::back()
+{
+ if (d->page)
+ d->page->triggerAction(QWebPage::Back);
+}
+
+/*!
+ Convenience slot that loads the next document in the list of documents
+ built by navigating links. Does nothing if there is no next document.
+
+ \sa back()
+*/
+void QGraphicsWebView::forward()
+{
+ if (d->page)
+ d->page->triggerAction(QWebPage::Forward);
+}
+
+/*!
+ Reloads the current document.
+
+ \sa stop(), loadStarted()
+*/
+void QGraphicsWebView::reload()
+{
+ if (d->page)
+ d->page->triggerAction(QWebPage::Reload);
+}
+
+/*!
+ Loads the specified \a url and displays it.
+
+ \note The view remains the same until enough data has arrived to display the new \a url.
+
+ \sa setUrl(), url(), urlChanged()
+*/
+void QGraphicsWebView::load(const QUrl& url)
+{
+ page()->mainFrame()->load(url);
+}
+
+/*!
+ \fn void QGraphicsWebView::load(const QNetworkRequest &request, QNetworkAccessManager::Operation operation, const QByteArray &body)
+
+ Loads a network request, \a request, using the method specified in \a operation.
+
+ \a body is optional and is only used for POST operations.
+
+ \note The view remains the same until enough data has arrived to display the new url.
+
+ \sa url(), urlChanged()
+*/
+
+void QGraphicsWebView::load(const QNetworkRequest& request,
+ QNetworkAccessManager::Operation operation,
+ const QByteArray& body)
+{
+ page()->mainFrame()->load(request, operation, body);
+}
+
+/*!
+ Sets the content of the web view to the specified \a html.
+
+ External objects such as stylesheets or images referenced in the HTML
+ document are located relative to \a baseUrl.
+
+ The \a html is loaded immediately; external objects are loaded asynchronously.
+
+ When using this method, WebKit assumes that external resources such as
+ JavaScript programs or style sheets are encoded in UTF-8 unless otherwise
+ specified. For example, the encoding of an external script can be specified
+ through the charset attribute of the HTML script tag. Alternatively, the
+ encoding can also be specified by the web server.
+
+ \sa load(), setContent(), QWebFrame::toHtml()
+*/
+void QGraphicsWebView::setHtml(const QString& html, const QUrl& baseUrl)
+{
+ page()->mainFrame()->setHtml(html, baseUrl);
+}
+
+/*!
+ Sets the content of the web graphicsitem to the specified content \a data. If the \a mimeType argument
+ is empty it is currently assumed that the content is HTML but in future versions we may introduce
+ auto-detection.
+
+ External objects referenced in the content are located relative to \a baseUrl.
+
+ The \a data is loaded immediately; external objects are loaded asynchronously.
+
+ \sa load(), setHtml(), QWebFrame::toHtml()
+*/
+void QGraphicsWebView::setContent(const QByteArray& data, const QString& mimeType, const QUrl& baseUrl)
+{
+ page()->mainFrame()->setContent(data, mimeType, baseUrl);
+}
+
+/*!
+ Returns a pointer to the view's history of navigated web pages.
+
+ It is equivalent to
+
+ \snippet webkitsnippets/qtwebkit_qwebview_snippet.cpp 0
+*/
+QWebHistory* QGraphicsWebView::history() const
+{
+ return page()->history();
+}
+
+/*!
+ \property QGraphicsWebView::modified
+ \brief whether the document was modified by the user
+
+ Parts of HTML documents can be editable for example through the
+ \c{contenteditable} attribute on HTML elements.
+
+ By default, this property is false.
+*/
+bool QGraphicsWebView::isModified() const
+{
+ if (d->page)
+ return d->page->isModified();
+ return false;
+}
+
+/*!
+ Returns a pointer to the view/page specific settings object.
+
+ It is equivalent to
+
+ \snippet webkitsnippets/qtwebkit_qwebview_snippet.cpp 1
+
+ \sa QWebSettings::globalSettings()
+*/
+QWebSettings* QGraphicsWebView::settings() const
+{
+ return page()->settings();
+}
+
+/*!
+ Returns a pointer to a QAction that encapsulates the specified web action \a action.
+*/
+QAction *QGraphicsWebView::pageAction(QWebPage::WebAction action) const
+{
+ return page()->action(action);
+}
+
+/*!
+ Triggers the specified \a action. If it is a checkable action the specified
+ \a checked state is assumed.
+
+ \sa pageAction()
+*/
+void QGraphicsWebView::triggerPageAction(QWebPage::WebAction action, bool checked)
+{
+ page()->triggerAction(action, checked);
+}
+
+/*!
+ Finds the specified string, \a subString, in the page, using the given \a options.
+
+ If the HighlightAllOccurrences flag is passed, the function will highlight all occurrences
+ that exist in the page. All subsequent calls will extend the highlight, rather than
+ replace it, with occurrences of the new string.
+
+ If the HighlightAllOccurrences flag is not passed, the function will select an occurrence
+ and all subsequent calls will replace the current occurrence with the next one.
+
+ To clear the selection, just pass an empty string.
+
+ Returns true if \a subString was found; otherwise returns false.
+
+ \sa QWebPage::selectedText(), QWebPage::selectionChanged()
+*/
+bool QGraphicsWebView::findText(const QString &subString, QWebPage::FindFlags options)
+{
+ if (d->page)
+ return d->page->findText(subString, options);
+ return false;
+}
+
+/*! \reimp
+*/
+void QGraphicsWebView::hoverMoveEvent(QGraphicsSceneHoverEvent* ev)
+{
+ if (d->page) {
+ const bool accepted = ev->isAccepted();
+ QMouseEvent me = QMouseEvent(QEvent::MouseMove,
+ ev->pos().toPoint(), Qt::NoButton,
+ Qt::NoButton, Qt::NoModifier);
+ d->page->event(&me);
+ ev->setAccepted(accepted);
+ }
+
+ if (!ev->isAccepted())
+ QGraphicsItem::hoverMoveEvent(ev);
+}
+
+/*! \reimp
+*/
+void QGraphicsWebView::hoverLeaveEvent(QGraphicsSceneHoverEvent* ev)
+{
+ Q_UNUSED(ev);
+}
+
+/*! \reimp
+*/
+void QGraphicsWebView::mouseMoveEvent(QGraphicsSceneMouseEvent* ev)
+{
+ if (d->page) {
+ const bool accepted = ev->isAccepted();
+ d->page->event(ev);
+ ev->setAccepted(accepted);
+ }
+
+ if (!ev->isAccepted())
+ QGraphicsItem::mouseMoveEvent(ev);
+}
+
+/*! \reimp
+*/
+void QGraphicsWebView::mousePressEvent(QGraphicsSceneMouseEvent* ev)
+{
+ if (d->page) {
+ const bool accepted = ev->isAccepted();
+ d->page->event(ev);
+ ev->setAccepted(accepted);
+ }
+
+ if (!ev->isAccepted())
+ QGraphicsItem::mousePressEvent(ev);
+}
+
+/*! \reimp
+*/
+void QGraphicsWebView::mouseReleaseEvent(QGraphicsSceneMouseEvent* ev)
+{
+ if (d->page) {
+ const bool accepted = ev->isAccepted();
+ d->page->event(ev);
+ ev->setAccepted(accepted);
+ }
+
+ if (!ev->isAccepted())
+ QGraphicsItem::mouseReleaseEvent(ev);
+}
+
+/*! \reimp
+*/
+void QGraphicsWebView::mouseDoubleClickEvent(QGraphicsSceneMouseEvent* ev)
+{
+ if (d->page) {
+ const bool accepted = ev->isAccepted();
+ d->page->event(ev);
+ ev->setAccepted(accepted);
+ }
+
+ if (!ev->isAccepted())
+ QGraphicsItem::mouseDoubleClickEvent(ev);
+}
+
+/*! \reimp
+*/
+void QGraphicsWebView::keyPressEvent(QKeyEvent* ev)
+{
+ if (d->page)
+ d->page->event(ev);
+
+ if (!ev->isAccepted())
+ QGraphicsItem::keyPressEvent(ev);
+}
+
+/*! \reimp
+*/
+void QGraphicsWebView::keyReleaseEvent(QKeyEvent* ev)
+{
+ if (d->page)
+ d->page->event(ev);
+
+ if (!ev->isAccepted())
+ QGraphicsItem::keyReleaseEvent(ev);
+}
+
+/*! \reimp
+*/
+void QGraphicsWebView::focusInEvent(QFocusEvent* ev)
+{
+ if (d->page)
+ d->page->event(ev);
+ else
+ QGraphicsItem::focusInEvent(ev);
+}
+
+/*! \reimp
+*/
+void QGraphicsWebView::focusOutEvent(QFocusEvent* ev)
+{
+ if (d->page)
+ d->page->event(ev);
+ else
+ QGraphicsItem::focusOutEvent(ev);
+}
+
+/*! \reimp
+*/
+bool QGraphicsWebView::focusNextPrevChild(bool next)
+{
+ if (d->page)
+ return d->page->focusNextPrevChild(next);
+
+ return QGraphicsWidget::focusNextPrevChild(next);
+}
+
+/*! \reimp
+*/
+void QGraphicsWebView::dragEnterEvent(QGraphicsSceneDragDropEvent* ev)
+{
+#ifndef QT_NO_DRAGANDDROP
+ //if (d->page)
+ // d->page->event(ev);
+ //Just remove this line below when the code above is working
+ Q_UNUSED(ev);
+#else
+ Q_UNUSED(ev);
+#endif
+}
+
+/*! \reimp
+*/
+void QGraphicsWebView::dragLeaveEvent(QGraphicsSceneDragDropEvent* ev)
+{
+#ifndef QT_NO_DRAGANDDROP
+ if (d->page) {
+ const bool accepted = ev->isAccepted();
+ d->page->event(ev);
+ ev->setAccepted(accepted);
+ }
+
+ if (!ev->isAccepted())
+ QGraphicsWidget::dragLeaveEvent(ev);
+#else
+ Q_UNUSED(ev);
+#endif
+}
+
+/*! \reimp
+*/
+void QGraphicsWebView::dragMoveEvent(QGraphicsSceneDragDropEvent* ev)
+{
+#ifndef QT_NO_DRAGANDDROP
+ if (d->page) {
+ const bool accepted = ev->isAccepted();
+ d->page->event(ev);
+ ev->setAccepted(accepted);
+ }
+
+ if (!ev->isAccepted())
+ QGraphicsWidget::dragMoveEvent(ev);
+#else
+ Q_UNUSED(ev);
+#endif
+}
+
+/*! \reimp
+*/
+void QGraphicsWebView::dropEvent(QGraphicsSceneDragDropEvent* ev)
+{
+#ifndef QT_NO_DRAGANDDROP
+ if (d->page) {
+ const bool accepted = ev->isAccepted();
+ d->page->event(ev);
+ ev->setAccepted(accepted);
+ }
+
+ if (!ev->isAccepted())
+ QGraphicsWidget::dropEvent(ev);
+#else
+ Q_UNUSED(ev);
+#endif
+}
+
+#ifndef QT_NO_CONTEXTMENU
+/*! \reimp
+*/
+void QGraphicsWebView::contextMenuEvent(QGraphicsSceneContextMenuEvent* ev)
+{
+ if (d->page) {
+ const bool accepted = ev->isAccepted();
+ d->page->event(ev);
+ ev->setAccepted(accepted);
+ }
+}
+#endif // QT_NO_CONTEXTMENU
+
+#ifndef QT_NO_WHEELEVENT
+/*! \reimp
+*/
+void QGraphicsWebView::wheelEvent(QGraphicsSceneWheelEvent* ev)
+{
+ if (d->page) {
+ const bool accepted = ev->isAccepted();
+ d->page->event(ev);
+ ev->setAccepted(accepted);
+ }
+
+ if (!ev->isAccepted())
+ QGraphicsItem::wheelEvent(ev);
+}
+#endif // QT_NO_WHEELEVENT
+
+/*! \reimp
+*/
+void QGraphicsWebView::inputMethodEvent(QInputMethodEvent* ev)
+{
+ if (d->page)
+ d->page->event(ev);
+
+ if (!ev->isAccepted())
+ QGraphicsItem::inputMethodEvent(ev);
+}
+
+/*!
+ \fn void QGraphicsWebView::statusBarMessage(const QString& text)
+
+ This signal is emitted when the statusbar \a text is changed by the page.
+*/
+
+/*!
+ \fn void QGraphicsWebView::loadProgress(int progress)
+
+ This signal is emitted every time an element in the web page
+ completes loading and the overall loading progress advances.
+
+ This signal tracks the progress of all child frames.
+
+ The current value is provided by \a progress and scales from 0 to 100,
+ which is the default range of QProgressBar.
+
+ \sa loadStarted(), loadFinished()
+*/
+
+/*!
+ \fn void QGraphicsWebView::linkClicked(const QUrl &url)
+
+ This signal is emitted whenever the user clicks on a link and the page's linkDelegationPolicy
+ property is set to delegate the link handling for the specified \a url.
+
+ \sa QWebPage::linkDelegationPolicy()
+*/
+
+#include "moc_qgraphicswebview.cpp"
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.h b/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.h
new file mode 100644
index 000000000..f3afb4ce6
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.h
@@ -0,0 +1,142 @@
+/*
+ Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef QGraphicsWebView_h
+#define QGraphicsWebView_h
+
+#include "qwebkitglobal.h"
+#include "qwebpage.h"
+#include <QtCore/qurl.h>
+#include <QtGui/qevent.h>
+#include <QtGui/qgraphicswidget.h>
+#include <QtGui/qicon.h>
+#include <QtGui/qpainter.h>
+#include <QtNetwork/qnetworkaccessmanager.h>
+
+class QWebPage;
+class QWebHistory;
+class QWebSettings;
+
+class QGraphicsWebViewPrivate;
+
+class QWEBKIT_EXPORT QGraphicsWebView : public QGraphicsWidget {
+ Q_OBJECT
+
+ Q_PROPERTY(QString title READ title NOTIFY titleChanged)
+ Q_PROPERTY(QIcon icon READ icon NOTIFY iconChanged)
+ Q_PROPERTY(qreal zoomFactor READ zoomFactor WRITE setZoomFactor)
+
+ Q_PROPERTY(QUrl url READ url WRITE setUrl NOTIFY urlChanged)
+
+ Q_PROPERTY(bool modified READ isModified)
+
+public:
+ explicit QGraphicsWebView(QGraphicsItem* parent = 0);
+ ~QGraphicsWebView();
+
+ QWebPage* page() const;
+ void setPage(QWebPage*);
+
+ QUrl url() const;
+ void setUrl(const QUrl&);
+
+ QString title() const;
+ QIcon icon() const;
+
+ qreal zoomFactor() const;
+ void setZoomFactor(qreal);
+
+ bool isModified() const;
+
+ void load(const QUrl &url);
+ void load(const QNetworkRequest& request, QNetworkAccessManager::Operation operation = QNetworkAccessManager::GetOperation, const QByteArray& body = QByteArray());
+
+ void setHtml(const QString& html, const QUrl& baseUrl = QUrl());
+ // FIXME: Consider rename to setHtml?
+ void setContent(const QByteArray& data, const QString& mimeType = QString(), const QUrl& baseUrl = QUrl());
+
+ QWebHistory* history() const;
+ QWebSettings* settings() const;
+
+ QAction* pageAction(QWebPage::WebAction action) const;
+ void triggerPageAction(QWebPage::WebAction action, bool checked = false);
+
+ bool findText(const QString& subString, QWebPage::FindFlags options = 0);
+
+ virtual void setGeometry(const QRectF& rect);
+ virtual void updateGeometry();
+ virtual void paint(QPainter*, const QStyleOptionGraphicsItem* options, QWidget* widget = 0);
+ virtual QVariant itemChange(GraphicsItemChange change, const QVariant& value);
+ virtual bool event(QEvent*);
+
+ virtual QSizeF sizeHint(Qt::SizeHint which, const QSizeF& constraint) const;
+
+ virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const;
+
+public Q_SLOTS:
+ void stop();
+ void back();
+ void forward();
+ void reload();
+
+Q_SIGNALS:
+ void loadStarted();
+ void loadFinished(bool);
+
+ void loadProgress(int progress);
+ void urlChanged(const QUrl&);
+ void titleChanged(const QString&);
+ void iconChanged();
+ void statusBarMessage(const QString& message);
+ void linkClicked(const QUrl&);
+
+protected:
+ virtual void mousePressEvent(QGraphicsSceneMouseEvent*);
+ virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent*);
+ virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent*);
+ virtual void mouseMoveEvent(QGraphicsSceneMouseEvent*);
+ virtual void hoverMoveEvent(QGraphicsSceneHoverEvent*);
+ virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent*);
+#ifndef QT_NO_WHEELEVENT
+ virtual void wheelEvent(QGraphicsSceneWheelEvent*);
+#endif
+ virtual void keyPressEvent(QKeyEvent*);
+ virtual void keyReleaseEvent(QKeyEvent*);
+#ifndef QT_NO_CONTEXTMENU
+ virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent*);
+#endif
+ virtual void dragEnterEvent(QGraphicsSceneDragDropEvent*);
+ virtual void dragLeaveEvent(QGraphicsSceneDragDropEvent*);
+ virtual void dragMoveEvent(QGraphicsSceneDragDropEvent*);
+ virtual void dropEvent(QGraphicsSceneDragDropEvent*);
+ virtual void focusInEvent(QFocusEvent*);
+ virtual void focusOutEvent(QFocusEvent*);
+ virtual void inputMethodEvent(QInputMethodEvent*);
+ virtual bool focusNextPrevChild(bool next);
+
+ virtual bool sceneEvent(QEvent*);
+
+private:
+ Q_PRIVATE_SLOT(d, void _q_doLoadFinished(bool success))
+
+ QGraphicsWebViewPrivate* const d;
+ friend class QGraphicsWebViewPrivate;
+};
+
+#endif // QGraphicsWebView_h
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebdatabase.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebdatabase.cpp
index d51e4e6fd..4e8fd30bd 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebdatabase.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebdatabase.cpp
@@ -33,6 +33,8 @@ using namespace WebCore;
\since 4.5
\brief The QWebDatabase class provides access to HTML 5 databases created with JavaScript.
+ \inmodule QtWebKit
+
The upcoming HTML 5 standard includes support for SQL databases that web sites can create and
access on a local computer through JavaScript. QWebDatabase is the C++ interface to these
databases.
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.cpp
index 3ef969e7f..441bec752 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.cpp
@@ -23,27 +23,32 @@
#include "CSSComputedStyleDeclaration.h"
#include "CSSMutableStyleDeclaration.h"
#include "CSSParser.h"
-#include "CSSRuleList.h"
#include "CSSRule.h"
+#include "CSSRuleList.h"
#include "CSSStyleRule.h"
#include "CString.h"
#include "Document.h"
#include "DocumentFragment.h"
#include "FrameView.h"
+#include "GraphicsContext.h"
#include "HTMLElement.h"
#include "JSGlobalObject.h"
#include "JSHTMLElement.h"
#include "JSObject.h"
#include "NodeList.h"
#include "PropertyNameArray.h"
+#include "RenderImage.h"
#include "ScriptFunctionCall.h"
#include "StaticNodeList.h"
#include "qt_runtime.h"
#include "qwebframe.h"
#include "qwebframe_p.h"
#include "runtime_root.h"
+#include <parser/SourceCode.h>
#include <wtf/Vector.h>
+#include <QPainter>
+
using namespace WebCore;
class QWebElementPrivate {
@@ -55,7 +60,7 @@ public:
\since 4.6
\brief The QWebElement class provides convenient access to DOM elements in
a QWebFrame.
-
+ \inmodule QtWebKit
A QWebElement object allows easy access to the document model, represented
by a tree-like structure of DOM elements. The root of the tree is called
@@ -95,15 +100,13 @@ public:
setPlainText() and setInnerXml(). To replace the element itself and its
contents, use setOuterXml().
- In the JavaScript DOM interfaces, elements can have additional functions
- depending on their type. For example, an HTML form element can be triggered
- to submit the entire form to the web server using the submit() function. A
- list of these special functions can be obtained in QWebElement using
- functions(); they can be invoked using callFunction().
+ \section1 Examples
+
+ The \l{DOM Traversal Example} shows one way to traverse documents in a running
+ example.
- Similarly, element specific properties can be obtained using
- scriptableProperties() and read or written using scriptableProperty() or
- setScriptableProperty().
+ The \l{Simple Selector Example} can be used to experiment with the searching
+ features of this class and provides sample code you can start working with.
*/
/*!
@@ -200,38 +203,22 @@ bool QWebElement::isNull() const
\a selectorQuery. If there are no matching elements, an empty list is
returned.
- \l{http://www.w3.org/TR/REC-CSS2/selector.html#q1}{Standard CSS2 selector}
- syntax is used for the query.
+ \l{Standard CSS2 selector} syntax is used for the query.
\note This search is performed recursively.
\sa findFirst()
*/
-QList<QWebElement> QWebElement::findAll(const QString &selectorQuery) const
+QWebElementCollection QWebElement::findAll(const QString &selectorQuery) const
{
- QList<QWebElement> elements;
- if (!m_element)
- return elements;
-
- ExceptionCode exception = 0; // ###
- RefPtr<NodeList> nodes = m_element->querySelectorAll(selectorQuery, exception);
- if (!nodes)
- return elements;
-
- for (int i = 0; i < nodes->length(); ++i) {
- WebCore::Node* n = nodes->item(i);
- elements.append(QWebElement(static_cast<Element*>(n)));
- }
-
- return elements;
+ return QWebElementCollection(*this, selectorQuery);
}
/*!
Returns the first child element that matches the given CSS selector
\a selectorQuery.
- \l{http://www.w3.org/TR/REC-CSS2/selector.html#q1}{Standard CSS2 selector}
- syntax is used for the query.
+ \l{Standard CSS2 selector} syntax is used for the query.
\note This search is performed recursively.
@@ -472,6 +459,57 @@ bool QWebElement::hasAttributes() const
}
/*!
+ Return the list of attributes for the namespace given as \a namespaceUri.
+
+ \sa attribute(), setAttribute()
+*/
+QStringList QWebElement::attributeNames(const QString& namespaceUri) const
+{
+ if (!m_element)
+ return QStringList();
+
+ QStringList attributeNameList;
+ const NamedNodeMap* const attrs = m_element->attributes(/* read only = */ true);
+ if (attrs) {
+ const String namespaceUriString(namespaceUri); // convert QString -> String once
+ const unsigned attrsCount = attrs->length();
+ for (unsigned i = 0; i < attrsCount; ++i) {
+ const Attribute* const attribute = attrs->attributeItem(i);
+ if (namespaceUriString == attribute->namespaceURI())
+ attributeNameList.append(attribute->localName());
+ }
+ }
+ return attributeNameList;
+}
+
+/*!
+ Returns true if the element has keyboard input focus; otherwise, returns false
+
+ \sa setFocus()
+*/
+bool QWebElement::hasFocus() const
+{
+ if (!m_element)
+ return false;
+ if (m_element->document())
+ return m_element == m_element->document()->focusedNode();
+ return false;
+}
+
+/*!
+ Gives keyboard input focus to this element
+
+ \sa hasFocus()
+*/
+void QWebElement::setFocus()
+{
+ if (!m_element)
+ return;
+ if (m_element->document() && m_element->isFocusable())
+ m_element->document()->setFocusedNode(m_element);
+}
+
+/*!
Returns the geometry of this element, relative to its containing frame.
\sa tagName()
@@ -660,7 +698,7 @@ static bool setupScriptContext(WebCore::Element* element, JSC::JSValue& thisValu
if (!scriptController)
return false;
- state = scriptController->globalObject()->globalExec();
+ state = scriptController->globalObject(mainThreadNormalWorld())->globalExec();
if (!state)
return false;
@@ -672,41 +710,10 @@ static bool setupScriptContext(WebCore::Element* element, JSC::JSValue& thisValu
}
-static bool setupScriptObject(WebCore::Element* element, ScriptObject& object, ScriptState*& state, ScriptController*& scriptController)
-{
- if (!element)
- return false;
-
- Document* document = element->document();
- if (!document)
- return false;
-
- Frame* frame = document->frame();
- if (!frame)
- return false;
-
- scriptController = frame->script();
-
- state = scriptController->globalObject()->globalExec();
-
- JSC::JSValue thisValue = toJS(state, element);
- if (!thisValue)
- return false;
-
- JSC::JSObject* thisObject = thisValue.toObject(state);
- if (!thisObject)
- return false;
-
- object = ScriptObject(thisObject);
- return true;
-}
-
/*!
Executes \a scriptSource with this element as \c this object.
-
- \sa callFunction()
*/
-QVariant QWebElement::evaluateScript(const QString& scriptSource)
+QVariant QWebElement::evaluateJavaScript(const QString& scriptSource)
{
if (scriptSource.isEmpty())
return QVariant();
@@ -733,256 +740,25 @@ QVariant QWebElement::evaluateScript(const QString& scriptSource)
}
/*!
- Calls the function with the given \a name and \a arguments.
-
- The underlying DOM element that QWebElement wraps may have dedicated
- functions, depending on its type. For example, a form element can have the
- \c submit function, that would submit the form to the destination specified
- in the HTML.
-
- \sa functions()
-*/
-QVariant QWebElement::callFunction(const QString &name, const QVariantList &arguments)
-{
- ScriptState* state = 0;
- ScriptObject thisObject;
- ScriptController* scriptController = 0;
-
- if (!setupScriptObject(m_element, thisObject, state, scriptController))
- return QVariant();
-
- ScriptFunctionCall functionCall(state, thisObject, name);
-
- for (QVariantList::ConstIterator it = arguments.constBegin(), end = arguments.constEnd();
- it != end; ++it)
- functionCall.appendArgument(JSC::Bindings::convertQVariantToValue(state, scriptController->bindingRootObject(), *it));
-
- bool hadException = false;
- ScriptValue result = functionCall.call(hadException);
- if (hadException)
- return QVariant();
-
- int distance = 0;
- return JSC::Bindings::convertValueToQVariant(state, result.jsValue(), QMetaType::Void, &distance);
-}
-
-/*!
- Returns a list of function names this element supports.
-
- The function names returned are the same functions callable from the DOM
- element's JavaScript binding.
-
- \sa callFunction()
-*/
-QStringList QWebElement::functions() const
-{
- ScriptState* state = 0;
- ScriptObject thisObject;
- ScriptController* scriptController = 0;
-
- if (!setupScriptObject(m_element, thisObject, state, scriptController))
- return QStringList();
-
- JSC::JSObject* object = thisObject.jsObject();
- if (!object)
- return QStringList();
-
- QStringList names;
-
- // Enumerate the contents of the object
- JSC::PropertyNameArray properties(state);
- object->getPropertyNames(state, properties);
- for (JSC::PropertyNameArray::const_iterator it = properties.begin();
- it != properties.end(); ++it) {
-
- JSC::JSValue property = object->get(state, *it);
- if (!property)
- continue;
-
- JSC::JSObject* function = property.toObject(state);
- if (!function)
- continue;
-
- JSC::CallData callData;
- JSC::CallType callType = function->getCallData(callData);
- if (callType == JSC::CallTypeNone)
- continue;
-
- JSC::UString ustring = (*it).ustring();
- names << QString::fromUtf16((const ushort*)ustring.rep()->data(), ustring.size());
- }
-
- if (state->hadException())
- state->clearException();
-
- return names;
-}
-
-/*!
- Returns the value of the element's \a name property. If no such property
- exists, an invalid QVariant is returned.
-
- The return value's property has the same value as the corresponding
- property in the element's JavaScript binding with the same name.
-
- Information about all available properties is provided through
- scriptProperties().
-
- \sa setScriptableProperty(), scriptableProperties()
-*/
-QVariant QWebElement::scriptableProperty(const QString &name) const
-{
- ScriptState* state = 0;
- ScriptObject thisObject;
- ScriptController *scriptController = 0;
-
- if (!setupScriptObject(m_element, thisObject, state, scriptController))
- return QVariant();
-
- String wcName(name);
- JSC::JSValue property = thisObject.jsObject()->get(state, JSC::Identifier(state, wcName));
-
- // ###
- if (state->hadException())
- state->clearException();
-
- int distance = 0;
- return JSC::Bindings::convertValueToQVariant(state, property, QMetaType::Void, &distance);
-}
-
-/*!
- Sets the value of the element's \a name property to \a value.
-
- Information about all available properties is provided through
- scriptProperties().
-
- Setting the property will affect the corresponding property in the
- element's JavaScript binding with the same name.
-
- \sa scriptableProperty(), scriptableProperties()
-*/
-void QWebElement::setScriptableProperty(const QString &name, const QVariant &value)
-{
- ScriptState* state = 0;
- ScriptObject thisObject;
- ScriptController* scriptController = 0;
-
- if (!setupScriptObject(m_element, thisObject, state, scriptController))
- return;
-
- JSC::JSValue jsValue = JSC::Bindings::convertQVariantToValue(state, scriptController->bindingRootObject(), value);
- if (!jsValue)
- return;
-
- String wcName(name);
- JSC::PutPropertySlot slot;
- thisObject.jsObject()->put(state, JSC::Identifier(state, wcName), jsValue, slot);
- if (state->hadException())
- state->clearException();
-}
-
-/*!
- Returns a list of property names this element supports.
-
- The function names returned are the same properties that are accessible
- from the DOM element's JavaScript binding.
-
- \sa setScriptableProperty(), scriptableProperty()
-*/
-QStringList QWebElement::scriptableProperties() const
-{
- if (!m_element)
- return QStringList();
-
- Document* document = m_element->document();
- if (!document)
- return QStringList();
-
- Frame* frame = document->frame();
- if (!frame)
- return QStringList();
-
- ScriptController* script = frame->script();
- JSC::ExecState* exec = script->globalObject()->globalExec();
-
- JSC::JSValue thisValue = toJS(exec, m_element);
- if (!thisValue)
- return QStringList();
-
- JSC::JSObject* object = thisValue.toObject(exec);
- if (!object)
- return QStringList();
-
- QStringList names;
-
- // Enumerate the contents of the object
- JSC::PropertyNameArray properties(exec);
- object->getPropertyNames(exec, properties);
- for (JSC::PropertyNameArray::const_iterator it = properties.begin();
- it != properties.end(); ++it) {
-
- JSC::JSValue property = object->get(exec, *it);
- if (!property)
- continue;
-
- JSC::JSObject* function = property.toObject(exec);
- if (!function)
- continue;
-
- JSC::CallData callData;
- JSC::CallType callType = function->getCallData(callData);
- if (callType != JSC::CallTypeNone)
- continue;
-
- JSC::UString ustring = (*it).ustring();
- names << QString::fromUtf16((const ushort*)ustring.rep()->data(), ustring.size());
- }
-
- if (exec->hadException())
- exec->clearException();
-
- return names;
-}
-
-/*!
- \enum QWebElement::ResolveRule
- \since 4.6
+ \enum QWebElement::StyleResolveStrategy
This enum describes how QWebElement's styleProperty resolves the given
property name.
- \value IgnoreCascadingStyles Return the property value as it is defined in
+ \value InlineStyle Return the property value as it is defined in
the element, without respecting style inheritance and other CSS
rules.
- \value RespectCascadingStyles The property's value is determined using the
+ \value CascadedStyle The property's value is determined using the
inheritance and importance rules defined in the document's
stylesheet.
+ \value ComputedStyle The property's value is the absolute value
+ of the style property resolved from the environment.
*/
/*!
- \enum QWebElement::StylePriority
- \since 4.6
-
- This enum describes the priority newly set CSS properties should have when
- set using QWebElement::setStyleProperty().
-
- \value NormalStylePriority Define the property without important priority
- even if "!important" is explicitly set in \a value.
- \value DeclaredStylePriority Define the property respecting the priority
- specified in \a value.
- \value ImportantStylePriority Define the property to have an important
- priority. This is equal to appending "!important" to the value.
-*/
-
-/*!
- Returns the value of the style with the given \a name. If a style with
- \a name does not exist, an empty string is returned.
-
- If \a rule is IgnoreCascadingStyles, the value defined inside the element
- (inline in CSS terminology) is returned.
-
- if \a rule is RespectCascadingStyles, the actual style applied to the
- element is returned.
+ Returns the value of the style with the given \a name using the specified
+ \a strategy. If a style with \a name does not exist, an empty string is
+ returned.
In CSS, the cascading part depends on which CSS rule has priority and is
thus applied. Generally, the last defined rule has priority. Thus, an
@@ -996,7 +772,8 @@ QStringList QWebElement::scriptableProperties() const
\sa setStyleProperty()
*/
-QString QWebElement::styleProperty(const QString &name, ResolveRule rule) const
+
+QString QWebElement::styleProperty(const QString &name, StyleResolveStrategy strategy) const
{
if (!m_element || !m_element->isStyledElement())
return QString();
@@ -1008,10 +785,10 @@ QString QWebElement::styleProperty(const QString &name, ResolveRule rule) const
CSSStyleDeclaration* style = static_cast<StyledElement*>(m_element)->style();
- if (rule == IgnoreCascadingStyles)
+ if (strategy == InlineStyle)
return style->getPropertyValue(propID);
- if (rule == RespectCascadingStyles) {
+ if (strategy == CascadedStyle) {
if (style->getPropertyPriority(propID))
return style->getPropertyValue(propID);
@@ -1039,33 +816,33 @@ QString QWebElement::styleProperty(const QString &name, ResolveRule rule) const
return style->getPropertyValue(propID);
}
+ if (strategy == ComputedStyle) {
+ if (!m_element || !m_element->isStyledElement())
+ return QString();
+
+ int propID = cssPropertyID(name);
+
+ RefPtr<CSSComputedStyleDeclaration> style = computedStyle(m_element);
+ if (!propID || !style)
+ return QString();
+
+ return style->getPropertyValue(propID);
+ }
+
return QString();
}
/*!
- Sets the value of the style with the given \a name to \a value.
+ Sets the value of the inline style with the given \a name to \a value.
Setting a value, does not necessarily mean that it will become the applied
value, due to the fact that the style property's value might have been set
- earlier with priority in external or embedded style declarations.
-
- In order to ensure that the value will be applied, ImportantStylePriority
- should be used as \a priority.
+ earlier with a higher priority in external or embedded style declarations.
- Following the CSS syntax for property values, this is equal to appending
+ In order to ensure that the value will be applied, you may have to append
"!important" to the value.
-
- This syntax is supported when using DeclaredStylePriority as \a priority.
-
- Using NormalStylePriority as \a priority, the property will have normal
- priority, and any "!important" declaration will be ignored. On the other
- hand, using ImportantStylePriority sets the important priority even when
- it is not explicitly passed in \a value.
-
- By using DeclaredStylePriority as \a priority the property will respect the
- priority specified in \a value.
*/
-void QWebElement::setStyleProperty(const QString &name, const QString &value, StylePriority priority)
+void QWebElement::setStyleProperty(const QString &name, const QString &value)
{
if (!m_element || !m_element->isStyledElement())
return;
@@ -1076,43 +853,7 @@ void QWebElement::setStyleProperty(const QString &name, const QString &value, St
return;
ExceptionCode exception = 0;
-
- const QRegExp hasImportantTest(QLatin1String("!\\s*important"));
- int index = value.indexOf(hasImportantTest);
-
- QString newValue = (index != -1) ? value.left(index - 1) : value;
-
- switch (priority) {
- case NormalStylePriority:
- style->setProperty(name, newValue, "", exception);
- break;
- case DeclaredStylePriority:
- style->setProperty(name, newValue, (index != -1) ? "important" : "", exception);
- break;
- case ImportantStylePriority:
- style->setProperty(name, newValue, "important", exception);
- break;
- default:
- break;
- }
-}
-
-/*!
- Returns the computed value for style with the given \a name. If a style
- with \a name does not exist, an empty string is returned.
-*/
-QString QWebElement::computedStyleProperty(const QString &name) const
-{
- if (!m_element || !m_element->isStyledElement())
- return QString();
-
- int propID = cssPropertyID(name);
-
- RefPtr<CSSComputedStyleDeclaration> style = computedStyle(m_element);
- if (!propID || !style)
- return QString();
-
- return style->getPropertyValue(propID);
+ style->setProperty(name, value, exception);
}
/*!
@@ -1412,7 +1153,7 @@ QWebElement QWebElement::clone() const
The element is still valid after removal, and can be inserted into other
parts of the document.
- \sa removeChildren(), removeFromDocument()
+ \sa removeAllChildren(), removeFromDocument()
*/
QWebElement &QWebElement::takeFromDocument()
{
@@ -1428,7 +1169,7 @@ QWebElement &QWebElement::takeFromDocument()
/*!
Removes this element from the document and makes it a null element.
- \sa removeChildren(), takeFromDocument()
+ \sa removeAllChildren(), takeFromDocument()
*/
void QWebElement::removeFromDocument()
{
@@ -1446,7 +1187,7 @@ void QWebElement::removeFromDocument()
\sa removeFromDocument(), takeFromDocument()
*/
-void QWebElement::removeChildren()
+void QWebElement::removeAllChildren()
{
if (!m_element)
return;
@@ -1661,6 +1402,23 @@ void QWebElement::replace(const QString &markup)
}
/*!
+ \internal
+ Walk \a node's parents until a valid QWebElement is found.
+ For example, a WebCore::Text node is not a valid Html QWebElement, but its
+ enclosing p tag is.
+*/
+QWebElement QWebElement::enclosingElement(WebCore::Node* node)
+{
+ QWebElement element(node);
+
+ while (element.isNull() && node) {
+ node = node->parentNode();
+ element = QWebElement(node);
+ }
+ return element;
+}
+
+/*!
\fn inline bool QWebElement::operator==(const QWebElement& o) const;
Returns true if this element points to the same underlying DOM object as
@@ -1673,3 +1431,600 @@ void QWebElement::replace(const QString &markup)
Returns true if this element points to a different underlying DOM object
than \a o; otherwise returns false.
*/
+
+
+/*!
+ Render the element into \a painter .
+*/
+void QWebElement::render(QPainter* painter)
+{
+ WebCore::Element* e = m_element;
+ Document* doc = e ? e->document() : 0;
+ if (!doc)
+ return;
+
+ Frame* frame = doc->frame();
+ if (!frame || !frame->view() || !frame->contentRenderer())
+ return;
+
+ FrameView* view = frame->view();
+
+ view->layoutIfNeededRecursive();
+
+ IntRect rect = e->getRect();
+
+ if (rect.size().isEmpty())
+ return;
+
+ GraphicsContext context(painter);
+
+ context.save();
+ context.translate(-rect.x(), -rect.y());
+ view->setNodeToDraw(e);
+ view->paintContents(&context, rect);
+ view->setNodeToDraw(0);
+ context.restore();
+}
+
+class QWebElementCollectionPrivate : public QSharedData
+{
+public:
+ static QWebElementCollectionPrivate* create(const PassRefPtr<Node> &context, const QString &query);
+
+ RefPtr<NodeList> m_result;
+
+private:
+ inline QWebElementCollectionPrivate() {}
+};
+
+QWebElementCollectionPrivate* QWebElementCollectionPrivate::create(const PassRefPtr<Node> &context, const QString &query)
+{
+ if (!context)
+ return 0;
+
+ // Let WebKit do the hard work hehehe
+ ExceptionCode exception = 0; // ###
+ RefPtr<NodeList> nodes = context->querySelectorAll(query, exception);
+ if (!nodes)
+ return 0;
+
+ QWebElementCollectionPrivate* priv = new QWebElementCollectionPrivate;
+ priv->m_result = nodes;
+ return priv;
+}
+
+/*!
+ \class QWebElementCollection
+ \since 4.6
+ \brief The QWebElementCollection class represents a collection of web elements.
+ \preliminary
+
+ Elements in a document can be selected using QWebElement::findAll() or using the
+ QWebElement constructor. The collection is composed by choosing all elements in the
+ document that match a specified CSS selector expression.
+
+ The number of selected elements is provided through the count() property. Individual
+ elements can be retrieved by index using at().
+
+ It is also possible to iterate through all elements in the collection using Qt's foreach
+ macro:
+
+ \code
+ QWebElementCollection collection = document.findAll("p");
+ foreach (QWebElement paraElement, collection) {
+ ...
+ }
+ \endcode
+*/
+
+/*!
+ Constructs an empty collection.
+*/
+QWebElementCollection::QWebElementCollection()
+{
+}
+
+/*!
+ Constructs a copy of \a other.
+*/
+QWebElementCollection::QWebElementCollection(const QWebElementCollection &other)
+ : d(other.d)
+{
+}
+
+/*!
+ Constructs a collection of elements from the list of child elements of \a contextElement that
+ match the specified CSS selector \a query.
+*/
+QWebElementCollection::QWebElementCollection(const QWebElement &contextElement, const QString &query)
+{
+ d = QExplicitlySharedDataPointer<QWebElementCollectionPrivate>(QWebElementCollectionPrivate::create(contextElement.m_element, query));
+}
+
+/*!
+ Assigns \a other to this collection and returns a reference to this collection.
+*/
+QWebElementCollection &QWebElementCollection::operator=(const QWebElementCollection &other)
+{
+ d = other.d;
+ return *this;
+}
+
+/*!
+ Destroys the collection.
+*/
+QWebElementCollection::~QWebElementCollection()
+{
+}
+
+/*! \fn QWebElementCollection &QWebElementCollection::operator+=(const QWebElementCollection &other)
+
+ Appends the items of the \a other list to this list and returns a
+ reference to this list.
+
+ \sa operator+(), append()
+*/
+
+/*!
+ Returns a collection that contains all the elements of this collection followed
+ by all the elements in the \a other collection. Duplicates may occur in the result.
+
+ \sa operator+=()
+*/
+QWebElementCollection QWebElementCollection::operator+(const QWebElementCollection &other) const
+{
+ QWebElementCollection n = *this; n.d.detach(); n += other; return n;
+}
+
+/*!
+ Extends the collection by appending all items of \a other.
+
+ The resulting collection may include duplicate elements.
+
+ \sa operator+=()
+*/
+void QWebElementCollection::append(const QWebElementCollection &other)
+{
+ if (!d) {
+ *this = other;
+ return;
+ }
+ if (!other.d)
+ return;
+ Vector<RefPtr<Node> > nodes;
+ RefPtr<NodeList> results[] = { d->m_result, other.d->m_result };
+ nodes.reserveInitialCapacity(results[0]->length() + results[1]->length());
+
+ for (int i = 0; i < 2; ++i) {
+ int j = 0;
+ Node* n = results[i]->item(j);
+ while (n) {
+ nodes.append(n);
+ n = results[i]->item(++j);
+ }
+ }
+
+ d->m_result = StaticNodeList::adopt(nodes);
+}
+
+/*!
+ Returns the number of elements in the collection.
+*/
+int QWebElementCollection::count() const
+{
+ if (!d)
+ return 0;
+ return d->m_result->length();
+}
+
+/*!
+ Returns the element at index position \a i in the collection.
+*/
+QWebElement QWebElementCollection::at(int i) const
+{
+ if (!d)
+ return QWebElement();
+ Node* n = d->m_result->item(i);
+ return QWebElement(static_cast<Element*>(n));
+}
+
+/*!
+ \fn const QWebElement QWebElementCollection::operator[](int position) const
+
+ Returns the element at the specified \a position in the collection.
+*/
+
+/*! \fn QWebElement QWebElementCollection::first() const
+
+ Returns the first element in the collection.
+
+ \sa last(), operator[](), at(), count()
+*/
+
+/*! \fn QWebElement QWebElementCollection::last() const
+
+ Returns the last element in the collection.
+
+ \sa first(), operator[](), at(), count()
+*/
+
+/*!
+ Returns a QList object with the elements contained in this collection.
+*/
+QList<QWebElement> QWebElementCollection::toList() const
+{
+ if (!d)
+ return QList<QWebElement>();
+ QList<QWebElement> elements;
+ int i = 0;
+ Node* n = d->m_result->item(i);
+ while (n) {
+ if (n->isElementNode())
+ elements.append(QWebElement(static_cast<Element*>(n)));
+ n = d->m_result->item(++i);
+ }
+ return elements;
+}
+
+/*!
+ \fn QWebElementCollection::const_iterator QWebElementCollection::begin() const
+
+ Returns an STL-style iterator pointing to the first element in the collection.
+
+ \sa end()
+*/
+
+/*!
+ \fn QWebElementCollection::const_iterator QWebElementCollection::end() const
+
+ Returns an STL-style iterator pointing to the imaginary element after the
+ last element in the list.
+
+ \sa begin()
+*/
+
+/*!
+ \class QWebElementCollection::const_iterator
+ \since 4.6
+ \brief The QWebElementCollection::const_iterator class provides an STL-style const iterator for QWebElementCollection.
+
+ QWebElementCollection provides STL style const iterators for fast low-level access to the elements.
+
+ QWebElementCollection::const_iterator allows you to iterate over a QWebElementCollection.
+*/
+
+/*!
+ \fn QWebElementCollection::const_iterator::const_iterator(const const_iterator &other)
+
+ Constructs a copy of \a other.
+*/
+
+/*!
+ \fn QWebElementCollection::const_iterator::const_iterator(const QWebElementCollection *collection, int index)
+ \internal
+*/
+
+/*!
+ \fn const QWebElement QWebElementCollection::const_iterator::operator*() const
+
+ Returns the current element.
+*/
+
+/*!
+ \fn bool QWebElementCollection::const_iterator::operator==(const const_iterator &other) const
+
+ Returns true if \a other points to the same item as this iterator;
+ otherwise returns false.
+
+ \sa operator!=()
+*/
+
+/*!
+ \fn bool QWebElementCollection::const_iterator::operator!=(const const_iterator &other) const
+
+ Returns true if \a other points to a different element than this;
+ iterator; otherwise returns false.
+
+ \sa operator==()
+*/
+
+/*!
+ \fn QWebElementCollection::const_iterator &QWebElementCollection::const_iterator::operator++()
+
+ The prefix ++ operator (\c{++it}) advances the iterator to the next element in the collection
+ and returns an iterator to the new current element.
+
+ Calling this function on QWebElementCollection::end() leads to undefined results.
+
+ \sa operator--()
+*/
+
+/*!
+ \fn QWebElementCollection::const_iterator QWebElementCollection::const_iterator::operator++(int)
+
+ \overload
+
+ The postfix ++ operator (\c{it++}) advances the iterator to the next element in the collection
+ and returns an iterator to the previously current element.
+
+ Calling this function on QWebElementCollection::end() leads to undefined results.
+*/
+
+/*!
+ \fn QWebElementCollection::const_iterator &QWebElementCollection::const_iterator::operator--()
+
+ The prefix -- operator (\c{--it}) makes the preceding element current and returns an
+ iterator to the new current element.
+
+ Calling this function on QWebElementCollection::begin() leads to undefined results.
+
+ \sa operator++()
+*/
+
+/*!
+ \fn QWebElementCollection::const_iterator QWebElementCollection::const_iterator::operator--(int)
+
+ \overload
+
+ The postfix -- operator (\c{it--}) makes the preceding element current and returns
+ an iterator to the previously current element.
+*/
+
+/*!
+ \fn QWebElementCollection::const_iterator &QWebElementCollection::const_iterator::operator+=(int j)
+
+ Advances the iterator by \a j elements. If \a j is negative, the iterator goes backward.
+
+ \sa operator-=(), operator+()
+*/
+
+/*!
+ \fn QWebElementCollection::const_iterator &QWebElementCollection::const_iterator::operator-=(int j)
+
+ Makes the iterator go back by \a j elements. If \a j is negative, the iterator goes forward.
+
+ \sa operator+=(), operator-()
+*/
+
+/*!
+ \fn QWebElementCollection::const_iterator QWebElementCollection::const_iterator::operator+(int j) const
+
+ Returns an iterator to the element at \a j positions forward from this iterator. If \a j
+ is negative, the iterator goes backward.
+
+ \sa operator-(), operator+=()
+*/
+
+/*!
+ \fn QWebElementCollection::const_iterator QWebElementCollection::const_iterator::operator-(int j) const
+
+ Returns an iterator to the element at \a j positiosn backward from this iterator.
+ If \a j is negative, the iterator goes forward.
+
+ \sa operator+(), operator-=()
+*/
+
+/*!
+ \fn int QWebElementCollection::const_iterator::operator-(const_iterator other) const
+
+ Returns the number of elements between the item point to by \a other
+ and the element pointed to by this iterator.
+*/
+
+/*!
+ \fn bool QWebElementCollection::const_iterator::operator<(const const_iterator &other) const
+
+ Returns true if the element pointed to by this iterator is less than the element pointed to
+ by the \a other iterator.
+*/
+
+/*!
+ \fn bool QWebElementCollection::const_iterator::operator<=(const const_iterator &other) const
+
+ Returns true if the element pointed to by this iterator is less than or equal to the
+ element pointed to by the \a other iterator.
+*/
+
+/*!
+ \fn bool QWebElementCollection::const_iterator::operator>(const const_iterator &other) const
+
+ Returns true if the element pointed to by this iterator is greater than the element pointed to
+ by the \a other iterator.
+*/
+
+/*!
+ \fn bool QWebElementCollection::const_iterator::operator>=(const const_iterator &other) const
+
+ Returns true if the element pointed to by this iterator is greater than or equal to the
+ element pointed to by the \a other iterator.
+*/
+
+/*!
+ \fn QWebElementCollection::iterator QWebElementCollection::begin()
+
+ Returns an STL-style iterator pointing to the first element in the collection.
+
+ \sa end()
+*/
+
+/*!
+ \fn QWebElementCollection::iterator QWebElementCollection::end()
+
+ Returns an STL-style iterator pointing to the imaginary element after the
+ last element in the list.
+
+ \sa begin()
+*/
+
+/*!
+ \fn QWebElementCollection::const_iterator QWebElementCollection::constBegin() const
+
+ Returns an STL-style iterator pointing to the first element in the collection.
+
+ \sa end()
+*/
+
+/*!
+ \fn QWebElementCollection::const_iterator QWebElementCollection::constEnd() const
+
+ Returns an STL-style iterator pointing to the imaginary element after the
+ last element in the list.
+
+ \sa begin()
+*/
+
+/*!
+ \class QWebElementCollection::iterator
+ \since 4.6
+ \brief The QWebElementCollection::iterator class provides an STL-style iterator for QWebElementCollection.
+
+ QWebElementCollection provides STL style iterators for fast low-level access to the elements.
+
+ QWebElementCollection::iterator allows you to iterate over a QWebElementCollection.
+*/
+
+/*!
+ \fn QWebElementCollection::iterator::iterator(const iterator &other)
+
+ Constructs a copy of \a other.
+*/
+
+/*!
+ \fn QWebElementCollection::iterator::iterator(const QWebElementCollection *collection, int index)
+ \internal
+*/
+
+/*!
+ \fn const QWebElement QWebElementCollection::iterator::operator*() const
+
+ Returns the current element.
+*/
+
+/*!
+ \fn bool QWebElementCollection::iterator::operator==(const iterator &other) const
+
+ Returns true if \a other points to the same item as this iterator;
+ otherwise returns false.
+
+ \sa operator!=()
+*/
+
+/*!
+ \fn bool QWebElementCollection::iterator::operator!=(const iterator &other) const
+
+ Returns true if \a other points to a different element than this;
+ iterator; otherwise returns false.
+
+ \sa operator==()
+*/
+
+/*!
+ \fn QWebElementCollection::iterator &QWebElementCollection::iterator::operator++()
+
+ The prefix ++ operator (\c{++it}) advances the iterator to the next element in the collection
+ and returns an iterator to the new current element.
+
+ Calling this function on QWebElementCollection::end() leads to undefined results.
+
+ \sa operator--()
+*/
+
+/*!
+ \fn QWebElementCollection::iterator QWebElementCollection::iterator::operator++(int)
+
+ \overload
+
+ The postfix ++ operator (\c{it++}) advances the iterator to the next element in the collection
+ and returns an iterator to the previously current element.
+
+ Calling this function on QWebElementCollection::end() leads to undefined results.
+*/
+
+/*!
+ \fn QWebElementCollection::iterator &QWebElementCollection::iterator::operator--()
+
+ The prefix -- operator (\c{--it}) makes the preceding element current and returns an
+ iterator to the new current element.
+
+ Calling this function on QWebElementCollection::begin() leads to undefined results.
+
+ \sa operator++()
+*/
+
+/*!
+ \fn QWebElementCollection::iterator QWebElementCollection::iterator::operator--(int)
+
+ \overload
+
+ The postfix -- operator (\c{it--}) makes the preceding element current and returns
+ an iterator to the previously current element.
+*/
+
+/*!
+ \fn QWebElementCollection::iterator &QWebElementCollection::iterator::operator+=(int j)
+
+ Advances the iterator by \a j elements. If \a j is negative, the iterator goes backward.
+
+ \sa operator-=(), operator+()
+*/
+
+/*!
+ \fn QWebElementCollection::iterator &QWebElementCollection::iterator::operator-=(int j)
+
+ Makes the iterator go back by \a j elements. If \a j is negative, the iterator goes forward.
+
+ \sa operator+=(), operator-()
+*/
+
+/*!
+ \fn QWebElementCollection::iterator QWebElementCollection::iterator::operator+(int j) const
+
+ Returns an iterator to the element at \a j positions forward from this iterator. If \a j
+ is negative, the iterator goes backward.
+
+ \sa operator-(), operator+=()
+*/
+
+/*!
+ \fn QWebElementCollection::iterator QWebElementCollection::iterator::operator-(int j) const
+
+ Returns an iterator to the element at \a j positiosn backward from this iterator.
+ If \a j is negative, the iterator goes forward.
+
+ \sa operator+(), operator-=()
+*/
+
+/*!
+ \fn int QWebElementCollection::iterator::operator-(iterator other) const
+
+ Returns the number of elements between the item point to by \a other
+ and the element pointed to by this iterator.
+*/
+
+/*!
+ \fn bool QWebElementCollection::iterator::operator<(const iterator &other) const
+
+ Returns true if the element pointed to by this iterator is less than the element pointed to
+ by the \a other iterator.
+*/
+
+/*!
+ \fn bool QWebElementCollection::iterator::operator<=(const iterator &other) const
+
+ Returns true if the element pointed to by this iterator is less than or equal to the
+ element pointed to by the \a other iterator.
+*/
+
+/*!
+ \fn bool QWebElementCollection::iterator::operator>(const iterator &other) const
+
+ Returns true if the element pointed to by this iterator is greater than the element pointed to
+ by the \a other iterator.
+*/
+
+/*!
+ \fn bool QWebElementCollection::iterator::operator>=(const iterator &other) const
+
+ Returns true if the element pointed to by this iterator is greater than or equal to the
+ element pointed to by the \a other iterator.
+*/
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.h
index bc6f8a956..3833070b5 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.h
@@ -21,6 +21,7 @@
#define QWEBELEMENT_H
#include <QString>
+#include <QStringList>
#include <QRect>
#include <QVariant>
#include <QExplicitlySharedDataPointer>
@@ -31,7 +32,12 @@ namespace WebCore {
class Node;
}
+QT_BEGIN_NAMESPACE
+class QPainter;
+QT_END_NAMESPACE
+
class QWebFrame;
+class QWebElementCollection;
class QWebElementPrivate;
class QWEBKIT_EXPORT QWebElement {
@@ -46,8 +52,8 @@ public:
bool isNull() const;
- QList<QWebElement> findAll(const QString& selectorQuery) const;
- QWebElement findFirst(const QString& selectorQuery) const;
+ QWebElementCollection findAll(const QString &selectorQuery) const;
+ QWebElement findFirst(const QString &selectorQuery) const;
void setPlainText(const QString& text);
QString toPlainText() const;
@@ -67,6 +73,7 @@ public:
void removeAttribute(const QString& name);
void removeAttributeNS(const QString& namespaceUri, const QString& name);
bool hasAttributes() const;
+ QStringList attributeNames(const QString& namespaceUri = QString()) const;
QStringList classes() const;
bool hasClass(const QString& name) const;
@@ -74,6 +81,9 @@ public:
void removeClass(const QString& name);
void toggleClass(const QString& name);
+ bool hasFocus() const;
+ void setFocus();
+
QRect geometry() const;
QString tagName() const;
@@ -89,7 +99,7 @@ public:
QWebElement document() const;
QWebFrame *webFrame() const;
- // TODO: Add QList<QWebElement> overloads
+ // TODO: Add QWebElementCollection overloads
// docs need example snippet
void appendInside(const QString& markup);
void appendInside(const QWebElement& element);
@@ -118,35 +128,131 @@ public:
QWebElement clone() const;
QWebElement& takeFromDocument();
void removeFromDocument();
- void removeChildren();
-
- QVariant evaluateScript(const QString& scriptSource);
+ void removeAllChildren();
- QVariant callFunction(const QString& functionName, const QVariantList& arguments = QVariantList());
- QStringList functions() const;
+ QVariant evaluateJavaScript(const QString& scriptSource);
- QVariant scriptableProperty(const QString& name) const;
- void setScriptableProperty(const QString& name, const QVariant& value);
- QStringList scriptableProperties() const;
+ enum StyleResolveStrategy {
+ InlineStyle,
+ CascadedStyle,
+ ComputedStyle,
+ };
+ QString styleProperty(const QString& name, StyleResolveStrategy strategy) const;
+ void setStyleProperty(const QString& name, const QString& value);
- enum ResolveRule { IgnoreCascadingStyles, RespectCascadingStyles };
- QString styleProperty(const QString& name, ResolveRule = IgnoreCascadingStyles) const;
-
- enum StylePriority { NormalStylePriority, DeclaredStylePriority, ImportantStylePriority };
- void setStyleProperty(const QString& name, const QString& value, StylePriority = DeclaredStylePriority);
-
- QString computedStyleProperty(const QString& name) const;
+ void render(QPainter* painter);
private:
explicit QWebElement(WebCore::Element*);
explicit QWebElement(WebCore::Node*);
+ static QWebElement enclosingElement(WebCore::Node*);
+
friend class QWebFrame;
+ friend class QWebElementCollection;
friend class QWebHitTestResult;
friend class QWebHitTestResultPrivate;
+ friend class QWebPage;
QWebElementPrivate* d;
WebCore::Element* m_element;
};
+class QWebElementCollectionPrivate;
+
+class QWEBKIT_EXPORT QWebElementCollection
+{
+public:
+ QWebElementCollection();
+ QWebElementCollection(const QWebElement &contextElement, const QString &query);
+ QWebElementCollection(const QWebElementCollection &);
+ QWebElementCollection &operator=(const QWebElementCollection &);
+ ~QWebElementCollection();
+
+ QWebElementCollection operator+(const QWebElementCollection &other) const;
+ inline QWebElementCollection &operator+=(const QWebElementCollection &other)
+ {
+ append(other); return *this;
+ }
+
+ void append(const QWebElementCollection &collection);
+
+ int count() const;
+ QWebElement at(int i) const;
+ inline QWebElement operator[](int i) const { return at(i); }
+
+ inline QWebElement first() const { return at(0); }
+ inline QWebElement last() const { return at(count() - 1); }
+
+ QList<QWebElement> toList() const;
+
+ class const_iterator {
+ public:
+ inline const_iterator(const QWebElementCollection* collection, int index) : i(index), collection(collection) {}
+ inline const_iterator(const const_iterator& o) : i(o.i), collection(o.collection) {}
+
+ inline const QWebElement operator*() const { return collection->at(i); }
+
+ inline bool operator==(const const_iterator& o) const { return i == o.i && collection == o.collection; }
+ inline bool operator!=(const const_iterator& o) const { return i != o.i || collection != o.collection; }
+ inline bool operator<(const const_iterator& o) const { return i < o.i; }
+ inline bool operator<=(const const_iterator& o) const { return i <= o.i; }
+ inline bool operator>(const const_iterator& o) const { return i > o.i; }
+ inline bool operator>=(const const_iterator& o) const { return i >= o.i; }
+
+ inline const_iterator& operator++() { ++i; return *this; }
+ inline const_iterator operator++(int) { const_iterator n(collection, i); ++i; return n; }
+ inline const_iterator& operator--() { i--; return *this; }
+ inline const_iterator operator--(int) { const_iterator n(collection, i); i--; return n; }
+ inline const_iterator& operator+=(int j) { i += j; return *this; }
+ inline const_iterator& operator-=(int j) { i -= j; return *this; }
+ inline const_iterator operator+(int j) const { return const_iterator(collection, i + j); }
+ inline const_iterator operator-(int j) const { return const_iterator(collection, i - j); }
+ inline int operator-(const_iterator j) const { return i - j.i; }
+ private:
+ int i;
+ const QWebElementCollection* const collection;
+ };
+ friend class const_iterator;
+
+ inline const_iterator begin() const { return constBegin(); }
+ inline const_iterator end() const { return constEnd(); }
+ inline const_iterator constBegin() const { return const_iterator(this, 0); }
+ inline const_iterator constEnd() const { return const_iterator(this, count()); };
+
+ class iterator {
+ public:
+ inline iterator(const QWebElementCollection* collection, int index) : i(index), collection(collection) {}
+ inline iterator(const iterator& o) : i(o.i), collection(o.collection) {}
+
+ inline QWebElement operator*() const { return collection->at(i); }
+
+ inline bool operator==(const iterator& o) const { return i == o.i && collection == o.collection; }
+ inline bool operator!=(const iterator& o) const { return i != o.i || collection != o.collection; }
+ inline bool operator<(const iterator& o) const { return i < o.i; }
+ inline bool operator<=(const iterator& o) const { return i <= o.i; }
+ inline bool operator>(const iterator& o) const { return i > o.i; }
+ inline bool operator>=(const iterator& o) const { return i >= o.i; }
+
+ inline iterator& operator++() { ++i; return *this; }
+ inline iterator operator++(int) { iterator n(collection, i); ++i; return n; }
+ inline iterator& operator--() { i--; return *this; }
+ inline iterator operator--(int) { iterator n(collection, i); i--; return n; }
+ inline iterator& operator+=(int j) { i += j; return *this; }
+ inline iterator& operator-=(int j) { i -= j; return *this; }
+ inline iterator operator+(int j) const { return iterator(collection, i + j); }
+ inline iterator operator-(int j) const { return iterator(collection, i - j); }
+ inline int operator-(iterator j) const { return i - j.i; }
+ private:
+ int i;
+ const QWebElementCollection* const collection;
+ };
+ friend class iterator;
+
+ inline iterator begin() { return iterator(this, 0); }
+ inline iterator end() { return iterator(this, count()); }
+private:
+ QExplicitlySharedDataPointer<QWebElementCollectionPrivate> d;
+};
+
#endif // QWEBELEMENT_H
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
index 23cb473dc..e84b8dffe 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
@@ -185,6 +185,17 @@ void QWEBKIT_EXPORT qt_drt_garbageCollector_collectOnAlternateThread(bool waitUn
gcController().garbageCollectOnAlternateThreadForDebugging(waitUntilDone);
}
+// Returns the value of counter in the element specified by \a id.
+QString QWEBKIT_EXPORT qt_drt_counterValueForElementById(QWebFrame* qFrame, const QString& id)
+{
+ Frame* frame = QWebFramePrivate::core(qFrame);
+ if (Document* document = frame->document()) {
+ Element* element = document->getElementById(id);
+ return WebCore::counterValueForElement(element);
+ }
+ return QString();
+}
+
QWebFrameData::QWebFrameData(WebCore::Page* parentPage, WebCore::Frame* parentFrame,
WebCore::HTMLFrameOwnerElement* ownerFrameElement,
const WebCore::String& frameName)
@@ -232,7 +243,7 @@ WebCore::Scrollbar* QWebFramePrivate::verticalScrollBar() const
return frame->view()->verticalScrollbar();
}
-void QWebFramePrivate::renderPrivate(QPainter *painter, const QRegion &clip)
+void QWebFramePrivate::renderPrivate(QPainter *painter, QWebFrame::RenderLayer layer, const QRegion &clip)
{
if (!frame->view() || !frame->contentRenderer())
return;
@@ -241,24 +252,58 @@ void QWebFramePrivate::renderPrivate(QPainter *painter, const QRegion &clip)
if (vector.isEmpty())
return;
- WebCore::FrameView* view = frame->view();
- view->layoutIfNeededRecursive();
-
GraphicsContext context(painter);
+ if (context.paintingDisabled() && !context.updatingControlTints())
+ return;
- if (clipRenderToViewport)
- view->paint(&context, vector.first());
- else
- view->paintContents(&context, vector.first());
+ WebCore::FrameView* view = frame->view();
+ view->layoutIfNeededRecursive();
- for (int i = 1; i < vector.size(); ++i) {
+ for (int i = 0; i < vector.size(); ++i) {
const QRect& clipRect = vector.at(i);
+ QRect intersectedRect = clipRect.intersected(view->frameRect());
+
painter->save();
painter->setClipRect(clipRect, Qt::IntersectClip);
- if (clipRenderToViewport)
- view->paint(&context, clipRect);
- else
- view->paintContents(&context, clipRect);
+
+ int x = view->x();
+ int y = view->y();
+
+ if (layer & QWebFrame::ContentsLayer) {
+ context.save();
+
+ int scrollX = view->scrollX();
+ int scrollY = view->scrollY();
+
+ QRect rect = intersectedRect;
+ context.translate(x, y);
+ rect.translate(-x, -y);
+ context.translate(-scrollX, -scrollY);
+ rect.translate(scrollX, scrollY);
+ context.clip(view->visibleContentRect());
+
+ view->paintContents(&context, rect);
+
+ context.restore();
+ }
+
+ if (layer & QWebFrame::ScrollBarLayer
+ && !view->scrollbarsSuppressed()
+ && (view->horizontalScrollbar() || view->verticalScrollbar())) {
+ context.save();
+
+ QRect rect = intersectedRect;
+ context.translate(x, y);
+ rect.translate(-x, -y);
+
+ view->paintScrollbars(&context, rect);
+
+ context.restore();
+ }
+
+ if (layer & QWebFrame::PanIconLayer)
+ view->paintPanScrollIcon(&context);
+
painter->restore();
}
}
@@ -268,6 +313,8 @@ void QWebFramePrivate::renderPrivate(QPainter *painter, const QRegion &clip)
\since 4.4
\brief The QWebFrame class represents a frame in a web page.
+ \inmodule QtWebKit
+
QWebFrame represents a frame inside a web page. Each QWebPage
object contains at least one frame, the main frame, obtained using
QWebPage::mainFrame(). Additional frames will be created for HTML
@@ -277,7 +324,7 @@ void QWebFramePrivate::renderPrivate(QPainter *painter, const QRegion &clip)
the HTML content readily available, you can use setHtml() instead.
The page() function returns a pointer to the web page object. See
- \l{Elements of QWebView} for an explanation of how web
+ \l{QWebView}{Elements of QWebView} for an explanation of how web
frames are related to a web page and web view.
The QWebFrame class also offers methods to retrieve both the URL currently
@@ -309,6 +356,19 @@ void QWebFramePrivate::renderPrivate(QPainter *painter, const QRegion &clip)
\sa QWebPage
*/
+/*!
+ \enum QWebFrame::RenderLayer
+
+ This enum describes the layers available for rendering using \l{QWebFrame::}{render()}.
+ The layers can be OR-ed together from the following list:
+
+ \value ContentsLayer The web content of the frame
+ \value ScrollBarLayer The scrollbars of the frame
+ \value PanIconLayer The icon used when panning the frame
+
+ \value AllLayers Includes all the above layers
+*/
+
QWebFrame::QWebFrame(QWebPage *parent, QWebFrameData *frameData)
: QObject(parent)
, d(new QWebFramePrivate)
@@ -384,7 +444,7 @@ void QWebFrame::addToJavaScriptWindowObject(const QString &name, QObject *object
return;
JSC::JSLock lock(JSC::SilenceAssertionsOnly);
- JSDOMWindow* window = toJSDOMWindow(d->frame);
+ JSDOMWindow* window = toJSDOMWindow(d->frame, mainThreadNormalWorld());
JSC::Bindings::RootObject* root = d->frame->script()->bindingRootObject();
if (!window) {
qDebug() << "Warning: couldn't get window object";
@@ -424,7 +484,9 @@ QString QWebFrame::toPlainText() const
d->frame->view()->layout();
Element *documentElement = d->frame->document()->documentElement();
- return documentElement->innerText();
+ if (documentElement)
+ return documentElement->innerText();
+ return QString();
}
/*!
@@ -538,11 +600,26 @@ QUrl QWebFrame::url() const
*/
QUrl QWebFrame::requestedUrl() const
{
- if (!d->frame->loader()->activeDocumentLoader()
- || !d->frameLoaderClient->m_loadSucceeded)
- return QUrl(d->frame->loader()->outgoingReferrer());
+ // There are some possible edge cases to be handled here,
+ // apart from checking if activeDocumentLoader is valid:
+ //
+ // * Method can be called while processing an unsucessful load.
+ // In this case, frameLoaderClient will hold the current error
+ // (m_loadError), and we will make use of it to recover the 'failingURL'.
+ // * If the 'failingURL' holds a null'ed string though, we fallback
+ // to 'outgoingReferrer' (it yet is safer than originalRequest).
+ FrameLoader* loader = d->frame->loader();
+ FrameLoaderClientQt* loaderClient = d->frameLoaderClient;
+
+ if (!loader->activeDocumentLoader()
+ || !loaderClient->m_loadError.isNull()) {
+ if (!loaderClient->m_loadError.failingURL().isNull())
+ return QUrl(loaderClient->m_loadError.failingURL());
+ else if (!loader->outgoingReferrer().isEmpty())
+ return QUrl(loader->outgoingReferrer());
+ }
- return d->frame->loader()->originalRequest().url();
+ return loader->originalRequest().url();
}
/*!
\since 4.6
@@ -672,6 +749,11 @@ void QWebFrame::load(const QNetworkRequest &req,
case QNetworkAccessManager::PostOperation:
request.setHTTPMethod("POST");
break;
+#if QT_VERSION >= 0x040600
+ case QNetworkAccessManager::DeleteOperation:
+ request.setHTTPMethod("DELETE");
+ break;
+#endif
case QNetworkAccessManager::UnknownOperation:
// eh?
break;
@@ -699,12 +781,18 @@ void QWebFrame::load(const QNetworkRequest &req,
The \a html is loaded immediately; external objects are loaded asynchronously.
+ If a script in the \a html runs longer than the default script timeout (currently 10 seconds),
+ for example due to being blocked by a modal JavaScript alert dialog, this method will return
+ as soon as possible after the timeout and any subsequent \a html will be loaded asynchronously.
+
When using this method WebKit assumes that external resources such as JavaScript programs or style
sheets are encoded in UTF-8 unless otherwise specified. For example, the encoding of an external
script can be specified through the charset attribute of the HTML script tag. It is also possible
for the encoding to be specified by web server.
- \sa toHtml()
+ \note This method will not affect session or global history for the frame.
+
+ \sa toHtml(), setContent()
*/
void QWebFrame::setHtml(const QString &html, const QUrl &baseUrl)
{
@@ -712,7 +800,7 @@ void QWebFrame::setHtml(const QString &html, const QUrl &baseUrl)
WebCore::ResourceRequest request(kurl);
const QByteArray utf8 = html.toUtf8();
WTF::RefPtr<WebCore::SharedBuffer> data = WebCore::SharedBuffer::create(utf8.constData(), utf8.length());
- WebCore::SubstituteData substituteData(data, WebCore::String("text/html"), WebCore::String("utf-8"), kurl);
+ WebCore::SubstituteData substituteData(data, WebCore::String("text/html"), WebCore::String("utf-8"), KURL());
d->frame->loader()->load(request, substituteData, false);
}
@@ -725,7 +813,9 @@ void QWebFrame::setHtml(const QString &html, const QUrl &baseUrl)
The \a data is loaded immediately; external objects are loaded asynchronously.
- \sa toHtml()
+ \note This method will not affect session or global history for the frame.
+
+ \sa toHtml(), setHtml()
*/
void QWebFrame::setContent(const QByteArray &data, const QString &mimeType, const QUrl &baseUrl)
{
@@ -735,11 +825,10 @@ void QWebFrame::setContent(const QByteArray &data, const QString &mimeType, cons
QString actualMimeType = mimeType;
if (actualMimeType.isEmpty())
actualMimeType = QLatin1String("text/html");
- WebCore::SubstituteData substituteData(buffer, WebCore::String(actualMimeType), WebCore::String(), kurl);
+ WebCore::SubstituteData substituteData(buffer, WebCore::String(actualMimeType), WebCore::String(), KURL());
d->frame->loader()->load(request, substituteData, false);
}
-
/*!
Returns the parent frame of this frame, or 0 if the frame is the web pages
main frame.
@@ -797,13 +886,11 @@ void QWebFrame::setScrollBarPolicy(Qt::Orientation orientation, Qt::ScrollBarPol
d->horizontalScrollBarPolicy = policy;
if (d->frame->view()) {
d->frame->view()->setHorizontalScrollbarMode((ScrollbarMode)policy);
- d->frame->view()->updateDefaultScrollbarState();
}
} else {
d->verticalScrollBarPolicy = policy;
if (d->frame->view()) {
d->frame->view()->setVerticalScrollbarMode((ScrollbarMode)policy);
- d->frame->view()->updateDefaultScrollbarState();
}
}
}
@@ -869,6 +956,7 @@ int QWebFrame::scrollBarMaximum(Qt::Orientation orientation) const
*/
int QWebFrame::scrollBarMinimum(Qt::Orientation orientation) const
{
+ Q_UNUSED(orientation)
return 0;
}
@@ -927,44 +1015,37 @@ void QWebFrame::setScrollPosition(const QPoint &pos)
}
/*!
- Render the frame into \a painter clipping to \a clip.
+ \since 4.6
+ Render the \a layer of the frame using \a painter clipping to \a clip.
\sa print()
*/
-void QWebFrame::render(QPainter *painter, const QRegion &clip)
-{
- d->renderPrivate(painter, clip);
-}
-/*!
- Render the frame into \a painter.
-*/
-void QWebFrame::render(QPainter *painter)
+void QWebFrame::render(QPainter* painter, RenderLayer layer, const QRegion& clip)
{
- if (!d->frame->view())
- return;
-
- d->renderPrivate(painter, QRegion(d->frame->view()->frameRect()));
+ if (!clip.isEmpty())
+ d->renderPrivate(painter, layer, clip);
+ else if (d->frame->view())
+ d->renderPrivate(painter, layer, QRegion(d->frame->view()->frameRect()));
}
/*!
- \since 4.6
- \property QWebFrame::clipRenderToViewport
-
- Returns true if render will clip content to viewport; otherwise returns false.
+ Render the frame into \a painter clipping to \a clip.
*/
-bool QWebFrame::clipRenderToViewport() const
+void QWebFrame::render(QPainter *painter, const QRegion &clip)
{
- return d->clipRenderToViewport;
+ d->renderPrivate(painter, AllLayers, clip);
}
/*!
- \since 4.6
- Sets whether the content of a frame will be clipped to viewport when rendered.
+ Render the frame into \a painter.
*/
-void QWebFrame::setClipRenderToViewport(bool clipRenderToViewport)
+void QWebFrame::render(QPainter *painter)
{
- d->clipRenderToViewport = clipRenderToViewport;
+ if (!d->frame->view())
+ return;
+
+ d->renderPrivate(painter, AllLayers, QRegion(d->frame->view()->frameRect()));
}
/*!
@@ -1020,7 +1101,8 @@ qreal QWebFrame::zoomFactor() const
*/
bool QWebFrame::hasFocus() const
{
- return QWebFramePrivate::kit(d->frame->page()->focusController()->focusedFrame()) == this;
+ WebCore::Frame* ff = d->frame->page()->focusController()->focusedFrame();
+ return ff && QWebFramePrivate::kit(ff) == this;
}
/*!
@@ -1094,7 +1176,7 @@ QWebElement QWebFrame::documentElement() const
\sa QWebElement::findAll()
*/
-QList<QWebElement> QWebFrame::findAllElements(const QString &selectorQuery) const
+QWebElementCollection QWebFrame::findAllElements(const QString &selectorQuery) const
{
return documentElement().findAll(selectorQuery);
}
@@ -1242,9 +1324,9 @@ QVariant QWebFrame::evaluateJavaScript(const QString& scriptSource)
ScriptController *proxy = d->frame->script();
QVariant rc;
if (proxy) {
- JSC::JSValue v = proxy->evaluate(ScriptSourceCode(scriptSource)).jsValue();
+ JSC::JSValue v = d->frame->script()->executeScript(ScriptSourceCode(scriptSource)).jsValue();
int distance = 0;
- rc = JSC::Bindings::convertValueToQVariant(proxy->globalObject()->globalExec(), v, QMetaType::Void, &distance);
+ rc = JSC::Bindings::convertValueToQVariant(proxy->globalObject(mainThreadNormalWorld())->globalExec(), v, QMetaType::Void, &distance);
}
return rc;
}
@@ -1360,6 +1442,8 @@ QWebFrame* QWebFramePrivate::kit(WebCore::Frame* coreFrame)
\brief The QWebHitTestResult class provides information about the web
page content after a hit test.
+ \inmodule QtWebKit
+
QWebHitTestResult is returned by QWebFrame::hitTestContent() to provide
information about the content of the web page at the specified position.
*/
@@ -1380,7 +1464,6 @@ QWebHitTestResultPrivate::QWebHitTestResultPrivate(const WebCore::HitTestResult
if (!hitTest.innerNode())
return;
pos = hitTest.point();
- boundingRect = hitTest.boundingBox();
WebCore::TextDirection dir;
title = hitTest.title(dir);
linkText = hitTest.textContent();
@@ -1390,6 +1473,7 @@ QWebHitTestResultPrivate::QWebHitTestResultPrivate(const WebCore::HitTestResult
imageUrl = hitTest.absoluteImageURL();
innerNode = hitTest.innerNode();
innerNonSharedNode = hitTest.innerNonSharedNode();
+ boundingRect = innerNonSharedNode ? innerNonSharedNode->renderer()->absoluteBoundingBoxRect(true) : IntRect();
WebCore::Image *img = hitTest.image();
if (img) {
QPixmap *pix = img->nativeImageForCurrentFrame();
@@ -1637,4 +1721,3 @@ QWebFrame *QWebHitTestResult::frame() const
return 0;
return d->frame;
}
-
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.h
index 55c73b413..08285f84a 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.h
@@ -50,6 +50,7 @@ class QWebHitTestResult;
class QWebHistoryItem;
class QWebSecurityOrigin;
class QWebElement;
+class QWebElementCollection;
namespace WebCore {
class WidgetPrivate;
@@ -112,7 +113,6 @@ class QWEBKIT_EXPORT QWebFrame : public QObject {
Q_PROPERTY(QIcon icon READ icon)
Q_PROPERTY(QSize contentsSize READ contentsSize)
Q_PROPERTY(QPoint scrollPosition READ scrollPosition WRITE setScrollPosition)
- Q_PROPERTY(bool clipRenderToViewport READ clipRenderToViewport WRITE setClipRenderToViewport)
Q_PROPERTY(bool focus READ hasFocus)
private:
QWebFrame(QWebPage *parent, QWebFrameData *frameData);
@@ -165,10 +165,17 @@ public:
QPoint scrollPosition() const;
void setScrollPosition(const QPoint &pos);
- void render(QPainter *painter, const QRegion &clip);
- void render(QPainter *painter);
- bool clipRenderToViewport() const;
- void setClipRenderToViewport(bool clipRenderToViewport);
+ enum RenderLayer {
+ ContentsLayer = 0x10,
+ ScrollBarLayer = 0x20,
+ PanIconLayer = 0x40,
+
+ AllLayers = 0xff
+ };
+
+ void render(QPainter*);
+ void render(QPainter*, const QRegion& clip);
+ void render(QPainter*, RenderLayer layer, const QRegion& clip = QRegion());
void setTextSizeMultiplier(qreal factor);
qreal textSizeMultiplier() const;
@@ -184,7 +191,7 @@ public:
QSize contentsSize() const;
QWebElement documentElement() const;
- QList<QWebElement> findAllElements(const QString &selectorQuery) const;
+ QWebElementCollection findAllElements(const QString &selectorQuery) const;
QWebElement findFirstElement(const QString &selectorQuery) const;
QWebHitTestResult hitTestContent(const QPoint &pos) const;
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe_p.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe_p.h
index d6afc01bc..081e65de7 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe_p.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe_p.h
@@ -70,7 +70,6 @@ public:
, allowsScrolling(true)
, marginWidth(-1)
, marginHeight(-1)
- , clipRenderToViewport(true)
{}
void init(QWebFrame* qframe, QWebFrameData* frameData);
@@ -79,15 +78,14 @@ public:
WebCore::Scrollbar* horizontalScrollBar() const;
WebCore::Scrollbar* verticalScrollBar() const;
- Qt::ScrollBarPolicy horizontalScrollBarPolicy;
- Qt::ScrollBarPolicy verticalScrollBarPolicy;
-
static WebCore::Frame* core(QWebFrame*);
static QWebFrame* kit(WebCore::Frame*);
- void renderPrivate(QPainter *painter, const QRegion &clip);
+ void renderPrivate(QPainter*, QWebFrame::RenderLayer, const QRegion& clip);
QWebFrame *q;
+ Qt::ScrollBarPolicy horizontalScrollBarPolicy;
+ Qt::ScrollBarPolicy verticalScrollBarPolicy;
WebCore::FrameLoaderClientQt *frameLoaderClient;
WebCore::Frame *frame;
QWebPage *page;
@@ -95,7 +93,6 @@ public:
bool allowsScrolling;
int marginWidth;
int marginHeight;
- bool clipRenderToViewport;
};
class QWebHitTestResultPrivate {
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.cpp
index 1c1c72a36..d852012b6 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.cpp
@@ -20,6 +20,7 @@
#include "config.h"
#include "qwebhistory.h"
#include "qwebhistory_p.h"
+#include "qwebframe_p.h"
#include "PlatformString.h"
#include "Image.h"
@@ -30,11 +31,18 @@
#include <QSharedData>
#include <QDebug>
+enum {
+ InitialHistoryVersion = 1,
+ DefaultHistoryVersion = InitialHistoryVersion
+};
+
/*!
\class QWebHistoryItem
\since 4.4
\brief The QWebHistoryItem class represents one item in the history of a QWebPage
+ \inmodule QtWebKit
+
Each QWebHistoryItem instance represents an entry in the history stack of a Web page,
containing information about the page, its location, and when it was last visited.
@@ -201,6 +209,8 @@ bool QWebHistoryItem::isValid() const
\since 4.4
\brief The QWebHistory class represents the history of a QWebPage
+ \inmodule QtWebKit
+
Each QWebPage instance contains a history of visited pages that can be accessed
by QWebPage::history(). QWebHistory represents this history and makes it possible
to navigate it.
@@ -221,7 +231,8 @@ bool QWebHistoryItem::isValid() const
number of items is given by count(), and the history can be cleared with the
clear() function.
- QWebHistory's state can be saved with saveState() and loaded with restoreState().
+ QWebHistory's state can be saved to a QDataStream using the >> operator and loaded
+ by using the << operator.
\sa QWebHistoryItem, QWebHistoryInterface, QWebPage
*/
@@ -244,17 +255,27 @@ QWebHistory::~QWebHistory()
*/
void QWebHistory::clear()
{
- RefPtr<WebCore::HistoryItem> current = d->lst->currentItem();
- int capacity = d->lst->capacity();
- d->lst->setCapacity(0);
+ //shortcut to private BackForwardList
+ WebCore::BackForwardList* lst = d->lst;
- WebCore::Page* page = d->lst->page();
+ //clear visited links
+ WebCore::Page* page = lst->page();
if (page && page->groupPtr())
page->groupPtr()->removeVisitedLinks();
- d->lst->setCapacity(capacity);
- d->lst->addItem(current.get());
- d->lst->goToItem(current.get());
+ //if count() == 0 then just return
+ if (!lst->entries().size())
+ return;
+
+ RefPtr<WebCore::HistoryItem> current = lst->currentItem();
+ int capacity = lst->capacity();
+ lst->setCapacity(0);
+
+ lst->setCapacity(capacity); //revert capacity
+ lst->addItem(current.get()); //insert old current item
+ lst->goToItem(current.get()); //and set it as current again
+
+ d->page()->updateNavigationActions();
}
/*!
@@ -267,7 +288,7 @@ QList<QWebHistoryItem> QWebHistory::items() const
const WebCore::HistoryItemVector &items = d->lst->entries();
QList<QWebHistoryItem> ret;
- for (int i = 0; i < items.size(); ++i) {
+ for (unsigned i = 0; i < items.size(); ++i) {
QWebHistoryItemPrivate *priv = new QWebHistoryItemPrivate(items[i].get());
ret.append(QWebHistoryItem(priv));
}
@@ -286,7 +307,7 @@ QList<QWebHistoryItem> QWebHistory::backItems(int maxItems) const
d->lst->backListWithLimit(maxItems, items);
QList<QWebHistoryItem> ret;
- for (int i = 0; i < items.size(); ++i) {
+ for (unsigned i = 0; i < items.size(); ++i) {
QWebHistoryItemPrivate *priv = new QWebHistoryItemPrivate(items[i].get());
ret.append(QWebHistoryItem(priv));
}
@@ -305,7 +326,7 @@ QList<QWebHistoryItem> QWebHistory::forwardItems(int maxItems) const
d->lst->forwardListWithLimit(maxItems, items);
QList<QWebHistoryItem> ret;
- for (int i = 0; i < items.size(); ++i) {
+ for (unsigned i = 0; i < items.size(); ++i) {
QWebHistoryItemPrivate *priv = new QWebHistoryItemPrivate(items[i].get());
ret.append(QWebHistoryItem(priv));
}
@@ -341,9 +362,11 @@ bool QWebHistory::canGoForward() const
*/
void QWebHistory::back()
{
- d->lst->goBack();
- WebCore::Page* page = d->lst->page();
- page->goToItem(currentItem().d->item, WebCore::FrameLoadTypeIndexedBackForward);
+ if (canGoBack()) {
+ d->lst->goBack();
+ WebCore::Page* page = d->lst->page();
+ page->goToItem(currentItem().d->item, WebCore::FrameLoadTypeIndexedBackForward);
+ }
}
/*!
@@ -354,9 +377,11 @@ void QWebHistory::back()
*/
void QWebHistory::forward()
{
- d->lst->goForward();
- WebCore::Page* page = d->lst->page();
- page->goToItem(currentItem().d->item, WebCore::FrameLoadTypeIndexedBackForward);
+ if (canGoForward()) {
+ d->lst->goForward();
+ WebCore::Page* page = d->lst->page();
+ page->goToItem(currentItem().d->item, WebCore::FrameLoadTypeIndexedBackForward);
+ }
}
/*!
@@ -456,128 +481,75 @@ void QWebHistory::setMaximumItemCount(int count)
}
/*!
- \enum QWebHistory::HistoryStateVersion
+ \since 4.6
+ \fn QDataStream& operator<<(QDataStream& stream, const QWebHistory& history)
+ \relates QWebHistory
- This enum describes the versions available for QWebHistory's saveState() function:
+ \brief The operator<< function streams a history into a data stream.
- \value HistoryVersion_1 Version 1 (Qt 4.6)
- \value DefaultHistoryVersion The current default version in 1.
+ It saves the \a history into the specified \a stream.
*/
+QDataStream& operator<<(QDataStream& target, const QWebHistory& history)
+{
+ QWebHistoryPrivate* d = history.d;
+
+ int version = DefaultHistoryVersion;
+
+ target << version;
+ target << history.count() << history.currentItemIndex();
+
+ const WebCore::HistoryItemVector &items = d->lst->entries();
+ for (unsigned i = 0; i < items.size(); i++)
+ items[i].get()->saveState(target, version);
+
+ return target;
+}
+
/*!
+ \fn QDataStream& operator>>(QDataStream& stream, QWebHistory& history)
+ \relates QWebHistory
\since 4.6
- Restores the state of QWebHistory from the given \a buffer. Returns true
- if the history was successfully restored; otherwise returns false.
+ \brief The operator>> function loads a history from a data stream.
- \sa saveState()
+ Loads a QWebHistory from the specified \a stream into the given \a history.
*/
-bool QWebHistory::restoreState(const QByteArray& buffer)
+
+QDataStream& operator>>(QDataStream& source, QWebHistory& history)
{
- QDataStream stream(buffer);
+ QWebHistoryPrivate* d = history.d;
+
int version;
- bool result = false;
- stream >> version;
- switch (version) {
- case HistoryVersion_1: {
+ source >> version;
+
+ if (version == 1) {
int count;
int currentIndex;
- stream >> count >> currentIndex;
+ source >> count >> currentIndex;
- clear();
+ history.clear();
// only if there are elements
if (count) {
// after clear() is new clear HistoryItem (at the end we had to remove it)
- WebCore::HistoryItem *nullItem = d->lst->currentItem();
- for (int i = 0;i < count;i++) {
+ WebCore::HistoryItem* nullItem = d->lst->currentItem();
+ for (int i = 0; i < count; i++) {
WTF::PassRefPtr<WebCore::HistoryItem> item = WebCore::HistoryItem::create();
- item->restoreState(stream, version);
+ item->restoreState(source, version);
d->lst->addItem(item);
}
d->lst->removeItem(nullItem);
- goToItem(itemAt(currentIndex));
- result = stream.status() == QDataStream::Ok;
+ history.goToItem(history.itemAt(currentIndex));
}
- break;
- }
- default: {} // result is false;
}
- return result;
-};
+ d->page()->updateNavigationActions();
-/*!
- \since 4.6
- Saves the state of this QWebHistory into a QByteArray.
-
- Saves the current state of this QWebHistory. The version number, \a version, is
- stored as part of the data.
-
- To restore the saved state, pass the return value to restoreState().
-
- \sa restoreState()
-*/
-QByteArray QWebHistory::saveState(HistoryStateVersion version) const
-{
- QByteArray buffer;
- QDataStream stream(&buffer, QIODevice::WriteOnly);
- stream << version;
-
- switch (version) {
- case HistoryVersion_1: {
- stream << count() << currentItemIndex();
-
- const WebCore::HistoryItemVector &items = d->lst->entries();
- for (int i = 0; i < items.size(); i++)
- items[i].get()->saveState(stream, version);
-
- if (stream.status() != QDataStream::Ok)
- buffer = QByteArray(); // make buffer isNull()==true and isEmpty()==true
- break;
- }
- default:
- buffer.clear();
-
- }
-
- return buffer;
-}
-
-/*!
- \since 4.6
- \fn QDataStream& operator<<(QDataStream& stream, const QWebHistory& history)
- \relates QWebHistory
-
- Saves the given \a history into the specified \a stream. This is a convenience function
- and is equivalent to calling the saveState() method.
-
- \sa QWebHistory::saveState()
-*/
-
-QDataStream& operator<<(QDataStream& stream, const QWebHistory& history)
-{
- return stream << history.saveState();
+ return source;
}
-/*!
- \fn QDataStream& operator>>(QDataStream& stream, QWebHistory& history)
- \relates QWebHistory
- \since 4.6
-
- Loads a QWebHistory from the specified \a stream into the given \a history.
- This is a convenience function and it is equivalent to calling the restoreState()
- method.
-
- \sa QWebHistory::restoreState()
-*/
-
-QDataStream& operator>>(QDataStream& stream, QWebHistory& history)
+QWebPagePrivate* QWebHistoryPrivate::page()
{
- QByteArray buffer;
- stream >> buffer;
- history.restoreState(buffer);
- return stream;
+ return QWebFramePrivate::kit(lst->page()->mainFrame())->page()->handle();
}
-
-
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.h
index e46f124c0..cce455356 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.h
@@ -42,9 +42,6 @@ public:
QWebHistoryItem &operator=(const QWebHistoryItem &other);
~QWebHistoryItem();
- //bool restoreState(QByteArray& buffer);
- //QByteArray saveState(QWebHistory::HistoryStateVersion version = DefaultHistoryVersion) const;
-
QUrl originalUrl() const;
QUrl url() const;
@@ -69,22 +66,10 @@ private:
QExplicitlySharedDataPointer<QWebHistoryItemPrivate> d;
};
-//QWEBKIT_EXPORT QDataStream & operator<<(QDataStream& out,const QWebHistoryItem& hist);
-//QWEBKIT_EXPORT QDataStream & operator>>(QDataStream& in,QWebHistoryItem& hist);
-
class QWebHistoryPrivate;
class QWEBKIT_EXPORT QWebHistory {
public:
- enum HistoryStateVersion {
- HistoryVersion_1,
- /*, HistoryVersion_2, */
- DefaultHistoryVersion = HistoryVersion_1
- };
-
- bool restoreState(const QByteArray& buffer);
- QByteArray saveState(HistoryStateVersion version = DefaultHistoryVersion) const;
-
void clear();
QList<QWebHistoryItem> items() const;
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory_p.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory_p.h
index e77adefc2..a6682cd01 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory_p.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory_p.h
@@ -25,13 +25,15 @@
#include <QtCore/qglobal.h>
#include <QtCore/qshareddata.h>
+class QWebPagePrivate;
+
class Q_AUTOTEST_EXPORT QWebHistoryItemPrivate : public QSharedData {
public:
- static QExplicitlySharedDataPointer<QWebHistoryItemPrivate> get(QWebHistoryItem *q)
+ static QExplicitlySharedDataPointer<QWebHistoryItemPrivate> get(QWebHistoryItem* q)
{
return q->d;
}
- QWebHistoryItemPrivate(WebCore::HistoryItem *i)
+ QWebHistoryItemPrivate(WebCore::HistoryItem* i)
{
if (i)
i->ref();
@@ -43,30 +45,12 @@ public:
item->deref();
}
- /* QByteArray saveStateWithoutVersionControl(QWebHistory::HistoryStateVersion version)
- {
- QByteArray buffer;
- switch(version){
- case QWebHistory::HistoryVersion1:
- buffer=item->saveState(version);
- break;
- default:{}
- }
- return buffer;
- }
-
- bool restoreStateWithoutVersionControl(QWebHistory::HistoryStateVersion version,QDataStream& stream)
- {
-
- }
-*/
-
- WebCore::HistoryItem *item;
+ WebCore::HistoryItem* item;
};
class QWebHistoryPrivate : public QSharedData {
public:
- QWebHistoryPrivate(WebCore::BackForwardList *l)
+ QWebHistoryPrivate(WebCore::BackForwardList* l)
{
l->ref();
lst = l;
@@ -75,7 +59,10 @@ public:
{
lst->deref();
}
- WebCore::BackForwardList *lst;
+
+ QWebPagePrivate* page();
+
+ WebCore::BackForwardList* lst;
};
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebhistoryinterface.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebhistoryinterface.cpp
index 87d52cecd..80567d1e0 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebhistoryinterface.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebhistoryinterface.cpp
@@ -81,6 +81,8 @@ QWebHistoryInterface* QWebHistoryInterface::defaultInterface()
\since 4.4
\brief The QWebHistoryInterface class provides an interface to implement link history.
+ \inmodule QtWebKit
+
The QWebHistoryInterface is an interface that can be used to
implement link history. It contains two pure virtual methods that
are called by the WebKit engine. addHistoryEntry() is used to add
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector.cpp
new file mode 100644
index 000000000..f43cbbfd5
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector.cpp
@@ -0,0 +1,186 @@
+/*
+ Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include "qwebinspector.h"
+
+#include "Element.h"
+#include "InspectorController.h"
+#include "qwebelement.h"
+#include "qwebinspector_p.h"
+#include "qwebpage_p.h"
+
+#include <QResizeEvent>
+
+/*!
+ \class QWebInspector
+ \since 4.6
+ \brief The QWebInspector class allows the placement and control of a
+ QWebPage's inspector.
+ The inspector allows you to see a page current hierarchy and loading
+ statistics.
+
+ The QWebPage to be inspected is determined with the setPage() method.
+
+ A typical use of QWebInspector follows:
+
+ \snippet webkitsnippets/qtwebkit_qwebinspector_snippet.cpp 0
+
+ \note A QWebInspector will display a blank widget if either:
+ \list
+ \o page() is null
+ \o QWebSettings::DeveloperExtrasEnabled is false
+ \endlist
+
+ \section1 Resources
+
+ This class acts mostly as a container and a controller for the inspector.
+ Most of the resources needed by the inspector are owned by the associated
+ QWebPage and are allocated the first time that:
+ \list
+ \o an element is inspected
+ \o the QWebInspector is shown.
+ \endlist
+
+ \section1 Inspector configuration persistence
+
+ The inspector allows the user to configure some options through its
+ interface (e.g. the resource tracking "Always enable" option).
+ These settings are persisted automatically by QtWebKit using QSettings.
+
+ However since the QSettings object is instantiated using the empty
+ constructor, QCoreApplication::setOrganizationName() and
+ QCoreApplication::setApplicationName() must be called within your
+ application to enable the persistence of these options.
+*/
+
+/*!
+ Constructs an empty QWebInspector with parent \a parent.
+*/
+QWebInspector::QWebInspector(QWidget* parent)
+ : QWidget(parent)
+ , d(new QWebInspectorPrivate(this))
+{
+}
+
+/*!
+ Destroys the inspector.
+*/
+QWebInspector::~QWebInspector()
+{
+ // Remove association principally to prevent deleting a child frontend
+ setPage(0);
+}
+
+/*!
+ Sets the QWebPage to be inspected.
+
+ There can only be one QWebInspector associated with a QWebPage
+ and vices versa.
+
+ Calling with \a page as null will break the current association, if any.
+
+ If \a page is already associated to another QWebInspector, the association
+ will be replaced and the previous QWebInspector will have no page
+ associated.
+
+ \sa page()
+*/
+void QWebInspector::setPage(QWebPage* page)
+{
+ if (d->page) {
+ // Break currentPage-->this
+ d->page->d->setInspector(0);
+ }
+ if (page && page->d->inspector && page->d->inspector != this) {
+ // Break newPage<->newPageCurrentInspector
+ page->d->inspector->setPage(0);
+ }
+
+ d->page = page;
+
+ if (page) {
+ // Setup the reciprocal association
+ page->d->setInspector(this);
+ }
+}
+
+/*!
+ Returns the inspected QWebPage.
+ If no web page is currently associated, a null pointer is returned.
+*/
+QWebPage* QWebInspector::page() const
+{
+ return d->page;
+}
+
+/*! \reimp */
+QSize QWebInspector::sizeHint() const
+{
+ return QSize(450, 300);
+}
+
+/*! \reimp */
+bool QWebInspector::event(QEvent* ev)
+{
+ return QWidget::event(ev);
+}
+
+/*! \reimp */
+void QWebInspector::resizeEvent(QResizeEvent* event)
+{
+ d->adjustFrontendSize(event->size());
+}
+
+/*! \reimp */
+void QWebInspector::showEvent(QShowEvent* event)
+{
+ // Allows QWebInspector::show() to init the inspector.
+ if (d->page)
+ d->page->d->inspectorController()->show();
+}
+
+/*! \reimp */
+void QWebInspector::hideEvent(QHideEvent* event)
+{
+ if (d->page)
+ d->page->d->inspectorController()->setWindowVisible(false);
+}
+
+/*! \internal */
+void QWebInspectorPrivate::setFrontend(QWidget* newFrontend)
+{
+ if (frontend)
+ frontend->setParent(0);
+
+ frontend = newFrontend;
+
+ if (frontend) {
+ frontend->setParent(q);
+ frontend->show();
+ adjustFrontendSize(q->size());
+ }
+}
+
+void QWebInspectorPrivate::adjustFrontendSize(const QSize& size)
+{
+ if (frontend)
+ frontend->resize(size);
+}
+
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector.h
new file mode 100644
index 000000000..a5c1ed5b4
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector.h
@@ -0,0 +1,55 @@
+/*
+ Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef QWEBINSPECTOR_H
+#define QWEBINSPECTOR_H
+
+#include "qwebkitglobal.h"
+#include "qwebpage.h"
+
+#include "qwebview.h"
+
+class QWebInspectorPrivate;
+
+class QWEBKIT_EXPORT QWebInspector : public QWidget {
+ Q_OBJECT
+public:
+ QWebInspector(QWidget* parent = 0);
+ ~QWebInspector();
+
+ void setPage(QWebPage* page);
+ QWebPage* page() const;
+
+ QSize sizeHint() const;
+ bool event(QEvent*);
+
+protected:
+ void resizeEvent(QResizeEvent* event);
+ void showEvent(QShowEvent* event);
+ void hideEvent(QHideEvent* event);
+
+private:
+ QWebInspectorPrivate* d;
+
+ friend class QWebInspectorPrivate;
+ friend class QWebPage;
+ friend class QWebPagePrivate;
+ friend class WebCore::InspectorClientQt;
+};
+#endif
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector_p.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector_p.h
new file mode 100644
index 000000000..4d327cc5a
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector_p.h
@@ -0,0 +1,46 @@
+/*
+ Copyright (C) 2008, 2009 Nokia Corporation and/or its subsidiary(-ies)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef QWEBINSPECTOR_P_H
+#define QWEBINSPECTOR_P_H
+
+QT_BEGIN_NAMESPACE
+class QSize;
+class QWidget;
+QT_END_NAMESPACE
+class QWebInspector;
+class QWebPage;
+
+class QWebInspectorPrivate {
+public:
+ QWebInspectorPrivate(QWebInspector* qq)
+ : q(qq)
+ , page(0)
+ , frontend(0)
+ {}
+
+ void setFrontend(QWidget* newFrontend);
+ void adjustFrontendSize(const QSize& size);
+
+ QWebInspector* q;
+ QWebPage* page;
+ QWidget* frontend;
+};
+
+#endif
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebkitversion.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebkitversion.cpp
new file mode 100644
index 000000000..062839fab
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebkitversion.cpp
@@ -0,0 +1,58 @@
+/*
+ Copyright (C) 2009 Robert Hogan <robert@roberthogan.net>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include <qwebkitversion.h>
+#include <WebKitVersion.h>
+
+/*!
+
+ Returns the version number of WebKit at run-time as a string (for
+ example, "531.3"). This is the version of WebKit the application
+ was compiled against.
+
+*/
+QString qWebKitVersion()
+{
+ return QString("%1.%2").arg(WEBKIT_MAJOR_VERSION).arg(WEBKIT_MINOR_VERSION);
+}
+
+/*!
+
+ Returns the 'major' version number of WebKit at run-time as an integer
+ (for example, 531). This is the version of WebKit the application
+ was compiled against.
+
+*/
+int qWebKitMajorVersion()
+{
+ return WEBKIT_MAJOR_VERSION;
+}
+
+/*!
+
+ Returns the 'minor' version number of WebKit at run-time as an integer
+ (for example, 3). This is the version of WebKit the application
+ was compiled against.
+
+*/
+int qWebKitMinorVersion()
+{
+ return WEBKIT_MINOR_VERSION;
+}
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebkitversion.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebkitversion.h
new file mode 100644
index 000000000..f0fbef0ef
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebkitversion.h
@@ -0,0 +1,32 @@
+/*
+ Copyright (C) 2009 Robert Hogan <robert@roberthogan.net>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <qstring.h>
+
+#ifndef qwebkitversion_h
+#define qwebkitversion_h
+
+#include <QtCore/qstring.h>
+#include "qwebkitglobal.h"
+
+QWEBKIT_EXPORT QString qWebKitVersion();
+QWEBKIT_EXPORT int qWebKitMajorVersion();
+QWEBKIT_EXPORT int qWebKitMinorVersion();
+
+#endif // qwebkitversion_h
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
index 613a72fd0..1bdc3ed1e 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
@@ -27,7 +27,10 @@
#include "qwebframe_p.h"
#include "qwebhistory.h"
#include "qwebhistory_p.h"
+#include "qwebinspector.h"
+#include "qwebinspector_p.h"
#include "qwebsettings.h"
+#include "qwebkitversion.h"
#include "Frame.h"
#include "FrameTree.h"
@@ -35,6 +38,7 @@
#include "FrameLoaderClientQt.h"
#include "FrameView.h"
#include "FormState.h"
+#include "ApplicationCacheStorage.h"
#include "ChromeClientQt.h"
#include "ContextMenu.h"
#include "ContextMenuClientQt.h"
@@ -62,13 +66,19 @@
#include "PluginDatabase.h"
#include "ProgressTracker.h"
#include "RefPtr.h"
+#include "RenderTextControl.h"
+#include "TextIterator.h"
#include "HashMap.h"
#include "HTMLFormElement.h"
+#include "HTMLInputElement.h"
+#include "HTMLNames.h"
#include "HitTestResult.h"
#include "WindowFeatures.h"
#include "LocalizedStrings.h"
#include "Cache.h"
#include "runtime/InitializeThreading.h"
+#include "PageGroup.h"
+#include "QWebPageClient.h"
#include <QApplication>
#include <QBasicTimer>
@@ -91,12 +101,16 @@
#include <QSslSocket>
#include <QStyle>
#include <QSysInfo>
+#include <QTextCharFormat>
#if QT_VERSION >= 0x040400
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#else
#include "qwebnetworkinterface.h"
#endif
+#if defined(Q_WS_X11)
+#include <QX11Info>
+#endif
using namespace WebCore;
@@ -128,6 +142,102 @@ QString QWEBKIT_EXPORT qt_webpage_groupName(QWebPage* page)
return page->handle()->page->groupName();
}
+class QWebPageWidgetClient : public QWebPageClient {
+public:
+ QWebPageWidgetClient(QWidget* view)
+ : view(view)
+ {
+ Q_ASSERT(view);
+ }
+
+ virtual void scroll(int dx, int dy, const QRect&);
+ virtual void update(const QRect& dirtyRect);
+ virtual void setInputMethodEnabled(bool enable);
+ virtual bool inputMethodEnabled() const;
+#if QT_VERSION >= 0x040600
+ virtual void setInputMethodHint(Qt::InputMethodHint hint, bool enable);
+#endif
+
+#ifndef QT_NO_CURSOR
+ virtual QCursor cursor() const;
+ virtual void updateCursor(const QCursor& cursor);
+#endif
+
+ virtual QPalette palette() const;
+ virtual int screenNumber() const;
+ virtual QWidget* ownerWidget() const;
+
+ virtual QObject* pluginParent() const;
+
+ QWidget* view;
+};
+
+void QWebPageWidgetClient::scroll(int dx, int dy, const QRect& rectToScroll)
+{
+ view->scroll(qreal(dx), qreal(dy), rectToScroll);
+}
+
+void QWebPageWidgetClient::update(const QRect & dirtyRect)
+{
+ view->update(dirtyRect);
+}
+
+void QWebPageWidgetClient::setInputMethodEnabled(bool enable)
+{
+ view->setAttribute(Qt::WA_InputMethodEnabled, enable);
+}
+
+bool QWebPageWidgetClient::inputMethodEnabled() const
+{
+ return view->testAttribute(Qt::WA_InputMethodEnabled);
+}
+
+#if QT_VERSION >= 0x040600
+void QWebPageWidgetClient::setInputMethodHint(Qt::InputMethodHint hint, bool enable)
+{
+ if (enable)
+ view->setInputMethodHints(view->inputMethodHints() | hint);
+ else
+ view->setInputMethodHints(view->inputMethodHints() & ~hint);
+}
+#endif
+#ifndef QT_NO_CURSOR
+QCursor QWebPageWidgetClient::cursor() const
+{
+ return view->cursor();
+}
+
+void QWebPageWidgetClient::updateCursor(const QCursor& cursor)
+{
+ view->setCursor(cursor);
+}
+#endif
+
+QPalette QWebPageWidgetClient::palette() const
+{
+ return view->palette();
+}
+
+int QWebPageWidgetClient::screenNumber() const
+{
+#if defined(Q_WS_X11)
+ if (view)
+ return view->x11Info().screen();
+#endif
+
+ return 0;
+}
+
+QWidget* QWebPageWidgetClient::ownerWidget() const
+{
+ return view;
+}
+
+QObject* QWebPageWidgetClient::pluginParent() const
+{
+ return view;
+}
+
// Lookup table mapping QWebPage::WebActions to the associated Editor commands
static const char* editorCommandWebActions[] =
{
@@ -223,18 +333,6 @@ const char* QWebPagePrivate::editorCommandForWebActions(QWebPage::WebAction acti
return 0;
}
-#ifndef QT_NO_CURSOR
-SetCursorEvent::SetCursorEvent(const QCursor& cursor)
- : QEvent(static_cast<QEvent::Type>(EventType))
- , m_cursor(cursor)
-{}
-
-QCursor SetCursorEvent::cursor() const
-{
- return m_cursor;
-}
-#endif
-
// If you change this make sure to also adjust the docs for QWebPage::userAgentForUrl
#define WEBKIT_VERSION "527+"
@@ -264,21 +362,25 @@ static inline Qt::DropAction dragOpToDropAction(unsigned actions)
QWebPagePrivate::QWebPagePrivate(QWebPage *qq)
: q(qq)
+ , client(0)
+#if QT_VERSION < 0x040600
, view(0)
+#endif
+ , inspectorFrontend(0)
+ , inspector(0)
+ , inspectorIsInternalOnly(false)
, viewportSize(QSize(0, 0))
+ , clickCausedFocus(false)
{
WebCore::InitializeLoggingChannelsIfNecessary();
JSC::initializeThreading();
- WebCore::FrameLoader::setLocalLoadPolicy(WebCore::FrameLoader::AllowLocalLoadsForLocalAndSubstituteData);
+ WebCore::SecurityOrigin::setLocalLoadPolicy(WebCore::SecurityOrigin::AllowLocalLoadsForLocalAndSubstituteData);
chromeClient = new ChromeClientQt(q);
contextMenuClient = new ContextMenuClientQt();
editorClient = new EditorClientQt(q);
page = new Page(chromeClient, contextMenuClient, editorClient,
- new DragClientQt(q), new InspectorClientQt(q));
-
- // ### should be configurable
- page->settings()->setDefaultTextEncodingName("iso-8859-1");
+ new DragClientQt(q), new InspectorClientQt(q), 0);
settings = new QWebSettings(page->settings());
@@ -303,6 +405,8 @@ QWebPagePrivate::QWebPagePrivate(QWebPage *qq)
history.d = new QWebHistoryPrivate(page->backForwardList());
memset(actions, 0, sizeof(actions));
+
+ PageGroup::setShouldTrackVisitedLinks(true);
}
QWebPagePrivate::~QWebPagePrivate()
@@ -379,7 +483,7 @@ static QWebPage::WebAction webActionForContextMenuAction(WebCore::ContextMenuAct
QMenu *QWebPagePrivate::createContextMenu(const WebCore::ContextMenu *webcoreMenu,
const QList<WebCore::ContextMenuItem> *items, QBitArray *visitedWebActions)
{
- QMenu* menu = new QMenu(view);
+ QMenu* menu = new QMenu(q->view());
for (int i = 0; i < items->count(); ++i) {
const ContextMenuItem &item = items->at(i);
switch (item.type()) {
@@ -437,13 +541,13 @@ void QWebPagePrivate::_q_webActionTriggered(bool checked)
q->triggerAction(action, checked);
}
-#ifndef NDEBUG
void QWebPagePrivate::_q_cleanupLeakMessages()
{
+#ifndef NDEBUG
// Need this to make leak messages accurate.
cache()->setCapacities(0, 0, 0);
-}
#endif
+}
void QWebPagePrivate::updateAction(QWebPage::WebAction action)
{
@@ -459,10 +563,10 @@ void QWebPagePrivate::updateAction(QWebPage::WebAction action)
switch (action) {
case QWebPage::Back:
- enabled = loader->canGoBackOrForward(-1);
+ enabled = page->canGoBackOrForward(-1);
break;
case QWebPage::Forward:
- enabled = loader->canGoBackOrForward(1);
+ enabled = page->canGoBackOrForward(1);
break;
case QWebPage::Stop:
enabled = loader->isLoading();
@@ -580,6 +684,16 @@ void QWebPagePrivate::timerEvent(QTimerEvent *ev)
q->QObject::timerEvent(ev);
}
+void QWebPagePrivate::mouseMoveEvent(QGraphicsSceneMouseEvent* ev)
+{
+ WebCore::Frame* frame = QWebFramePrivate::core(mainFrame);
+ if (!frame->view())
+ return;
+
+ bool accepted = frame->eventHandler()->mouseMoved(PlatformMouseEvent(ev, 0));
+ ev->setAccepted(accepted);
+}
+
void QWebPagePrivate::mouseMoveEvent(QMouseEvent *ev)
{
WebCore::Frame* frame = QWebFramePrivate::core(mainFrame);
@@ -590,12 +704,38 @@ void QWebPagePrivate::mouseMoveEvent(QMouseEvent *ev)
ev->setAccepted(accepted);
}
+void QWebPagePrivate::mousePressEvent(QGraphicsSceneMouseEvent* ev)
+{
+ WebCore::Frame* frame = QWebFramePrivate::core(mainFrame);
+ if (!frame->view())
+ return;
+
+ if (tripleClickTimer.isActive()
+ && (ev->pos().toPoint() - tripleClick).manhattanLength()
+ < QApplication::startDragDistance()) {
+ mouseTripleClickEvent(ev);
+ return;
+ }
+
+ bool accepted = false;
+ PlatformMouseEvent mev(ev, 1);
+ // ignore the event if we can't map Qt's mouse buttons to WebCore::MouseButton
+ if (mev.button() != NoButton)
+ accepted = frame->eventHandler()->handleMousePressEvent(mev);
+ ev->setAccepted(accepted);
+}
+
void QWebPagePrivate::mousePressEvent(QMouseEvent *ev)
{
WebCore::Frame* frame = QWebFramePrivate::core(mainFrame);
if (!frame->view())
return;
+ RefPtr<WebCore::Node> oldNode;
+ if (page->focusController()->focusedFrame()
+ && page->focusController()->focusedFrame()->document())
+ oldNode = page->focusController()->focusedFrame()->document()->focusedNode();
+
if (tripleClickTimer.isActive()
&& (ev->pos() - tripleClick).manhattanLength()
< QApplication::startDragDistance()) {
@@ -609,6 +749,31 @@ void QWebPagePrivate::mousePressEvent(QMouseEvent *ev)
if (mev.button() != NoButton)
accepted = frame->eventHandler()->handleMousePressEvent(mev);
ev->setAccepted(accepted);
+
+ RefPtr<WebCore::Node> newNode;
+ if (page->focusController()->focusedFrame()
+ && page->focusController()->focusedFrame()->document())
+ newNode = page->focusController()->focusedFrame()->document()->focusedNode();
+
+ if (newNode && oldNode != newNode)
+ clickCausedFocus = true;
+}
+
+void QWebPagePrivate::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *ev)
+{
+ WebCore::Frame* frame = QWebFramePrivate::core(mainFrame);
+ if (!frame->view())
+ return;
+
+ bool accepted = false;
+ PlatformMouseEvent mev(ev, 2);
+ // ignore the event if we can't map Qt's mouse buttons to WebCore::MouseButton
+ if (mev.button() != NoButton)
+ accepted = frame->eventHandler()->handleMousePressEvent(mev);
+ ev->setAccepted(accepted);
+
+ tripleClickTimer.start(QApplication::doubleClickInterval(), q);
+ tripleClick = ev->pos().toPoint();
}
void QWebPagePrivate::mouseDoubleClickEvent(QMouseEvent *ev)
@@ -628,7 +793,7 @@ void QWebPagePrivate::mouseDoubleClickEvent(QMouseEvent *ev)
tripleClick = ev->pos();
}
-void QWebPagePrivate::mouseTripleClickEvent(QMouseEvent *ev)
+void QWebPagePrivate::mouseTripleClickEvent(QGraphicsSceneMouseEvent *ev)
{
WebCore::Frame* frame = QWebFramePrivate::core(mainFrame);
if (!frame->view())
@@ -642,30 +807,33 @@ void QWebPagePrivate::mouseTripleClickEvent(QMouseEvent *ev)
ev->setAccepted(accepted);
}
-void QWebPagePrivate::mouseReleaseEvent(QMouseEvent *ev)
+void QWebPagePrivate::mouseTripleClickEvent(QMouseEvent *ev)
{
WebCore::Frame* frame = QWebFramePrivate::core(mainFrame);
if (!frame->view())
return;
bool accepted = false;
- PlatformMouseEvent mev(ev, 0);
+ PlatformMouseEvent mev(ev, 3);
// ignore the event if we can't map Qt's mouse buttons to WebCore::MouseButton
if (mev.button() != NoButton)
- accepted = frame->eventHandler()->handleMouseReleaseEvent(mev);
+ accepted = frame->eventHandler()->handleMousePressEvent(mev);
ev->setAccepted(accepted);
+}
+void QWebPagePrivate::handleClipboard(QEvent* ev, Qt::MouseButton button)
+{
#ifndef QT_NO_CLIPBOARD
if (QApplication::clipboard()->supportsSelection()) {
bool oldSelectionMode = Pasteboard::generalPasteboard()->isSelectionMode();
Pasteboard::generalPasteboard()->setSelectionMode(true);
WebCore::Frame* focusFrame = page->focusController()->focusedOrMainFrame();
- if (ev->button() == Qt::LeftButton) {
+ if (button == Qt::LeftButton) {
if (focusFrame && (focusFrame->editor()->canCopy() || focusFrame->editor()->canDHTMLCopy())) {
focusFrame->editor()->copy();
ev->setAccepted(true);
}
- } else if (ev->button() == Qt::MidButton) {
+ } else if (button == Qt::MidButton) {
if (focusFrame && (focusFrame->editor()->canPaste() || focusFrame->editor()->canDHTMLPaste())) {
focusFrame->editor()->paste();
ev->setAccepted(true);
@@ -676,12 +844,68 @@ void QWebPagePrivate::mouseReleaseEvent(QMouseEvent *ev)
#endif
}
+void QWebPagePrivate::mouseReleaseEvent(QGraphicsSceneMouseEvent* ev)
+{
+ WebCore::Frame* frame = QWebFramePrivate::core(mainFrame);
+ if (!frame->view())
+ return;
+
+ bool accepted = false;
+ PlatformMouseEvent mev(ev, 0);
+ // ignore the event if we can't map Qt's mouse buttons to WebCore::MouseButton
+ if (mev.button() != NoButton)
+ accepted = frame->eventHandler()->handleMouseReleaseEvent(mev);
+ ev->setAccepted(accepted);
+
+ handleClipboard(ev, ev->button());
+ handleSoftwareInputPanel(ev->button());
+}
+
+void QWebPagePrivate::handleSoftwareInputPanel(Qt::MouseButton button)
+{
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+ Frame* frame = page->focusController()->focusedFrame();
+ if (!frame)
+ return;
+
+ if (client && client->inputMethodEnabled()
+ && frame->document()->focusedNode()
+ && button == Qt::LeftButton && qApp->autoSipEnabled()) {
+ QStyle::RequestSoftwareInputPanel behavior = QStyle::RequestSoftwareInputPanel(
+ client->ownerWidget()->style()->styleHint(QStyle::SH_RequestSoftwareInputPanel));
+ if (!clickCausedFocus || behavior == QStyle::RSIP_OnMouseClick) {
+ QEvent event(QEvent::RequestSoftwareInputPanel);
+ QApplication::sendEvent(client->ownerWidget(), &event);
+ }
+ }
+
+ clickCausedFocus = false;
+#endif
+}
+
+void QWebPagePrivate::mouseReleaseEvent(QMouseEvent *ev)
+{
+ WebCore::Frame* frame = QWebFramePrivate::core(mainFrame);
+ if (!frame->view())
+ return;
+
+ bool accepted = false;
+ PlatformMouseEvent mev(ev, 0);
+ // ignore the event if we can't map Qt's mouse buttons to WebCore::MouseButton
+ if (mev.button() != NoButton)
+ accepted = frame->eventHandler()->handleMouseReleaseEvent(mev);
+ ev->setAccepted(accepted);
+
+ handleClipboard(ev, ev->button());
+ handleSoftwareInputPanel(ev->button());
+}
+
#ifndef QT_NO_CONTEXTMENU
-void QWebPagePrivate::contextMenuEvent(QContextMenuEvent *ev)
+void QWebPagePrivate::contextMenuEvent(const QPoint& globalPos)
{
QMenu *menu = q->createStandardContextMenu();
if (menu) {
- menu->exec(ev->globalPos());
+ menu->exec(globalPos);
delete menu;
}
}
@@ -706,6 +930,17 @@ QMenu *QWebPage::createStandardContextMenu()
}
#ifndef QT_NO_WHEELEVENT
+void QWebPagePrivate::wheelEvent(QGraphicsSceneWheelEvent* ev)
+{
+ WebCore::Frame* frame = QWebFramePrivate::core(mainFrame);
+ if (!frame->view())
+ return;
+
+ WebCore::PlatformWheelEvent pev(ev);
+ bool accepted = frame->eventHandler()->handleWheelEvent(pev);
+ ev->setAccepted(accepted);
+}
+
void QWebPagePrivate::wheelEvent(QWheelEvent *ev)
{
WebCore::Frame* frame = QWebFramePrivate::core(mainFrame);
@@ -776,7 +1011,6 @@ void QWebPagePrivate::keyPressEvent(QKeyEvent *ev)
{
bool handled = false;
WebCore::Frame* frame = page->focusController()->focusedOrMainFrame();
- WebCore::Editor* editor = frame->editor();
// we forward the key event to WebCore first to handle potential DOM
// defined event handlers and later on end up in EditorClientQt::handleKeyboardEvent
// to trigger editor commands via triggerAction().
@@ -785,10 +1019,9 @@ void QWebPagePrivate::keyPressEvent(QKeyEvent *ev)
if (!handled) {
handled = true;
QFont defaultFont;
- if (view)
- defaultFont = view->font();
+ if (q->view())
+ defaultFont = q->view()->font();
QFontMetrics fm(defaultFont);
- int fontHeight = fm.height();
if (!handleScrolling(ev, frame)) {
switch (ev->key()) {
case Qt::Key_Back:
@@ -831,18 +1064,16 @@ void QWebPagePrivate::keyReleaseEvent(QKeyEvent *ev)
ev->setAccepted(handled);
}
-void QWebPagePrivate::focusInEvent(QFocusEvent *ev)
+void QWebPagePrivate::focusInEvent(QFocusEvent*)
{
FocusController *focusController = page->focusController();
- Frame *frame = focusController->focusedFrame();
focusController->setActive(true);
- if (frame)
- focusController->setFocused(true);
- else
+ focusController->setFocused(true);
+ if (!focusController->focusedFrame())
focusController->setFocusedFrame(QWebFramePrivate::core(mainFrame));
}
-void QWebPagePrivate::focusOutEvent(QFocusEvent *ev)
+void QWebPagePrivate::focusOutEvent(QFocusEvent*)
{
// only set the focused frame inactive so that we stop painting the caret
// and the focus frame. But don't tell the focus controller so that upon
@@ -852,7 +1083,19 @@ void QWebPagePrivate::focusOutEvent(QFocusEvent *ev)
focusController->setFocused(false);
}
-void QWebPagePrivate::dragEnterEvent(QDragEnterEvent *ev)
+void QWebPagePrivate::dragEnterEvent(QGraphicsSceneDragDropEvent* ev)
+{
+#ifndef QT_NO_DRAGANDDROP
+ DragData dragData(ev->mimeData(), ev->pos().toPoint(),
+ QCursor::pos(), dropActionToDragOp(ev->possibleActions()));
+ Qt::DropAction action = dragOpToDropAction(page->dragController()->dragEntered(&dragData));
+ ev->setDropAction(action);
+ if (action != Qt::IgnoreAction)
+ ev->accept();
+#endif
+}
+
+void QWebPagePrivate::dragEnterEvent(QDragEnterEvent* ev)
{
#ifndef QT_NO_DRAGANDDROP
DragData dragData(ev->mimeData(), ev->pos(), QCursor::pos(),
@@ -864,7 +1107,16 @@ void QWebPagePrivate::dragEnterEvent(QDragEnterEvent *ev)
#endif
}
-void QWebPagePrivate::dragLeaveEvent(QDragLeaveEvent *ev)
+void QWebPagePrivate::dragLeaveEvent(QGraphicsSceneDragDropEvent* ev)
+{
+#ifndef QT_NO_DRAGANDDROP
+ DragData dragData(0, IntPoint(), QCursor::pos(), DragOperationNone);
+ page->dragController()->dragExited(&dragData);
+ ev->accept();
+#endif
+}
+
+void QWebPagePrivate::dragLeaveEvent(QDragLeaveEvent* ev)
{
#ifndef QT_NO_DRAGANDDROP
DragData dragData(0, IntPoint(), QCursor::pos(), DragOperationNone);
@@ -873,7 +1125,19 @@ void QWebPagePrivate::dragLeaveEvent(QDragLeaveEvent *ev)
#endif
}
-void QWebPagePrivate::dragMoveEvent(QDragMoveEvent *ev)
+void QWebPagePrivate::dragMoveEvent(QGraphicsSceneDragDropEvent* ev)
+{
+#ifndef QT_NO_DRAGANDDROP
+ DragData dragData(ev->mimeData(), ev->pos().toPoint(),
+ QCursor::pos(), dropActionToDragOp(ev->possibleActions()));
+ Qt::DropAction action = dragOpToDropAction(page->dragController()->dragUpdated(&dragData));
+ ev->setDropAction(action);
+ if (action != Qt::IgnoreAction)
+ ev->accept();
+#endif
+}
+
+void QWebPagePrivate::dragMoveEvent(QDragMoveEvent* ev)
{
#ifndef QT_NO_DRAGANDDROP
DragData dragData(ev->mimeData(), ev->pos(), QCursor::pos(),
@@ -885,7 +1149,18 @@ void QWebPagePrivate::dragMoveEvent(QDragMoveEvent *ev)
#endif
}
-void QWebPagePrivate::dropEvent(QDropEvent *ev)
+void QWebPagePrivate::dropEvent(QGraphicsSceneDragDropEvent* ev)
+{
+#ifndef QT_NO_DRAGANDDROP
+ DragData dragData(ev->mimeData(), ev->pos().toPoint(),
+ QCursor::pos(), dropActionToDragOp(ev->possibleActions()));
+ Qt::DropAction action = dragOpToDropAction(page->dragController()->performDrag(&dragData));
+ if (action != Qt::IgnoreAction)
+ ev->accept();
+#endif
+}
+
+void QWebPagePrivate::dropEvent(QDropEvent* ev)
{
#ifndef QT_NO_DRAGANDDROP
DragData dragData(ev->mimeData(), ev->pos(), QCursor::pos(),
@@ -896,7 +1171,7 @@ void QWebPagePrivate::dropEvent(QDropEvent *ev)
#endif
}
-void QWebPagePrivate::leaveEvent(QEvent *ev)
+void QWebPagePrivate::leaveEvent(QEvent*)
{
// Fake a mouse move event just outside of the widget, since all
// the interesting mouse-out behavior like invalidating scrollbars
@@ -939,13 +1214,53 @@ void QWebPagePrivate::inputMethodEvent(QInputMethodEvent *ev)
return;
}
+ RenderObject* renderer = 0;
+ RenderTextControl* renderTextControl = 0;
+
+ if (frame->selection()->rootEditableElement())
+ renderer = frame->selection()->rootEditableElement()->shadowAncestorNode()->renderer();
+
+ if (renderer && renderer->isTextControl())
+ renderTextControl = toRenderTextControl(renderer);
+
+ Vector<CompositionUnderline> underlines;
+
+ for (int i = 0; i < ev->attributes().size(); ++i) {
+ const QInputMethodEvent::Attribute& a = ev->attributes().at(i);
+ switch (a.type) {
+ case QInputMethodEvent::TextFormat: {
+ QTextCharFormat textCharFormat = a.value.value<QTextFormat>().toCharFormat();
+ QColor qcolor = textCharFormat.underlineColor();
+ underlines.append(CompositionUnderline(a.start, a.length, Color(makeRGBA(qcolor.red(), qcolor.green(), qcolor.blue(), qcolor.alpha())), false));
+ break;
+ }
+ case QInputMethodEvent::Cursor: {
+ frame->setCaretVisible(a.length); //if length is 0 cursor is invisible
+ if (a.length > 0) {
+ RenderObject* caretRenderer = frame->selection()->caretRenderer();
+ if (caretRenderer) {
+ QColor qcolor = a.value.value<QColor>();
+ caretRenderer->style()->setColor(Color(makeRGBA(qcolor.red(), qcolor.green(), qcolor.blue(), qcolor.alpha())));
+ }
+ }
+ break;
+ }
+#if QT_VERSION >= 0x040600
+ case QInputMethodEvent::Selection: {
+ if (renderTextControl) {
+ renderTextControl->setSelectionStart(a.start);
+ renderTextControl->setSelectionEnd(a.start + a.length);
+ }
+ break;
+ }
+#endif
+ }
+ }
+
if (!ev->commitString().isEmpty())
editor->confirmComposition(ev->commitString());
- else {
+ else if (!ev->preeditString().isEmpty()) {
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));
editor->setComposition(preedit, underlines, preedit.length(), 0);
}
ev->accept();
@@ -1048,44 +1363,138 @@ bool QWebPagePrivate::handleScrolling(QKeyEvent *ev, Frame *frame)
*/
QVariant QWebPage::inputMethodQuery(Qt::InputMethodQuery property) const
{
+ Frame* frame = d->page->focusController()->focusedFrame();
+ if (!frame)
+ return QVariant();
+
+ WebCore::Editor* editor = frame->editor();
+
+ RenderObject* renderer = 0;
+ RenderTextControl* renderTextControl = 0;
+
+ if (frame->selection()->rootEditableElement())
+ renderer = frame->selection()->rootEditableElement()->shadowAncestorNode()->renderer();
+
+ if (renderer && renderer->isTextControl())
+ renderTextControl = toRenderTextControl(renderer);
+
switch (property) {
- case Qt::ImMicroFocus: {
- Frame *frame = d->page->focusController()->focusedFrame();
- if (frame)
+ case Qt::ImMicroFocus: {
return QVariant(frame->selection()->absoluteCaretBounds());
- return QVariant();
- }
- case Qt::ImFont: {
- QWebView *webView = qobject_cast<QWebView *>(d->view);
- if (webView)
- return QVariant(webView->font());
- return QVariant();
- }
- case Qt::ImCursorPosition: {
- Frame *frame = d->page->focusController()->focusedFrame();
- if (frame) {
- VisibleSelection selection = frame->selection()->selection();
- if (selection.isCaret())
- return QVariant(selection.start().deprecatedEditingOffset());
}
- return QVariant();
- }
- case Qt::ImSurroundingText: {
- Frame *frame = d->page->focusController()->focusedFrame();
- if (frame) {
- Document *document = frame->document();
- if (document->focusedNode())
- return QVariant(document->focusedNode()->nodeValue());
+ case Qt::ImFont: {
+ if (renderTextControl) {
+ RenderStyle* renderStyle = renderTextControl->style();
+ return QVariant(QFont(renderStyle->font().font()));
+ }
+ return QVariant(QFont());
}
- return QVariant();
+ case Qt::ImCursorPosition: {
+ if (renderTextControl) {
+ if (editor->hasComposition()) {
+ RefPtr<Range> range = editor->compositionRange();
+ return QVariant(renderTextControl->selectionEnd() - TextIterator::rangeLength(range.get()));
+ }
+ return QVariant(renderTextControl->selectionEnd());
+ }
+ return QVariant();
+ }
+ case Qt::ImSurroundingText: {
+ if (renderTextControl) {
+ QString text = renderTextControl->text();
+ RefPtr<Range> range = editor->compositionRange();
+ if (range) {
+ text.remove(range->startPosition().offsetInContainerNode(), TextIterator::rangeLength(range.get()));
+ }
+ return QVariant(text);
+ }
+ return QVariant();
+ }
+ case Qt::ImCurrentSelection: {
+ if (renderTextControl) {
+ int start = renderTextControl->selectionStart();
+ int end = renderTextControl->selectionEnd();
+ if (end > start)
+ return QVariant(QString(renderTextControl->text()).mid(start,end-start));
+ }
+ return QVariant();
+
+ }
+#if QT_VERSION >= 0x040600
+ case Qt::ImAnchorPosition: {
+ if (renderTextControl) {
+ if (editor->hasComposition()) {
+ RefPtr<Range> range = editor->compositionRange();
+ return QVariant(renderTextControl->selectionStart() - TextIterator::rangeLength(range.get()));
+ }
+ return QVariant(renderTextControl->selectionStart());
+ }
+ return QVariant();
+ }
+ case Qt::ImMaximumTextLength: {
+ if (frame->selection()->isContentEditable()) {
+ if (frame->document() && frame->document()->focusedNode()) {
+ if (frame->document()->focusedNode()->hasTagName(HTMLNames::inputTag)) {
+ HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(frame->document()->focusedNode());
+ return QVariant(inputElement->maxLength());
+ }
+ }
+ return QVariant(InputElement::s_maximumLength);
+ }
+ return QVariant(0);
+ }
+#endif
+ default:
+ return QVariant();
}
- case Qt::ImCurrentSelection:
- return QVariant(selectedText());
- default:
- return QVariant();
+}
+
+/*!
+ \internal
+*/
+void QWebPagePrivate::setInspector(QWebInspector* insp)
+{
+ if (inspector)
+ inspector->d->setFrontend(0);
+
+ if (inspectorIsInternalOnly) {
+ QWebInspector* inspToDelete = inspector;
+ inspector = 0;
+ inspectorIsInternalOnly = false;
+ delete inspToDelete; // Delete after to prevent infinite recursion
+ }
+
+ inspector = insp;
+
+ // Give inspector frontend web view if previously created
+ if (inspector && inspectorFrontend)
+ inspector->d->setFrontend(inspectorFrontend);
+}
+
+/*!
+ \internal
+ Returns the inspector and creates it if it wasn't created yet.
+ The instance created here will not be available through QWebPage's API.
+*/
+QWebInspector* QWebPagePrivate::getOrCreateInspector()
+{
+ if (!inspector) {
+ QWebInspector* insp = new QWebInspector;
+ insp->setPage(q);
+ inspectorIsInternalOnly = true;
+
+ Q_ASSERT(inspector); // Associated through QWebInspector::setPage(q)
}
+ return inspector;
}
+/*! \internal */
+InspectorController* QWebPagePrivate::inspectorController()
+{
+ return page->inspectorController();
+}
+
+
/*!
\enum QWebPage::FindFlag
@@ -1224,6 +1633,8 @@ QVariant QWebPage::inputMethodQuery(Qt::InputMethodQuery property) const
\since 4.4
\brief The QWebPage class provides an object to view and edit web documents.
+ \inmodule QtWebKit
+
QWebPage holds a main frame responsible for web content, settings, the history
of navigated links and actions. This class can be used, together with QWebFrame,
to provide functionality like QWebView in a widget-less environment.
@@ -1274,7 +1685,7 @@ QVariant QWebPage::inputMethodQuery(Qt::InputMethodQuery property) const
*/
/*!
- Constructs an empty QWebView with parent \a parent.
+ Constructs an empty QWebPage with parent \a parent.
*/
QWebPage::QWebPage(QObject *parent)
: QObject(parent)
@@ -1293,9 +1704,12 @@ QWebPage::QWebPage(QObject *parent)
*/
QWebPage::~QWebPage()
{
+ d->createMainFrame();
FrameLoader *loader = d->mainFrame->d->frame->loader();
if (loader)
loader->detachFromParent();
+ if (d->inspector)
+ d->inspector->setPage(0);
delete d;
}
@@ -1320,6 +1734,7 @@ QWebFrame *QWebPage::mainFrame() const
*/
QWebFrame *QWebPage::currentFrame() const
{
+ d->createMainFrame();
return static_cast<WebCore::FrameLoaderClientQt *>(d->page->focusController()->focusedOrMainFrame()->loader()->client())->webFrame();
}
@@ -1345,6 +1760,7 @@ QWebFrame* QWebPage::frameAt(const QPoint& pos) const
*/
QWebHistory *QWebPage::history() const
{
+ d->createMainFrame();
return &d->history;
}
@@ -1355,8 +1771,19 @@ QWebHistory *QWebPage::history() const
*/
void QWebPage::setView(QWidget *view)
{
- d->view = view;
- setViewportSize(view ? view->size() : QSize(0, 0));
+ if (this->view() != view) {
+ d->view = view;
+ if (!view) {
+ delete d->client;
+ d->client = 0;
+ } else {
+ if (!d->client)
+ d->client = new QWebPageWidgetClient(view);
+ else
+ static_cast<QWebPageWidgetClient*>(d->client)->view = view;
+ }
+ setViewportSize(view ? view->size() : QSize(0, 0));
+ }
}
/*!
@@ -1366,7 +1793,11 @@ void QWebPage::setView(QWidget *view)
*/
QWidget *QWebPage::view() const
{
+#if QT_VERSION < 0x040600
return d->view;
+#else
+ return d->view.data();
+#endif
}
/*!
@@ -1391,8 +1822,9 @@ void QWebPage::javaScriptConsoleMessage(const QString& message, int lineNumber,
*/
void QWebPage::javaScriptAlert(QWebFrame *frame, const QString& msg)
{
+ Q_UNUSED(frame)
#ifndef QT_NO_MESSAGEBOX
- QMessageBox::information(d->view, tr("JavaScript Alert - %1").arg(mainFrame()->url().host()), msg, QMessageBox::Ok);
+ QMessageBox::information(view(), tr("JavaScript Alert - %1").arg(mainFrame()->url().host()), msg, QMessageBox::Ok);
#endif
}
@@ -1404,10 +1836,11 @@ void QWebPage::javaScriptAlert(QWebFrame *frame, const QString& msg)
*/
bool QWebPage::javaScriptConfirm(QWebFrame *frame, const QString& msg)
{
+ Q_UNUSED(frame)
#ifdef QT_NO_MESSAGEBOX
return true;
#else
- return QMessageBox::Yes == QMessageBox::information(d->view, tr("JavaScript Confirm - %1").arg(mainFrame()->url().host()), msg, QMessageBox::Yes, QMessageBox::No);
+ return QMessageBox::Yes == QMessageBox::information(view(), tr("JavaScript Confirm - %1").arg(mainFrame()->url().host()), msg, QMessageBox::Yes, QMessageBox::No);
#endif
}
@@ -1422,9 +1855,10 @@ bool QWebPage::javaScriptConfirm(QWebFrame *frame, const QString& msg)
*/
bool QWebPage::javaScriptPrompt(QWebFrame *frame, const QString& msg, const QString& defaultValue, QString* result)
{
+ Q_UNUSED(frame)
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);
+ QString x = QInputDialog::getText(view(), tr("JavaScript Prompt - %1").arg(mainFrame()->url().host()), msg, QLineEdit::Normal, defaultValue, &ok);
if (ok && result)
*result = x;
#endif
@@ -1449,7 +1883,7 @@ bool QWebPage::shouldInterruptJavaScript()
#ifdef QT_NO_MESSAGEBOX
return false;
#else
- return QMessageBox::Yes == QMessageBox::information(d->view, tr("JavaScript Problem - %1").arg(mainFrame()->url().host()), tr("The script on this page appears to have a problem. Do you want to stop the script?"), QMessageBox::Yes, QMessageBox::No);
+ return QMessageBox::Yes == QMessageBox::information(view(), tr("JavaScript Problem - %1").arg(mainFrame()->url().host()), tr("The script on this page appears to have a problem. Do you want to stop the script?"), QMessageBox::Yes, QMessageBox::No);
#endif
}
@@ -1466,7 +1900,7 @@ bool QWebPage::shouldInterruptJavaScript()
*/
QWebPage *QWebPage::createWindow(WebWindowType type)
{
- QWebView *webView = qobject_cast<QWebView *>(d->view);
+ QWebView *webView = qobject_cast<QWebView *>(view());
if (webView) {
QWebView *newView = webView->createWindow(type);
if (newView)
@@ -1515,7 +1949,7 @@ static void openNewWindow(const QUrl& url, WebCore::Frame* frame)
\sa action()
*/
-void QWebPage::triggerAction(WebAction action, bool checked)
+void QWebPage::triggerAction(WebAction action, bool)
{
WebCore::Frame *frame = d->page->focusController()->focusedOrMainFrame();
if (!frame)
@@ -1529,7 +1963,7 @@ void QWebPage::triggerAction(WebAction action, bool checked)
WTF::RefPtr<WebCore::Frame> wcFrame = targetFrame->d->frame;
targetFrame->d->frame->loader()->loadFrameRequest(frameLoadRequest(d->hitTestResult.linkUrl(), wcFrame.get()),
/*lockHistory*/ false, /*lockBackForwardList*/ false, /*event*/ 0,
- /*FormState*/ 0);
+ /*FormState*/ 0, SendReferrer);
break;
}
// fall through
@@ -1591,12 +2025,14 @@ void QWebPage::triggerAction(WebAction action, bool checked)
case SetTextDirectionRightToLeft:
editor->setBaseWritingDirection(RightToLeftWritingDirection);
break;
- case InspectElement:
- if (!d->hitTestResult.isNull())
+ case InspectElement: {
+ if (!d->hitTestResult.isNull()) {
+ d->getOrCreateInspector(); // Make sure the inspector is created
+ d->inspector->show(); // The inspector is expected to be shown on inspection
d->page->inspectorController()->inspect(d->hitTestResult.d->innerNonSharedNode.get());
- else
- d->page->inspectorController()->show();
+ }
break;
+ }
default:
command = QWebPagePrivate::editorCommandForWebActions(action);
break;
@@ -1637,7 +2073,7 @@ void QWebPage::setViewportSize(const QSize &size) const
}
}
-QSize QWebPage::fixedContentsSize() const
+QSize QWebPage::preferredContentsSize() const
{
QWebFrame* frame = d->mainFrame;
if (frame) {
@@ -1650,7 +2086,7 @@ QSize QWebPage::fixedContentsSize() const
}
/*!
- \property QWebPage::fixedContentsSize
+ \property QWebPage::preferredContentsSize
\since 4.6
\brief the size of the fixed layout
@@ -1658,7 +2094,7 @@ QSize QWebPage::fixedContentsSize() const
1024x768 for example then webkit will layout the page as if the viewport were that size
rather than something different.
*/
-void QWebPage::setFixedContentsSize(const QSize &size) const
+void QWebPage::setPreferredContentsSize(const QSize &size) const
{
d->fixedLayoutSize = size;
@@ -1697,6 +2133,7 @@ bool QWebPage::acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &
bool QWebPage::acceptNavigationRequest(QWebFrame *frame, const QWebNetworkRequest &request, QWebPage::NavigationType type)
#endif
{
+ Q_UNUSED(frame)
if (type == NavigationTypeLinkClicked) {
switch (d->linkPolicy) {
case DontDelegateLinks:
@@ -1726,6 +2163,7 @@ bool QWebPage::acceptNavigationRequest(QWebFrame *frame, const QWebNetworkReques
*/
QString QWebPage::selectedText() const
{
+ d->createMainFrame();
return d->page->focusController()->focusedOrMainFrame()->selectedText();
}
@@ -2051,24 +2489,42 @@ bool QWebPage::event(QEvent *ev)
case QEvent::MouseMove:
d->mouseMoveEvent(static_cast<QMouseEvent*>(ev));
break;
+ case QEvent::GraphicsSceneMouseMove:
+ d->mouseMoveEvent(static_cast<QGraphicsSceneMouseEvent*>(ev));
+ break;
case QEvent::MouseButtonPress:
d->mousePressEvent(static_cast<QMouseEvent*>(ev));
break;
+ case QEvent::GraphicsSceneMousePress:
+ d->mousePressEvent(static_cast<QGraphicsSceneMouseEvent*>(ev));
+ break;
case QEvent::MouseButtonDblClick:
d->mouseDoubleClickEvent(static_cast<QMouseEvent*>(ev));
break;
+ case QEvent::GraphicsSceneMouseDoubleClick:
+ d->mouseDoubleClickEvent(static_cast<QGraphicsSceneMouseEvent*>(ev));
+ break;
case QEvent::MouseButtonRelease:
d->mouseReleaseEvent(static_cast<QMouseEvent*>(ev));
break;
+ case QEvent::GraphicsSceneMouseRelease:
+ d->mouseReleaseEvent(static_cast<QGraphicsSceneMouseEvent*>(ev));
+ break;
#ifndef QT_NO_CONTEXTMENU
case QEvent::ContextMenu:
- d->contextMenuEvent(static_cast<QContextMenuEvent*>(ev));
+ d->contextMenuEvent(static_cast<QContextMenuEvent*>(ev)->globalPos());
+ break;
+ case QEvent::GraphicsSceneContextMenu:
+ d->contextMenuEvent(static_cast<QGraphicsSceneContextMenuEvent*>(ev)->screenPos());
break;
#endif
#ifndef QT_NO_WHEELEVENT
case QEvent::Wheel:
d->wheelEvent(static_cast<QWheelEvent*>(ev));
break;
+ case QEvent::GraphicsSceneWheel:
+ d->wheelEvent(static_cast<QGraphicsSceneWheelEvent*>(ev));
+ break;
#endif
case QEvent::KeyPress:
d->keyPressEvent(static_cast<QKeyEvent*>(ev));
@@ -2086,15 +2542,27 @@ bool QWebPage::event(QEvent *ev)
case QEvent::DragEnter:
d->dragEnterEvent(static_cast<QDragEnterEvent*>(ev));
break;
+ case QEvent::GraphicsSceneDragEnter:
+ d->dragEnterEvent(static_cast<QGraphicsSceneDragDropEvent*>(ev));
+ break;
case QEvent::DragLeave:
d->dragLeaveEvent(static_cast<QDragLeaveEvent*>(ev));
break;
+ case QEvent::GraphicsSceneDragLeave:
+ d->dragLeaveEvent(static_cast<QGraphicsSceneDragDropEvent*>(ev));
+ break;
case QEvent::DragMove:
d->dragMoveEvent(static_cast<QDragMoveEvent*>(ev));
break;
+ case QEvent::GraphicsSceneDragMove:
+ d->dragMoveEvent(static_cast<QGraphicsSceneDragDropEvent*>(ev));
+ break;
case QEvent::Drop:
d->dropEvent(static_cast<QDropEvent*>(ev));
break;
+ case QEvent::GraphicsSceneDrop:
+ d->dropEvent(static_cast<QGraphicsSceneDragDropEvent*>(ev));
+ break;
#endif
case QEvent::InputMethod:
d->inputMethodEvent(static_cast<QInputMethodEvent*>(ev));
@@ -2251,6 +2719,7 @@ void QWebPage::updatePositionDependentActions(const QPoint &pos)
}
}
+ d->createMainFrame();
WebCore::Frame* focusedFrame = d->page->focusController()->focusedOrMainFrame();
HitTestResult result = focusedFrame->eventHandler()->hitTestResultAtPoint(focusedFrame->view()->windowToContents(pos), /*allowShadowContent*/ false);
@@ -2300,6 +2769,17 @@ void QWebPage::updatePositionDependentActions(const QPoint &pos)
as a result of the user clicking on a "file upload" button in a HTML form where multiple
file selection is allowed.
+ \omitvalue ErrorPageExtension (introduced in Qt 4.6)
+*/
+
+/*!
+ \enum QWebPage::ErrorDomain
+ \since 4.6
+ \internal
+
+ \value QtNetwork
+ \value Http
+ \value WebKit
*/
/*!
@@ -2307,15 +2787,62 @@ void QWebPage::updatePositionDependentActions(const QPoint &pos)
\since 4.4
\brief The ExtensionOption class provides an extended input argument to QWebPage's extension support.
+ \inmodule QtWebKit
+
\sa QWebPage::extension()
*/
/*!
+ \class QWebPage::ErrorPageExtensionOption
+ \since 4.6
+ \brief The ErrorPageExtensionOption class describes the option
+ for the error page extension.
+
+ \inmodule QtWebKit
+
+ The ErrorPageExtensionOption class holds the \a url for which an error occoured as well as
+ the associated \a frame.
+
+ The error itself is reported by an error \a domain, the \a error code as well as \a errorString.
+
+ \sa QWebPage::ErrorPageExtensionReturn
+*/
+
+/*!
+ \class QWebPage::ErrorPageExtensionReturn
+ \since 4.6
+ \brief The ErrorPageExtensionReturn describes the error page, which will be shown for the
+ frame for which the error occured.
+
+ \inmodule QtWebKit
+
+ The ErrorPageExtensionReturn class holds the data needed for creating an error page. Some are
+ optional such as \a contentType, which defaults to "text/html", as well as the \a encoding, which
+ is assumed to be UTF-8 if not indicated otherwise.
+
+ The error page is stored in the \a content byte array, as HTML content. In order to convert a
+ QString to a byte array, the QString::toUtf8() method can be used.
+
+ External objects such as stylesheets or images referenced in the HTML are located relative to
+ \a baseUrl.
+
+ \sa QWebPage::ErrorPageExtensionOption, QString::toUtf8()
+*/
+
+/*!
+ \fn QWebPage::ErrorPageExtensionReturn::ErrorPageExtensionReturn()
+
+ Constructs a new error page object.
+*/
+
+/*!
\class QWebPage::ChooseMultipleFilesExtensionOption
\since 4.5
\brief The ChooseMultipleFilesExtensionOption class describes the option
for the multiple files selection extension.
+ \inmodule QtWebKit
+
The ChooseMultipleFilesExtensionOption class holds the frame originating the request
and the suggested filenames which might be provided.
@@ -2328,6 +2855,8 @@ void QWebPage::updatePositionDependentActions(const QPoint &pos)
\brief The ChooseMultipleFilesExtensionReturn describes the return value
for the multiple files selection extension.
+ \inmodule QtWebKit
+
The ChooseMultipleFilesExtensionReturn class holds the filenames selected by the user
when the extension is invoked.
@@ -2352,7 +2881,7 @@ bool QWebPage::extension(Extension extension, const ExtensionOption *option, Ext
if (extension == ChooseMultipleFilesExtension) {
// FIXME: do not ignore suggestedFiles
QStringList suggestedFiles = static_cast<const ChooseMultipleFilesExtensionOption*>(option)->suggestedFileNames;
- QStringList names = QFileDialog::getOpenFileNames(d->view, QString::null);
+ QStringList names = QFileDialog::getOpenFileNames(view(), QString::null);
static_cast<ChooseMultipleFilesExtensionReturn*>(output)->fileNames = names;
return true;
}
@@ -2432,8 +2961,9 @@ QWebSettings *QWebPage::settings() const
*/
QString QWebPage::chooseFile(QWebFrame *parentFrame, const QString& suggestedFile)
{
+ Q_UNUSED(parentFrame)
#ifndef QT_NO_FILEDIALOG
- return QFileDialog::getOpenFileName(d->view, QString::null, suggestedFile);
+ return QFileDialog::getOpenFileName(view(), QString::null, suggestedFile);
#else
return QString::null;
#endif
@@ -2472,6 +3002,9 @@ QNetworkProxy QWebPage::networkProxy() const
Sets the QNetworkAccessManager \a manager responsible for serving network requests for this
QWebPage.
+ \note It is currently not supported to change the network access manager after the
+ QWebPage has used it. The results of doing this are undefined.
+
\sa networkAccessManager()
*/
void QWebPage::setNetworkAccessManager(QNetworkAccessManager *manager)
@@ -2530,7 +3063,7 @@ QWebPluginFactory *QWebPage::pluginFactory() const
The default implementation returns the following value:
- "Mozilla/5.0 (%Platform%; %Security%; %Subplatform%; %Locale%) AppleWebKit/%WebKitVersion% (KHTML, like Gecko, Safari/419.3) %AppVersion"
+ "Mozilla/5.0 (%Platform%; %Security%; %Subplatform%; %Locale%) AppleWebKit/%WebKitVersion% (KHTML, like Gecko) %AppVersion Safari/%WebKitVersion%"
In this string the following values are replaced at run-time:
\list
@@ -2538,7 +3071,7 @@ QWebPluginFactory *QWebPage::pluginFactory() const
\o %Security% expands to U if SSL is enabled, otherwise N. SSL is enabled if QSslSocket::supportsSsl() returns true.
\o %Locale% is replaced with QLocale::name(). The locale is determined from the view of the QWebPage. If no view is set on the QWebPage,
then a default constructed QLocale is used instead.
- \o %WebKitVersion% currently expands to 527+
+ \o %WebKitVersion% is the version of WebKit the application was compiled against.
\o %AppVersion% expands to QCoreApplication::applicationName()/QCoreApplication::applicationVersion() if they're set; otherwise defaulting to Qt and the current Qt version.
\endlist
*/
@@ -2670,6 +3203,11 @@ QString QWebPage::userAgentForUrl(const QUrl& url) const
case QSysInfo::WV_VISTA:
ver = "Windows NT 6.0";
break;
+#if QT_VERSION > 0x040500
+ case QSysInfo::WV_WINDOWS7:
+ ver = "Windows NT 6.1";
+ break;
+#endif
case QSysInfo::WV_CE:
ver = "Windows CE";
break;
@@ -2688,20 +3226,21 @@ QString QWebPage::userAgentForUrl(const QUrl& url) const
// Language
QLocale locale;
- if (d->view)
- locale = d->view->locale();
+ if (view())
+ locale = view()->locale();
QString name = locale.name();
name[2] = QLatin1Char('-');
ua.append(name);
ua.append(QLatin1String(") "));
// webkit/qt version
- ua.append(QLatin1String("AppleWebKit/" WEBKIT_VERSION " (KHTML, like Gecko, Safari/419.3) "));
+ ua.append(QString(QLatin1String("AppleWebKit/%1 (KHTML, like Gecko) "))
+ .arg(QString(qWebKitVersion())));
// Application name/version
QString appName = QCoreApplication::applicationName();
if (!appName.isEmpty()) {
- ua.append(QLatin1Char(' ') + appName);
+ ua.append(appName);
#if QT_VERSION >= 0x040400
QString appVer = QCoreApplication::applicationVersion();
if (!appVer.isEmpty())
@@ -2712,6 +3251,10 @@ QString QWebPage::userAgentForUrl(const QUrl& url) const
ua.append(QLatin1String("Qt/"));
ua.append(QLatin1String(qVersion()));
}
+
+ ua.append(QString(QLatin1String(" Safari/%1"))
+ .arg(qWebKitVersion()));
+
return ua;
}
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h
index 24741a165..8c455b149 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h
@@ -25,18 +25,19 @@
#include "qwebkitglobal.h"
#include <QtCore/qobject.h>
+#include <QtCore/qurl.h>
#include <QtGui/qwidget.h>
QT_BEGIN_NAMESPACE
class QNetworkProxy;
class QUndoStack;
-class QUrl;
class QMenu;
class QNetworkRequest;
class QNetworkReply;
class QNetworkAccessManager;
QT_END_NAMESPACE
+class QWebElement;
class QWebFrame;
class QWebNetworkRequest;
class QWebHistory;
@@ -55,6 +56,7 @@ namespace WebCore {
class InspectorClientQt;
class ResourceHandle;
class HitTestResult;
+ class QNetworkReplyHandler;
struct FrameLoadRequest;
}
@@ -65,7 +67,7 @@ class QWEBKIT_EXPORT QWebPage : public QObject {
Q_PROPERTY(bool modified READ isModified)
Q_PROPERTY(QString selectedText READ selectedText)
Q_PROPERTY(QSize viewportSize READ viewportSize WRITE setViewportSize)
- Q_PROPERTY(QSize fixedContentsSize READ fixedContentsSize WRITE setFixedContentsSize)
+ Q_PROPERTY(QSize preferredContentsSize READ preferredContentsSize WRITE setPreferredContentsSize)
Q_PROPERTY(bool forwardUnsupportedContent READ forwardUnsupportedContent WRITE setForwardUnsupportedContent)
Q_PROPERTY(LinkDelegationPolicy linkDelegationPolicy READ linkDelegationPolicy WRITE setLinkDelegationPolicy)
Q_PROPERTY(QPalette palette READ palette WRITE setPalette)
@@ -235,8 +237,8 @@ public:
QSize viewportSize() const;
void setViewportSize(const QSize &size) const;
- QSize fixedContentsSize() const;
- void setFixedContentsSize(const QSize &size) const;
+ QSize preferredContentsSize() const;
+ void setPreferredContentsSize(const QSize &size) const;
virtual bool event(QEvent*);
bool focusNextPrevChild(bool next);
@@ -265,7 +267,8 @@ public:
QMenu *createStandardContextMenu();
enum Extension {
- ChooseMultipleFilesExtension
+ ChooseMultipleFilesExtension,
+ ErrorPageExtension
};
class ExtensionOption
{};
@@ -283,6 +286,26 @@ public:
QStringList fileNames;
};
+ enum ErrorDomain { QtNetwork, Http, WebKit };
+ class ErrorPageExtensionOption : public ExtensionOption {
+ public:
+ QUrl url;
+ QWebFrame* frame;
+ ErrorDomain domain;
+ int error;
+ QString errorString;
+ };
+
+ class ErrorPageExtensionReturn : public ExtensionReturn {
+ public:
+ ErrorPageExtensionReturn() : contentType(QLatin1String("text/html")), encoding(QLatin1String("utf-8")) {};
+ QString contentType;
+ QString encoding;
+ QUrl baseUrl;
+ QByteArray content;
+ };
+
+
virtual bool extension(Extension extension, const ExtensionOption *option = 0, ExtensionReturn *output = 0);
virtual bool supportsExtension(Extension extension) const;
@@ -343,19 +366,21 @@ protected:
private:
Q_PRIVATE_SLOT(d, void _q_onLoadProgressChanged(int))
Q_PRIVATE_SLOT(d, void _q_webActionTriggered(bool checked))
-#ifndef NDEBUG
Q_PRIVATE_SLOT(d, void _q_cleanupLeakMessages())
-#endif
+
QWebPagePrivate *d;
friend class QWebFrame;
friend class QWebPagePrivate;
friend class QWebView;
+ friend class QGraphicsWebView;
+ friend class QWebInspector;
friend class WebCore::ChromeClientQt;
friend class WebCore::EditorClientQt;
friend class WebCore::FrameLoaderClientQt;
friend class WebCore::InspectorClientQt;
friend class WebCore::ResourceHandle;
+ friend class WebCore::QNetworkReplyHandler;
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QWebPage::FindFlags)
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h
index 87c624d6e..f0f842d09 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h
@@ -25,6 +25,7 @@
#include <qnetworkproxy.h>
#include <qpointer.h>
#include <qevent.h>
+#include <qgraphicssceneevent.h>
#include "qwebpage.h"
#include "qwebhistory.h"
@@ -42,21 +43,10 @@ namespace WebCore {
class ContextMenu;
class EditorClientQt;
class Element;
+ class InspectorController;
class Node;
class Page;
class Frame;
-
-#ifndef QT_NO_CURSOR
- class SetCursorEvent : public QEvent {
- public:
- static const int EventType = 724;
- SetCursorEvent(const QCursor&);
-
- QCursor cursor() const;
- private:
- QCursor m_cursor;
- };
-#endif
}
QT_BEGIN_NAMESPACE
@@ -65,6 +55,9 @@ class QMenu;
class QBitArray;
QT_END_NAMESPACE
+class QWebInspector;
+class QWebPageClient;
+
class QWebPagePrivate {
public:
QWebPagePrivate(QWebPage*);
@@ -75,9 +68,7 @@ public:
#endif
void _q_onLoadProgressChanged(int);
void _q_webActionTriggered(bool checked);
-#ifndef NDEBUG
void _q_cleanupLeakMessages();
-#endif
void updateAction(QWebPage::WebAction action);
void updateNavigationActions();
void updateEditorActions();
@@ -85,32 +76,48 @@ public:
void timerEvent(QTimerEvent*);
void mouseMoveEvent(QMouseEvent*);
+ void mouseMoveEvent(QGraphicsSceneMouseEvent*);
void mousePressEvent(QMouseEvent*);
+ void mousePressEvent(QGraphicsSceneMouseEvent*);
void mouseDoubleClickEvent(QMouseEvent*);
+ void mouseDoubleClickEvent(QGraphicsSceneMouseEvent*);
void mouseTripleClickEvent(QMouseEvent*);
+ void mouseTripleClickEvent(QGraphicsSceneMouseEvent*);
void mouseReleaseEvent(QMouseEvent*);
+ void mouseReleaseEvent(QGraphicsSceneMouseEvent*);
#ifndef QT_NO_CONTEXTMENU
- void contextMenuEvent(QContextMenuEvent*);
+ void contextMenuEvent(const QPoint& globalPos);
#endif
#ifndef QT_NO_WHEELEVENT
void wheelEvent(QWheelEvent*);
+ void wheelEvent(QGraphicsSceneWheelEvent*);
#endif
void keyPressEvent(QKeyEvent*);
void keyReleaseEvent(QKeyEvent*);
void focusInEvent(QFocusEvent*);
void focusOutEvent(QFocusEvent*);
- void dragEnterEvent(QDragEnterEvent *);
- void dragLeaveEvent(QDragLeaveEvent *);
- void dragMoveEvent(QDragMoveEvent *);
- void dropEvent(QDropEvent *);
+ void dragEnterEvent(QDragEnterEvent*);
+ void dragEnterEvent(QGraphicsSceneDragDropEvent*);
+ void dragLeaveEvent(QDragLeaveEvent*);
+ void dragLeaveEvent(QGraphicsSceneDragDropEvent*);
+ void dragMoveEvent(QDragMoveEvent*);
+ void dragMoveEvent(QGraphicsSceneDragDropEvent*);
+ void dropEvent(QDropEvent*);
+ void dropEvent(QGraphicsSceneDragDropEvent*);
void inputMethodEvent(QInputMethodEvent*);
void shortcutOverrideEvent(QKeyEvent*);
- void leaveEvent(QEvent *);
+ void leaveEvent(QEvent*);
+ void handleClipboard(QEvent*, Qt::MouseButton);
+ void handleSoftwareInputPanel(Qt::MouseButton);
bool handleScrolling(QKeyEvent*, WebCore::Frame*);
+ void setInspector(QWebInspector*);
+ QWebInspector* getOrCreateInspector();
+ WebCore::InspectorController* inspectorController();
+
#ifndef QT_NO_SHORTCUT
static QWebPage::WebAction editorActionForKeyEvent(QKeyEvent* event);
#endif
@@ -124,10 +131,16 @@ public:
QPointer<QWebFrame> mainFrame;
QWebPage *q;
+ QWebPageClient* client;
#ifndef QT_NO_UNDOSTACK
QUndoStack *undoStack;
#endif
- QWidget *view;
+
+#if QT_VERSION >= 0x040600
+ QWeakPointer<QWidget> view;
+#else
+ QWidget* view;
+#endif
bool insideOpenCall;
quint64 m_totalBytes;
@@ -136,6 +149,8 @@ public:
QPoint tripleClick;
QBasicTimer tripleClickTimer;
+ bool clickCausedFocus;
+
#if QT_VERSION < 0x040400
bool acceptNavigationRequest(QWebFrame *frame, const QWebNetworkRequest &request, QWebPage::NavigationType type);
@@ -168,6 +183,10 @@ public:
QWebPluginFactory *pluginFactory;
+ QWidget* inspectorFrontend;
+ QWebInspector* inspector;
+ bool inspectorIsInternalOnly; // True if created through the Inspect context menu action
+
static bool drtRun;
};
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebplugindatabase.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebplugindatabase.cpp
new file mode 100644
index 000000000..758e2573d
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebplugindatabase.cpp
@@ -0,0 +1,389 @@
+/*
+ Copyright (C) 2009 Jakub Wieczorek <faw217@gmail.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include "qwebplugindatabase_p.h"
+
+#include "PluginDatabase.h"
+#include "PluginPackage.h"
+
+using namespace WebCore;
+
+/*!
+ \internal
+ \typedef QWebPluginInfo::MimeType
+ \since 4.6
+ \brief Represents a single MIME type supported by a plugin.
+*/
+
+/*!
+ \class QWebPluginInfo
+ \internal
+ \since 4.6
+ \brief The QWebPluginInfo class represents a single Netscape plugin.
+
+ A QWebPluginInfo object represents a Netscape plugin picked up by WebKit
+ and included in the plugin database. This class contains information about
+ the plugin, such as its name(), description(), a list of MIME types that it
+ supports (can be accessed with mimeTypes()) and the path of the plugin
+ file.
+
+ Plugins can be enabled and disabled with setEnabled(). If a plugin is
+ disabled, it will not be used by WebKit to handle supported MIME types. To
+ check if a plugin is enabled or not, use enabled().
+
+ \sa QWebPluginDatabase
+*/
+
+/*!
+ Constructs a null QWebPluginInfo.
+*/
+QWebPluginInfo::QWebPluginInfo()
+ : m_package(0)
+{
+}
+
+QWebPluginInfo::QWebPluginInfo(PluginPackage* package)
+ : m_package(package)
+{
+ if (m_package)
+ m_package->ref();
+}
+
+/*!
+ Contructs a copy of \a other.
+*/
+QWebPluginInfo::QWebPluginInfo(const QWebPluginInfo& other)
+ : m_package(other.m_package)
+{
+ if (m_package)
+ m_package->ref();
+}
+
+/*!
+ Destroys the plugin info.
+*/
+QWebPluginInfo::~QWebPluginInfo()
+{
+ if (m_package)
+ m_package->deref();
+}
+
+/*!
+ Returns the name of the plugin.
+
+ \sa description()
+*/
+QString QWebPluginInfo::name() const
+{
+ if (!m_package)
+ return QString();
+ return m_package->name();
+}
+
+/*!
+ Returns the description of the plugin.
+
+ \sa name()
+*/
+QString QWebPluginInfo::description() const
+{
+ if (!m_package)
+ return QString();
+ return m_package->description();
+}
+
+/*!
+ Returns a list of MIME types supported by the plugin.
+
+ \sa supportsMimeType()
+*/
+QList<QWebPluginInfo::MimeType> QWebPluginInfo::mimeTypes() const
+{
+ if (m_package && m_mimeTypes.isEmpty()) {
+ const MIMEToDescriptionsMap& mimeToDescriptions = m_package->mimeToDescriptions();
+ MIMEToDescriptionsMap::const_iterator end = mimeToDescriptions.end();
+
+ for (MIMEToDescriptionsMap::const_iterator it = mimeToDescriptions.begin(); it != end; ++it) {
+ MimeType mimeType;
+ mimeType.name = it->first;
+ mimeType.description = it->second;
+
+ QStringList fileExtensions;
+ Vector<String> extensions = m_package->mimeToExtensions().get(mimeType.name);
+
+ for (unsigned i = 0; i < extensions.size(); ++i)
+ fileExtensions.append(extensions[i]);
+
+ mimeType.fileExtensions = fileExtensions;
+ m_mimeTypes.append(mimeType);
+ }
+ }
+
+ return m_mimeTypes;
+}
+
+/*!
+ Returns true if the plugin supports a specific \a mimeType; otherwise
+ returns false.
+
+ \sa mimeTypes()
+*/
+bool QWebPluginInfo::supportsMimeType(const QString& mimeType) const
+{
+ if (!m_package)
+ return false;
+ return m_package->mimeToDescriptions().contains(mimeType);
+}
+
+/*!
+ Returns an absolute path to the plugin file.
+*/
+QString QWebPluginInfo::path() const
+{
+ if (!m_package)
+ return QString();
+ return m_package->path();
+}
+
+/*!
+ Returns true if the plugin is a null plugin; otherwise returns false.
+*/
+bool QWebPluginInfo::isNull() const
+{
+ return !m_package;
+}
+
+/*!
+ Enables or disables the plugin, depending on the \a enabled parameter.
+
+ Disabled plugins will not be picked up by WebKit when looking for a plugin
+ supporting a particular MIME type.
+
+ \sa isEnabled()
+*/
+void QWebPluginInfo::setEnabled(bool enabled)
+{
+ if (!m_package)
+ return;
+ m_package->setEnabled(enabled);
+}
+
+/*!
+ Returns true if the plugin is enabled; otherwise returns false.
+
+ \sa setEnabled()
+*/
+bool QWebPluginInfo::isEnabled() const
+{
+ if (!m_package)
+ return false;
+ return m_package->isEnabled();
+}
+
+/*!
+ Returns true if this plugin info is the same as the \a other plugin info.
+*/
+bool QWebPluginInfo::operator==(const QWebPluginInfo& other) const
+{
+ return m_package == other.m_package;
+}
+
+/*!
+ Returns true if this plugin info is different from the \a other plugin info.
+*/
+bool QWebPluginInfo::operator!=(const QWebPluginInfo& other) const
+{
+ return m_package != other.m_package;
+}
+
+/*!
+ Assigns the \a other plugin info to this plugin info, and returns a reference
+ to this plugin info.
+*/
+QWebPluginInfo &QWebPluginInfo::operator=(const QWebPluginInfo& other)
+{
+ if (this == &other)
+ return *this;
+
+ if (m_package)
+ m_package->deref();
+ m_package = other.m_package;
+ if (m_package)
+ m_package->ref();
+ m_mimeTypes = other.m_mimeTypes;
+
+ return *this;
+}
+
+/*!
+ \class QWebPluginDatabase
+ \internal
+ \since 4.6
+ \brief The QWebPluginDatabase class provides an interface for managing
+ Netscape plugins used by WebKit in QWebPages.
+
+ The QWebPluginDatabase class is a database of Netscape plugins that are used
+ by WebKit. The plugins are picked up by WebKit by looking up a set of search paths.
+ The default set can be accessed using defaultSearchPaths(). The search paths
+ can be changed, see searchPaths() and setSearchPaths(). Additional search paths
+ can also be added using addSearchPath().
+
+ The plugins that have been detected are exposed by the plugins() method.
+ The list contains QWebPlugin objects that hold both the metadata and the MIME
+ types that are supported by particular plugins.
+
+ WebKit specifies a plugin for a MIME type by looking for the first plugin that
+ supports the specific MIME type. To get a plugin, that is used by WebKit to
+ handle a specific MIME type, you can use the pluginForMimeType() function.
+
+ To change the way of resolving MIME types ambiguity, you can explicitly set
+ a preferred plugin for a specific MIME type, using setPreferredPluginForMimeType().
+
+ \sa QWebPluginInfo, QWebSettings::pluginDatabase()
+*/
+
+QWebPluginDatabase::QWebPluginDatabase(QObject* parent)
+ : QObject(parent)
+ , m_database(PluginDatabase::installedPlugins())
+{
+}
+
+QWebPluginDatabase::~QWebPluginDatabase()
+{
+}
+
+/*!
+ Returns a list of plugins installed in the search paths.
+
+ This list will contain disabled plugins, although they will not be used by
+ WebKit.
+
+ \sa pluginForMimeType()
+*/
+QList<QWebPluginInfo> QWebPluginDatabase::plugins() const
+{
+ QList<QWebPluginInfo> qwebplugins;
+ const Vector<PluginPackage*>& plugins = m_database->plugins();
+
+ for (unsigned int i = 0; i < plugins.size(); ++i) {
+ PluginPackage* plugin = plugins[i];
+ qwebplugins.append(QWebPluginInfo(plugin));
+ }
+
+ return qwebplugins;
+}
+
+/*!
+ Returns a default set of search paths.
+
+ \sa searchPaths(), setSearchPaths()
+*/
+QStringList QWebPluginDatabase::defaultSearchPaths()
+{
+ QStringList paths;
+
+ const Vector<String>& directories = PluginDatabase::defaultPluginDirectories();
+ for (unsigned int i = 0; i < directories.size(); ++i)
+ paths.append(directories[i]);
+
+ return paths;
+}
+
+/*!
+ Returns a list of search paths that are used by WebKit to look for plugins.
+
+ \sa defaultSearchPaths(), setSearchPaths()
+*/
+QStringList QWebPluginDatabase::searchPaths() const
+{
+ QStringList paths;
+
+ const Vector<String>& directories = m_database->pluginDirectories();
+ for (unsigned int i = 0; i < directories.size(); ++i)
+ paths.append(directories[i]);
+
+ return paths;
+}
+
+/*!
+ Changes the search paths to \a paths.
+ The database is automatically refreshed.
+
+ \sa searchPaths(), defaultSearchPaths()
+*/
+void QWebPluginDatabase::setSearchPaths(const QStringList& paths)
+{
+ Vector<String> directories;
+
+ for (int i = 0; i < paths.count(); ++i)
+ directories.append(paths.at(i));
+
+ m_database->setPluginDirectories(directories);
+ // PluginDatabase::setPluginDirectories() does not refresh the database.
+ m_database->refresh();
+}
+
+/*!
+ Adds an additional \a path to the current set.
+ The database is automatically refreshed.
+
+ \sa searchPaths(), setSearchPaths()
+*/
+void QWebPluginDatabase::addSearchPath(const QString& path)
+{
+ m_database->addExtraPluginDirectory(path);
+ // PluginDatabase::addExtraPluginDirectory() does refresh the database.
+}
+
+/*!
+ Refreshes the plugin database, adds new plugins that have been found and removes
+ the ones that are no longer available in the search paths.
+
+ You can call this function when the set of plugins installed in the search paths
+ changes. You do not need to call this function when changing search paths,
+ in that case WebKit automatically refreshes the database.
+*/
+void QWebPluginDatabase::refresh()
+{
+ m_database->refresh();
+}
+
+/*!
+ Returns the plugin that is currently used by WebKit for a given \a mimeType.
+
+ \sa setPreferredPluginForMimeType()
+*/
+QWebPluginInfo QWebPluginDatabase::pluginForMimeType(const QString& mimeType)
+{
+ return QWebPluginInfo(m_database->pluginForMIMEType(mimeType));
+}
+
+/*!
+ Changes the preferred plugin for a given \a mimeType to \a plugin. The \a plugin
+ has to support the given \a mimeType, otherwise the setting will have no effect.
+
+ Calling the function with a null \a plugin resets the setting.
+
+ \sa pluginForMimeType()
+*/
+void QWebPluginDatabase::setPreferredPluginForMimeType(const QString& mimeType, const QWebPluginInfo& plugin)
+{
+ m_database->setPreferredPluginForMIMEType(mimeType, plugin.m_package);
+}
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebplugindatabase_p.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebplugindatabase_p.h
new file mode 100644
index 000000000..b22c3de59
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebplugindatabase_p.h
@@ -0,0 +1,98 @@
+/*
+ Copyright (C) 2009 Jakub Wieczorek <faw217@gmail.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef QWEBPLUGINDATABASE_H
+#define QWEBPLUGINDATABASE_H
+
+#include "qwebkitglobal.h"
+#include "qwebpluginfactory.h"
+
+#include <QtCore/qobject.h>
+#include <QtCore/qstringlist.h>
+
+namespace WebCore {
+ class PluginDatabase;
+ class PluginPackage;
+}
+
+class QWebPluginInfoPrivate;
+class QWEBKIT_EXPORT QWebPluginInfo {
+public:
+ QWebPluginInfo();
+ QWebPluginInfo(const QWebPluginInfo& other);
+ QWebPluginInfo &operator=(const QWebPluginInfo& other);
+ ~QWebPluginInfo();
+
+private:
+ QWebPluginInfo(WebCore::PluginPackage* package);
+
+public:
+ typedef QWebPluginFactory::MimeType MimeType;
+
+ QString name() const;
+ QString description() const;
+ QList<MimeType> mimeTypes() const;
+ bool supportsMimeType(const QString& mimeType) const;
+ QString path() const;
+
+ bool isNull() const;
+
+ void setEnabled(bool enabled);
+ bool isEnabled() const;
+
+ bool operator==(const QWebPluginInfo& other) const;
+ bool operator!=(const QWebPluginInfo& other) const;
+
+ friend class QWebPluginDatabase;
+
+private:
+ QWebPluginInfoPrivate* d;
+ WebCore::PluginPackage* m_package;
+ mutable QList<MimeType> m_mimeTypes;
+};
+
+class QWebPluginDatabasePrivate;
+class QWEBKIT_EXPORT QWebPluginDatabase : public QObject {
+ Q_OBJECT
+
+private:
+ QWebPluginDatabase(QObject* parent = 0);
+ ~QWebPluginDatabase();
+
+public:
+ QList<QWebPluginInfo> plugins() const;
+
+ static QStringList defaultSearchPaths();
+ QStringList searchPaths() const;
+ void setSearchPaths(const QStringList& paths);
+ void addSearchPath(const QString& path);
+
+ void refresh();
+
+ QWebPluginInfo pluginForMimeType(const QString& mimeType);
+ void setPreferredPluginForMimeType(const QString& mimeType, const QWebPluginInfo& plugin);
+
+ friend class QWebSettings;
+
+private:
+ QWebPluginDatabasePrivate* d;
+ WebCore::PluginDatabase* m_database;
+};
+
+#endif // QWEBPLUGINDATABASE_H
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpluginfactory.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebpluginfactory.cpp
index d2bb124db..8ff13b10d 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpluginfactory.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpluginfactory.cpp
@@ -26,6 +26,8 @@
\brief The QWebPluginFactory class creates plugins to be embedded into web
pages.
+ \inmodule QtWebKit
+
QWebPluginFactory is a factory for creating plugins for QWebPage. A plugin
factory can be installed on a QWebPage using QWebPage::setPluginFactory().
@@ -47,6 +49,8 @@
\class QWebPluginFactory::Plugin
\since 4.4
\brief the QWebPluginFactory::Plugin structure describes the properties of a plugin a QWebPluginFactory can create.
+
+ \inmodule QtWebKit
*/
/*!
@@ -68,6 +72,24 @@
\class QWebPluginFactory::MimeType
\since 4.4
\brief The QWebPluginFactory::MimeType structure describes a mime type supported by a plugin.
+
+ \inmodule QtWebKit
+*/
+
+/*!
+ Returns true if this mimetype is the same as the \a other mime type.
+*/
+bool QWebPluginFactory::MimeType::operator==(const MimeType& other) const
+{
+ return name == other.name
+ && description == other.description
+ && fileExtensions == other.fileExtensions;
+}
+
+/*!
+ \fn bool QWebPluginFactory::MimeType::operator!=(const MimeType& other) const
+
+ Returns true if this mimetype is different from the \a other mime type.
*/
/*!
@@ -136,7 +158,7 @@ void QWebPluginFactory::refreshPlugins()
For example:
\code
- <object type="application/x-pdf" data="http://qtsoftware.com/document.pdf" width="500" height="400">
+ <object type="application/x-pdf" data="http://qt.nokia.com/document.pdf" width="500" height="400">
<param name="showTableOfContents" value="true" />
<param name="hideThumbnails" value="false" />
</object>
@@ -149,7 +171,7 @@ void QWebPluginFactory::refreshPlugins()
\row \o mimeType
\o "application/x-pdf"
\row \o url
- \o "http://qtsoftware.com/document.pdf"
+ \o "http://qt.nokia.com/document.pdf"
\row \o argumentNames
\o "showTableOfContents" "hideThumbnails"
\row \o argumentVaues
@@ -173,6 +195,8 @@ void QWebPluginFactory::refreshPlugins()
\since 4.4
\brief The ExtensionOption class provides an extended input argument to QWebPluginFactory's extension support.
+ \inmodule QtWebKit
+
\sa QWebPluginFactory::extension()
*/
@@ -181,6 +205,8 @@ void QWebPluginFactory::refreshPlugins()
\since 4.4
\brief The ExtensionOption class provides an extended output argument to QWebPluginFactory's extension support.
+ \inmodule QtWebKit
+
\sa QWebPluginFactory::extension()
*/
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpluginfactory.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebpluginfactory.h
index cff774d60..4a06b5999 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpluginfactory.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpluginfactory.h
@@ -34,10 +34,12 @@ class QWebPluginFactoryPrivate;
class QWEBKIT_EXPORT QWebPluginFactory : public QObject {
Q_OBJECT
public:
- struct MimeType {
+ struct QWEBKIT_EXPORT MimeType {
QString name;
QString description;
QStringList fileExtensions;
+ bool operator==(const MimeType& other) const;
+ inline bool operator!=(const MimeType& other) const { return !operator==(other); }
};
struct Plugin {
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.cpp
index d2eaf1021..2a225c576 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.cpp
@@ -30,11 +30,23 @@
using namespace WebCore;
+void QWEBKIT_EXPORT qt_drt_whiteListAccessFromOrigin(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains)
+{
+ SecurityOrigin::whiteListAccessFromOrigin(*SecurityOrigin::createFromString(sourceOrigin), destinationProtocol, destinationHost, allowDestinationSubdomains);
+}
+
+void QWEBKIT_EXPORT qt_drt_resetOriginAccessWhiteLists()
+{
+ SecurityOrigin::resetOriginAccessWhiteLists();
+}
+
/*!
\class QWebSecurityOrigin
\since 4.5
\brief The QWebSecurityOrigin class defines a security boundary for web sites.
+ \inmodule QtWebKit
+
QWebSecurityOrigin provides access to the security domains defined by web sites.
An origin consists of a host name, a scheme, and a port number. Web sites
with the same security origin can access each other's resources for client-side
@@ -198,3 +210,42 @@ QList<QWebDatabase> QWebSecurityOrigin::databases() const
return databases;
}
+/*!
+ \since 4.6
+
+ Adds the given \a scheme to the list of schemes that are considered equivalent
+ to the \c file: scheme. They are not subject to cross domain restrictions.
+*/
+void QWebSecurityOrigin::addLocalScheme(const QString& scheme)
+{
+ SecurityOrigin::registerURLSchemeAsLocal(scheme);
+}
+
+/*!
+ \since 4.6
+
+ Removes the given \a scheme from the list of local schemes.
+
+ \sa addLocalScheme()
+*/
+void QWebSecurityOrigin::removeLocalScheme(const QString& scheme)
+{
+ SecurityOrigin::removeURLSchemeRegisteredAsLocal(scheme);
+}
+
+/*!
+ \since 4.6
+ Returns a list of all the schemes that were set by the application as local schemes,
+ \sa addLocalScheme(), removeLocalScheme()
+*/
+QStringList QWebSecurityOrigin::localSchemes()
+{
+ QStringList list;
+ const URLSchemesMap& map = SecurityOrigin::localURLSchemes();
+ URLSchemesMap::const_iterator end = map.end();
+ for (URLSchemesMap::const_iterator i = map.begin(); i != end; ++i) {
+ const QString scheme = *i;
+ list.append(scheme);
+ }
+ return list;
+}
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.h
index 3cfb0f49c..16f8bc1d4 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.h
@@ -37,6 +37,9 @@ class QWebFrame;
class QWEBKIT_EXPORT QWebSecurityOrigin {
public:
static QList<QWebSecurityOrigin> allOrigins();
+ static void addLocalScheme(const QString& scheme);
+ static void removeLocalScheme(const QString& scheme);
+ static QStringList localSchemes();
~QWebSecurityOrigin();
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp
index fb94d55b1..b637d0453 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp
@@ -22,6 +22,7 @@
#include "qwebpage.h"
#include "qwebpage_p.h"
+#include "qwebplugindatabase_p.h"
#include "Cache.h"
#include "CrossOriginPreflightResultCache.h"
@@ -36,7 +37,11 @@
#include "IntSize.h"
#include "ApplicationCacheStorage.h"
#include "DatabaseTracker.h"
+#include "FileSystem.h"
+#include <QApplication>
+#include <QDesktopServices>
+#include <QDir>
#include <QHash>
#include <QSharedData>
#include <QUrl>
@@ -54,7 +59,7 @@ public:
QHash<int, bool> attributes;
QUrl userStyleSheetLocation;
QString defaultTextEncoding;
- QString localStorageDatabasePath;
+ QString localStoragePath;
QString offlineWebApplicationCachePath;
qint64 offlineStorageDefaultQuota;
@@ -166,8 +171,8 @@ void QWebSettingsPrivate::apply()
QString encoding = !defaultTextEncoding.isEmpty() ? defaultTextEncoding: global->defaultTextEncoding;
settings->setDefaultTextEncodingName(encoding);
- QString localStoragePath = !localStorageDatabasePath.isEmpty() ? localStorageDatabasePath : global->localStorageDatabasePath;
- settings->setLocalStorageDatabasePath(localStoragePath);
+ QString storagePath = !localStoragePath.isEmpty() ? localStoragePath : global->localStoragePath;
+ settings->setLocalStorageDatabasePath(storagePath);
value = attributes.value(QWebSettings::ZoomTextOnly,
global->attributes.value(QWebSettings::ZoomTextOnly));
@@ -185,13 +190,15 @@ void QWebSettingsPrivate::apply()
global->attributes.value(QWebSettings::OfflineWebApplicationCacheEnabled));
settings->setOfflineWebApplicationCacheEnabled(value);
- value = attributes.value(QWebSettings::LocalStorageDatabaseEnabled,
- global->attributes.value(QWebSettings::LocalStorageDatabaseEnabled));
+ value = attributes.value(QWebSettings::LocalStorageEnabled,
+ global->attributes.value(QWebSettings::LocalStorageEnabled));
+
settings->setLocalStorageEnabled(value);
value = attributes.value(QWebSettings::LocalContentCanAccessRemoteUrls,
global->attributes.value(QWebSettings::LocalContentCanAccessRemoteUrls));
settings->setAllowUniversalAccessFromFileURLs(value);
+ settings->setUsesPageCache(WebCore::pageCache()->capacity());
} else {
QList<QWebSettingsPrivate*> settings = *::allSettings();
for (int i = 0; i < settings.count(); ++i)
@@ -219,6 +226,8 @@ QWebSettings* QWebSettings::globalSettings()
\brief The QWebSettings class provides an object to store the settings used
by QWebPage and QWebFrame.
+ \inmodule QtWebKit
+
Each QWebPage object has its own QWebSettings object, which configures the
settings for that page. If a setting is not configured, then it is looked
up in the global settings object, which can be accessed using
@@ -253,7 +262,7 @@ QWebSettings* QWebSettings::globalSettings()
setOfflineStoragePath() with an appropriate file path, and can limit the quota
for each application by calling setOfflineStorageDefaultQuota().
- \sa QWebPage::settings(), QWebView::settings(), {Browser}
+ \sa QWebPage::settings(), QWebView::settings(), {Web Browser}
*/
/*!
@@ -301,6 +310,8 @@ QWebSettings* QWebSettings::globalSettings()
\value AutoLoadImages Specifies whether images are automatically loaded in
web pages.
+ \value DnsPrefetchEnabled Specifies whether QtWebkit will try to pre-fetch DNS entries to
+ speed up browsing. This only works as a global attribute. Only for Qt 4.6 and later.
\value JavascriptEnabled Enables or disables the running of JavaScript
programs.
\value JavaEnabled Enables or disables Java applets.
@@ -313,8 +324,9 @@ QWebSettings* QWebSettings::globalSettings()
\value JavascriptCanAccessClipboard Specifies whether JavaScript programs
can read or write to the clipboard.
\value DeveloperExtrasEnabled Enables extra tools for Web developers.
- Currently this enables the "Inspect" element in the context menu,
- which shows the WebKit WebInspector for web site debugging.
+ Currently this enables the "Inspect" element in the context menu as
+ well as the use of QWebInspector which controls the WebKit WebInspector
+ for web site debugging.
\value LinksIncludedInFocusChain Specifies whether hyperlinks should be
included in the keyboard focus chain.
\value ZoomTextOnly Specifies whether the zoom factor on a frame applies to
@@ -322,11 +334,13 @@ QWebSettings* QWebSettings::globalSettings()
\value PrintElementBackgrounds Specifies whether the background color and images
are also drawn when the page is printed.
\value OfflineStorageDatabaseEnabled Specifies whether support for the HTML 5
- offline storage feature is enabled or not.
+ offline storage feature is enabled or not. Disabled by default.
\value OfflineWebApplicationCacheEnabled Specifies whether support for the HTML 5
- web application cache feature is enabled or not.
- \value LocalStorageDatabaseEnabled Specifies whether support for the HTML 5
- local storage feature is enabled or not.
+ web application cache feature is enabled or not. Disabled by default.
+ \value LocalStorageEnabled Specifies whether support for the HTML 5
+ local storage feature is enabled or not. Disabled by default.
+ \value LocalStorageDatabaseEnabled \e{This enum value is deprecated.} Use
+ QWebSettings::LocalStorageEnabled instead.
\value LocalContentCanAccessRemoteUrls Specifies whether locally loaded documents are allowed to access remote urls.
*/
@@ -339,8 +353,8 @@ QWebSettings::QWebSettings()
// Initialize our global defaults
d->fontSizes.insert(QWebSettings::MinimumFontSize, 0);
d->fontSizes.insert(QWebSettings::MinimumLogicalFontSize, 0);
- d->fontSizes.insert(QWebSettings::DefaultFontSize, 14);
- d->fontSizes.insert(QWebSettings::DefaultFixedFontSize, 14);
+ d->fontSizes.insert(QWebSettings::DefaultFontSize, 16);
+ d->fontSizes.insert(QWebSettings::DefaultFixedFontSize, 13);
d->fontFamilies.insert(QWebSettings::StandardFont, QLatin1String("Arial"));
d->fontFamilies.insert(QWebSettings::FixedFont, QLatin1String("Courier New"));
d->fontFamilies.insert(QWebSettings::SerifFont, QLatin1String("Times New Roman"));
@@ -349,16 +363,17 @@ QWebSettings::QWebSettings()
d->fontFamilies.insert(QWebSettings::FantasyFont, QLatin1String("Arial"));
d->attributes.insert(QWebSettings::AutoLoadImages, true);
+ d->attributes.insert(QWebSettings::DnsPrefetchEnabled, false);
d->attributes.insert(QWebSettings::JavascriptEnabled, true);
d->attributes.insert(QWebSettings::LinksIncludedInFocusChain, true);
d->attributes.insert(QWebSettings::ZoomTextOnly, false);
d->attributes.insert(QWebSettings::PrintElementBackgrounds, true);
- d->attributes.insert(QWebSettings::OfflineStorageDatabaseEnabled, true);
- d->attributes.insert(QWebSettings::OfflineWebApplicationCacheEnabled, true);
- d->attributes.insert(QWebSettings::LocalStorageDatabaseEnabled, true);
- d->attributes.insert(QWebSettings::LocalContentCanAccessRemoteUrls, true);
+ d->attributes.insert(QWebSettings::OfflineStorageDatabaseEnabled, false);
+ d->attributes.insert(QWebSettings::OfflineWebApplicationCacheEnabled, false);
+ d->attributes.insert(QWebSettings::LocalStorageEnabled, false);
+ d->attributes.insert(QWebSettings::LocalContentCanAccessRemoteUrls, false);
d->offlineStorageDefaultQuota = 5 * 1024 * 1024;
-
+ d->defaultTextEncoding = QLatin1String("iso-8859-1");
}
/*!
@@ -422,7 +437,10 @@ void QWebSettings::resetFontSize(FontSize type)
/*!
Specifies the location of a user stylesheet to load with every web page.
- The \a location can be a URL or a path on the local filesystem.
+ The \a location must be either a path on the local filesystem, or a data URL
+ with UTF-8 and Base64 encoded data, such as:
+
+ "data:text/css;charset=utf-8;base64,cCB7IGJhY2tncm91bmQtY29sb3I6IHJlZCB9Ow==;"
\sa userStyleSheetUrl()
*/
@@ -539,6 +557,18 @@ QIcon QWebSettings::iconForUrl(const QUrl& url)
return* icon;
}
+/*
+ Returns the plugin database object.
+
+QWebPluginDatabase *QWebSettings::pluginDatabase()
+{
+ static QWebPluginDatabase* database = 0;
+ if (!database)
+ database = new QWebPluginDatabase();
+ return database;
+}
+*/
+
/*!
Sets \a graphic to be drawn when QtWebKit needs to draw an image of the
given \a type.
@@ -596,21 +626,26 @@ void QWebSettings::clearMemoryCaches()
// Invalidating the font cache and freeing all inactive font data.
WebCore::fontCache()->invalidate();
-#if ENABLE(OFFLINE_WEB_APPLICATIONS)
- // Empty the application cache.
- WebCore::cacheStorage().empty();
-#endif
-
// Empty the Cross-Origin Preflight cache
WebCore::CrossOriginPreflightResultCache::shared().empty();
}
/*!
- Sets the maximum number of pages to hold in the memory cache to \a pages.
+ Sets the maximum number of pages to hold in the memory page cache to \a pages.
+
+ The Page Cache allows for a nicer user experience when navigating forth or back
+ to pages in the forward/back history, by pausing and resuming up to \a pages
+ per page group.
+
+ For more information about the feature, please refer to:
+
+ http://webkit.org/blog/427/webkit-page-cache-i-the-basics/
*/
void QWebSettings::setMaximumPagesInCache(int pages)
{
+ QWebSettingsPrivate* global = QWebSettings::globalSettings()->d;
WebCore::pageCache()->setCapacity(qMax(0, pages));
+ global->apply();
}
/*!
@@ -627,7 +662,7 @@ int QWebSettings::maximumPagesInCache()
The \a cacheMinDeadCapacity specifies the \e minimum number of bytes that
dead objects should consume when the cache is under pressure.
-
+
\a cacheMaxDead is the \e maximum number of bytes that dead objects should
consume when the cache is \bold not under pressure.
@@ -687,7 +722,7 @@ void QWebSettings::resetFontFamily(FontFamily which)
/*!
\fn void QWebSettings::setAttribute(WebAttribute attribute, bool on)
-
+
Enables or disables the specified \a attribute feature depending on the
value of \a on.
*/
@@ -784,27 +819,35 @@ qint64 QWebSettings::offlineStorageDefaultQuota()
return QWebSettings::globalSettings()->d->offlineStorageDefaultQuota;
}
-/*
- \internal
+/*!
+ \since 4.6
\relates QWebSettings
Sets the path for HTML5 offline web application cache storage to \a path.
+ An application cache acts like an HTTP cache in some sense. For documents
+ that use the application cache via JavaScript, the loader mechinery will
+ first ask the application cache for the contents, before hitting the
+ network.
+
+ The feature is described in details at:
+ http://dev.w3.org/html5/spec/Overview.html#appcache
+
\a path must point to an existing directory where the cache is stored.
Setting an empty path disables the feature.
\sa offlineWebApplicationCachePath()
*/
-void QWEBKIT_EXPORT qt_websettings_setOfflineWebApplicationCachePath(const QString& path)
+void QWebSettings::setOfflineWebApplicationCachePath(const QString& path)
{
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
WebCore::cacheStorage().setCacheDirectory(path);
#endif
}
-/*
- \internal
+/*!
+ \since 4.6
\relates QWebSettings
Returns the path of the HTML5 offline web application cache storage
@@ -812,7 +855,7 @@ void QWEBKIT_EXPORT qt_websettings_setOfflineWebApplicationCachePath(const QStri
\sa setOfflineWebApplicationCachePath()
*/
-QString QWEBKIT_EXPORT qt_websettings_offlineWebApplicationCachePath()
+QString QWebSettings::offlineWebApplicationCachePath()
{
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
return WebCore::cacheStorage().cacheDirectory();
@@ -821,37 +864,98 @@ QString QWEBKIT_EXPORT qt_websettings_offlineWebApplicationCachePath()
#endif
}
-/*
- \since 4.5
- \relates QWebSettings
+/*!
+ \since 4.6
+
+ Sets the value of the quota for the offline web application cache
+ to \a maximumSize.
+*/
+void QWebSettings::setOfflineWebApplicationCacheQuota(qint64 maximumSize)
+{
+#if ENABLE(OFFLINE_WEB_APPLICATIONS)
+ WebCore::cacheStorage().setMaximumSize(maximumSize);
+#endif
+}
- Sets the path for HTML5 local storage databases to \a path.
+/*!
+ \since 4.6
- \a path must point to an existing directory where the cache is stored.
+ Returns the value of the quota for the offline web application cache.
+*/
+qint64 QWebSettings::offlineWebApplicationCacheQuota()
+{
+#if ENABLE(OFFLINE_WEB_APPLICATIONS)
+ return WebCore::cacheStorage().maximumSize();
+#else
+ return 0;
+#endif
+}
- Setting an empty path disables the feature.
+/*!
+ \since 4.6
+ \relates QWebSettings
+
+ Sets the path for HTML5 local storage to \a path.
+
+ For more information on HTML5 local storage see the
+ \l{http://www.w3.org/TR/webstorage/#the-localstorage-attribute}{Web Storage standard}.
+
+ Support for local storage can enabled by setting the
+ \l{QWebSettings::LocalStorageEnabled}{LocalStorageEnabled} attribute.
- \sa localStorageDatabasePath()
+ \sa localStoragePath()
*/
-void QWEBKIT_EXPORT qt_websettings_setLocalStorageDatabasePath(QWebSettings* settings, const QString& path)
+void QWebSettings::setLocalStoragePath(const QString& path)
{
- QWebSettingsPrivate* d = settings->handle();
- d->localStorageDatabasePath = path;
+ d->localStoragePath = path;
d->apply();
}
-/*
- \since 4.5
+/*!
+ \since 4.6
\relates QWebSettings
- Returns the path for HTML5 local storage databases
- or an empty string if the feature is disabled.
+ Returns the path for HTML5 local storage.
+
+ \sa setLocalStoragePath()
+*/
+QString QWebSettings::localStoragePath() const
+{
+ return d->localStoragePath;
+}
- \sa setLocalStorageDatabasePath()
+/*!
+ \since 4.6
+ \relates QWebSettings
+
+ Enables WebKit persistent data and sets the path to \a path.
+ If the \a path is empty the path for persistent data is set to the
+ user-specific data location specified by
+ \l{QDesktopServices::DataLocation}{DataLocation}.
+
+ \sa localStoragePath()
*/
-QString QWEBKIT_EXPORT qt_websettings_localStorageDatabasePath(QWebSettings* settings)
+void QWebSettings::enablePersistentStorage(const QString& path)
{
- return settings->handle()->localStorageDatabasePath;
+ QString storagePath;
+
+ if (path.isEmpty()) {
+ storagePath = QDesktopServices::storageLocation(QDesktopServices::DataLocation);
+
+ if (storagePath.isEmpty())
+ storagePath = WebCore::pathByAppendingComponent(QDir::homePath(), QCoreApplication::applicationName());
+ } else
+ storagePath = path;
+
+ WebCore::makeAllDirectories(storagePath);
+
+ QWebSettings::setIconDatabasePath(storagePath);
+ QWebSettings::setOfflineWebApplicationCachePath(storagePath);
+ QWebSettings::setOfflineStoragePath(WebCore::pathByAppendingComponent(storagePath, "Databases"));
+ QWebSettings::globalSettings()->setLocalStoragePath(WebCore::pathByAppendingComponent(storagePath, "LocalStorage"));
+ QWebSettings::globalSettings()->setAttribute(QWebSettings::LocalStorageEnabled, true);
+ QWebSettings::globalSettings()->setAttribute(QWebSettings::OfflineStorageDatabaseEnabled, true);
+ QWebSettings::globalSettings()->setAttribute(QWebSettings::OfflineWebApplicationCacheEnabled, true);
}
/*!
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h
index 63144cb40..50cf42439 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h
@@ -32,6 +32,7 @@ namespace WebCore {
}
class QWebPage;
+class QWebPluginDatabase;
class QWebSettingsPrivate;
QT_BEGIN_NAMESPACE
class QUrl;
@@ -61,8 +62,12 @@ public:
PrintElementBackgrounds,
OfflineStorageDatabaseEnabled,
OfflineWebApplicationCacheEnabled,
- LocalStorageDatabaseEnabled,
- LocalContentCanAccessRemoteUrls
+ LocalStorageEnabled,
+#ifdef QT_DEPRECATED
+ LocalStorageDatabaseEnabled = LocalStorageEnabled,
+#endif
+ LocalContentCanAccessRemoteUrls,
+ DnsPrefetchEnabled
};
enum WebGraphic {
MissingImageGraphic,
@@ -102,6 +107,8 @@ public:
static void clearIconDatabase();
static QIcon iconForUrl(const QUrl &url);
+ //static QWebPluginDatabase *pluginDatabase();
+
static void setWebGraphic(WebGraphic type, const QPixmap &graphic);
static QPixmap webGraphic(WebGraphic type);
@@ -114,8 +121,18 @@ public:
static void setOfflineStorageDefaultQuota(qint64 maximumSize);
static qint64 offlineStorageDefaultQuota();
+ static void setOfflineWebApplicationCachePath(const QString& path);
+ static QString offlineWebApplicationCachePath();
+ static void setOfflineWebApplicationCacheQuota(qint64 maximumSize);
+ static qint64 offlineWebApplicationCacheQuota();
+
+ void setLocalStoragePath(const QString& path);
+ QString localStoragePath() const;
+
static void clearMemoryCaches();
+ static void enablePersistentStorage(const QString& path = QString());
+
inline QWebSettingsPrivate* handle() const { return d; }
private:
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp
index e1a0c98cb..1d4b46f06 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp
@@ -1,6 +1,7 @@
/*
Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
Copyright (C) 2008 Holger Hans Peter Freyther
+ Copyright (C) 2009 Girish Ramakrishnan <girish@forwardbias.in>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
@@ -20,6 +21,8 @@
#include "config.h"
#include "qwebview.h"
+
+#include "QWebPageClient.h"
#include "qwebframe.h"
#include "qwebpage_p.h"
@@ -36,40 +39,24 @@ public:
: view(view)
, page(0)
, renderHints(QPainter::TextAntialiasing)
-#ifndef QT_NO_CURSOR
- , cursorSetByWebCore(false)
- , usesWebCoreCursor(true)
-#endif
- {}
+ {
+ Q_ASSERT(view);
+ }
+
+ void _q_pageDestroyed();
QWebView *view;
QWebPage *page;
QPainter::RenderHints renderHints;
-
-#ifndef QT_NO_CURSOR
- /*
- * We keep track of if we have called setCursor and if the CursorChange
- * event is sent due our setCursor call and if we currently use the WebCore
- * Cursor and use it to decide if we can update to another WebCore Cursor.
- */
- bool cursorSetByWebCore;
- bool usesWebCoreCursor;
-
- void setCursor(const QCursor& newCursor)
- {
- webCoreCursor = newCursor;
-
- if (usesWebCoreCursor) {
- cursorSetByWebCore = true;
- view->setCursor(webCoreCursor);
- }
- }
-
- QCursor webCoreCursor;
-#endif
};
+void QWebViewPrivate::_q_pageDestroyed()
+{
+ page = 0;
+ view->setPage(0);
+}
+
/*!
\class QWebView
\since 4.4
@@ -77,11 +64,13 @@ public:
web documents.
\ingroup advanced
+ \inmodule QtWebKit
+
QWebView is the main widget component of the QtWebKit web browsing module.
It can be used in various applications to display web content live from the
Internet.
- The image below shows QWebView previewed in \QD with the Trolltech website.
+ The image below shows QWebView previewed in \QD with a Nokia website.
\image qwebview-url.png
@@ -160,7 +149,7 @@ QWebView::QWebView(QWidget *parent)
{
d = new QWebViewPrivate(this);
-#if !defined(Q_WS_QWS)
+#if !defined(Q_WS_QWS) && !defined(Q_OS_SYMBIAN)
setAttribute(Qt::WA_InputMethodEnabled);
#endif
@@ -175,8 +164,15 @@ QWebView::QWebView(QWidget *parent)
*/
QWebView::~QWebView()
{
- if (d->page)
+ if (d->page) {
+#if QT_VERSION >= 0x040600
+ d->page->d->view.clear();
+#else
d->page->d->view = 0;
+#endif
+ delete d->page->d->client;
+ d->page->d->client = 0;
+ }
if (d->page && d->page->parent() == this)
delete d->page;
@@ -211,6 +207,7 @@ void QWebView::setPage(QWebPage* page)
if (d->page == page)
return;
if (d->page) {
+ d->page->d->client = 0; // unset the page client
if (d->page->parent() == this)
delete d->page;
else
@@ -222,12 +219,12 @@ void QWebView::setPage(QWebPage* page)
d->page->setPalette(palette());
// #### connect signals
QWebFrame *mainFrame = d->page->mainFrame();
- connect(mainFrame, SIGNAL(titleChanged(const QString&)),
- this, SIGNAL(titleChanged(const QString&)));
+ connect(mainFrame, SIGNAL(titleChanged(QString)),
+ this, SIGNAL(titleChanged(QString)));
connect(mainFrame, SIGNAL(iconChanged()),
this, SIGNAL(iconChanged()));
- connect(mainFrame, SIGNAL(urlChanged(const QUrl &)),
- this, SIGNAL(urlChanged(const QUrl &)));
+ connect(mainFrame, SIGNAL(urlChanged(QUrl)),
+ this, SIGNAL(urlChanged(QUrl)));
connect(d->page, SIGNAL(loadStarted()),
this, SIGNAL(loadStarted()));
@@ -235,97 +232,26 @@ void QWebView::setPage(QWebPage* page)
this, SIGNAL(loadProgress(int)));
connect(d->page, SIGNAL(loadFinished(bool)),
this, SIGNAL(loadFinished(bool)));
- connect(d->page, SIGNAL(statusBarMessage(const QString &)),
- this, SIGNAL(statusBarMessage(const QString &)));
- connect(d->page, SIGNAL(linkClicked(const QUrl &)),
- this, SIGNAL(linkClicked(const QUrl &)));
+ connect(d->page, SIGNAL(statusBarMessage(QString)),
+ this, SIGNAL(statusBarMessage(QString)));
+ connect(d->page, SIGNAL(linkClicked(QUrl)),
+ this, SIGNAL(linkClicked(QUrl)));
connect(d->page, SIGNAL(microFocusChanged()),
this, SLOT(updateMicroFocus()));
+ connect(d->page, SIGNAL(destroyed()),
+ this, SLOT(_q_pageDestroyed()));
}
setAttribute(Qt::WA_OpaquePaintEvent, d->page);
update();
}
/*!
- Returns a valid URL from a user supplied \a string if one can be deducted.
- In the case that is not possible, an invalid QUrl() is returned.
-
- \since 4.6
-
- Most applications that can browse the web, allow the user to input a URL
- in the form of a plain string. This string can be manually typed into
- a location bar, obtained from the clipboard, or passed in via command
- line arguments.
-
- When the string is not already a valid URL, a best guess is performed,
- making various web related assumptions.
-
- In the case the string corresponds to a valid file path on the system,
- a file:// URL is constructed, using QUrl::fromLocalFile().
-
- If that is not the case, an attempt is made to turn the string into a
- http:// or ftp:// URL. The latter in the case the string starts with
- 'ftp'. The result is then passed through QUrl's tolerant parser, and
- in the case or success, a valid QUrl is returned, or else a QUrl().
-
- \section1 Examples:
-
- \list
- \o webkit.org becomes http://webkit.org
- \o ftp.webkit.org becomes ftp://ftp.webkit.org
- \o localhost becomes http://localhost
- \o /home/user/test.html becomes file:///home/user/test.html (if exists)
- \endlist
-
- \section2 Tips when dealing with URLs and strings:
-
- \list
- \o When creating a QString from a QByteArray or a char*, always use
- QString::fromUtf8().
- \o Do not use QUrl(string), nor QUrl::toString() anywhere where the URL might
- be used, such as in the location bar, as those functions loose data.
- Instead use QUrl::fromEncoded() and QUrl::toEncoded(), respectively.
- \endlist
- */
-QUrl QWebView::guessUrlFromString(const QString &string)
-{
- QString trimmedString = string.trimmed();
-
- // Check the most common case of a valid url with scheme and host first
- QUrl url = QUrl::fromEncoded(trimmedString.toUtf8(), QUrl::TolerantMode);
- if (url.isValid() && !url.scheme().isEmpty() && !url.host().isEmpty())
- return url;
-
- // Absolute files that exists
- if (QDir::isAbsolutePath(trimmedString) && QFile::exists(trimmedString))
- return QUrl::fromLocalFile(trimmedString);
-
- // If the string is missing the scheme or the scheme is not valid prepend a scheme
- QString scheme = url.scheme();
- if (scheme.isEmpty() || scheme.contains(QLatin1Char('.')) || scheme == QLatin1String("localhost")) {
- // Do not do anything for strings such as "foo", only "foo.com"
- int dotIndex = trimmedString.indexOf(QLatin1Char('.'));
- if (dotIndex != -1 || trimmedString.startsWith(QLatin1String("localhost"))) {
- const QString hostscheme = trimmedString.left(dotIndex).toLower();
- QByteArray scheme = (hostscheme == QLatin1String("ftp")) ? "ftp" : "http";
- trimmedString = QLatin1String(scheme) + QLatin1String("://") + trimmedString;
- }
- url = QUrl::fromEncoded(trimmedString.toUtf8(), QUrl::TolerantMode);
- }
-
- if (url.isValid())
- return url;
-
- return QUrl();
-}
-
-/*!
Loads the specified \a url and displays it.
\note The view remains the same until enough data has arrived to display the new \a url.
- \sa setUrl(), url(), urlChanged(), guessUrlFromString()
+ \sa setUrl(), url(), urlChanged(), QUrl::fromUserInput()
*/
void QWebView::load(const QUrl &url)
{
@@ -613,10 +539,20 @@ qreal QWebView::textSizeMultiplier() const
\since 4.6
\brief the default render hints for the view
- These hints are used to initialize QPainter before painting the web page.
+ These hints are used to initialize QPainter before painting the Web page.
QPainter::TextAntialiasing is enabled by default.
+ \note This property is not available on Symbian. However, the getter and
+ setter functions can still be used directly.
+
+ \sa QPainter::renderHints()
+*/
+
+/*!
+ \since 4.6
+ Returns the render hints used by the view to render content.
+
\sa QPainter::renderHints()
*/
QPainter::RenderHints QWebView::renderHints() const
@@ -624,6 +560,12 @@ QPainter::RenderHints QWebView::renderHints() const
return d->renderHints;
}
+/*!
+ \since 4.6
+ Sets the render hints used by the view to the specified \a hints.
+
+ \sa QPainter::setRenderHints()
+*/
void QWebView::setRenderHints(QPainter::RenderHints hints)
{
if (hints == d->renderHints)
@@ -633,11 +575,11 @@ void QWebView::setRenderHints(QPainter::RenderHints hints)
}
/*!
- If \a enabled is true, the render hint \a hint is enabled; otherwise it
- is disabled.
-
\since 4.6
- \sa renderHints
+ If \a enabled is true, enables the specified render \a hint; otherwise
+ disables it.
+
+ \sa renderHints, QPainter::renderHints()
*/
void QWebView::setRenderHint(QPainter::RenderHint hint, bool enabled)
{
@@ -694,19 +636,18 @@ bool QWebView::event(QEvent *e)
if (e->type() == QEvent::ShortcutOverride) {
d->page->event(e);
#ifndef QT_NO_CURSOR
- } else if (e->type() == static_cast<QEvent::Type>(WebCore::SetCursorEvent::EventType)) {
- d->setCursor(static_cast<WebCore::SetCursorEvent*>(e)->cursor());
#if QT_VERSION >= 0x040400
} else if (e->type() == QEvent::CursorChange) {
- // Okay we might use the WebCore Cursor now.
- d->usesWebCoreCursor = d->cursorSetByWebCore;
- d->cursorSetByWebCore = false;
-
- // Go back to the WebCore Cursor. QWidget::unsetCursor is appromixated with this
- if (!d->usesWebCoreCursor && cursor().shape() == Qt::ArrowCursor) {
- d->usesWebCoreCursor = true;
- d->setCursor(d->webCoreCursor);
- }
+ // An unsetCursor will set the cursor to Qt::ArrowCursor.
+ // Thus this cursor change might be a QWidget::unsetCursor()
+ // If this is not the case and it came from WebCore, the
+ // QWebPageClient already has set its cursor internally
+ // to Qt::ArrowCursor, so updating the cursor is always
+ // right, as it falls back to the last cursor set by
+ // WebCore.
+ // FIXME: Add a QEvent::CursorUnset or similar to Qt.
+ if (cursor().shape() == Qt::ArrowCursor)
+ d->page->d->client->resetCursor();
#endif
#endif
} else if (e->type() == QEvent::Leave)
@@ -818,8 +759,12 @@ void QWebView::paintEvent(QPaintEvent *ev)
}
/*!
- This function is called whenever WebKit wants to create a new window of the given \a type, for example as a result of
- a JavaScript request to open a document in a new window.
+ This function is called from the createWindow() method of the associated QWebPage,
+ each time the page wants to create a new window of the given \a type. This might
+ be the result, for example, of a JavaScript request to open a document in a new window.
+
+ \note If the createWindow() method of the associated page is reimplemented, this
+ method is not called, unless explicitly done so in the reimplementation.
\sa QWebPage::createWindow()
*/
@@ -1033,7 +978,7 @@ void QWebView::changeEvent(QEvent *e)
/*!
\fn void QWebView::statusBarMessage(const QString& text)
- This signal is emitted when the statusbar \a text is changed by the page.
+ This signal is emitted when the status bar \a text is changed by the page.
*/
/*!
@@ -1094,3 +1039,6 @@ void QWebView::changeEvent(QEvent *e)
\sa QWebPage::linkDelegationPolicy()
*/
+
+#include "moc_qwebview.cpp"
+
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebview.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.h
index e8861444d..e9c1ec8e0 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebview.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.h
@@ -50,7 +50,13 @@ class QWEBKIT_EXPORT QWebView : public QWidget {
//Q_PROPERTY(Qt::TextInteractionFlags textInteractionFlags READ textInteractionFlags WRITE setTextInteractionFlags)
Q_PROPERTY(qreal textSizeMultiplier READ textSizeMultiplier WRITE setTextSizeMultiplier DESIGNABLE false)
Q_PROPERTY(qreal zoomFactor READ zoomFactor WRITE setZoomFactor)
+
+// FIXME: temporary work around for elftran issue that it couldn't find the QPainter::staticMetaObject
+// symbol from Qt lib; it should be reverted after the right symbol is exported.
+// See bug: http://qt.nokia.com/developer/task-tracker/index_html?method=entry&id=258893
+#if defined(Q_QDOC) || !defined(Q_OS_SYMBIAN)
Q_PROPERTY(QPainter::RenderHints renderHints READ renderHints WRITE setRenderHints)
+#endif
Q_FLAGS(QPainter::RenderHints)
public:
explicit QWebView(QWidget* parent = 0);
@@ -59,8 +65,6 @@ public:
QWebPage* page() const;
void setPage(QWebPage* page);
- static QUrl guessUrlFromString(const QString& string);
-
void load(const QUrl& url);
#if QT_VERSION < 0x040400 && !defined(qdoc)
void load(const QWebNetworkRequest& request);
@@ -162,6 +166,7 @@ protected:
private:
friend class QWebPage;
QWebViewPrivate* d;
+ Q_PRIVATE_SLOT(d, void _q_pageDestroyed())
};
#endif // QWEBVIEW_H
diff --git a/src/3rdparty/webkit/WebKit/qt/ChangeLog b/src/3rdparty/webkit/WebKit/qt/ChangeLog
index 83808d24b..2f0bf17d6 100644
--- a/src/3rdparty/webkit/WebKit/qt/ChangeLog
+++ b/src/3rdparty/webkit/WebKit/qt/ChangeLog
@@ -1,3 +1,3587 @@
+2009-11-28 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] SoftwareInputPanelRequest event sent when clicking in newly loaded page
+
+ https://bugs.webkit.org/show_bug.cgi?id=31401
+
+ Don't set the event unless there is a focused node we can use
+ for editing afterwards.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::handleSoftwareInputPanel):
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::inputMethods):
+
+2009-11-23 David Boddie <dboddie@trolltech.com>
+
+ Reviewed by Simon Hausmann.
+
+ Updated the QWebElement documentation with links to examples and
+ external resources.
+ Fixed the project file for the webelement snippet and tidied up the
+ markers used for quoting the code.
+
+ * Api/qwebelement.cpp:
+ * docs/webkitsnippets/webelement/main.cpp:
+ (findAll):
+ * docs/webkitsnippets/webelement/webelement.pro:
+
+2009-11-23 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Wrong runtime instance objects of wrapped QObjects may be used if
+ the wrapped object died before the gc removed the instance.
+
+ https://bugs.webkit.org/show_bug.cgi?id=31681
+
+ Added a unit-test to verify that wrapping a QObject with the
+ same identity as a previously but now dead object works.
+
+ * tests/qwebframe/tst_qwebframe.cpp:
+
+2009-11-19 Olivier Goffart <ogoffart@trolltech.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Normalize signal and slot signatures.
+
+ * Api/qgraphicswebview.cpp:
+ (QGraphicsWebView::setPage):
+ * Api/qwebview.cpp:
+ (QWebView::setPage):
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::setFrame):
+ * docs/webkitsnippets/qtwebkit_qwebinspector_snippet.cpp:
+ (wrapInFunction):
+ * tests/qwebframe/tst_qwebframe.cpp:
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::modified):
+ (tst_QWebPage::database):
+
+2009-11-18 Paul Olav Tvete <paul.tvete@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Make the QWebElement::render() test pass when pixmaps aren't 32 bit.
+
+ * tests/qwebelement/tst_qwebelement.cpp:
+ (tst_QWebElement::render):
+
+2009-11-18 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Clarify and simplify the legal section in the overview documentation,
+ after review with our legal team.
+
+ * docs/qtwebkit.qdoc:
+
+2009-11-18 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed and suggested by Tor Arne Vestbø.
+
+ Fix the autotest after commit ecbb2c0dd21bfc197e1f7b53150ec9b1a1d8cb8f
+ to compare the Qt::ImFont property's family against an explicitly
+ previously configured family.
+
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::inputMethods):
+
+2009-11-16 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ API documentation fixes.
+
+ * Api/qgraphicswebview.cpp: Removed duplicate docs.
+ * Api/qwebelement.cpp: Added missing docs.
+ * Api/qwebsettings.cpp: Ditto.
+
+2009-11-14 Antonio Gomes <tonikitoo@webkit.org>
+
+ Reviewed by Antti Koivisto.
+
+ [Qt] Broken back/forward after using ErrorPageExtension to set error page
+ https://bugs.webkit.org/show_bug.cgi?id=30573
+
+ Implemented autotests for covering the back/forward
+ reset problem involving error pages.
+
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::errorPageExtension):
+
+2009-11-16 Holger Hans Peter Freyther <zecke@selfish.org>
+
+ Reviewed by NOBODY (OOPS!).
+
+ [Qt] Do not show the QWidget when the WebCore::Widget is hidden
+ https://bugs.webkit.org/show_bug.cgi?id=31203
+
+ The clipping code was making a QWidget visible even if the
+ WebCore::Widget was hidden. Fix the bug by calling setVisible
+ only if the WebCore::Widget is shown.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::QtPluginWidget::show): Override WebCore::Widget
+ (WebCore::QtPluginWidget::hide): Override WebCore::Widget
+ (WebCore::QtPluginWidget::handleVisibility): New method to call setVisible when we are visible
+ (FrameLoaderClientQt::createPlugin): Hide the QWidget by default
+
+2009-11-09 Benjamin Poulain <benjamin.poulain@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ https://bugs.webkit.org/show_bug.cgi?id=30628
+ Add an API to get all the attributes from a QWebElement.
+
+ * Api/qwebelement.cpp:
+ (QWebElement::attributesName):
+ * Api/qwebelement.h:
+ * tests/qwebelement/tst_qwebelement.cpp:
+ (tst_QWebElement::listAttributes):
+
+2009-11-13 Andras Becsi <becsi.andras@stud.u-szeged.hu>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Enable Page Cache if setMaximumPagesInCache needs it.
+ This fixes https://bugs.webkit.org/show_bug.cgi?id=31266.
+
+ * Api/qwebsettings.cpp:
+ (QWebSettingsPrivate::apply):
+ (QWebSettings::setMaximumPagesInCache):
+
+2009-11-13 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Update documentation for the Qt API
+
+ * Api/qgraphicswebview.cpp:
+ * Api/qwebelement.cpp:
+ * Api/qwebframe.cpp:
+ * Api/qwebsettings.cpp:
+ * Api/qwebview.cpp:
+
+2009-11-13 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Use correct install-path when running qdoc3
+
+ * docs/docs.pri:
+
+2009-11-12 Antonio Gomes <tonikitoo@webkit.org>
+
+ Reviewed by Jan Alonzo.
+
+ [Qt] Various doc fixes
+ https://bugs.webkit.org/show_bug.cgi?id=31358
+
+ QWebPage's constructor docs are mentioning "QWebView":
+ "Constructs an empty QWebView with parent".
+
+ * Api/qwebpage.cpp:
+
+2009-11-11 Antonio Gomes <tonikitoo@webkit.org>
+
+ Reviewed by Kenneth Christiansen.
+
+ [Qt] Various doc fixes
+ https://bugs.webkit.org/show_bug.cgi?id=31358
+
+ Fixed wrong documentation: item's dimensions do fit to Web page
+ content by default.
+
+ Kenneth agreed to land this as a followup patch to the
+ just landed documentation patch.
+
+ * Api/qgraphicswebview.cpp:
+
+2009-11-11 David Boddie <dboddie@trolltech.com>
+
+ Reviewed by Kenneth Christiansen.
+
+ [Qt] Various doc fixes
+ https://bugs.webkit.org/show_bug.cgi?id=31323
+
+ Fixed and synchronized QWebView related documentation.
+
+ * Api/qgraphicswebview.cpp:
+ * Api/qwebview.cpp:
+
+2009-11-09 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Few classes have virtual functions but non-virtual destructor
+ https://bugs.webkit.org/show_bug.cgi?id=31269
+
+ * Api/qgraphicswebview.cpp:
+ (QGraphicsWebViewPrivate::~QGraphicsWebViewPrivate): Add virtual
+ destructor.
+
+2009-10-30 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by NOBODY (OOPS!).
+
+ [Qt] Use the default timeout interval for JS as the HTML tokenizer delay for setHtml()
+
+ This ensures that long-running JavaScript (for example due to a modal alert() dialog),
+ will not trigger a deferred load after only 500ms (the default tokenizer delay) while
+ still giving a reasonable timeout (10 seconds) to prevent deadlock.
+
+ https://bugs.webkit.org/show_bug.cgi?id=29381
+
+ * Api/qwebframe.cpp: Document the behaviour
+ * WebCoreSupport/FrameLoaderClientQt.cpp: set the custom tokenizer delay for substitute loads
+ * tests/qwebframe/tst_qwebframe.cpp: Add test
+
+2009-11-13 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Fix initial QWebView focus behavior.
+
+ focusController->setFocused(true) was not always called.
+ https://bugs.webkit.org/show_bug.cgi?id=31466
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::focusInEvent):
+
+2009-11-12 Benjamin Poulain <benjamin.poulain@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Custom printing shrink factors
+ https://bugs.webkit.org/show_bug.cgi?id=29042
+
+ This reverts commit r49769. The public API for this needs to be reviewed
+ before its inclusion in Qt.
+
+ * Api/qwebsettings.cpp:
+ (QWebSettingsPrivate::apply):
+ (QWebSettings::QWebSettings):
+ * Api/qwebsettings.h:
+
+2009-11-11 Liang QI <liang.qi@nokia.com>
+ Update documentation for the Qt API
+
+ * Api/qgraphicswebview.cpp:
+ * Api/qwebelement.cpp:
+ * Api/qwebframe.cpp:
+ * Api/qwebsettings.cpp:
+ * Api/qwebview.cpp:
+
+2009-11-13 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+
+ [Qt] Fix tst_qwebpage and tst_qwebframe compilation on Symbian.
+
+ * tests/qwebframe/qwebframe.pro:
+ * tests/qwebframe/tst_qwebframe.cpp:
+ * tests/qwebpage/qwebpage.pro:
+ * tests/qwebpage/tst_qwebpage.cpp:
+
+2009-11-11 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ Fix a crash in the layout test plugins/document-open.html
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::toPlainText):
+
+2009-11-11 Warwick Allison <warwick.allison@nokia.com>, Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ [Qt] Regression: Preserve the parent of plugin objects when using
+ QtWebKit with only a QWebPage.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::createPlugin): Don't reparent
+ plugins to 0.
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (PluginCounterPage::PluginCounterPage): Initialize m_pluginParent to 0.
+ (PluginCounterPage::~PluginCounterPage): Delete the plugin parent later
+ (after the page)
+ (PluginTracerPage::createPlugin): Assign a dummy parent to the plugin.
+ (PluginTracerPage::PluginTracerPage): Set up the plugin parent.
+ (tst_QWebPage::createViewlessPlugin): Verify that for viewless pages the
+ plugin parent remains unchanged.
+
+2009-11-11 David Boddie <dboddie@trolltech.com>
+
+ [Qt] Doc: Added internal or hidden placeholder documentation.
+
+ * Api/qwebpage.cpp:
+
+2009-11-11 Martin Smith <msmith@trolltech.com>
+
+ [Qt] doc: Changed Trolltech to Nokia
+
+ * Api/qwebview.cpp:
+
+2009-11-10 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Unreviewed documentation fixes.
+
+ Added a few improvements from Jocelyn Turcotte to the
+ createWindow docs.
+
+ * Api/qwebview.cpp:
+
+2009-11-10 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Unreviewed documentation fix.
+
+ [Qt] Make qwebpage's createWindow not qwebview dependent.
+ https://bugs.webkit.org/show_bug.cgi?id=30771
+
+ Update documentation to make it clear that a reimplementation
+ of the createWindow method of the associated QWebPage can
+ result in the QWebView::createWindow method to never be called.
+
+ * Api/qwebview.cpp:
+
+2009-11-11 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Fix enabling of software input panel when activating editable elements
+ in QGraphicsWebView.
+
+ * Api/qgraphicswebview.cpp:
+ (QGraphicsWebViewPrivate::inputMethodEnabled): Implement method to
+ query for input method support.
+ * Api/qwebpage.cpp:
+ (QWebPageWidgetClient::inputMethodEnabled): Ditto for QWidget.
+ (QWebPagePrivate::handleSoftwareInputPanel): Don't use view() to
+ test for input method support. Instead query using QWebPageClient
+ and send the SIPR event to the ownerWidget() instead of the view().
+ The latter is null for QGraphicsWebView.
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (EventSpy::EventSpy):
+ (EventSpy::eventFilter):
+ (tst_QWebPage::inputMethods): Modify the test to verify that SIPR
+ events are dispatched when activating focusable content.
+
+2009-11-09 Benjamin Poulain <benjamin.poulain@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ https://bugs.webkit.org/show_bug.cgi?id=30772
+ Add a non-const iterator to QWebElementCollection.
+ Move the two attributes of the iterator to private.
+
+ * Api/qwebelement.h:
+ (const_iterator::begin):
+ (const_iterator::end):
+ (const_iterator::constBegin):
+ (const_iterator::constEnd):
+ (const_iterator::iterator::iterator):
+ (const_iterator::iterator::operator*):
+ (const_iterator::iterator::operator==):
+ (const_iterator::iterator::operator!=):
+ (const_iterator::iterator::operator<):
+ (const_iterator::iterator::operator<=):
+ (const_iterator::iterator::operator>):
+ (const_iterator::iterator::operator>=):
+ (const_iterator::iterator::operator++):
+ (const_iterator::iterator::operator--):
+ (const_iterator::iterator::operator+=):
+ (const_iterator::iterator::operator-=):
+ (const_iterator::iterator::operator+):
+ (const_iterator::iterator::operator-):
+ * tests/qwebelement/tst_qwebelement.cpp:
+ (tst_QWebElement::nonConstIterator):
+ (tst_QWebElement::constIterator):
+
+2009-11-09 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Kenneth Christiansen.
+
+ [Qt] Remove the sessionStorage setting (per Page)
+ https://bugs.webkit.org/show_bug.cgi?id=31249
+
+ This setting allows to run sessionStorage on/off on a per page
+ basis. Remove this prematurely exposed API.
+
+ * Api/qwebsettings.cpp:
+ (QWebSettingsPrivate::apply):
+ (QWebSettings::QWebSettings):
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::database):
+ (tst_QWebPage::testOptionalJSObjects):
+
+2009-11-09 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Remove the QWebPage:webInspectorTriggered signal.
+ User customization of the communication between QWebPage
+ and QWebInspector will be properly designed in the next version.
+ https://bugs.webkit.org/show_bug.cgi?id=30773
+
+ * Api/qwebinspector.cpp:
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::getOrCreateInspector):
+ (QWebPage::triggerAction):
+ * Api/qwebpage.h:
+ * QtLauncher/main.cpp:
+ (MainWindow::MainWindow):
+
+2009-11-05 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Added a missing re-implementation of QGraphicsItem::inputMethodQuery().
+
+ * Api/qgraphicswebview.cpp:
+ (QGraphicsWebView::inputMethodQuery):
+ * Api/qgraphicswebview.h:
+
+2009-11-04 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Provide a dummy re-implementation of QGraphicsLayoutItem::sizeHint(),
+ similar to QWebView.
+
+ * Api/qgraphicswebview.cpp:
+ (QGraphicsWebView::sizeHint):
+ * Api/qgraphicswebview.h:
+
+2009-11-04 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Removed zoomFactoryChanged() signal and added
+ linkClicked() to QGraphicsWebView, for consistency with
+ QWebView.
+
+ * Api/qgraphicswebview.cpp:
+ (QGraphicsWebView::setPage):
+ (QGraphicsWebView::setZoomFactor):
+ * Api/qgraphicswebview.h:
+
+2009-11-04 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Added QGraphicsWebView::findText() for convenience and consistency
+ with QWebView.
+
+ * Api/qgraphicswebview.cpp:
+ (QGraphicsWebView::findText):
+ * Api/qgraphicswebview.h:
+
+2009-11-04 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Added QGraphicsWebView::pageAction() and triggerPageAction(), for
+ consistency with QWebView.
+
+ * Api/qgraphicswebview.cpp:
+ (QGraphicsWebView::pageAction):
+ (QGraphicsWebView::triggerPageAction):
+ * Api/qgraphicswebview.h:
+
+2009-11-04 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Removed QGraphicsWebView::toHtml() after API review.
+
+ That's consistent with QWebView and also based on the assumption that
+ toHtml() is called less frequently than setHtml().
+
+ * Api/qgraphicswebview.cpp:
+ * Api/qgraphicswebview.h:
+ * tests/qgraphicswebview/tst_qgraphicswebview.cpp:
+ (tst_QGraphicsWebView::qgraphicswebview):
+
+2009-11-04 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Removed the interactive property of QGraphicsWebView.
+
+ There are clearly use-cases for this feature, but it will require
+ more work to make this fully work with an enum to have fine-grained
+ control over the interactivity levels. For now it is easy to achieve
+ in user-code what the boolean property did.
+
+ * Api/qgraphicswebview.cpp:
+ (QGraphicsWebViewPrivate::QGraphicsWebViewPrivate):
+ (QGraphicsWebView::hoverMoveEvent):
+ (QGraphicsWebView::mouseMoveEvent):
+ (QGraphicsWebView::mousePressEvent):
+ (QGraphicsWebView::mouseReleaseEvent):
+ (QGraphicsWebView::mouseDoubleClickEvent):
+ (QGraphicsWebView::keyPressEvent):
+ (QGraphicsWebView::keyReleaseEvent):
+ (QGraphicsWebView::dragLeaveEvent):
+ (QGraphicsWebView::dragMoveEvent):
+ (QGraphicsWebView::dropEvent):
+ (QGraphicsWebView::wheelEvent):
+ (QGraphicsWebView::inputMethodEvent):
+ * Api/qgraphicswebview.h:
+ * tests/qgraphicswebview/tst_qgraphicswebview.cpp:
+ (tst_QGraphicsWebView::qgraphicswebview):
+
+2009-11-04 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Make the QGraphicsWebView constructor explicit.
+
+ * Api/qgraphicswebview.h:
+
+2009-11-05 Simon Hausmann <hausmann@webkit.org>
+
+ Last Qt 4.5 build fix (*sigh*)
+
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (inputMethodHints): inputMethodHints() is only used for
+ Qt 4.6, so guard the whole function.
+
+2009-11-05 Simon Hausmann <hausmann@webkit.org>
+
+ Another prospective build fix against Qt 4.5 (build bot)
+
+ Don't compile & run the QGraphicsWebView portion of the
+ input methods auto test with Qt 4.5.
+
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::inputMethods_data):
+ (inputMethodHints):
+ (inputMethodEnabled):
+ (tst_QWebPage::inputMethods):
+
+2009-11-05 Simon Hausmann <hausmann@webkit.org>
+
+ Prospective build fix against Qt 4.5 (build bot)
+
+ * Api/qgraphicswebview.cpp:
+ (QGraphicsWebViewPrivate::setInputMethodEnabled): Guard the
+ use of Qt 4.6 specific API with #ifdefs.
+
+2009-11-01 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Kenneth Christiansen.
+
+ [Qt] Fix enabling of input method support on QGraphicsWebView.
+ https://bugs.webkit.org/show_bug.cgi?id=30605
+
+ Instead of setting the unsupported widget attribute on the
+ QGraphicsWidget in setInputMethodEnabled() set the
+ ItemAcceptsInputMethod GraphicsItem flag directly.
+
+ Changed the existing input method auto test to run once
+ on a QWebView and once on a QGraphicsWebView.
+
+ * Api/qgraphicswebview.cpp:
+ (QGraphicsWebViewPrivate::setInputMethodEnabled):
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::inputMethods_data):
+ (inputMethodHints):
+ (inputMethodEnabled):
+ (tst_QWebPage::inputMethods):
+
+2009-11-04 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Kenneth Christiansen.
+
+ Added QGraphicsWebView::modified property, for consistency
+ with QWebView.
+
+ * Api/qgraphicswebview.cpp:
+ (QGraphicsWebView::isModified):
+ * Api/qgraphicswebview.h:
+ * tests/qgraphicswebview/tst_qgraphicswebview.cpp:
+ (tst_QGraphicsWebView::qgraphicswebview):
+
+2009-11-04 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Kenneth Christiansen.
+
+ Removed status and progress properties of QGraphicsWebView.
+ Added loadProgress and statusBarMessage signals instead,
+ after API review.
+
+ * Api/qgraphicswebview.cpp:
+ (QGraphicsWebViewPrivate::QGraphicsWebViewPrivate):
+ (QGraphicsWebView::setPage):
+ * Api/qgraphicswebview.h:
+ * tests/qgraphicswebview/tst_qgraphicswebview.cpp:
+ (tst_QGraphicsWebView::qgraphicswebview):
+
+2009-11-04 Yael Aharon <yael.aharon@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] REGRESSION: Allow applications to use their own QWidget bypassing QWebView.
+ https://bugs.webkit.org/show_bug.cgi?id=30979
+
+ Decouple QWebViewPrivate from QWebPageClient, and automatically create
+ QWebPageWidgetClient whenever the view is QWidget based.
+
+ * Api/qwebpage.cpp:
+ (QWebPageWidgetClient::QWebPageWidgetClient):
+ (QWebPageWidgetClient::scroll):
+ (QWebPageWidgetClient::update):
+ (QWebPageWidgetClient::setInputMethodEnabled):
+ (QWebPageWidgetClient::setInputMethodHint):
+ (QWebPageWidgetClient::cursor):
+ (QWebPageWidgetClient::updateCursor):
+ (QWebPageWidgetClient::palette):
+ (QWebPageWidgetClient::screenNumber):
+ (QWebPageWidgetClient::ownerWidget):
+ (QWebPageWidgetClient::pluginParent):
+ (QWebPage::setView):
+ * Api/qwebview.cpp:
+ (QWebView::~QWebView):
+ (QWebView::setPage):
+ (QWebView::event):
+
+2009-11-03 Andras Becsi <becsi.andras@stud.u-szeged.hu>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Fix build of unit-test after r50454.
+
+ * tests/qwebpage/tst_qwebpage.cpp:
+
+2009-11-03 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Make QWebPluginDatabase private API for now.
+
+ https://bugs.webkit.org/show_bug.cgi?id=30775
+
+ * Api/headers.pri:
+ * Api/qwebplugindatabase.cpp:
+ * Api/qwebplugindatabase_p.h: Renamed from WebKit/qt/Api/qwebplugindatabase.h.
+ * Api/qwebsettings.cpp:
+ * Api/qwebsettings.h:
+ * QtLauncher/main.cpp:
+ (MainWindow::setupUI):
+ * tests/tests.pro:
+
+2009-11-03 Simon Hausmann <hausmann@webkit.org>
+
+ Rubber-stamped by Tor Arne Vestbø.
+
+ Oops, also remove the API docs of the removed networkRequestStarted() signal.
+
+ * Api/qwebpage.cpp:
+
+2009-11-03 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Replace the QWebPage::networkRequestStarted() signal with the originatingObject
+ property set to the QWebFrame that belongs to the request.
+
+ https://bugs.webkit.org/show_bug.cgi?id=29975
+
+ * Api/qwebpage.h:
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNewWindowAction):
+ (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction):
+ (WebCore::FrameLoaderClientQt::startDownload):
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::loadFinished):
+ (TestNetworkManager::createRequest):
+ (tst_QWebPage::originatingObjectInNetworkRequests):
+
+2009-11-02 Jedrzej Nowacki <jedrzej.nowacki@nokia.com>
+
+ Reviewed by Adam Barth.
+
+ QWebView crash fix.
+
+ The QWebView should not crash if the stop() method is called from
+ a function triggered by the loadProgress signal.
+
+ A null pointer protection was added in the ProgressTracker::incrementProgress.
+
+ New autotest was created.
+
+ https://bugs.webkit.org/show_bug.cgi?id=29425
+
+ * tests/qwebview/tst_qwebview.cpp:
+ (WebViewCrashTest::WebViewCrashTest):
+ (WebViewCrashTest::loading):
+ (tst_QWebView::crashTests):
+
+2009-10-30 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ [Qt] Remove the QWebInspector::windowTitleChanged signal,
+ QEvent::WindowTitleChange can be used to achieve the same.
+ https://bugs.webkit.org/show_bug.cgi?id=30927
+
+ * Api/qwebinspector.cpp:
+ * Api/qwebinspector.h:
+ * WebCoreSupport/InspectorClientQt.cpp:
+ (WebCore::InspectorClientQt::updateWindowTitle):
+
+2009-10-29 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ [Qt] Implement DELETE HTTP method for XmlHttpRequest
+ https://bugs.webkit.org/show_bug.cgi?id=30894
+
+ No new tests as this functionality is already tested by the
+ xmlhttprequest LayoutTests. As this patch depends on an unreleased
+ version of the dependent QtNetwork library and the tests will be
+ enabled later once the dependent library is released (and the
+ buildbot is updated).
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::load):
+
+2009-10-29 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Remove QWebView::guessUrlFromString() and replace its use
+ with the new QUrl::fromUserInput() if using Qt 4.6 or newer.
+
+ * Api/qwebview.cpp:
+ * Api/qwebview.h:
+ * QGVLauncher/main.cpp:
+ (urlFromUserInput):
+ (WebPage::applyProxy):
+ (MainWindow::load):
+ * QtLauncher/main.cpp:
+ (urlFromUserInput):
+ (MainWindow::MainWindow):
+ (MainWindow::changeLocation):
+ * tests/qwebview/tst_qwebview.cpp:
+
+2009-10-28 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Serialize directly to the stream, and not first to an QByteArray,
+ that is later serialized. That is slower and also uses more bytes.
+
+ * Api/qwebhistory.cpp:
+ (operator<<):
+ (operator>>):
+
+2009-10-28 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ [Qt] WebFrame::counterValueForElementById must not be exposed
+ https://bugs.webkit.org/show_bug.cgi?id=30882
+
+ * Api/qwebframe.cpp:
+ (qt_drt_counterValueForElementById):
+ * Api/qwebframe.h:
+
+2009-10-27 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ Provide a way to get counter values with layoutTestContoller
+ https://bugs.webkit.org/show_bug.cgi?id=30555
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::counterValueForElementById):
+ (QWebHitTestResult::frame):
+ * Api/qwebframe.h:
+
+2009-10-28 Antonio Gomes <tonikitoo@webkit.org>
+
+ Pushing missing WebKit/qt/tests/qwebframe/resources/ dir from bug 29248.
+
+ [Qt] [API] Make it possible to have 'invisible' loads
+ https://bugs.webkit.org/show_bug.cgi?id=29248
+
+ * tests/qwebframe/resources/image2.png: Copied from WebKit/qt/tests/qwebelement/image.png.
+
+2009-10-28 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Tor Arne Vestbø.
+
+ [Qt] QWebHistory::saveState() is inconsistent with the Qt API
+ https://bugs.webkit.org/show_bug.cgi?id=30710
+
+ Make the versioning internal and enforce it in the WebCore
+ part. Adjust the comments, as well as remove now dead code.
+
+ * Api/qwebhistory.cpp:
+ (operator<<):
+ (operator>>):
+ * Api/qwebhistory.h:
+
+2009-10-28 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Holger Freyther.
+
+ [Qt] QWebHistory::saveState() is inconsistent with the Qt API
+ https://bugs.webkit.org/show_bug.cgi?id=30710
+
+ Remove the QWebHistory::saveState() and ::restoreState() as
+ they are inconsistent with the Qt API.
+
+ Update unittests to reflect the change.
+
+ * Api/qwebhistory.cpp:
+ (operator<<):
+ (operator>>):
+ * Api/qwebhistory.h:
+ * tests/qwebhistory/tst_qwebhistory.cpp:
+ (saveHistory):
+ (restoreHistory):
+ (tst_QWebHistory::saveAndRestore_crash_1):
+ (tst_QWebHistory::saveAndRestore_crash_2):
+ (tst_QWebHistory::saveAndRestore_crash_3):
+ (tst_QWebHistory::clear):
+
+2009-10-27 Antonio Gomes <tonikitoo@webkit.org>
+
+ Reviewed by Holger Freyther.
+
+ Complementary fix to bug 30779.
+
+ By mistake I used QWeakPointer's toStrongRef() method which docs
+ explicitly say to not be used in this situation (when the tracked
+ pointer is devired from QObject). Instead QWeakPointer's data()
+ is recommended.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::view):
+
+2009-10-27 Holger Hans Peter Freyther <zecke@selfish.org>
+
+ Reviewed by Simon Fraser.
+
+ Change HitTestResult methods to use (3d) transformation aware methods
+ https://bugs.webkit.org/show_bug.cgi?id=27347
+
+ The HitTestResult::boundingBox method was removed. The
+ RenderObject must be used directly. In contrast to the
+ old HitTestResult::boundingBox method this code must use
+ a (3d) transformation aware method to not run into an
+ assert in SVGRenderBase::mapLocalToContainer.
+
+ * Api/qwebframe.cpp:
+ (QWebHitTestResultPrivate::QWebHitTestResultPrivate):
+
+2009-10-27 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Rubberstamped by Oliver Hunt.
+
+ Change two methods to be internal for DRT use only.
+
+ Part of [Qt] Review all new API in Qt 4.6
+ https://bugs.webkit.org/show_bug.cgi?id=29843#c11
+
+ * Api/qwebsecurityorigin.cpp:
+ (qt_drt_whiteListAccessFromOrigin):
+ (qt_drt_resetOriginAccessWhiteLists):
+ (QWebSecurityOrigin::localSchemes):
+ * Api/qwebsecurityorigin.h:
+
+2009-10-27 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Make sure that initiating a rotation while rotating won't make
+ it end up at rotation positions that are not a multiply of
+ 180 degrees.
+
+ * QGVLauncher/main.cpp:
+ (MainView::animatedFlip):
+
+2009-10-27 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Unreviewed Qt build fix.
+
+ Update the tests as well to the new API change.
+
+ * tests/qwebelement/tst_qwebelement.cpp:
+ (tst_QWebElement::clear):
+
+2009-10-27 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Rubberstamped by Tor Arne Vestbø.
+
+ [Qt] QWebElement::removeChildren() should be
+ QWebElement::removeAllChildren()
+ https://bugs.webkit.org/show_bug.cgi?id=30630
+
+ * Api/qwebelement.cpp:
+ (QWebElement::removeAllChildren):
+ * Api/qwebelement.h:
+
+2009-10-27 Antonio Gomes <tonikitoo@webkit.org>
+
+ Reviewed by Antti Koivisto and Holger Freyther.
+
+ Make QWebPagePrivate's (QWidget) view to be a QWeakPointer.
+ https://bugs.webkit.org/show_bug.cgi?id=30779
+
+ The fact that it was been set from external objects of qwebpage
+ and not being deleted internally can lead to dangling references.
+
+ * Api/qgraphicswebview.cpp:
+ (QGraphicsWebView::~QGraphicsWebView):
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate):
+ (QWebPagePrivate::createContextMenu):
+ (QWebPagePrivate::handleSoftwareInputPanel):
+ (QWebPagePrivate::keyPressEvent):
+ (QWebPage::setView):
+ (QWebPage::view):
+ (QWebPage::javaScriptAlert):
+ (QWebPage::javaScriptConfirm):
+ (QWebPage::javaScriptPrompt):
+ (QWebPage::shouldInterruptJavaScript):
+ (QWebPage::createWindow):
+ (QWebPage::extension):
+ (QWebPage::chooseFile):
+ (QWebPage::userAgentForUrl):
+ * Api/qwebpage_p.h:
+ * Api/qwebview.cpp:
+ (QWebView::~QWebView):
+
+2009-10-26 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Unreviewed documentation fix from David Boddie (Qt Doc Team)
+
+ Removes the check around the RenderHints property documentation
+ that was clearly added to synchronize the source and header files
+ when the #if !defined(Q_OS_SYMBIAN) guards was added to the
+ property.
+
+ The documentation has also been updated to ensure that Symbian
+ users know that there is no actual RenderHints property on their
+ platform.
+
+ * Api/qwebview.cpp:
+
+2009-10-26 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Unreviewed documentation fix from David Boddie (Qt Doc Team)
+
+ Ensure that qdoc will always see the RenderHints property.
+
+ The property was only defined in the header file if the Q_OS_SYMBIAN
+ symbol was not defined, resulting in the property not showing up
+ in the Qt documentation just because one platform doesn't support it.
+
+ A follow up commit will improve the documentation for the property
+ and note that it is not supported on the Symbiam platform.
+
+ * Api/qwebview.h:
+
+2009-10-26 Benjamin Poulain <benjamin.poulain@nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ [Qt] Reintroduce QWebElementCollection
+
+ Revert the patch that has replaced QWebElementCollection
+ with QList<QWebElement>. Update the tests accordingly.
+
+ Remove the constness of the return type of QWebElement operator[].
+
+ https://bugs.webkit.org/show_bug.cgi?id=30767
+
+ * Api/qwebelement.cpp:
+ (QWebElement::findAll):
+ (QWebElementCollectionPrivate::QWebElementCollectionPrivate):
+ (QWebElementCollectionPrivate::create):
+ (QWebElementCollection::QWebElementCollection):
+ (QWebElementCollection::operator=):
+ (QWebElementCollection::~QWebElementCollection):
+ (QWebElementCollection::operator+):
+ (QWebElementCollection::append):
+ (QWebElementCollection::count):
+ (QWebElementCollection::at):
+ (QWebElementCollection::toList):
+ * Api/qwebelement.h:
+ (const_iterator::begin):
+ (const_iterator::end):
+ (const_iterator::operator[]):
+ * Api/qwebframe.cpp:
+ (QWebFrame::findAllElements):
+ * Api/qwebframe.h:
+ * QtLauncher/main.cpp:
+ (MainWindow::selectElements):
+ * tests/qwebelement/tst_qwebelement.cpp:
+ (tst_QWebElement::simpleCollection):
+ (tst_QWebElement::iteration):
+ (tst_QWebElement::emptyCollection):
+ (tst_QWebElement::appendCollection):
+ (tst_QWebElement::nullSelect):
+ (tst_QWebElement::hasSetFocus):
+ (tst_QWebElement::render):
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::inputMethods):
+
+2009-10-24 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Holger Freyther.
+
+ [Qt] [Symbian] Set the capability and memory required to run QtWebKit for Symbian
+ https://bugs.webkit.org/show_bug.cgi?id=30476
+
+ Assign ReadUserData WriteUserData NetworkServices Symbian capabilities
+ to all QtWebkit executables.
+
+ * QGVLauncher/QGVLauncher.pro:
+ * QtLauncher/QtLauncher.pro:
+ * tests/benchmarks/loading/tst_loading.pro:
+ * tests/benchmarks/painting/tst_painting.pro:
+ * tests/qgraphicswebview/qgraphicswebview.pro:
+ * tests/qwebelement/qwebelement.pro:
+ * tests/qwebframe/qwebframe.pro:
+ * tests/qwebhistory/qwebhistory.pro:
+ * tests/qwebhistoryinterface/qwebhistoryinterface.pro:
+ * tests/qwebpage/qwebpage.pro:
+ * tests/qwebplugindatabase/qwebplugindatabase.pro:
+ * tests/qwebview/qwebview.pro:
+
+2009-10-22 Gavin Barraclough <barraclough@apple.com>
+
+ Reviewed by NOBODY (speculative build fix - qt is currently already broken!)
+ Build fix following bug #30696.
+
+ * Api/qwebelement.cpp:
+ (setupScriptContext):
+ * Api/qwebframe.cpp:
+ (QWebFrame::evaluateJavaScript):
+
+2009-10-22 Shu Chang <Chang.Shu@nokia.com>
+
+ Reviewed by Eric Seidel.
+
+ [Qt] Enable track visited links in QWebPage
+ https://bugs.webkit.org/show_bug.cgi?id=30574
+
+ Test: fast/history/clicked-link-is-visited.html
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate):
+
+2009-10-22 Girish Ramakrishnan <girish@forwardbias.in>
+
+ Reviewed by Eric Seidel.
+
+ [Qt] Add Print Shortcut to QtLauncher
+
+ https://bugs.webkit.org/show_bug.cgi?id=30682
+
+ * QtLauncher/main.cpp:
+ (MainWindow::setupUI):
+
+2009-10-22 Antonio Gomes <tonikitoo@webkit.org>
+
+ Rubberstamped by Tor Arne Vestbø.
+
+ Code standarlization for QGVLauncher.
+
+ 1) Made member initilization lists in constructors
+ to be per line.
+ 2) Made applyProxy method inline as all other methods in
+ WebPage class.
+
+ * QGVLauncher/main.cpp:
+ (WebPage::WebPage):
+ (WebPage::applyProxy):
+ (MainView::MainView):
+ (MainWindow::MainWindow):
+ (MainWindow::init):
+
+2009-10-22 Antonio Gomes <tonikitoo@webkit.org>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Add a Y-Axis rotation to QGVLauncher.
+
+ It uses the QStateMachine API from Qt 4.6.
+
+ * QGVLauncher/main.cpp:
+ (WebView::WebView):
+ (WebView::setYRotation):
+ (WebView::yRotation):
+ (MainView::flip):
+ (MainView::animatedYFlip):
+ (SharedScene::SharedScene):
+ (SharedScene::webView):
+ (MainWindow::init):
+ (MainWindow::animatedYFlip):
+ (MainWindow::buildUI):
+
+2009-10-20 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed By Adam Barth.
+
+ Add some actions to the menu for cursor debugging.
+
+ GraphicsView based launcher only.
+
+ * QGVLauncher/main.cpp:
+ (MainView::setWaitCursor):
+ (MainView::resetCursor):
+ (MainView::flip):
+ (MainWindow::setWaitCursor):
+ (MainWindow::resetCursor):
+ (MainWindow::buildUI):
+
+2009-10-20 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Rubberstamped by Adam Barth.
+
+ Remove clipRenderToViewport as agreed upon in
+ https://bugs.webkit.org/show_bug.cgi?id=29843
+
+ * Api/qwebframe.cpp:
+ * Api/qwebframe.h:
+ * Api/qwebframe_p.h:
+ (QWebFramePrivate::QWebFramePrivate):
+
+2009-10-20 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Update the tests to test the new render functionality, and take
+ into consideration that render() clips to the frame itself as well
+ as the viewport.
+
+ QWebFrame::render() now always clips, so the old tests were bogus.
+
+ Rendering pure contents (no scrollbars etc) without clipping can now
+ be accomplished using QWebFrame::documentElement()->render(...)
+
+ * Api/qwebframe.cpp:
+ * Api/qwebframe.h:
+ * Api/qwebframe_p.h:
+ (QWebFramePrivate::QWebFramePrivate):
+ * tests/qwebframe/tst_qwebframe.cpp:
+
+2009-10-20 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Rubberstamped by Adam Barth.
+
+ As we do not support rendering a QWebFrame without it being clipped
+ the the frame as well as the viewport, we now set the viewport size
+ to the size of the contents.
+
+ Rendering pure contents (no scrollbars etc) without clipping can be
+ acomplished using QWebFrame::documentElement()->render(...)
+
+ * tests/qwebelement/tst_qwebelement.cpp:
+ (tst_QWebElement::render):
+
+2009-10-20 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Add menu item to dump the plugin list to the console,
+ which can be handy for debugging.
+
+ * QtLauncher/main.cpp:
+ (MainWindow::dumpPlugins):
+ (MainWindow::setupUI):
+
+2009-10-19 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Introduce new render method on QWebFrame, which supports specifying
+ which layers to render (scrollbars, contents, pan-icon).
+
+ * Api/qwebframe.cpp:
+ (QWebFramePrivate::renderPrivate):
+ (QWebFrame::render):
+ * Api/qwebframe.h:
+ * Api/qwebframe_p.h:
+
+2009-10-19 Antonio Gomes <tonikitoo@webkit.org>
+
+ Reviewed by Ariya Hidayat.
+
+ [Qt] Infinite loop (leading to crash) when setting cursor in QGraphicsWebView
+ https://bugs.webkit.org/show_bug.cgi?id=30549
+
+ Patch reimplements QGraphicsItem's itemChange method, and make
+ CursorChange event to be emitted after cursor has already been
+ set.
+
+ QWidget::setCursor send the event just after it sets the cursor,
+ then patch makes both behaviors compatible.
+
+ * Api/qgraphicswebview.cpp:
+ (QGraphicsWebView::itemChange):
+ * Api/qgraphicswebview.h:
+
+2009-10-19 Nate Chapin <japhet@chromium.org>
+
+ Unreviewed, build fix.
+
+ Update call to FrameLoader::loadFrameRequest().
+
+ * Api/qwebpage.cpp:
+ (QWebPage::triggerAction):
+
+2009-10-19 Viatcheslav Ostapenko <ostapenko.viatcheslav@nokia.com>
+
+ Reviewed by Ariya Hidayat.
+
+ Add QWebElement::render API which allows rendering of single
+ element.
+
+ * Api/qwebelement.cpp:
+ (QWebElement::render):
+ * Api/qwebelement.h:
+ * tests/qwebelement/tst_qwebelement.cpp:
+ (tst_QWebElement::render):
+ * tests/qwebelement/qwebelement.qrc:
+ * tests/qwebelement/image.png: Added.
+
+2009-10-19 Markus Goetz <Markus.Goetz@nokia.com>
+
+ Reviewed by Ariya Hidayat.
+
+ QWebPage: Doc: setNetworkAccessManager should only be called once.
+
+ * Api/qwebpage.cpp:
+
+2009-10-19 Antonio Gomes <tonikitoo@webkit.org>
+
+ Reviewed by Tor Arne.
+
+ Wrong ifdef combination in QGraphicsWebView's event method.
+
+ * Api/qgraphicswebview.cpp:
+ (QGraphicsWebView::event):
+
+2009-10-19 Girish Ramakrishnan <girish@forwardbias.in>
+
+ Reviewed by Holger Freyther.
+
+ [Qt] Windowed Plugins: Don't crash when client is 0.
+
+ Client is 0 when we use QWebPage without a QWebView or QGraphicsWebView.
+ In addition, setFrameRect()/updatePluginWidget() is called even if the
+ plugin was not succesfully loaded. updatePluginWidget() updates the
+ window rect which is, in theory, useful to draw something that indicates
+ that we didn't load successfully.
+
+ So, a status check is added to setNPWindowIfNeeded.
+
+ https://bugs.webkit.org/show_bug.cgi?id=30380
+
+ * tests/qwebpage/qwebpage.pro:
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (takeScreenshot):
+ (tst_QWebPage::screenshot_data):
+ (tst_QWebPage::screenshot):
+ * tests/resources/test.swf: Copied from LayoutTests/fast/replaced/resources/test.swf.
+
+2009-10-19 Girish Ramakrishnan <girish@forwardbias.in>
+
+ Reviewed by Holger Freyther.
+
+ [Qt] Windowed Plugins: Fix crash when QWebPage is deleted after QWebView.
+
+ Fixes various sources of crashes:
+ 1. The PluginContainer is a child of QWebView. When the view gets deleted,
+ the PluginView is not notified about the deletion of PluginContainer.
+ 2. QWebView destructor does not set client to 0.
+ 3. Sometimes pending paint events are sent after the plugin has died, so add
+ a check in PluginView::setNPWindowIfNeeded.
+
+ https://bugs.webkit.org/show_bug.cgi?id=30354
+
+ * Api/qwebview.cpp:
+ (QWebView::~QWebView):
+ * tests/qwebview/qwebview.pro:
+ * tests/qwebview/tst_qwebview.cpp:
+ (tst_QWebView::reusePage_data):
+ (tst_QWebView::reusePage):
+
+2009-10-19 Jakob Truelsen <antialize@gmail.com>
+
+ Reviewed by Adam Barth.
+
+ https://bugs.webkit.org/show_bug.cgi?id=29042
+
+ Allow one to costumize the minimal and maximal shrink factors,
+ Added methods setPrintingMinimumShrinkFactor, printingMinimumShrinkFactor,
+ setPrintingMaximumShrinkFactor, printingMaximumShrinkFactor to QWebSettings.
+
+
+ * Api/qwebsettings.cpp:
+ (QWebSettingsPrivate::apply):
+ (QWebSettings::QWebSettings):
+ (QWebSettings::setPrintingMinimumShrinkFactor):
+ (QWebSettings::printingMinimumShrinkFactor):
+ (QWebSettings::setPrintingMaximumShrinkFactor):
+ (QWebSettings::printingMaximumShrinkFactor):
+ * Api/qwebsettings.h:
+
+2009-10-18 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ Rename fixedContentsSize property to preferredContentsSize as
+ agreed upon with Simon Hausmann and Matthias Ettrich.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::preferredContentsSize):
+ (QWebPage::setPreferredContentsSize):
+ * Api/qwebpage.h:
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::transitionToCommittedForNewPage):
+
+2009-10-16 Antonio Gomes <tonikitoo@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] QGLauncher leaks WebPage object
+ https://bugs.webkit.org/show_bug.cgi?id=30465
+
+ Make 'SharedScene' to own 'WebPage' reference and delete it at its destructor.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::view):
+ * Api/qwebpage_p.h:
+ * QGVLauncher/main.cpp:
+ (SharedScene::SharedScene):
+ (SharedScene::~SharedScene):
+
+2009-10-16 Antonio Gomes <tonikitoo@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] "dangling" pointer to qwebpage's view object can leads QGLauncher to crash
+ https://bugs.webkit.org/show_bug.cgi?id=30459
+
+ Remove all setView(ev->widget()) calls in QWebPage and QGWV event handling methods,
+ since QWebPageClient would do the trick.
+
+ * Api/qgraphicswebview.cpp:
+ (QGraphicsWebView::hoverMoveEvent):
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::mouseMoveEvent):
+ (QWebPagePrivate::mousePressEvent):
+ (QWebPagePrivate::mouseDoubleClickEvent):
+ (QWebPagePrivate::mouseReleaseEvent):
+ (QWebPagePrivate::wheelEvent):
+ (QWebPagePrivate::dragEnterEvent):
+ (QWebPagePrivate::dragLeaveEvent):
+ (QWebPagePrivate::dragMoveEvent):
+
+2009-10-16 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Pull out r49676 as it caused build breakges on Symbian
+
+ * Api/qwebpage.cpp:
+
+2009-10-16 Yael Aharon <yael.aharon@nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ [Qt] Need a way to inform the application when a Netscape plugin is created or deleted
+ https://bugs.webkit.org/show_bug.cgi?id=30179
+
+ Added "c" style static methods for the application to hook up for
+ receiving notifications when a plugin is created or destroyed.
+
+ * Api/qwebpage.cpp:
+
+2009-10-15 Antonio Gomes <tonikitoo@webkit.org>
+
+ Rubberstamped by Tor Arne.
+
+ Make QGLauncher's WebPage class constructor to get a QObject* as parent (not QWidget*).
+
+ * QGVLauncher/main.cpp:
+ (WebPage::WebPage):
+
+2009-10-15 Antonio Gomes <tonikitoo@webkit.org>
+
+ Reviewed by Tor Arne.
+
+ [Qt] QGLauncher crashes while closing a window
+ https://bugs.webkit.org/show_bug.cgi?id=30385
+
+ Set page's pageClient reference to '0' at QGWV deletion.
+
+ * Api/qgraphicswebview.cpp:
+ (QGraphicsWebView::~QGraphicsWebView):
+ * tests/qgraphicswebview/tst_qgraphicswebview.cpp:
+ (WebPage::WebPage):
+ (WebPage::aborting):
+ (tst_QGraphicsWebView::crashOnViewlessWebPages):
+
+2009-10-13 Antonio Gomes <tonikitoo@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Make context menu to work in QGraphicsWebView
+ https://bugs.webkit.org/show_bug.cgi?id=30336
+
+ * Api/qgraphicswebview.cpp:
+ (QGraphicsWebView::event):
+
+2009-10-13 Girish Ramakrishnan <girish@forwardbias.in>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Plugins : Remove all traces of winId. Use ownerWidget() instead.
+
+ This is a bug for two reasons:
+ 1. Everytime we use winId(), we end up creating a native widget. This causes an
+ unnecessary copy of contents from the backing store to the native widget.
+ 2. Neither windowed nor windowless plugins require the winId of the QWebView or
+ QGraphicsView.
+
+ Introduce ownerWidget() which returns a QWidget * without creating a native widget
+ (as opposed to QWidget::find(winId)).
+
+ https://bugs.webkit.org/show_bug.cgi?id=30170
+
+ * Api/qgraphicswebview.cpp:
+ (QGraphicsWebViewPrivate::ownerWidget):
+ * Api/qwebview.cpp:
+ (QWebViewPrivate::ownerWidget):
+
+2009-10-13 Antonio Gomes <tonikitoo@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Add some initial autotests for QWebPage's ErrorPageExtention
+ https://bugs.webkit.org/show_bug.cgi?id=30296
+
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (ErrorPage::ErrorPage):
+ (ErrorPage::supportsExtension):
+ (ErrorPage::extension):
+ (tst_QWebPage::errorPageExtension):
+
+2009-10-13 Antonio Gomes <tonikitoo@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] better handle possible edge cases on qwebframe::requestedUrl use
+ https://bugs.webkit.org/show_bug.cgi?id=30216
+
+ QWebFrame::requestedUrl can be called at any time during the load
+ process, including:
+
+ * An error handling (whereas an alternate error page for unsuccessful
+ load is being set);
+ * A ssl error exception call;
+ * During navigation notifications/callbacks (titleChanged, urlChanged,
+ progresses, addHistoryEntry, etc);
+ * Among others.
+
+ This patch makes requestedUrl calls to fallback to FrameLoaderClient
+ m_loadError's failingURL when an error has occurred, unless it is
+ null/empty.
+
+ Also, m_loadError is now being reset at each the main frame starts a
+ load, in order to avoid previous load errors footprints.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::requestedUrl):
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::postProgressStartedNotification):
+
+2009-10-12 Jakub Wieczorek <faw217@gmail.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Missing default value for the default text encoding.
+ https://bugs.webkit.org/show_bug.cgi?id=30311
+
+ QtWebKit has provided a default, hardcoded value for default charset but since
+ the addition of the defaultTextEncoding setting in QWebSettings, that hardcoded
+ value has had no effect.
+
+ Added a regression test and unskipped fast/dom/Document/document-charset.html,
+ which is passing now.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate):
+ * Api/qwebsettings.cpp:
+ (QWebSettings::QWebSettings):
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::defaultTextEncoding):
+
+2009-10-12 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ Implement the new palette() methods on the page clients
+
+ * Api/qgraphicswebview.cpp:
+ (QGraphicsWebViewPrivate::palette):
+ * Api/qwebview.cpp:
+ (QWebViewPrivate::palette):
+
+2009-10-12 Jedrzej Nowacki <jedrzej.nowacki@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ QWebPage's createViewlessPlugin autotest crash fix.
+
+ It is possible that plugins that are QWidgets or QGraphicsWidgets
+ are created before a view has been assigned to a QWebPage. The
+ plug-ins won't be fully functional, as by design, they should
+ visualise something, but they won't crash and will stay in memory.
+
+ An autotest that covers this use-case, is included.
+
+ https://bugs.webkit.org/show_bug.cgi?id=30118
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::createPlugin):
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (PluginTrackedPageWidget::PluginTrackedPageWidget):
+ (PluginTrackedPageGraphicsWidget::PluginTrackedPageGraphicsWidget):
+ (PluginTrackedPageGraphicsWidget::createPlugin):
+ (tst_QWebPage::destroyPlugin):
+ (tst_QWebPage::createViewlessPlugin):
+
+2009-10-09 Joe Ligman <joseph.ligman@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Sets Qt::WA_InputMethodEnabled and Qt::ImhHiddenText for password fields in EditorClientQt
+ setInputMethodState. This change is needed so widgets such as the s60 software
+ input panel can receive input method events for password fields.
+ It's up to the Qt platform to determine which widget will receive input method
+ events when these flags are set.
+ Also added implementation for setInputMethodEnabled and setInputMethodHint
+ to QGraphicsWebViewPrivate and QWebViewPrivate. This change removes the direct
+ dependency on QWebView and uses QWebPageClient.
+ Added autotest to tst_qwebpage.cpp
+ https://bugs.webkit.org/show_bug.cgi?id=30023
+
+ * Api/qgraphicswebview.cpp:
+ (QGraphicsWebViewPrivate::setInputMethodEnabled):
+ (QGraphicsWebViewPrivate::setInputMethodHint):
+ * Api/qwebview.cpp:
+ (QWebViewPrivate::setInputMethodEnabled):
+ (QWebViewPrivate::setInputMethodHint):
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::setInputMethodState):
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::inputMethods):
+
+2009-10-08 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Move executeScript from FrameLoader to ScriptController
+ https://bugs.webkit.org/show_bug.cgi?id=30200
+
+ Update API call.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::evaluateJavaScript):
+
+2009-10-08 Jedrzej Nowacki <jedrzej.nowacki@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Part of testOptionalJSObjects autotest was marked as "expect to fail".
+
+ Two places in tst_QWebPage::testOptionalJSObjects were marked as
+ expected to fail. The problem concern checking if a feature is enabled
+ or disabled. According to discussion on webkit dev mailing list
+ a disabled feature should be invisible from java script level, but
+ there are exceptions from the rule. So we decided to disable the test
+ for now.
+
+ https://bugs.webkit.org/show_bug.cgi?id=29867
+
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::testOptionalJSObjects):
+
+2009-10-07 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Factor PolicyChecker out of FrameLoader
+ https://bugs.webkit.org/show_bug.cgi?id=30155
+
+ Move the policy callback to the policy object.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::callPolicyFunction):
+
+2009-10-07 Antonio Gomes <tonikitoo@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Get rid of useless loadFailed signal in QGraphicsWebView
+ https://bugs.webkit.org/show_bug.cgi?id=30166
+
+ * Api/qgraphicswebview.cpp:
+ (QGraphicsWebViewPrivate::_q_doLoadFinished):
+ * Api/qgraphicswebview.h:
+ * QGVLauncher/main.cpp:
+ (MainWindow::init):
+ (MainWindow::loadFinished):
+
+2009-10-07 Girish Ramakrishnan <girish@forwardbias.in>
+
+ Reviewed by Simon Hausmann.
+
+ Add a simple rotation effect to QGVLauncher
+
+ https://bugs.webkit.org/show_bug.cgi?id=30162
+
+ * QGVLauncher/main.cpp:
+ (MainView::animatedFlip):
+ (MainWindow::animatedFlip):
+ (MainWindow::buildUI):
+
+2009-10-07 Volker Hilsheimer <volker.hilsheimer@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Doc: Document HTML and status as properties.
+
+ * Api/qgraphicswebview.cpp:
+
+2009-10-07 Martin Smith <msmith@trolltech.com>
+
+ Reviewed by Simon Hausmann.
+
+ Fix qdoc warning about disabled renderHints property
+ on Symbian.
+
+ * Api/qwebview.cpp:
+ * Api/qwebview.h:
+
+2009-10-06 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Move setLocalLoadPolicy and friends to SecurityOrigin
+ https://bugs.webkit.org/show_bug.cgi?id=30110
+
+ Call the new API.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate):
+
+2009-10-06 Benjamin C Meyer <bmeyer@rim.com>
+
+ Reviewed by Ariya Hidayat.
+
+ When the drag data contains an image set it on the QDrag so it will be visible to the user.
+
+ * WebCoreSupport/DragClientQt.cpp:
+ (WebCore::DragClientQt::startDrag):
+
+2009-10-06 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Timothy Hatcher.
+
+ Web Inspector: close inspector client view on
+ InspectorController::close API call.
+
+ In order to run batch web inspector layout tests (and not affect
+ subsequent tests) we should close inspector client's view upon
+ InspectorController::close API call.
+
+ https://bugs.webkit.org/show_bug.cgi?id=30009
+
+ * WebCoreSupport/InspectorClientQt.cpp:
+ (WebCore::InspectorClientQt::createPage):
+
+2009-10-06 Janne Koskinen <janne.p.koskinen@digia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] don't enable input methods on Symbian by default.
+ https://bugs.webkit.org/show_bug.cgi?id=30117
+
+ If input methods are enabled Symbian FEP will be launched on every
+ pointer event making webpage navigation impossible with QWebView.
+
+ * Api/qwebview.cpp:
+ (QWebView::QWebView):
+
+2009-10-05 Holger Hans Peter Freyther <zecke@selfish.org>
+
+ Reviewed by Simon Hausmann.
+
+ QtLauncher: print the number of loaded urls
+
+ When using the -r mode print the number of URLs loaded so far. This
+ is extremly useful when opening the same URL over and over again and
+ one wants to see the progress.
+
+ * QtLauncher/main.cpp:
+ (URLLoader::URLLoader):
+ (URLLoader::loadNext):
+
+2009-10-05 Girish Ramakrishnan <girish@forwardbias.in>
+
+ Reviewed by Simon Hausmann.
+
+ Add screenshot option to menubar
+
+ https://bugs.webkit.org/show_bug.cgi?id=30067
+
+ * QtLauncher/main.cpp:
+ (MainWindow::screenshot):
+ (MainWindow::setupUI):
+
+2009-10-05 Girish Ramakrishnan <girish@forwardbias.in>
+
+ Reviewed by Simon Hausmann.
+
+ Setting the env QTLAUNCHER_USE_ARGB_VISUALS makes Qt use WA_TranslucentWindow.
+
+ https://bugs.webkit.org/show_bug.cgi?id=30068
+
+ * QtLauncher/main.cpp:
+ (MainWindow::MainWindow):
+
+2009-10-05 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Rubberstamped by Simon Hausmann.
+
+ Add documentation to the ErrorPageExtension.
+
+ * Api/qwebpage.cpp:
+
+2009-10-02 Yael Aharon <yael.aharon@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Inform the application when a new request is created
+ https://bugs.webkit.org/show_bug.cgi?id=29975
+
+ Add a signal to QWebPage, to inform the application when a request is created.
+
+ * Api/qwebpage.cpp:
+ * Api/qwebpage.h:
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::loadFinished):
+
+2009-10-05 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ ErrorPageExtension: Add a pointer to the QWebFrame that had
+ an error.
+
+ * Api/qwebpage.h:
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::callErrorPageExtension):
+
+2009-10-05 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Do not empty the offline web appcache when clearing
+ memory caches. That one is not in memory, but stored
+ in sqlite.
+
+ * Api/qwebsettings.cpp:
+ (QWebSettings::clearMemoryCaches):
+
+2009-10-05 J-P Nurmi <jpnurmi@gmail.com>
+
+ Reviewed by Simon Hausmann.
+
+ Added QGraphicsWidget-plugins support to FrameLoaderClientQt.
+
+ https://bugs.webkit.org/show_bug.cgi?id=29710
+
+ * Api/qgraphicswebview.cpp:
+ (QGraphicsWebViewPrivate::pluginParent):
+ * Api/qwebview.cpp:
+ (QWebViewPrivate::pluginParent):
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::):
+ (WebCore::FrameLoaderClientQt::createPlugin):
+
+2009-10-03 Adam Barth <abarth@webkit.org>
+
+ Unreview build fix. I wish I had a try server...
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::updateAction):
+
+2009-10-02 Norbert Leser <norbert.leser@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Conditionally guard cursor code (cursor and updateCursor functions) with !QT_NO_CURSOR.
+ Otherwise, it is inconsistent with class declaration of QCursor.
+
+ * Api/qgraphicswebview.cpp:
+ * Api/qwebview.cpp:
+
+2009-10-02 Prasanth Ullattil <prasanth.ullattil@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Fix compiler warnings about unused function arguments.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::scrollBarMinimum):
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::focusInEvent):
+ (QWebPagePrivate::focusOutEvent):
+ (QWebPagePrivate::leaveEvent):
+ (QWebPage::javaScriptAlert):
+ (QWebPage::javaScriptConfirm):
+ (QWebPage::javaScriptPrompt):
+ (QWebPage::triggerAction):
+ (QWebPage::acceptNavigationRequest):
+ (QWebPage::chooseFile):
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::repaint):
+ (WebCore::ChromeClientQt::mouseDidMoveOverElement):
+ (WebCore::ChromeClientQt::reachedMaxAppCacheSize):
+ * WebCoreSupport/ContextMenuClientQt.cpp:
+ (WebCore::ContextMenuClientQt::downloadURL):
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::dispatchWillPerformClientRedirect):
+ (WebCore::FrameLoaderClientQt::setMainFrameDocumentReady):
+ (WebCore::FrameLoaderClientQt::representationExistsForURLScheme):
+ (WebCore::FrameLoaderClientQt::generatedMIMETypeForURLScheme):
+ (WebCore::FrameLoaderClientQt::shouldGoToHistoryItem):
+ (WebCore::FrameLoaderClientQt::pluginWillHandleLoadError):
+ (WebCore::FrameLoaderClientQt::assignIdentifierToInitialRequest):
+ (WebCore::FrameLoaderClientQt::dispatchDidFinishLoading):
+ (WebCore::FrameLoaderClientQt::createJavaAppletWidget):
+ * WebCoreSupport/InspectorClientQt.cpp:
+ (WebCore::InspectorClientQt::setAttachedWindowHeight):
+ (WebCore::InspectorClientQt::highlight):
+ (WebCore::InspectorClientQt::removeSetting):
+
+2009-10-01 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Make Software Input Panel requests work with QGraphicsWebView
+ _and_ QWebView by sharing the event code in handleSoftwareInputPanel().
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::mouseReleaseEvent):
+ (QWebPagePrivate::handleSoftwareInputPanel):
+ * Api/qwebpage_p.h:
+
+2009-10-01 Alexis Menard <alexis.menard@nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Rename QWebGraphicsItem to QGraphicsWebView
+
+ * Api/headers.pri:
+ * Api/qwebpage.h:
+ * Api/qwebgraphicsitem.cpp: Renamed.
+ * Api/qwebgraphicsitem.h: Renamed.
+ * WebKit/qt/QGVLauncher/main.cpp:
+ * tests/tests.pro:
+ * tests/qwebgraphicsitem/qwebgraphicsitem.pro: Renamed.
+ * tests/qwebgraphicsitem/tst_qwebgraphicsitem.cpp: Renamed.
+
+2009-10-01 Antonio Gomes <tonikitoo@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ https://bugs.webkit.org/show_bug.cgi?id=29248
+ [Qt] [API] Make it possible to have 'invisible' loads
+
+ Make QWebFrame's setHtml and setContent methods to not change
+ session and global history at all.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::setHtml):
+ (QWebFrame::setContent):
+ * tests/qwebframe/qwebframe.pro:
+ * tests/qwebframe/tst_qwebframe.cpp:
+
+2009-10-01 Kristian Amlie <kristian.amlie@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Fixed software input panel support on web input elements.
+
+ Send the RequestSoftwareInputPanel event if the element supports focus
+ and the element is clicked.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate):
+ (QWebPagePrivate::mousePressEvent):
+ (QWebPagePrivate::mouseReleaseEvent):
+ * Api/qwebpage_p.h:
+
+2009-10-01 Joe Ligman <joseph.ligman@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Implementation for QWebPage::inputMethodQuery and QWebPagePrivate::inputMethodEvent
+
+ https://bugs.webkit.org/show_bug.cgi?id=29681
+
+ Some additional changes from Kristian Amlie <kristian.amlie@nokia.com>:
+
+ * Fixed surrounding text to exclude preedit string
+ * Avoid emission of microFocusChanged during setComposition()
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::inputMethodEvent):
+ (QWebPage::inputMethodQuery):
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::respondToChangedSelection):
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::inputMethods):
+
+2009-09-30 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by David Hyatt.
+
+ Add the failed URL to the ErrorPageExtension, as it is quite
+ useful for creating error pages.
+
+ * Api/qwebpage.h:
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::callErrorPageExtension):
+
+2009-09-29 Andras Becsi <becsi.andras@stud.u-szeged.hu>
+
+ Reviewed by Tor Arne Vestbø.
+
+ [Qt] Default font size reconciliation to 16px/13px to match other platform's de-facto standard.
+ This fixes https://bugs.webkit.org/show_bug.cgi?id=19674.
+
+ * Api/qwebsettings.cpp:
+ (QWebSettings::QWebSettings):
+
+2009-09-29 Jedrzej Nowacki <jedrzej.nowacki@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ https://bugs.webkit.org/show_bug.cgi?id=29844
+
+ QWebPage dependency autotest fix.
+
+ Fix for database() autotest. All opened databases should be removed at
+ end of test.
+
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::database):
+
+2009-09-29 Jedrzej Nowacki <jedrzej.nowacki@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Some QWebHistory and QWebPage autotest crash fixes.
+
+ Some checking for m_mainFrame were added. MainFrame should be created
+ at some point of QWebPage live cicle.
+
+ https://bugs.webkit.org/show_bug.cgi?id=29803
+
+ * Api/qwebpage.cpp:
+ (QWebPage::~QWebPage):
+ (QWebPage::currentFrame):
+ (QWebPage::history):
+ (QWebPage::selectedText):
+ (QWebPage::updatePositionDependentActions):
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::crashTests_LazyInitializationOfMainFrame):
+
+2009-09-29 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Simon Hausmann and Tor Arne Vestbø.
+
+ Implement QWebPage Extension for error pages, incl.
+ an example on how to use it in QtLauncher.
+
+ Correct our use of ResourceError.
+
+ * Api/qwebpage.h:
+ (ExtensionOption::):
+ (ExtensionOption::ErrorPageExtensionReturn::ErrorPageExtensionReturn):
+ * QtLauncher/main.cpp:
+ (WebPage::supportsExtension):
+ (MainWindow::MainWindow):
+ (MainWindow::selectElements):
+ (WebPage::extension):
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::cancelledError):
+ (WebCore::FrameLoaderClientQt::blockedError):
+ (WebCore::FrameLoaderClientQt::cannotShowURLError):
+ (WebCore::FrameLoaderClientQt::interruptForPolicyChangeError):
+ (WebCore::FrameLoaderClientQt::cannotShowMIMETypeError):
+ (WebCore::FrameLoaderClientQt::fileDoesNotExistError):
+ (WebCore::FrameLoaderClientQt::callErrorPageExtension):
+ (WebCore::FrameLoaderClientQt::dispatchDidFailProvisionalLoad):
+ (WebCore::FrameLoaderClientQt::dispatchDidFailLoad):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2009-09-28 Andre Poenitz <andre.poenitz@trolltech.com>
+
+ Reviewed by Simon Hausmann.
+
+ Compile fix with namespaced Qt.
+
+ * Api/qwebinspector_p.h:
+
+2009-09-27 Joe Ligman <joseph.ligman@mindspring.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Adding API setFocus and hasFocus to QWebElement. This API is needed for
+ clients that want to check/set the focus node of the document.
+ https://bugs.webkit.org/show_bug.cgi?id=29682
+
+ * Api/qwebelement.cpp:
+ (QWebElement::hasFocus):
+ (QWebElement::setFocus):
+ * Api/qwebelement.h:
+ * tests/qwebelement/tst_qwebelement.cpp:
+ (tst_QWebElement::hasSetFocus):
+
+2009-09-25 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Make tst_qwebframe work if Qt built without SSL support
+ https://bugs.webkit.org/show_bug.cgi?id=29735
+
+ * tests/qwebframe/tst_qwebframe.cpp: Missing #ifndef blocks added.
+
+2009-09-24 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Update QWebElement API to remove script related methods.
+ QWebElement::evaluateScript is the only one kept, these are
+ removed to postpone most of the QtWebKit<->JavaScript API design
+ after 4.6.
+ https://bugs.webkit.org/show_bug.cgi?id=29708
+
+ * Api/qwebelement.cpp:
+ * Api/qwebelement.h:
+ Methods removed:
+ - QWebElement::callFunction
+ - QWebElement::functions
+ - QWebElement::scriptableProperty
+ - QWebElement::setScriptableProperty
+ - QWebElement::scriptableProperties
+ * tests/qwebelement/tst_qwebelement.cpp:
+ (tst_QWebElement::evaluateScript):
+
+2009-09-25 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Rename QWebElement::evaluateScript
+ to QWebElement::evaluateJavaScript.
+ https://bugs.webkit.org/show_bug.cgi?id=29709
+
+ * Api/qwebelement.cpp:
+ (QWebElement::evaluateJavaScript):
+ * Api/qwebelement.h:
+ * tests/qwebelement/tst_qwebelement.cpp:
+ (tst_QWebElement::evaluateJavaScript):
+
+2009-09-25 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Update the stypeProperty API of QWebElement.
+ https://bugs.webkit.org/show_bug.cgi?id=29711
+
+ * Api/qwebelement.cpp:
+ (QWebElement::styleProperty):
+ - Merge the stypeProperty and the computedStyleProperty methods
+ - Remove the default value for the style resolving enum
+ - Rename ResolveRule to StyleResolveStrategy
+ (QWebElement::setStyleProperty):
+ - Remove the priority argument since it is possible to control the
+ behaviour by adding !important or removing in the value.
+ * Api/qwebelement.h:
+ * tests/qwebelement/tst_qwebelement.cpp:
+ (tst_QWebElement::style):
+ (tst_QWebElement::computedStyle):
+ * tests/qwebframe/tst_qwebframe.cpp:
+
+2009-09-24 Jon Honeycutt <jhoneycutt@apple.com>
+
+ Reviewed by Alice Liu.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate):
+ Pass 0 for new Page constructor argument.
+
+2009-09-24 Martin Smith <msmith@trolltech.com>
+
+ Reviewed by Simon Hausmann.
+
+ qdoc: Added \brief texts to all the since 4.6 functions.
+
+ * Api/qwebhistory.cpp:
+
+2009-09-23 J-P Nurmi <jpnurmi@gmail.com>
+
+ Reviewed by Simon Hausmann.
+
+ Prevent QWebPage::setView() from changing the viewport size on the fly
+ in case the view doesn't actually change. QWebPage::setView() is
+ called upon every QWebGraphicsItem::hoverMoveEvent(), which forced
+ the viewport size to be equal to the size of the whole graphics view.
+
+ https://bugs.webkit.org/show_bug.cgi?id=29676
+
+ * Api/qwebpage.cpp:
+ (QWebPage::setView):
+
+2009-09-23 Jedrzej Nowacki <jedrzej.nowacki@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Crash fix in QWebHistory back and forward methods.
+
+ QWebHistory::back() and QWebHistory::forward() were crashing on
+ ASSERT in WebCore::BackForwardList. The methods should check
+ canGoBack() and canGoForward() at the beginning.
+
+ https://bugs.webkit.org/show_bug.cgi?id=29675
+
+ * Api/qwebhistory.cpp:
+ (QWebHistory::back):
+ (QWebHistory::forward):
+
+2009-09-23 Jedrzej Nowacki <jedrzej.nowacki@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Bug fix. QWebHistory should call QWebPage::updateNavigationActions
+
+ In QWebHistory's methods that change item count or current item call
+ to QWebPage::updateNavigationActions should be executed.
+ QWebHistory::clear() and QWebHistory::restorState() were changed.
+ New helper method, QWebPagePrivate accesor, were created in
+ QWebHistoryPrivate class.
+ Two autotest were developed.
+
+ https://bugs.webkit.org/show_bug.cgi?id=29246
+
+ * Api/qwebhistory.cpp:
+ (QWebHistory::clear):
+ (QWebHistory::restoreState):
+ (QWebHistoryPrivate::page):
+ * Api/qwebhistory_p.h:
+ * tests/qwebhistory/tst_qwebhistory.cpp:
+ (tst_QWebHistory::saveAndRestore_1):
+ (tst_QWebHistory::clear):
+
+2009-09-23 Norbert Leser <norbert.leser@nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Need to guard QX11Info include with Q_WS_X11.
+ That class may not be available (in QT 4.5 for Symbian, for instance).
+ Completes fixes in r48627 and r48604.
+
+ * Api/qwebgraphicsitem.cpp:
+ * Api/qwebview.cpp:
+
+2009-09-22 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Add default timeout while waiting for signals in QWebPage auto
+ tests.
+ https://bugs.webkit.org/show_bug.cgi?id=29637
+
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (waitForSignal):
+
+2009-09-22 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reivewed by Simon Hausmann.
+
+ Fix the Qt/Mac build after r48604 (Implement new QWebPageClient class)
+
+ There's no QWidget::x11Info() on Mac, and setPlatformPluginWidget()
+ takes a QWidget*, not a QWebPageClient*
+
+ * Api/qwebgraphicsitem.cpp:
+ (QWebGraphicsItemPrivate::screenNumber):
+ * Api/qwebview.cpp:
+ (QWebViewPrivate::screenNumber):
+
+2009-09-21 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ For Qt, platformPageClient() will now return a class derived from
+ the QWebPageClient, so the patch adapts our Qt hooks to go though
+ this class and not depend on the QWebView.
+
+ * Api/qwebgraphicsitem.cpp:
+ (QWebGraphicsItemPrivate::scroll):
+ (QWebGraphicsItemPrivate::update):
+ (QWebGraphicsItemPrivate::cursor):
+ (QWebGraphicsItemPrivate::updateCursor):
+ (QWebGraphicsItemPrivate::screenNumber):
+ (QWebGraphicsItemPrivate::winId):
+ (QWebGraphicsItem::event):
+ (QWebGraphicsItem::setPage):
+ * Api/qwebgraphicsitem.h:
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate):
+ * Api/qwebpage_p.h:
+ * Api/qwebview.cpp:
+ (QWebViewPrivate::scroll):
+ (QWebViewPrivate::update):
+ (QWebViewPrivate::cursor):
+ (QWebViewPrivate::updateCursor):
+ (QWebViewPrivate::screenNumber):
+ (QWebViewPrivate::winId):
+ (QWebView::setPage):
+ (QWebView::event):
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::repaint):
+ (WebCore::ChromeClientQt::scroll):
+ (WebCore::ChromeClientQt::platformPageClient):
+
+2009-09-21 Yael Aharon <yael.aharon@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ https://bugs.webkit.org/show_bug.cgi?id=29609
+ Build fix for windows when using Qt 4.5.0.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::userAgentForUrl):
+
+2009-09-19 Benjamin Poulain <benjamin.poulain@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ https://bugs.webkit.org/show_bug.cgi?id=29345
+ The tests of QWebFrame did not use QTRY_VERIFY for
+ tests involving the event loop.
+
+ * tests/qwebframe/tst_qwebframe.cpp:
+ * tests/util.h: Added. Copy of tests/shared/util.h of Qt
+
+2009-09-19 Jakub Wieczorek <faw217@gmail.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Add an autotest stub for QWebGraphicsItem.
+
+ It just calls all the functions and makes sure they don't crash.
+
+ * tests/qwebgraphicsitem/qwebgraphicsitem.pro: Added.
+ * tests/qwebgraphicsitem/tst_qwebgraphicsitem.cpp: Added.
+ (tst_QWebGraphicsItem::qwebgraphicsitem):
+ * tests/tests.pro:
+
+2009-09-18 Norbert Leser <norbert.leser@nokia.com>
+
+ Reviewed by Eric Seidel.
+
+ Corrected the Symbian specific UID3 values to be assigned
+ from the "unprotected" pool that permits self-signing of
+ those test and demo executables. (Added new UID3 values
+ where they were missing for new components.)
+
+ * QGVLauncher/QGVLauncher.pro:
+ * QtLauncher/QtLauncher.pro:
+ * tests/benchmarks/loading/tst_loading.pro:
+ * tests/benchmarks/painting/tst_painting.pro:
+ * tests/qwebelement/qwebelement.pro:
+ * tests/qwebframe/qwebframe.pro:
+ * tests/qwebhistory/qwebhistory.pro:
+ * tests/qwebhistoryinterface/qwebhistoryinterface.pro:
+ * tests/qwebpage/qwebpage.pro:
+ * tests/qwebplugindatabase/qwebplugindatabase.pro:
+ * tests/qwebview/qwebview.pro:
+
+2009-09-17 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ Make PlatformWindow return something else than PlatformWidget
+ https://bugs.webkit.org/show_bug.cgi?id=29085
+
+ Reflect the rename of platformWindow and it's return type.
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::platformPageClient):
+ * WebCoreSupport/ChromeClientQt.h:
+
+2009-09-18 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Add persistence support for configuration options in the
+ inspector.
+
+ * Api/qwebinspector.cpp:
+ * QtLauncher/main.cpp:
+ (main):
+ * WebCoreSupport/InspectorClientQt.cpp:
+ (WebCore::InspectorClientQt::populateSetting):
+ (WebCore::InspectorClientQt::storeSetting):
+ (WebCore::variantToSetting):
+ (WebCore::settingToVariant):
+
+2009-09-18 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Ariya Hidayat.
+
+ Fixed a bunch of documentation warnings.
+
+ * Api/qwebgraphicsitem.cpp:
+ * Api/qwebplugindatabase.cpp:
+ * Api/qwebpluginfactory.cpp:
+ * Api/qwebsecurityorigin.cpp:
+
+2009-09-18 Warwick Allison <warwick.allison@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Added a test that console output works.
+
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (ConsolePage::ConsolePage):
+ (ConsolePage::javaScriptConsoleMessage):
+ (tst_QWebPage::consoleOutput):
+
+2009-09-17 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ Improve documentation for Page Cache.
+
+ * Api/qwebsettings.cpp:
+
+2009-09-17 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Update QWebSettings::setUserStyleSheetUrl() docs and test
+
+ https://bugs.webkit.org/show_bug.cgi?id=29081
+
+ The documentation now specifies that the URL has to be a local file
+ or a a data-URL (with utf-8 and base64-encoded data), as these are the
+ only two schemes that the current code path accepts.
+
+ The auto-test has been updated to reflect this limitation.
+
+ At a later point we should concider adding API for the new way of
+ doing both user defined stylesheets and scripts.
+
+ * Api/qwebsettings.cpp:
+ * tests/qwebpage/tst_qwebpage.cpp:
+
+2009-09-17 Janne Koskinen <janne.p.koskinen@digia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Symbian build fix.
+
+ Moved the #ifdefs around _q_cleanupLeakMessages() into the function
+ definition.
+
+ QMake is not being able to distinguish between release and debug builds
+ in Symbian build. This is a Symbian toolchain issue.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::_q_cleanupLeakMessages):
+ * Api/qwebpage.h:
+ * Api/qwebpage_p.h:
+
+2009-09-17 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Small cosmetic documentation fixlet in the QWebInspector.
+
+ * Api/qwebinspector.cpp:
+
+2009-09-16 Benjamin C Meyer <benjamin.meyer@torchmobile.com>
+
+ Reviewed by Eric Seidel.
+
+ Detect and add Windows7 properly to the user agent.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::userAgentForUrl):
+
+2009-09-16 Andras Becsi <andrewbecsi@yahoo.co.uk>
+
+ Rubberstamped by Kenneth Christiansen.
+
+ [Qt] Build fix for previous changes.
+
+ * QGVLauncher/main.cpp:
+ (MainView::flip):
+
+2009-09-16 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Unreviewed potential Qt < 4.6 build fix.
+
+ * QGVLauncher/main.cpp:
+ (MainView::flip):
+
+2009-09-16 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ Add a "Flip effect" to our GraphicsView based launcher.
+
+ * QGVLauncher/main.cpp:
+ (MainView::resizeEvent):
+ (MainView::flip):
+ (MainWindow::flip):
+ (MainWindow::buildUI):
+
+2009-09-16 Zoltan Herczeg <zherczeg@inf.u-szeged.hu>
+
+ Rubber-stamped by Simon Hausmann.
+
+ [Qt] Typo fix. Pass the window object to the Format
+ menu. In this way Qt can free its internal graphical
+ objects during exit.
+
+ * QtLauncher/main.cpp:
+ (MainWindow::setupUI):
+
+2009-09-16 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ [Qt] Build break fix on gcc ARM.
+
+ * Api/qwebgraphicsitem.cpp:
+ (QWebGraphicsItemPrivate::_q_doLoadProgress):
+
+2009-09-16 Warwick Allison <warwick.allison@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Fix a crash in QWebFrame::hasFocus() with a simple null pointer check
+ when the focused frame is null. We do the same check in other places
+ where we call kit().
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::hasFocus):
+
+2009-09-16 Jure Repinc <jlp@holodeck1.com>
+
+ Reviewed by Simon Hausmann.
+
+ Fixed a typo found during translation.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::interruptForPolicyChangeError):
+
+2009-09-14 Jakub Wieczorek <faw217@gmail.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] QWebGraphicsItem should check for null QWebPage.
+ https://bugs.webkit.org/show_bug.cgi?id=29185
+
+ Don't crash in QWebGraphicsItem when the page is still null, by
+ either checking if it's the case or constructing the default one.
+
+ * Api/qwebgraphicsitem.cpp:
+ (QWebGraphicsItem::icon):
+ (QWebGraphicsItem::setZoomFactor):
+ (QWebGraphicsItem::zoomFactor):
+ (QWebGraphicsItem::setGeometry):
+ (QWebGraphicsItem::load):
+ (QWebGraphicsItem::setHtml):
+ (QWebGraphicsItem::toHtml):
+ (QWebGraphicsItem::setContent):
+ (QWebGraphicsItem::history):
+ (QWebGraphicsItem::settings):
+
+2009-09-11 David Boddie <dboddie@trolltech.com>
+
+ Reviewed by Simon Hausmann.
+
+ Doc: Note that Netscape plugins are only available on desktop platforms.
+
+ * docs/qtwebkit.qdoc:
+
+2009-09-11 Martin Smith <msmith@trolltech.com>
+
+ Reviewed by Simon Hausmann.
+
+ Adjust the name of the contentspage for the documentation
+ to the new name used in Qt 4.6.
+
+ * docs/qtwebkit.qdoc:
+
+2009-09-11 Ariya Hidayat <ariya.hidayat@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Changed URLs from qtsoftware.com to qt.nokia.com, as part of a general
+ renaming.
+
+ * Api/qwebpluginfactory.cpp:
+ * docs/webkitsnippets/simple/main.cpp:
+ (main):
+ * docs/webkitsnippets/webpage/main.cpp:
+ (main):
+
+2009-09-11 Volker Hilsheimer <volker.hilsheimer@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Restructure the documentation, both on a file and on a content level.
+
+ * Api/qwebdatabase.cpp:
+ * Api/qwebelement.cpp:
+ * Api/qwebframe.cpp:
+ * Api/qwebhistory.cpp:
+ * Api/qwebhistoryinterface.cpp:
+ * Api/qwebpage.cpp:
+ * Api/qwebpluginfactory.cpp:
+ * Api/qwebsecurityorigin.cpp:
+ * Api/qwebsettings.cpp:
+ * Api/qwebview.cpp:
+ * docs/qtwebkit.qdoc:
+
+2009-09-11 Yongjun Zhang <yongjun.zhang@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ https://bugs.webkit.org/show_bug.cgi?id=29136
+ [Qt] emit microFocusChanged() signal when no QWidget-based view is present.
+
+ emit microFocusChange() signal regardless of view.
+
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::setInputMethodState):
+
+2009-09-11 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ https://bugs.webkit.org/show_bug.cgi?id=28806
+
+ [Qt] Make the WebInspector available as a QWidget.
+
+ * Api/headers.pri:
+ * Api/qwebelement.cpp:
+ (QWebElement::enclosingElement):
+ * Api/qwebelement.h:
+ * Api/qwebinspector.cpp: Added.
+ * Api/qwebinspector.h: Added.
+ * Api/qwebinspector_p.h: Added.
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate):
+ (QWebPagePrivate::setInspector):
+ (QWebPagePrivate::getOrCreateInspector):
+ (QWebPagePrivate::inspectorController):
+ (QWebPage::~QWebPage):
+ (QWebPage::triggerAction):
+ * Api/qwebpage.h:
+ * Api/qwebpage_p.h:
+ * Api/qwebsettings.cpp:
+ * QtLauncher/main.cpp:
+ (MainWindow::MainWindow):
+ * WebCoreSupport/InspectorClientQt.cpp:
+ (WebCore::InspectorClientWebPage::InspectorClientWebPage):
+ (WebCore::InspectorClientWebPage::createWindow):
+ (WebCore::InspectorClientQt::createPage):
+ (WebCore::InspectorClientQt::showWindow):
+ (WebCore::InspectorClientQt::closeWindow):
+ (WebCore::InspectorClientQt::attachWindow):
+ (WebCore::InspectorClientQt::detachWindow):
+ (WebCore::InspectorClientQt::updateWindowTitle):
+ * WebCoreSupport/InspectorClientQt.h:
+ * docs/webkitsnippets/qtwebkit_qwebinspector_snippet.cpp: Added.
+
+2009-09-10 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Eric Seidel.
+
+ [Qt] Fix comparison between signed and unsigned integer warnings
+ https://bugs.webkit.org/show_bug.cgi?id=29162
+
+ No functional change.
+
+ * Api/qwebelement.cpp:
+ (QWebElement::findAll):
+ * Api/qwebhistory.cpp:
+ (QWebHistory::items):
+ (QWebHistory::backItems):
+ (QWebHistory::forwardItems):
+ (QWebHistory::saveState):
+ * Api/qwebplugindatabase.cpp:
+ (QWebPluginDatabase::setSearchPaths):
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::runOpenPanel):
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::createPlugin):
+
+2009-09-10 Simon Hausmann <hausmann@webkit.org>
+
+ Rubber-stamped by Ariya Hidayat.
+
+ Fix a bunch of qdoc warnings: Invalid references, non-standard
+ wording, etc.
+
+ * Api/qwebelement.cpp:
+ * Api/qwebgraphicsitem.cpp:
+ * Api/qwebsecurityorigin.cpp:
+
+2009-09-10 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Ariya Hidayat.
+
+ Fix context menu event delivery with QWebGraphicsItem.
+
+ Re-implement the correct context menu virtual function using
+ a QGraphicsSceneContextMenuEvent and forward & handle it in
+ QWebPage.
+
+ * Api/qwebgraphicsitem.cpp:
+ (QWebGraphicsItem::contextMenuEvent):
+ * Api/qwebgraphicsitem.h:
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::contextMenuEvent):
+ (QWebPage::event):
+ * Api/qwebpage_p.h:
+
+2009-09-10 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Unreviewed.
+
+ Build fix for QtWebKit for Mac after r48219.
+
+ qevent and qstyleoption are QtGui interfaces.
+
+ * Api/qwebgraphicsitem.cpp:
+ * Api/qwebgraphicsitem.h:
+
+2009-09-09 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Call the right base class function QGraphicsWidget::event() instead
+ of skipping it and using QObject::event() instead.
+
+ * Api/qwebgraphicsitem.cpp:
+ (QWebGraphicsItem::event):
+
+2009-09-09 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Unreviewed.
+
+ Fix comment at Tor Arne Vestbø's request.
+
+ * Api/qwebgraphicsitem.cpp:
+ (QWebGraphicsItem::sceneEvent):
+ (QWebGraphicsItem::event):
+
+2009-09-09 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Implement some virtual event methods so that we can fix
+ event-related bugs in Qt patch releases.
+
+ * Api/qwebgraphicsitem.cpp:
+ (QWebGraphicsItem::sceneEvent):
+ (QWebGraphicsItem::event):
+ * Api/qwebgraphicsitem.h:
+
+2009-09-09 Kenneth Rohde Christiansen <kenneth@webkit.org>, Antonio Gomes <antonio.gomes@openbossa.org>
+
+ Reviewed by Simon Hausmann.
+
+ Add a new QGraphicsWidget based version of the "QWebView"
+ under the name "QWebGraphicsItem".
+
+ https://bugs.webkit.org/show_bug.cgi?id=28862
+
+ Includes an alternative Qt launcher using the QGraphicsView.
+
+ * Api/headers.pri:
+ * Api/qwebgraphicsitem.cpp: Added.
+ * Api/qwebgraphicsitem.h: Added.
+ * Api/qwebpage.h:
+ * QGVLauncher/QGVLauncher.pro: Copied from WebKit/qt/QtLauncher/QtLauncher.pro.
+ * QGVLauncher/main.cpp: Added.
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::repaint):
+ (WebCore::ChromeClientQt::scroll):
+
+2009-09-08 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Unreviewed build fix.
+
+ Potential build fix for Qt 4.5
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::mousePressEvent):
+
+2009-09-08 Benjamin Poulain <benjamin.poulain@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ https://bugs.webkit.org/show_bug.cgi?id=29007
+ Add a test for the signal QWebFrame::javaScriptWindowObjectCleared()
+
+ * tests/qwebframe/tst_qwebframe.cpp:
+
+2009-09-08 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Fix unused variable warnings
+ https://bugs.webkit.org/show_bug.cgi?id=29018
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::keyPressEvent):
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::startDownload):
+ (WebCore::FrameLoaderClientQt::createFrame):
+
+2009-09-08 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Ariya Hidayat.
+
+ [Qt] Use the declaration order in initializer lists
+ https://bugs.webkit.org/show_bug.cgi?id=29017
+
+ * Api/qwebframe_p.h:
+
+2009-09-08 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ Add support for handling QGraphicsScene events.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::mouseMoveEvent):
+ (QWebPagePrivate::mousePressEvent):
+ (QWebPagePrivate::mouseDoubleClickEvent):
+ (QWebPagePrivate::mouseTripleClickEvent):
+ (QWebPagePrivate::handleClipboard):
+ (QWebPagePrivate::mouseReleaseEvent):
+ (QWebPagePrivate::wheelEvent):
+ (QWebPagePrivate::dragEnterEvent):
+ (QWebPagePrivate::dragLeaveEvent):
+ (QWebPagePrivate::dragMoveEvent):
+ (QWebPagePrivate::dropEvent):
+ (QWebPage::event):
+ * Api/qwebpage_p.h:
+
+2009-09-08 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Make cursor set cleaner in QtWebKit Api: eliminate SetCursorEvent hack.
+ https://bugs.webkit.org/show_bug.cgi?id=28865
+
+ Clean up the unserCursor hack to use the QCursor set
+ as a property of the QWidget by WebCore::WidgetQt.
+
+ Remove all code that are no longer necessary for getting
+ cursor change events.
+
+ Patch by Kenneth Rohde Christiansen <kenneth@webkit.org> and
+ Antonio Gomes <antonio.gomes@openbossa.org> on 2009-09-07
+
+ * Api/qwebpage.cpp:
+ * Api/qwebpage_p.h:
+ * Api/qwebview.cpp:
+ (QWebViewPrivate::QWebViewPrivate):
+ (QWebView::event):
+
+2009-09-08 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] QtWebKit single API to enable persistency
+ https://bugs.webkit.org/show_bug.cgi?id=28682
+
+ Disable LocalStorage, ApplicationCache, HTML5 offline storage by
+ default.
+
+ If persistency is enabled the default directory for LocalStorage and
+ ApplicationCache is now based on QDesktopServices::DataLocation and not
+ QDesktopServices::CacheLocation (as it is expected to keep this data
+ around after a reboot).
+
+ If persistency is enabled initialize HTML5 offline storage as well - this
+ fixed offline Storage for QtLauncher.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate):
+ * Api/qwebsettings.cpp:
+ (QWebSettings::QWebSettings):
+ (QWebSettings::enablePersistentStorage):
+ * Api/qwebsettings.h: Add a new API called enablePersistentStorage
+ * QtLauncher/main.cpp: Use the new enablePersistentStorage API
+ (main):
+
+2009-09-07 Jakub Wieczorek <faw217@gmail.com>
+
+ Reviewed by Simon Hausmann.
+
+ Speed up the QWebPluginInfo::supportsMimeType() function.
+ https://bugs.webkit.org/show_bug.cgi?id=27651
+
+ Instead of going through the MIME types list constructed with
+ mimeTypes() function, look up the internal mimeToDescriptions map.
+
+ * Api/qwebplugindatabase.cpp:
+ (QWebPluginInfo::supportsMimeType):
+
+2009-09-07 Jakub Wieczorek <faw217@gmail.com>
+
+ Reviewed by Simon Hausmann.
+
+ Speed up the QWebPluginInfo::mimeTypes() function.
+ https://bugs.webkit.org/show_bug.cgi?id=27651
+
+ Instead of constructing a list of MIME types every time it is called,
+ do this only once.
+
+ * Api/qwebplugindatabase.cpp:
+ (QWebPluginInfo::mimeTypes):
+ (QWebPluginInfo::operator=):
+ * Api/qwebplugindatabase.h:
+ * tests/qwebplugindatabase/tst_qwebplugindatabase.cpp:
+ (tst_QWebPluginDatabase::operatorassign_data):
+ (tst_QWebPluginDatabase::operatorassign):
+
+2009-09-07 Jakub Wieczorek <faw217@gmail.com>
+
+ Reviewed by Simon Hausmann.
+
+ Remove the private classes from QWebPluginDatabase.
+ https://bugs.webkit.org/show_bug.cgi?id=27651
+
+ Instead, hold the PluginDatabase and PluginPackage objects as class
+ members and take care of refcounting on our own instead of using RefPtr.
+
+ This way we not only made the code cleaner but also got rid of
+ redundant allocations when constructing null QWebPluginInfo objects.
+
+ The private classes have been forward-declared and the d-pointers left
+ to be on the safe side.
+
+ * Api/qwebplugindatabase.cpp:
+ (QWebPluginInfo::QWebPluginInfo):
+ (QWebPluginInfo::~QWebPluginInfo):
+ (QWebPluginInfo::name):
+ (QWebPluginInfo::description):
+ (QWebPluginInfo::mimeTypes):
+ (QWebPluginInfo::path):
+ (QWebPluginInfo::isNull):
+ (QWebPluginInfo::setEnabled):
+ (QWebPluginInfo::isEnabled):
+ (QWebPluginInfo::operator==):
+ (QWebPluginInfo::operator!=):
+ (QWebPluginInfo::operator=):
+ (QWebPluginDatabase::QWebPluginDatabase):
+ (QWebPluginDatabase::~QWebPluginDatabase):
+ (QWebPluginDatabase::plugins):
+ (QWebPluginDatabase::searchPaths):
+ (QWebPluginDatabase::setSearchPaths):
+ (QWebPluginDatabase::addSearchPath):
+ (QWebPluginDatabase::refresh):
+ (QWebPluginDatabase::pluginForMimeType):
+ (QWebPluginDatabase::setPreferredPluginForMimeType):
+ * Api/qwebplugindatabase.h:
+ * Api/qwebplugindatabase_p.h: Removed.
+
+2009-09-05 Jakub Wieczorek <faw217@gmail.com>
+
+ Reviewed by Eric Seidel.
+
+ [Qt] r47424 broke binary compatibility
+ https://bugs.webkit.org/show_bug.cgi?id=28996
+
+ Append the new DnsPrefetchEnabled attribute at the end of the enum.
+
+ * Api/qwebsettings.h:
+
+2009-09-04 Mark Mentovai <mark@chromium.org>
+
+ Reviewed by Dave Hyatt.
+
+ https://bugs.webkit.org/show_bug.cgi?id=28614
+
+ Account for scrollbar state changes that occur during layout.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::setScrollBarPolicy):
+
+ Eliminate duplicated (and incorrect) scrollbar mode tracking between
+ FrameView and ScrollView.
+
+2009-09-04 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Eric Seidel.
+
+ [Qt] Fix tst_QWebPage::database autotest failure
+ https://bugs.webkit.org/show_bug.cgi?id=28961
+
+ Make sure that the test case enables the feature before
+ the feature gets tested
+
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::database):
+
+2009-09-04 Benjamin C Meyer <benjamin.meyer@torchmobile.com>
+
+ Reviewed by Eric Seidel.
+
+ Any QtWebKit application crashes on exit if the inspector is
+ used during the session rather then exiting.
+
+ If a QWebView has a QWebPage that is destroyed the QWebView
+ does not update its pointer and will crash the next time
+ it access the page pointers (such as in its destructor).
+
+ InspectorClientView should not call deleteLater when the page
+ is destroyed because it does not have a parent and is a top
+ level widget. close() needs to be called so that QApplication
+ can exit the application if quitOnLastWindowClosed is set
+ and a InspectorClientView is the last window, otherwise
+ the application will never exit.
+
+ * Api/qwebview.cpp:
+ (QWebViewPrivate::_q_pageDestroyed):
+ (QWebView::setPage):
+ * Api/qwebview.h:
+ * WebCoreSupport/InspectorClientQt.cpp:
+ (WebCore::InspectorClientView::InspectorClientView):
+
+2009-09-03 Adam Barth <abarth@webkit.org>
+
+ Reviewed by eric@webkit.org.
+
+ https://bugs.webkit.org/show_bug.cgi?id=24696
+
+ Stub implementations of mixed content methods of FrameLoaderClient.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::didDisplayInsecureContent):
+ (WebCore::FrameLoaderClientQt::didRunInsecureContent):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2009-09-03 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Eric Seidel.
+
+ [Qt] Add a setting to turn SessionStorage on/off
+ https://bugs.webkit.org/show_bug.cgi?id=28836
+
+ * Api/qwebsettings.cpp:
+ (QWebSettingsPrivate::apply):
+ (QWebSettings::QWebSettings):
+ * Api/qwebsettings.h:
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (testFlag):
+ (tst_QWebPage::testOptionalJSObjects):
+
+2009-09-02 Richard Moore <rich@kde.org>
+
+ Reviewed by Tor Arne Vestbø.
+
+ [Qt] Make sure we relayout the page after evaluating JS
+
+ https://bugs.webkit.org/show_bug.cgi?id=28235
+
+ QtWebKit does not always seem to reflow the page when evaluating
+ javascript. This patch changes the way evaluateJavaScript works to
+ use the frameloader which ensures that this is done properly.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::evaluateJavaScript):
+ * tests/qwebframe/tst_qwebframe.cpp:
+
+2009-08-28 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
+
+ Reviewed by Holger Freyther.
+
+ https://bugs.webkit.org/show_bug.cgi?id=25889
+ [GTK] scrollbar policy for main frame is not implementable
+
+ Add empty implementation for new ChromeClient method.
+
+ * WebCoreSupport/ChromeClientQt.h:
+ (WebCore::ChromeClientQt::scrollbarsModeDidChange):
+
+2009-08-27 Jedrzej Nowacki <jedrzej.nowacki@nokia.com>
+
+ Reviewed by Ariya Hidayat.
+
+ QWebHistory::clear() modifications.
+
+ Clear() method was changed. If QWebHistory is empty (there is no
+ elements even current) clear() do nothing. If there at least one
+ element clear() will delete everything apart of current.
+
+ New autotests in QWebHistory
+
+ New autotests were added to QWebHistory. They should check some crashes
+ in save and restore state process and clear() method and general
+ behavior on where QWebHistory::count() == 0 or QWebHistory::count() == 1
+
+ Bugzilla: https://bugs.webkit.org/show_bug.cgi?id=28711
+
+ * Api/qwebhistory.cpp:
+ (QWebHistory::clear):
+ * tests/qwebhistory/tst_qwebhistory.cpp:
+ (tst_QWebHistory::back):
+ (tst_QWebHistory::forward):
+ (tst_QWebHistory::saveAndRestore_crash_1):
+ (tst_QWebHistory::saveAndRestore_crash_2):
+ (tst_QWebHistory::saveAndRestore_crash_3):
+ (tst_QWebHistory::clear):
+
+2009-08-27 Jedrzej Nowacki <jedrzej.nowacki@nokia.com>
+
+ Reviewed by Ariya Hidayat.
+
+ [Qt] Cleanup, old and commented part of source code was removed.
+ Fix some formatting problems.
+
+ https://bugs.webkit.org/show_bug.cgi?id=28712
+
+ * Api/qwebhistory_p.h:
+ (QWebHistoryPrivate::QWebHistoryPrivate):
+
+2009-08-26 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Oliver Hunt.
+
+ Don't let local files access web URLs
+ https://bugs.webkit.org/show_bug.cgi?id=28480
+
+ * Api/qwebsettings.cpp:
+ (QWebSettings::QWebSettings):
+
+2009-08-25 Antonio Gomes <antonio.gomes@openbossa.org>
+
+ Reviewed by Ariya Hidayat.
+
+ Bug 28708 - Make possible to better use ResourceError in FrameLoaderClientQt class.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::requestedUrl):
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::FrameLoaderClientQt):
+ (WebCore::FrameLoaderClientQt::dispatchDidFinishLoad):
+ (WebCore::FrameLoaderClientQt::postProgressFinishedNotification):
+ (WebCore::FrameLoaderClientQt::dispatchDidFailProvisionalLoad):
+ (WebCore::FrameLoaderClientQt::dispatchDidFailLoad):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2009-08-22 Adam Barth <abarth@webkit.org>
+
+ Revert 47684. We're going to do this later once clients have had a
+ chance to opt into the setting they like.
+
+ * Api/qwebsettings.cpp:
+ (QWebSettings::QWebSettings):
+
+2009-08-22 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Don't let local files access web URLs
+ https://bugs.webkit.org/show_bug.cgi?id=28480
+
+ * Api/qwebsettings.cpp:
+ (QWebSettings::QWebSettings):
+
+2009-08-19 Aaron Boodman <aa@chromium.org>
+
+ Speculative build break fix for qt.
+
+ * Api/qwebsecurityorigin.cpp:
+ (QWebSecurityOrigin::whiteListAccessFromOrigin):
+ * Api/qwebsecurityorigin.h:
+
+2009-08-19 Aaron Boodman <aa@chromium.org>
+
+ Reviewed by David Levin.
+
+ https://bugs.webkit.org/show_bug.cgi?id=24853: Provide a way for WebKit clients to
+ specify a more granular policy for cross-origin XHR access.
+
+ * Api/qwebsecurityorigin.cpp: Add API to manipulate origin access whitelists.
+ (QWebSecurityOrigin::whiteListAccessFromOrigin): Ditto.
+ (QWebSecurityOrigin::resetOriginAccessWhiteLists): Ditto.
+ * Api/qwebsecurityorigin.h: Ditto.
+
+2009-08-18 Markus Goetz <Markus.Goetz@nokia.com>
+
+ Reviwed by Ariya Hidayat.
+
+ [Qt] For prefecthDNS, the pre-fetching has to be enabled in the
+ WebSettings.
+
+ * Api/qwebsettings.cpp:
+ (QWebSettings::QWebSettings):
+ * Api/qwebsettings.h:
+
+2009-08-17 Darin Adler <darin@apple.com>
+
+ Try to fix Qt build again.
+
+ * WebCoreSupport/EditorClientQt.cpp: Move "using namespace".
+
+2009-08-17 Darin Adler <darin@apple.com>
+
+ Try to fix Qt build.
+
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::shouldShowDeleteInterface):
+ Use getAttribute(classAttr) instead of className() function.
+
+2009-08-14 Yongjun Zhang <yongjun.zhang@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ RVCT elftran fails to resolve QPainter::staticMetaObject coming with
+ QWebView::RenderHints property.
+
+ This is a temporary fix and will be revereted when the right symbols
+ exported from Qt lib in S60.
+
+ https://bugs.webkit.org/show_bug.cgi?id=28181
+
+ * Api/qwebview.h:
+
+2009-08-14 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Public API to configure the storage path for HTML5 localStorage
+ https://bugs.webkit.org/show_bug.cgi?id=28036
+
+ Disables LocalStorage for QtWebKit by default by setting
+ QWebSettings::LocalStorageEnabled to false.
+
+ Sets up a default for the LocalStorage path so that clients would only
+ need to enable the LocalStorageEnabled setting to turn on LocalStoragre
+ support.
+
+ Turn on LocalStorage support for QtLauncher and the relevant test
+ since LocalStorage is now disabled by default for QtWebkit.
+
+ * Api/qwebpage.cpp:
+ (defaultCachePath):
+ (initializeApplicationCachePathIfNecessary):
+ (QWebPagePrivate::QWebPagePrivate):
+ * Api/qwebsettings.cpp:
+ (QWebSettingsPrivate::apply):
+ (QWebSettings::QWebSettings):
+ (QWebSettings::setLocalStoragePath):
+ (QWebSettings::localStoragePath):
+ * Api/qwebsettings.h:
+ * QtLauncher/main.cpp:
+ (main):
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::multiplePageGroupsAndLocalStorage):
+
+2009-08-14 Yael Aharon <yael.aharon@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Allow applications to register their own local URL scheme.
+ https://bugs.webkit.org/show_bug.cgi?id=28240
+
+ * Api/qwebsecurityorigin.cpp:
+ (QWebSecurityOrigin::addLocalScheme):
+ (QWebSecurityOrigin::removeLocalScheme):
+ (QWebSecurityOrigin::localSchemes):
+ * Api/qwebsecurityorigin.h:
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::localURLSchemes):
+
+2009-08-13 Mark Rowe <mrowe@apple.com>
+
+ Try and fix the Qt build.
+
+ * Api/qwebelement.cpp:
+
+2009-08-13 Kavindra Devi Palaraja <kavindra.palaraja@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Doc - Some cleanup on the documentation of QWebElement
+
+ * Api/qwebelement.cpp:
+
+2009-08-13 Norbert Leser <norbert.leser@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Symbian target components (library and executable files)
+ require Unique Identifiers (i.e., UID3).
+ These identifiers are defined in the respective project
+ files, conditionally for "symbian" platform.
+
+ * QtLauncher/QtLauncher.pro:
+ * tests/qwebelement/qwebelement.pro:
+ * tests/qwebframe/qwebframe.pro:
+ * tests/qwebhistory/qwebhistory.pro:
+ * tests/qwebhistoryinterface/qwebhistoryinterface.pro:
+ * tests/qwebpage/qwebpage.pro:
+ * tests/qwebview/qwebview.pro:
+
+2009-08-12 George Wright <george.wright@torchmobile.com>
+
+ Reviewed by Adam Treat.
+
+ Initialise zoom levels independent of whether a URL is valid or not to
+ fix https://bugs.webkit.org/show_bug.cgi?id=28162
+
+ * QtLauncher/main.cpp:
+ (MainWindow::MainWindow):
+
+2009-08-12 Joerg Bornemann <joerg.bornemann@trolltech.com>
+
+ Reviewed by Simon Hausmann.
+
+ QtWebKit compile fix for Windows CE
+
+ There's no getenv on Windows CE, use qgetenv instead.
+
+ * Api/qwebpage.cpp:
+ (qt_drt_overwritePluginDirectories):
+
+2009-08-10 Kavindra Palaraja <kavindra.palaraja@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Various fixes and improvements to the QWebPluginInfo, QWebPluginDatabase and QWebSettings documentation.
+
+ * Api/qwebplugindatabase.cpp:
+ * Api/qwebsettings.cpp:
+
+2009-08-08 Volker Hilsheimer <volker.hilsheimer@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Doc: there is no group of explicitly shared classes, only one class uses this.
+
+ Explain the implications in the QWebHistoryItem documentation, and get rid
+ of the "group".
+
+ * Api/qwebhistory.cpp:
+
+2009-08-05 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Fix build error caused by http://trac.webkit.org/changeset/46763
+
+ * Api/qwebpluginfactory.h: Export macro added.
+
+2009-08-04 Antonio Gomes <antonio.gomes@openbossa.org>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] QWebFrame::requestedUrl method can mis-behave in case of unhandled sslErrors.
+ https://bugs.webkit.org/show_bug.cgi?id=27804
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::requestedUrl):
+ * tests/qwebframe/tst_qwebframe.cpp:
+
+2009-08-04 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Rename QWebPlugin to QWebPluginInfo, as discussed on IRC.
+
+ * Api/qwebplugindatabase.cpp:
+ (QWebPluginInfoPrivate::QWebPluginInfoPrivate):
+ (QWebPluginInfo::QWebPluginInfo):
+ (QWebPluginInfo::~QWebPluginInfo):
+ (QWebPluginInfo::name):
+ (QWebPluginInfo::description):
+ (QWebPluginInfo::mimeTypes):
+ (QWebPluginInfo::supportsMimeType):
+ (QWebPluginInfo::path):
+ (QWebPluginInfo::isNull):
+ (QWebPluginInfo::setEnabled):
+ (QWebPluginInfo::isEnabled):
+ (QWebPluginInfo::operator==):
+ (QWebPluginInfo::operator!=):
+ (QWebPluginInfo::operator=):
+ (QWebPluginDatabase::plugins):
+ (QWebPluginDatabase::pluginForMimeType):
+ (QWebPluginDatabase::setPreferredPluginForMimeType):
+ * Api/qwebplugindatabase.h:
+ * Api/qwebplugindatabase_p.h:
+ * tests/qwebplugindatabase/tst_qwebplugindatabase.cpp:
+ (tst_QWebPluginDatabase::installedPlugins):
+ (tst_QWebPluginDatabase::searchPaths):
+ (tst_QWebPluginDatabase::null_data):
+ (tst_QWebPluginDatabase::null):
+ (tst_QWebPluginDatabase::pluginForMimeType):
+ (tst_QWebPluginDatabase::enabled):
+ (tst_QWebPluginDatabase::operatorequal_data):
+ (tst_QWebPluginDatabase::operatorequal):
+ (tst_QWebPluginDatabase::preferredPlugin):
+
+2009-08-04 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Adam Treat.
+
+ Replace QWebPlugin::MimeType with a typedef to
+ QWebPluginFactory::MimeType.
+
+ * Api/qwebplugindatabase.cpp:
+ * Api/qwebplugindatabase.h:
+ * Api/qwebpluginfactory.cpp:
+ (QWebPluginFactory::MimeType::operator==):
+ * Api/qwebpluginfactory.h:
+
+2009-08-04 Jakub Wieczorek <faw217@gmail.com>
+
+ Reviewed by Simon Hausmann.
+
+ Add QWebPluginDatabase API to the Qt API.
+
+ https://bugs.webkit.org/show_bug.cgi?id=27651
+
+ * Api/headers.pri:
+ * Api/qwebplugindatabase.cpp: Added.
+ (QWebPluginPrivate::QWebPluginPrivate):
+ (QWebPluginDatabasePrivate::QWebPluginDatabasePrivate):
+ (QWebPlugin::MimeType::operator==):
+ (QWebPlugin::QWebPlugin):
+ (QWebPlugin::~QWebPlugin):
+ (QWebPlugin::name):
+ (QWebPlugin::description):
+ (QWebPlugin::mimeTypes):
+ (QWebPlugin::supportsMimeType):
+ (QWebPlugin::path):
+ (QWebPlugin::isNull):
+ (QWebPlugin::setEnabled):
+ (QWebPlugin::isEnabled):
+ (QWebPlugin::operator==):
+ (QWebPlugin::operator!=):
+ (QWebPlugin::operator=):
+ (QWebPluginDatabase::QWebPluginDatabase):
+ (QWebPluginDatabase::~QWebPluginDatabase):
+ (QWebPluginDatabase::plugins):
+ (QWebPluginDatabase::defaultSearchPaths):
+ (QWebPluginDatabase::searchPaths):
+ (QWebPluginDatabase::setSearchPaths):
+ (QWebPluginDatabase::addSearchPath):
+ (QWebPluginDatabase::refresh):
+ (QWebPluginDatabase::pluginForMimeType):
+ (QWebPluginDatabase::setPreferredPluginForMimeType):
+ * Api/qwebplugindatabase.h: Added.
+ * Api/qwebplugindatabase_p.h: Added.
+ * Api/qwebsettings.cpp:
+ (QWebSettings::pluginDatabase):
+ * Api/qwebsettings.h:
+ * tests/qwebplugindatabase/qwebplugindatabase.pro: Added.
+ * tests/qwebplugindatabase/tst_qwebplugindatabase.cpp: Added.
+ (tst_QWebPluginDatabase::installedPlugins):
+ (tst_QWebPluginDatabase::searchPaths):
+ (tst_QWebPluginDatabase::null_data):
+ (tst_QWebPluginDatabase::null):
+ (tst_QWebPluginDatabase::pluginForMimeType):
+ (tst_QWebPluginDatabase::enabled):
+ (tst_QWebPluginDatabase::operatorequal_data):
+ (tst_QWebPluginDatabase::operatorequal):
+ (tst_QWebPluginDatabase::preferredPlugin):
+ * tests/tests.pro:
+
+2009-08-03 Balazs Kelemen <kelemen.balazs.3@stud.u-szeged.hu>
+
+ Reviewed by Simon Hausmann.
+
+ Do memory cleanup when running robotized QtLauncher in debug as well.
+
+ * QtLauncher/main.cpp:
+ (launcherMain):
+ (main):
+
+2009-07-30 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ [Qt] Initialize HTML5 Application Cache for QtWebKit to a sensible default
+ https://bugs.webkit.org/show_bug.cgi?id=27866
+
+ * Api/qwebpage.cpp:
+ (initializeApplicationCachePathIfNecessary):
+ (QWebPagePrivate::QWebPagePrivate):
+
+2009-07-31 Jakob Petsovits <jakob.petsovits@torchmobile.com>
+
+ Reviewed by Adam Treat.
+
+ Build QtWebKit without benchmark tests for Qt < 4.5.
+ https://bugs.webkit.org/show_bug.cgi?id=27886
+
+ The QBENCHMARK macro is only available from 4.5 on,
+ so builds for Qt < 4.5 shouldn't try to build those.
+
+ * tests/tests.pro:
+
+2009-07-31 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Adam Treat.
+
+ Fix warning by migrating use of QString.sprintf(...) to
+ QString.arg().arg()...
+
+ * WebCoreSupport/EditorClientQt.cpp:
+ (dumpRange):
+
+2009-07-31 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Expose the Offline Web Application Cache in the Qt API.
+
+ * Api/qwebsettings.cpp:
+ (QWebSettings::QWebSettings):
+ (QWebSettings::setOfflineWebApplicationCachePath):
+ (QWebSettings::offlineWebApplicationCachePath):
+ (QWebSettings::setOfflineWebApplicationCacheQuota):
+ (QWebSettings::offlineWebApplicationCacheQuota):
+ * Api/qwebsettings.h:
+
+2009-07-30 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Adam Treat.
+
+ Add missing Q_OBJECT to class inheriting from QObject.
+
+ * tests/qwebframe/tst_qwebframe.cpp:
+
+2009-07-30 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Adam Treat.
+
+ Fix indentation.
+
+ * tests/qwebframe/tst_qwebframe.cpp:
+
+2009-07-30 Volker Hilsheimer <volker.hilsheimer@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Fix documentation links to examples.
+
+ * Api/qwebview.cpp:
+
+2009-07-30 Balazs Kelemen <kelemen.balazs.3@stud.u-szeged.hu>
+
+ Reviewed by Simon Hausmann.
+
+ Allocate MainWindow on heap in robotized QtLauncher as well.
+
+ * QtLauncher/main.cpp:
+ (main):
+
+2009-07-29 Kevin McCullough <kmccullough@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Added foundation work to allow a testing infrastructure for the Web
+ Inspector.
+
+ * WebCoreSupport/InspectorClientQt.cpp:
+ (WebCore::InspectorClientQt::inspectorWindowObjectCleared):
+ * WebCoreSupport/InspectorClientQt.h:
+
+2009-07-29 Zoltan Herczeg <zherczeg@inf.u-szeged.hu>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] In debug mode, this fix frees cached resources
+ and other unreferenced objects (by calling the
+ garbage collector) to remove the LEAK messages.
+ https://bugs.webkit.org/show_bug.cgi?id=27767
+
+ * Api/qwebframe.cpp:
+ (qt_drt_cache_clear):
+ * QtLauncher/main.cpp:
+ (main):
+
+2009-07-28 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Fix the Qt build by adapting to the changes of ScriptObject.
+
+ * Api/qwebelement.cpp:
+ (setupScriptObject):
+
+2009-07-28 Robert Hogan <robert@roberthogan.net>
+
+ Reviewed by Simon Hausmann.
+
+ Add WebKit version API to Qt.
+
+ Get the current version of WebKit from WebKit/mac/Configurations/Version.xcconfig
+ at compile time and make it available to Qt applications through
+ qWebKitVersion().
+
+ Also amend the User Agent string to place the Safari clause outside
+ the final bracket and to the end of the UA string.
+
+ https://bugs.webkit.org/show_bug.cgi?id=27158
+
+ Minor build tweak by Simon Hausmann (adding export macros to new functions).
+
+ * Api/headers.pri:
+ * Api/qwebkitversion.cpp: Added.
+ (webKitVersion):
+ (webKitMajorVersion):
+ (webKitMinorVersion):
+ * Api/qwebkitversion.h: Added.
+ * Api/qwebpage.cpp:
+ (QWebPage::userAgentForUrl):
+ * tests/qwebview/tst_qwebview.cpp:
+ (tst_QWebView::getWebKitVersion):
+
2009-07-28 Simon Hausmann <simon.hausmann@nokia.com>
Rubber-stamped by Ariya Hidayat.
@@ -2663,7 +6247,7 @@
Reviewed by Simon Hausmann.
- http://www.qtsoftware.com/developer/task-tracker/index_html?id=238391&method=entry
+ http://qt.nokia.com/developer/task-tracker/index_html?id=238391&method=entry
[Qt] If QPainter fails to start on a QPrinter instance, do not
continue printing.
@@ -2856,7 +6440,7 @@
Rubber-stamped by Simon Hausmann.
- http://www.qtsoftware.com/developer/task-tracker/index_html?id=219344&method=entry
+ http://qt.nokia.com/developer/task-tracker/index_html?id=219344&method=entry
[Qt] API documentation for QWebPage::WebAction enum.
@@ -2911,7 +6495,7 @@
Reviewed by Simon Hausmann.
- http://www.qtsoftware.com/developer/task-tracker/index_html?id=241144&method=entry
+ http://qt.nokia.com/developer/task-tracker/index_html?id=241144&method=entry
[Qt] Create actions for text selection and editing for QWebPage.
Also properly disable and enable them when contentEditable is toggled.
diff --git a/src/3rdparty/webkit/WebKit/qt/Plugins/ICOHandler.cpp b/src/3rdparty/webkit/WebKit/qt/Plugins/ICOHandler.cpp
deleted file mode 100644
index d7fae07ca..000000000
--- a/src/3rdparty/webkit/WebKit/qt/Plugins/ICOHandler.cpp
+++ /dev/null
@@ -1,460 +0,0 @@
-/*
- * kimgio import filter for MS Windows .ico files
- *
- * Distributed under the terms of the LGPL
- * Copyright (c) 2000 Malte Starostik <malte@kde.org>
- *
- */
-
-#include "config.h"
-#include "ICOHandler.h"
-
-#include <cstring>
-#include <cstdlib>
-#include <algorithm>
-#include <vector>
-
-#include <QtGui/QImage>
-#include <QtGui/QBitmap>
-#include <QtGui/QApplication>
-#include <QtCore/QVector>
-#include <QtGui/QDesktopWidget>
-
-namespace
-{
- // Global header (see http://www.daubnet.com/formats/ICO.html)
- struct IcoHeader
- {
- enum Type { Icon = 1, Cursor };
- quint16 reserved;
- quint16 type;
- quint16 count;
- };
-
- inline QDataStream& operator >>( QDataStream& s, IcoHeader& h )
- {
- return s >> h.reserved >> h.type >> h.count;
- }
-
- // Based on qt_read_dib et al. from qimage.cpp
- // (c) 1992-2002 Nokia Corporation and/or its subsidiary(-ies).
- struct BMP_INFOHDR
- {
- static const quint32 Size = 40;
- quint32 biSize; // size of this struct
- quint32 biWidth; // pixmap width
- quint32 biHeight; // pixmap height
- quint16 biPlanes; // should be 1
- quint16 biBitCount; // number of bits per pixel
- enum Compression { RGB = 0 };
- quint32 biCompression; // compression method
- quint32 biSizeImage; // size of image
- quint32 biXPelsPerMeter; // horizontal resolution
- quint32 biYPelsPerMeter; // vertical resolution
- quint32 biClrUsed; // number of colors used
- quint32 biClrImportant; // number of important colors
- };
- const quint32 BMP_INFOHDR::Size;
-
- QDataStream& operator >>( QDataStream &s, BMP_INFOHDR &bi )
- {
- s >> bi.biSize;
- if ( bi.biSize == BMP_INFOHDR::Size )
- {
- s >> bi.biWidth >> bi.biHeight >> bi.biPlanes >> bi.biBitCount;
- s >> bi.biCompression >> bi.biSizeImage;
- s >> bi.biXPelsPerMeter >> bi.biYPelsPerMeter;
- s >> bi.biClrUsed >> bi.biClrImportant;
- }
- return s;
- }
-
-#if 0
- QDataStream &operator<<( QDataStream &s, const BMP_INFOHDR &bi )
- {
- s << bi.biSize;
- s << bi.biWidth << bi.biHeight;
- s << bi.biPlanes;
- s << bi.biBitCount;
- s << bi.biCompression;
- s << bi.biSizeImage;
- s << bi.biXPelsPerMeter << bi.biYPelsPerMeter;
- s << bi.biClrUsed << bi.biClrImportant;
- return s;
- }
-#endif
-
- // Header for every icon in the file
- struct IconRec
- {
- unsigned char width;
- unsigned char height;
- quint16 colors;
- quint16 hotspotX;
- quint16 hotspotY;
- quint32 size;
- quint32 offset;
- };
-
- inline QDataStream& operator >>( QDataStream& s, IconRec& r )
- {
- return s >> r.width >> r.height >> r.colors
- >> r.hotspotX >> r.hotspotY >> r.size >> r.offset;
- }
-
- struct LessDifference
- {
- LessDifference( unsigned s, unsigned c )
- : size( s ), colors( c ) {}
-
- bool operator ()( const IconRec& lhs, const IconRec& rhs ) const
- {
- // closest size match precedes everything else
- if ( std::abs( int( lhs.width - size ) ) <
- std::abs( int( rhs.width - size ) ) ) return true;
- else if ( std::abs( int( lhs.width - size ) ) >
- std::abs( int( rhs.width - size ) ) ) return false;
- else if ( colors == 0 )
- {
- // high/true color requested
- if ( lhs.colors == 0 ) return true;
- else if ( rhs.colors == 0 ) return false;
- else return lhs.colors > rhs.colors;
- }
- else
- {
- // indexed icon requested
- if ( lhs.colors == 0 && rhs.colors == 0 ) return false;
- else if ( lhs.colors == 0 ) return false;
- else return std::abs( int( lhs.colors - colors ) ) <
- std::abs( int( rhs.colors - colors ) );
- }
- }
- unsigned size;
- unsigned colors;
- };
-
- bool loadFromDIB( QDataStream& stream, const IconRec& rec, QImage& icon )
- {
- BMP_INFOHDR header;
- stream >> header;
- if ( stream.atEnd() || header.biSize != BMP_INFOHDR::Size ||
- header.biSize > rec.size ||
- header.biCompression != BMP_INFOHDR::RGB ||
- ( header.biBitCount != 1 && header.biBitCount != 4 &&
- header.biBitCount != 8 && header.biBitCount != 24 &&
- header.biBitCount != 32 ) ) return false;
-
- unsigned paletteSize, paletteEntries;
-
- if (header.biBitCount > 8)
- {
- paletteEntries = 0;
- paletteSize = 0;
- }
- else
- {
- paletteSize = (1 << header.biBitCount);
- paletteEntries = paletteSize;
- if (header.biClrUsed && header.biClrUsed < paletteSize)
- paletteEntries = header.biClrUsed;
- }
-
- // Always create a 32-bit image to get the mask right
- // Note: this is safe as rec.width, rec.height are bytes
- icon = QImage( rec.width, rec.height, QImage::Format_ARGB32 );
- if ( icon.isNull() ) return false;
-
- QVector< QRgb > colorTable( paletteSize );
-
- colorTable.fill( QRgb( 0 ) );
- for ( unsigned i = 0; i < paletteEntries; ++i )
- {
- unsigned char rgb[ 4 ];
- stream.readRawData( reinterpret_cast< char* >( &rgb ),
- sizeof( rgb ) );
- colorTable[ i ] = qRgb( rgb[ 2 ], rgb[ 1 ], rgb[ 0 ] );
- }
-
- unsigned bpl = ( rec.width * header.biBitCount + 31 ) / 32 * 4;
-
- unsigned char* buf = new unsigned char[ bpl ];
- for ( unsigned y = rec.height; !stream.atEnd() && y--; )
- {
- stream.readRawData( reinterpret_cast< char* >( buf ), bpl );
- unsigned char* pixel = buf;
- QRgb* p = reinterpret_cast< QRgb* >( icon.scanLine( y ) );
- switch ( header.biBitCount )
- {
- case 1:
- for ( unsigned x = 0; x < rec.width; ++x )
- *p++ = colorTable[
- ( pixel[ x / 8 ] >> ( 7 - ( x & 0x07 ) ) ) & 1 ];
- break;
- case 4:
- for ( unsigned x = 0; x < rec.width; ++x )
- if ( x & 1 ) *p++ = colorTable[ pixel[ x / 2 ] & 0x0f ];
- else *p++ = colorTable[ pixel[ x / 2 ] >> 4 ];
- break;
- case 8:
- for ( unsigned x = 0; x < rec.width; ++x )
- *p++ = colorTable[ pixel[ x ] ];
- break;
- case 24:
- for ( unsigned x = 0; x < rec.width; ++x )
- *p++ = qRgb( pixel[ 3 * x + 2 ],
- pixel[ 3 * x + 1 ],
- pixel[ 3 * x ] );
- break;
- case 32:
- for ( unsigned x = 0; x < rec.width; ++x )
- *p++ = qRgba( pixel[ 4 * x + 2 ],
- pixel[ 4 * x + 1 ],
- pixel[ 4 * x ],
- pixel[ 4 * x + 3] );
- break;
- }
- }
- delete[] buf;
-
- if ( header.biBitCount < 32 )
- {
- // Traditional 1-bit mask
- bpl = ( rec.width + 31 ) / 32 * 4;
- buf = new unsigned char[ bpl ];
- for ( unsigned y = rec.height; y--; )
- {
- stream.readRawData( reinterpret_cast< char* >( buf ), bpl );
- QRgb* p = reinterpret_cast< QRgb* >( icon.scanLine( y ) );
- for ( unsigned x = 0; x < rec.width; ++x, ++p )
- if ( ( ( buf[ x / 8 ] >> ( 7 - ( x & 0x07 ) ) ) & 1 ) )
- *p &= RGB_MASK;
- }
- delete[] buf;
- }
- return true;
- }
-}
-
-ICOHandler::ICOHandler()
-{
-}
-
-bool ICOHandler::canRead() const
-{
- return canRead(device());
-}
-
-bool ICOHandler::read(QImage *outImage)
-{
-
- qint64 offset = device()->pos();
-
- QDataStream stream( device() );
- stream.setByteOrder( QDataStream::LittleEndian );
- IcoHeader header;
- stream >> header;
- if ( stream.atEnd() || !header.count ||
- ( header.type != IcoHeader::Icon && header.type != IcoHeader::Cursor) )
- return false;
-
- unsigned requestedSize = 32;
- unsigned requestedColors = QApplication::desktop()->depth() > 8 ? 0 : QApplication::desktop()->depth();
- int requestedIndex = -1;
-#if 0
- if ( io->parameters() )
- {
- QStringList params = QString(io->parameters()).split( ';', QString::SkipEmptyParts );
- QMap< QString, QString > options;
- for ( QStringList::ConstIterator it = params.begin();
- it != params.end(); ++it )
- {
- QStringList tmp = (*it).split( '=', QString::SkipEmptyParts );
- if ( tmp.count() == 2 ) options[ tmp[ 0 ] ] = tmp[ 1 ];
- }
- if ( options[ "index" ].toUInt() )
- requestedIndex = options[ "index" ].toUInt();
- if ( options[ "size" ].toUInt() )
- requestedSize = options[ "size" ].toUInt();
- if ( options[ "colors" ].toUInt() )
- requestedColors = options[ "colors" ].toUInt();
- }
-#endif
-
- typedef std::vector< IconRec > IconList;
- IconList icons;
- for ( unsigned i = 0; i < header.count; ++i )
- {
- if ( stream.atEnd() )
- return false;
- IconRec rec;
- stream >> rec;
- icons.push_back( rec );
- }
- IconList::const_iterator selected;
- if (requestedIndex >= 0) {
- selected = std::min( icons.begin() + requestedIndex, icons.end() );
- } else {
- selected = std::min_element( icons.begin(), icons.end(),
- LessDifference( requestedSize, requestedColors ) );
- }
- if ( stream.atEnd() || selected == icons.end() ||
- offset + selected->offset > device()->size() )
- return false;
-
- device()->seek( offset + selected->offset );
- QImage icon;
- if ( loadFromDIB( stream, *selected, icon ) )
- {
-#ifndef QT_NO_IMAGE_TEXT
- icon.setText( "X-Index", 0, QString::number( selected - icons.begin() ) );
- if ( header.type == IcoHeader::Cursor )
- {
- icon.setText( "X-HotspotX", 0, QString::number( selected->hotspotX ) );
- icon.setText( "X-HotspotY", 0, QString::number( selected->hotspotY ) );
- }
-#endif
- *outImage = icon;
- return true;
- }
- return false;
-}
-
-bool ICOHandler::write(const QImage &/*image*/)
-{
-#if 0
- if (image.isNull())
- return;
-
- QByteArray dibData;
- QDataStream dib(dibData, QIODevice::ReadWrite);
- dib.setByteOrder(QDataStream::LittleEndian);
-
- QImage pixels = image;
- QImage mask;
- if (io->image().hasAlphaBuffer())
- mask = image.createAlphaMask();
- else
- mask = image.createHeuristicMask();
- mask.invertPixels();
- for ( int y = 0; y < pixels.height(); ++y )
- for ( int x = 0; x < pixels.width(); ++x )
- if ( mask.pixel( x, y ) == 0 ) pixels.setPixel( x, y, 0 );
-
- if (!qt_write_dib(dib, pixels))
- return;
-
- uint hdrPos = dib.device()->at();
- if (!qt_write_dib(dib, mask))
- return;
- memmove(dibData.data() + hdrPos, dibData.data() + hdrPos + BMP_WIN + 8, dibData.size() - hdrPos - BMP_WIN - 8);
- dibData.resize(dibData.size() - BMP_WIN - 8);
-
- QDataStream ico(device());
- ico.setByteOrder(QDataStream::LittleEndian);
- IcoHeader hdr;
- hdr.reserved = 0;
- hdr.type = Icon;
- hdr.count = 1;
- ico << hdr.reserved << hdr.type << hdr.count;
- IconRec rec;
- rec.width = image.width();
- rec.height = image.height();
- if (image.numColors() <= 16)
- rec.colors = 16;
- else if (image.depth() <= 8)
- rec.colors = 256;
- else
- rec.colors = 0;
- rec.hotspotX = 0;
- rec.hotspotY = 0;
- rec.dibSize = dibData.size();
- ico << rec.width << rec.height << rec.colors
- << rec.hotspotX << rec.hotspotY << rec.dibSize;
- rec.dibOffset = ico.device()->at() + sizeof(rec.dibOffset);
- ico << rec.dibOffset;
-
- BMP_INFOHDR dibHeader;
- dib.device()->at(0);
- dib >> dibHeader;
- dibHeader.biHeight = image.height() << 1;
- dib.device()->at(0);
- dib << dibHeader;
-
- ico.writeRawBytes(dibData.data(), dibData.size());
- return true;
-#endif
- return false;
-}
-
-QByteArray ICOHandler::name() const
-{
- return "ico";
-}
-
-bool ICOHandler::canRead(QIODevice *device)
-{
- if (!device) {
- qWarning("ICOHandler::canRead() called with no device");
- return false;
- }
-
- const qint64 oldPos = device->pos();
-
- char head[8];
- qint64 readBytes = device->read(head, sizeof(head));
- const bool readOk = readBytes == sizeof(head);
-
- if (device->isSequential()) {
- while (readBytes > 0)
- device->ungetChar(head[readBytes-- - 1]);
- } else {
- device->seek(oldPos);
- }
-
- if ( !readOk )
- return false;
-
- return head[2] == '\001' && head[3] == '\000' && // type should be 1
- ( head[6] == 16 || head[6] == 32 || head[6] == 64 ) && // width can only be one of those
- ( head[7] == 16 || head[7] == 32 || head[7] == 64 ); // same for height
-}
-
-class ICOPlugin : public QImageIOPlugin
-{
-public:
- QStringList keys() const;
- Capabilities capabilities(QIODevice *device, const QByteArray &format) const;
- QImageIOHandler *create(QIODevice *device, const QByteArray &format = QByteArray()) const;
-};
-
-QStringList ICOPlugin::keys() const
-{
- return QStringList() << "ico" << "ICO";
-}
-
-QImageIOPlugin::Capabilities ICOPlugin::capabilities(QIODevice *device, const QByteArray &format) const
-{
- if (format == "ico" || format == "ICO")
- return Capabilities(CanRead);
- if (!format.isEmpty())
- return 0;
- if (!device->isOpen())
- return 0;
-
- Capabilities cap;
- if (device->isReadable() && ICOHandler::canRead(device))
- cap |= CanRead;
- return cap;
-}
-
-QImageIOHandler *ICOPlugin::create(QIODevice *device, const QByteArray &format) const
-{
- QImageIOHandler *handler = new ICOHandler;
- handler->setDevice(device);
- handler->setFormat(format);
- return handler;
-}
-
-Q_EXPORT_STATIC_PLUGIN(ICOPlugin)
-Q_EXPORT_PLUGIN2(qtwebico, ICOPlugin)
diff --git a/src/3rdparty/webkit/WebKit/qt/Plugins/ICOHandler.h b/src/3rdparty/webkit/WebKit/qt/Plugins/ICOHandler.h
deleted file mode 100644
index 4f1f1d6b1..000000000
--- a/src/3rdparty/webkit/WebKit/qt/Plugins/ICOHandler.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * ico.h - kimgio import filter for MS Windows .ico files
- *
- * Distributed under the terms of the LGPL
- * Copyright (c) 2000 Malte Starostik <malte@kde.org>
- *
- */
-
-// You can use QImageIO::setParameters() to request a specific
-// Icon out of an .ico file:
-//
-// Options consist of a name=value pair and are separated by a semicolon.
-// Available options are:
-// size=<size> select the icon that most closely matches <size> (pixels)
-// default: 32
-// colors=<num> select the icon that has <num> colors (or comes closest)
-// default: 1 << display depth or 0 (RGB) if display depth > 8
-// index=<index> select the indexth icon from the file. If this option
-// is present, the size and colors options will be ignored.
-// default: none
-// If both size and colors are given, size takes precedence.
-//
-// The old format is still supported:
-// the parameters consist of a single string in the form
-// "<size>[:<colors>]" which correspond to the options above
-//
-// If an icon was returned (i.e. the file is valid and the index option
-// if present was not out of range), the icon's index within the .ico
-// file is returned in the text tag "X-Index" of the image.
-// If the icon is in fact a cursor, its hotspot coordinates are returned
-// in the text tags "X-HotspotX" and "X-HotspotY".
-
-#ifndef _ICOHANDLER_H_
-#define _ICOHANDLER_H_
-
-#include <QtGui/QImageIOPlugin>
-
-class ICOHandler : public QImageIOHandler
-{
-public:
- ICOHandler();
-
- bool canRead() const;
- bool read(QImage *image);
- bool write(const QImage &image);
-
- QByteArray name() const;
-
- static bool canRead(QIODevice *device);
-};
-
-#endif
diff --git a/src/3rdparty/webkit/WebKit/qt/Plugins/Plugins.pro b/src/3rdparty/webkit/WebKit/qt/Plugins/Plugins.pro
deleted file mode 100644
index a9b4f82f6..000000000
--- a/src/3rdparty/webkit/WebKit/qt/Plugins/Plugins.pro
+++ /dev/null
@@ -1,14 +0,0 @@
-TEMPLATE = lib
-TARGET = qtwebico
-CONFIG += plugin
-HEADERS += ICOHandler.h
-SOURCES += ICOHandler.cpp
-
-include(../../WebKit.pri)
-
-contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols
-unix:contains(QT_CONFIG, reduce_relocations):CONFIG += bsymbolic_functions
-
-target.path = $$[QT_INSTALL_PLUGINS]/imageformats
-INSTALLS += target
-
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
index d65983388..26cf6f6b1 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
@@ -39,12 +39,14 @@
#include "WindowFeatures.h"
#include "DatabaseTracker.h"
#include "SecurityOrigin.h"
+#include "QWebPageClient.h"
#include "qwebpage.h"
#include "qwebpage_p.h"
#include "qwebframe_p.h"
#include "qwebsecurityorigin.h"
#include "qwebsecurityorigin_p.h"
+#include "qwebview.h"
#include <qtooltip.h>
#include <qtextdocument.h>
@@ -303,16 +305,15 @@ IntRect ChromeClientQt::windowResizerRect() const
return IntRect();
}
-void ChromeClientQt::repaint(const IntRect& windowRect, bool contentChanged, bool immediate, bool repaintContentOnly)
+void ChromeClientQt::repaint(const IntRect& windowRect, bool contentChanged, bool, bool)
{
// No double buffer, so only update the QWidget if content changed.
if (contentChanged) {
- QWidget* view = m_webPage->view();
- if (view) {
+ if (platformPageClient()) {
QRect rect(windowRect);
rect = rect.intersected(QRect(QPoint(0, 0), m_webPage->viewportSize()));
if (!rect.isEmpty())
- view->update(rect);
+ platformPageClient()->update(rect);
}
emit m_webPage->repaintRequested(windowRect);
}
@@ -323,9 +324,8 @@ void ChromeClientQt::repaint(const IntRect& windowRect, bool contentChanged, boo
void ChromeClientQt::scroll(const IntSize& delta, const IntRect& scrollViewRect, const IntRect&)
{
- QWidget* view = m_webPage->view();
- if (view)
- view->scroll(delta.width(), delta.height(), scrollViewRect);
+ if (platformPageClient())
+ platformPageClient()->scroll(delta.width(), delta.height(), scrollViewRect);
emit m_webPage->scrollRequested(delta.width(), delta.height(), scrollViewRect);
}
@@ -341,9 +341,9 @@ IntPoint ChromeClientQt::screenToWindow(const IntPoint& point) const
return point;
}
-PlatformWidget ChromeClientQt::platformWindow() const
+PlatformPageClient ChromeClientQt::platformPageClient() const
{
- return m_webPage->view();
+ return m_webPage->d->client;
}
void ChromeClientQt::contentsSizeChanged(Frame* frame, const IntSize& size) const
@@ -351,7 +351,7 @@ void ChromeClientQt::contentsSizeChanged(Frame* frame, const IntSize& size) cons
emit QWebFramePrivate::kit(frame)->contentsSizeChanged(size);
}
-void ChromeClientQt::mouseDidMoveOverElement(const HitTestResult& result, unsigned modifierFlags)
+void ChromeClientQt::mouseDidMoveOverElement(const HitTestResult& result, unsigned)
{
TextDirection dir;
if (result.absoluteLinkURL() != lastHoverURL
@@ -402,7 +402,7 @@ void ChromeClientQt::exceededDatabaseQuota(Frame* frame, const String& databaseN
#endif
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
-void ChromeClientQt::reachedMaxAppCacheSize(int64_t spaceNeeded)
+void ChromeClientQt::reachedMaxAppCacheSize(int64_t)
{
// FIXME: Free some space.
notImplemented();
@@ -419,7 +419,7 @@ void ChromeClientQt::runOpenPanel(Frame* frame, PassRefPtr<FileChooser> prpFileC
option.parentFrame = QWebFramePrivate::kit(frame);
if (!fileChooser->filenames().isEmpty())
- for (int i = 0; i < fileChooser->filenames().size(); ++i)
+ for (unsigned i = 0; i < fileChooser->filenames().size(); ++i)
option.suggestedFileNames += fileChooser->filenames()[i];
QWebPage::ChooseMultipleFilesExtensionReturn output;
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.h b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.h
index 96c7faba9..196c4fcd0 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.h
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.h
@@ -105,9 +105,10 @@ namespace WebCore {
virtual void scroll(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect);
virtual IntPoint screenToWindow(const IntPoint&) const;
virtual IntRect windowToScreen(const IntRect&) const;
- virtual PlatformWidget platformWindow() const;
+ virtual PlatformPageClient platformPageClient() const;
virtual void contentsSizeChanged(Frame*, const IntSize&) const;
+ virtual void scrollbarsModeDidChange() const { }
virtual void mouseDidMoveOverElement(const HitTestResult&, unsigned modifierFlags);
virtual void setToolTip(const String&, TextDirection);
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ContextMenuClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ContextMenuClientQt.cpp
index ed7994623..b4400ff51 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ContextMenuClientQt.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ContextMenuClientQt.cpp
@@ -52,7 +52,7 @@ void ContextMenuClientQt::contextMenuItemSelected(ContextMenuItem*, const Contex
notImplemented();
}
-void ContextMenuClientQt::downloadURL(const KURL& url)
+void ContextMenuClientQt::downloadURL(const KURL&)
{
notImplemented();
}
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/DragClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/DragClientQt.cpp
index 0df0768ad..99e438d50 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/DragClientQt.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/DragClientQt.cpp
@@ -66,6 +66,8 @@ void DragClientQt::startDrag(DragImageRef, const IntPoint&, const IntPoint&, Cli
QWidget* view = m_webPage->view();
if (view) {
QDrag *drag = new QDrag(view);
+ if (clipboardData->hasImage())
+ drag->setPixmap(qvariant_cast<QPixmap>(clipboardData->imageData()));
drag->setMimeData(clipboardData);
drag->start();
}
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
index 6c31bd85d..34241f0e2 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
@@ -41,12 +41,15 @@
#include "FocusController.h"
#include "Frame.h"
#include "HTMLElement.h"
+#include "HTMLInputElement.h"
+#include "HTMLNames.h"
#include "KeyboardCodes.h"
#include "KeyboardEvent.h"
#include "NotImplemented.h"
#include "Page.h"
#include "Page.h"
#include "PlatformKeyboardEvent.h"
+#include "QWebPageClient.h"
#include "Range.h"
#include <stdio.h>
@@ -84,17 +87,19 @@ static QString dumpRange(WebCore::Range *range)
{
if (!range)
return QLatin1String("(null)");
- QString str;
WebCore::ExceptionCode code;
- str.sprintf("range from %ld of %ls to %ld of %ls",
- range->startOffset(code), dumpPath(range->startContainer(code)).unicode(),
- range->endOffset(code), dumpPath(range->endContainer(code)).unicode());
+
+ QString str = QString("range from %1 of %2 to %3 of %4")
+ .arg(range->startOffset(code)).arg(dumpPath(range->startContainer(code)))
+ .arg(range->endOffset(code)).arg(dumpPath(range->endContainer(code)));
+
return str;
}
namespace WebCore {
+using namespace HTMLNames;
bool EditorClientQt::shouldDeleteRange(Range* range)
{
@@ -107,7 +112,7 @@ bool EditorClientQt::shouldDeleteRange(Range* range)
bool EditorClientQt::shouldShowDeleteInterface(HTMLElement* element)
{
if (QWebPagePrivate::drtRun)
- return element->className() == "needsDeletionUI";
+ return element->getAttribute(classAttr) == "needsDeletionUI";
return false;
}
@@ -217,7 +222,9 @@ void EditorClientQt::respondToChangedSelection()
m_page->d->updateEditorActions();
emit m_page->selectionChanged();
- emit m_page->microFocusChanged();
+ Frame* frame = m_page->d->page->focusController()->focusedOrMainFrame();
+ if (!frame->editor()->ignoreCompositionSelectionChange())
+ emit m_page->microFocusChanged();
}
void EditorClientQt::didEndEditing()
@@ -591,11 +598,27 @@ bool EditorClientQt::isEditing() const
void EditorClientQt::setInputMethodState(bool active)
{
- QWidget *view = m_page->view();
- if (view) {
- view->setAttribute(Qt::WA_InputMethodEnabled, active);
- emit m_page->microFocusChanged();
+ QWebPageClient* webPageClient = m_page->d->client;
+ if (webPageClient) {
+#if QT_VERSION >= 0x040600
+ bool isPasswordField = false;
+ if (!active) {
+ // Setting the Qt::WA_InputMethodEnabled attribute true and Qt::ImhHiddenText flag
+ // for password fields. The Qt platform is responsible for determining which widget
+ // will receive input method events for password fields.
+ Frame* frame = m_page->d->page->focusController()->focusedOrMainFrame();
+ if (frame && frame->document() && frame->document()->focusedNode()) {
+ if (frame->document()->focusedNode()->hasTagName(HTMLNames::inputTag)) {
+ HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(frame->document()->focusedNode());
+ active = isPasswordField = inputElement->isPasswordField();
+ }
+ }
+ }
+ webPageClient->setInputMethodHint(Qt::ImhHiddenText, isPasswordField);
+#endif
+ webPageClient->setInputMethodEnabled(active);
}
+ emit m_page->microFocusChanged();
}
}
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
index 5cf86b12c..5cabca04e 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
@@ -37,6 +37,7 @@
#include "FrameTree.h"
#include "FrameView.h"
#include "DocumentLoader.h"
+#include "JSDOMWindowBase.h"
#include "MIMETypeRegistry.h"
#include "ResourceResponse.h"
#include "Page.h"
@@ -55,8 +56,10 @@
#include "ResourceHandle.h"
#include "Settings.h"
#include "ScriptString.h"
+#include "QWebPageClient.h"
#include "qwebpage.h"
+#include "qwebpage_p.h"
#include "qwebframe.h"
#include "qwebframe_p.h"
#include "qwebhistoryinterface.h"
@@ -67,6 +70,8 @@
#include <QCoreApplication>
#include <QDebug>
#if QT_VERSION >= 0x040400
+#include <QGraphicsScene>
+#include <QGraphicsWidget>
#include <QNetworkRequest>
#include <QNetworkReply>
#else
@@ -144,7 +149,7 @@ FrameLoaderClientQt::FrameLoaderClientQt()
, m_pluginView(0)
, m_hasSentResponseToPlugin(false)
, m_firstData(false)
- , m_loadSucceeded(false)
+ , m_loadError (ResourceError())
{
}
@@ -172,8 +177,8 @@ void FrameLoaderClientQt::setFrame(QWebFrame* webFrame, Frame* frame)
m_webFrame->page(), SIGNAL(loadFinished(bool)));
connect(this, SIGNAL(loadFinished(bool)),
m_webFrame, SIGNAL(loadFinished(bool)));
- connect(this, SIGNAL(titleChanged(const QString&)),
- m_webFrame, SIGNAL(titleChanged(const QString&)));
+ connect(this, SIGNAL(titleChanged(QString)),
+ m_webFrame, SIGNAL(titleChanged(QString)));
}
QWebFrame* FrameLoaderClientQt::webFrame() const
@@ -183,7 +188,7 @@ QWebFrame* FrameLoaderClientQt::webFrame() const
void FrameLoaderClientQt::callPolicyFunction(FramePolicyFunction function, PolicyAction action)
{
- (m_frame->loader()->*function)(action);
+ (m_frame->loader()->policyChecker()->*function)(action);
}
bool FrameLoaderClientQt::hasWebView() const
@@ -210,12 +215,12 @@ void FrameLoaderClientQt::transitionToCommittedForNewPage()
QColor backgroundColor = brush.style() == Qt::SolidPattern ? brush.color() : QColor();
QWebPage* page = m_webFrame->page();
- const QSize fixedLayoutSize = page->fixedContentsSize();
+ const QSize preferredLayoutSize = page->preferredContentsSize();
m_frame->createView(m_webFrame->page()->viewportSize(),
backgroundColor, !backgroundColor.alpha(),
- fixedLayoutSize.isValid() ? IntSize(fixedLayoutSize) : IntSize(),
- fixedLayoutSize.isValid(),
+ preferredLayoutSize.isValid() ? IntSize(preferredLayoutSize) : IntSize(),
+ preferredLayoutSize.isValid(),
(ScrollbarMode)m_webFrame->scrollBarPolicy(Qt::Horizontal),
(ScrollbarMode)m_webFrame->scrollBarPolicy(Qt::Vertical));
}
@@ -282,9 +287,7 @@ void FrameLoaderClientQt::dispatchDidCancelClientRedirect()
}
-void FrameLoaderClientQt::dispatchWillPerformClientRedirect(const KURL& url,
- double interval,
- double fireDate)
+void FrameLoaderClientQt::dispatchWillPerformClientRedirect(const KURL& url, double, double)
{
if (dumpFrameLoaderCallbacks)
printf("%s - willPerformClientRedirectToURL: %s \n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)), qPrintable(drtDescriptionSuitableForTestResult(url)));
@@ -376,7 +379,8 @@ void FrameLoaderClientQt::dispatchDidFinishLoad()
if (dumpFrameLoaderCallbacks)
printf("%s - didFinishLoadForFrame\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
- m_loadSucceeded = true;
+ // Clears the previous error.
+ m_loadError = ResourceError();
if (!m_webFrame)
return;
@@ -430,6 +434,8 @@ void FrameLoaderClientQt::revertToProvisionalState(DocumentLoader*)
void FrameLoaderClientQt::postProgressStartedNotification()
{
if (m_webFrame && m_frame->page()) {
+ // A new load starts, so lets clear the previous error.
+ m_loadError = ResourceError();
emit loadStarted();
postProgressEstimateChangedNotification();
}
@@ -461,10 +467,10 @@ void FrameLoaderClientQt::postProgressFinishedNotification()
}
if (m_webFrame && m_frame->page())
- emit loadFinished(m_loadSucceeded);
+ emit loadFinished(m_loadError.isNull());
}
-void FrameLoaderClientQt::setMainFrameDocumentReady(bool b)
+void FrameLoaderClientQt::setMainFrameDocumentReady(bool)
{
// this is only interesting once we provide an external API for the DOM
}
@@ -514,13 +520,13 @@ bool FrameLoaderClientQt::canShowMIMEType(const String& MIMEType) const
return false;
}
-bool FrameLoaderClientQt::representationExistsForURLScheme(const String& URLScheme) const
+bool FrameLoaderClientQt::representationExistsForURLScheme(const String&) const
{
return false;
}
-String FrameLoaderClientQt::generatedMIMETypeForURLScheme(const String& URLScheme) const
+String FrameLoaderClientQt::generatedMIMETypeForURLScheme(const String&) const
{
notImplemented();
return String();
@@ -632,11 +638,21 @@ void FrameLoaderClientQt::updateGlobalHistoryRedirectLinks()
{
}
-bool FrameLoaderClientQt::shouldGoToHistoryItem(WebCore::HistoryItem *item) const
+bool FrameLoaderClientQt::shouldGoToHistoryItem(WebCore::HistoryItem *) const
{
return true;
}
+void FrameLoaderClientQt::didDisplayInsecureContent()
+{
+ notImplemented();
+}
+
+void FrameLoaderClientQt::didRunInsecureContent(WebCore::SecurityOrigin*)
+{
+ notImplemented();
+}
+
void FrameLoaderClientQt::saveViewStateToItem(WebCore::HistoryItem* item)
{
QWebHistoryItem historyItem(new QWebHistoryItemPrivate(item));
@@ -692,8 +708,10 @@ void FrameLoaderClientQt::committedLoad(WebCore::DocumentLoader* loader, const c
WebCore::ResourceError FrameLoaderClientQt::cancelledError(const WebCore::ResourceRequest& request)
{
- return ResourceError("Error", -999, request.url().prettyURL(),
+ ResourceError error = ResourceError("QtNetwork", QNetworkReply::OperationCanceledError, request.url().prettyURL(),
QCoreApplication::translate("QWebFrame", "Request cancelled", 0, QCoreApplication::UnicodeUTF8));
+ error.setIsCancellation(true);
+ return error;
}
// copied from WebKit/Misc/WebKitErrors[Private].h
@@ -709,36 +727,36 @@ enum {
WebCore::ResourceError FrameLoaderClientQt::blockedError(const WebCore::ResourceRequest& request)
{
- return ResourceError("Error", WebKitErrorCannotUseRestrictedPort, request.url().prettyURL(),
+ return ResourceError("WebKit", WebKitErrorCannotUseRestrictedPort, request.url().prettyURL(),
QCoreApplication::translate("QWebFrame", "Request blocked", 0, QCoreApplication::UnicodeUTF8));
}
WebCore::ResourceError FrameLoaderClientQt::cannotShowURLError(const WebCore::ResourceRequest& request)
{
- return ResourceError("Error", WebKitErrorCannotShowURL, request.url().string(),
+ return ResourceError("WebKit", WebKitErrorCannotShowURL, request.url().string(),
QCoreApplication::translate("QWebFrame", "Cannot show URL", 0, QCoreApplication::UnicodeUTF8));
}
WebCore::ResourceError FrameLoaderClientQt::interruptForPolicyChangeError(const WebCore::ResourceRequest& request)
{
- return ResourceError("Error", WebKitErrorFrameLoadInterruptedByPolicyChange, request.url().string(),
- QCoreApplication::translate("QWebFrame", "Frame load interruped by policy change", 0, QCoreApplication::UnicodeUTF8));
+ return ResourceError("WebKit", WebKitErrorFrameLoadInterruptedByPolicyChange, request.url().string(),
+ QCoreApplication::translate("QWebFrame", "Frame load interrupted by policy change", 0, QCoreApplication::UnicodeUTF8));
}
WebCore::ResourceError FrameLoaderClientQt::cannotShowMIMETypeError(const WebCore::ResourceResponse& response)
{
- return ResourceError("Error", WebKitErrorCannotShowMIMEType, response.url().string(),
+ return ResourceError("WebKit", WebKitErrorCannotShowMIMEType, response.url().string(),
QCoreApplication::translate("QWebFrame", "Cannot show mimetype", 0, QCoreApplication::UnicodeUTF8));
}
WebCore::ResourceError FrameLoaderClientQt::fileDoesNotExistError(const WebCore::ResourceResponse& response)
{
- return ResourceError("Error", -998 /* ### */, response.url().string(),
+ return ResourceError("QtNetwork", QNetworkReply::ContentNotFoundError, response.url().string(),
QCoreApplication::translate("QWebFrame", "File does not exist", 0, QCoreApplication::UnicodeUTF8));
}
-WebCore::ResourceError FrameLoaderClientQt::pluginWillHandleLoadError(const WebCore::ResourceResponse& response)
+WebCore::ResourceError FrameLoaderClientQt::pluginWillHandleLoadError(const WebCore::ResourceResponse&)
{
notImplemented();
return ResourceError();
@@ -753,8 +771,16 @@ bool FrameLoaderClientQt::shouldFallBack(const WebCore::ResourceError&)
WTF::PassRefPtr<WebCore::DocumentLoader> FrameLoaderClientQt::createDocumentLoader(const WebCore::ResourceRequest& request, const SubstituteData& substituteData)
{
RefPtr<DocumentLoader> loader = DocumentLoader::create(request, substituteData);
- if (substituteData.isValid())
+ if (substituteData.isValid()) {
loader->setDeferMainResourceDataLoad(false);
+ // Use the default timeout interval for JS as the HTML tokenizer delay. This ensures
+ // that long-running JavaScript will still allow setHtml() to be synchronous, while
+ // still giving a reasonable timeout to prevent deadlock.
+ double delay = JSDOMWindowBase::commonJSGlobalData()->timeoutChecker.timeoutInterval() / 1000.0f;
+ m_frame->page()->setCustomHTMLTokenizerTimeDelay(delay);
+ } else {
+ m_frame->page()->setCustomHTMLTokenizerTimeDelay(-1);
+ }
return loader.release();
}
@@ -776,7 +802,7 @@ void FrameLoaderClientQt::download(WebCore::ResourceHandle* handle, const WebCor
#endif
}
-void FrameLoaderClientQt::assignIdentifierToInitialRequest(unsigned long identifier, WebCore::DocumentLoader* loader, const WebCore::ResourceRequest& request)
+void FrameLoaderClientQt::assignIdentifierToInitialRequest(unsigned long identifier, WebCore::DocumentLoader*, const WebCore::ResourceRequest& request)
{
if (dumpResourceLoadCallbacks)
dumpAssignedUrls[identifier] = drtDescriptionSuitableForTestResult(request.url());
@@ -823,7 +849,7 @@ void FrameLoaderClientQt::dispatchDidReceiveContentLength(WebCore::DocumentLoade
{
}
-void FrameLoaderClientQt::dispatchDidFinishLoading(WebCore::DocumentLoader* loader, unsigned long)
+void FrameLoaderClientQt::dispatchDidFinishLoading(WebCore::DocumentLoader*, unsigned long)
{
}
@@ -850,20 +876,58 @@ void FrameLoaderClientQt::dispatchDidLoadResourceByXMLHttpRequest(unsigned long,
notImplemented();
}
-void FrameLoaderClientQt::dispatchDidFailProvisionalLoad(const WebCore::ResourceError&)
+void FrameLoaderClientQt::callErrorPageExtension(const WebCore::ResourceError& error)
+{
+ QWebPage* page = m_webFrame->page();
+ if (page->supportsExtension(QWebPage::ErrorPageExtension)) {
+ QWebPage::ErrorPageExtensionOption option;
+
+ if (error.domain() == "QtNetwork")
+ option.domain = QWebPage::QtNetwork;
+ else if (error.domain() == "HTTP")
+ option.domain = QWebPage::Http;
+ else if (error.domain() == "WebKit")
+ option.domain = QWebPage::WebKit;
+ else
+ return;
+
+ option.url = QUrl(error.failingURL());
+ option.frame = m_webFrame;
+ option.error = error.errorCode();
+ option.errorString = error.localizedDescription();
+
+ QWebPage::ErrorPageExtensionReturn output;
+ if (!page->extension(QWebPage::ErrorPageExtension, &option, &output))
+ return;
+
+ KURL baseUrl(output.baseUrl);
+ KURL failingUrl(option.url);
+
+ WebCore::ResourceRequest request(baseUrl);
+ WTF::RefPtr<WebCore::SharedBuffer> buffer = WebCore::SharedBuffer::create(output.content.constData(), output.content.length());
+ WebCore::SubstituteData substituteData(buffer, output.contentType, output.encoding, failingUrl);
+ m_frame->loader()->load(request, substituteData, false);
+ }
+}
+
+void FrameLoaderClientQt::dispatchDidFailProvisionalLoad(const WebCore::ResourceError& error)
{
if (dumpFrameLoaderCallbacks)
printf("%s - didFailProvisionalLoadWithError\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
- m_loadSucceeded = false;
+ m_loadError = error;
+ if (!error.isNull() && !error.isCancellation())
+ callErrorPageExtension(error);
}
-void FrameLoaderClientQt::dispatchDidFailLoad(const WebCore::ResourceError&)
+void FrameLoaderClientQt::dispatchDidFailLoad(const WebCore::ResourceError& error)
{
if (dumpFrameLoaderCallbacks)
printf("%s - didFailLoadWithError\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
- m_loadSucceeded = false;
+ m_loadError = error;
+ if (!error.isNull() && !error.isCancellation())
+ callErrorPageExtension(error);
}
WebCore::Frame* FrameLoaderClientQt::dispatchCreatePage()
@@ -891,7 +955,7 @@ void FrameLoaderClientQt::dispatchDecidePolicyForNewWindowAction(FramePolicyFunc
#if QT_VERSION < 0x040400
QWebNetworkRequest r(request);
#else
- QNetworkRequest r(request.toNetworkRequest());
+ QNetworkRequest r(request.toNetworkRequest(m_webFrame));
#endif
QWebPage* page = m_webFrame->page();
@@ -916,7 +980,7 @@ void FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction(FramePolicyFun
#if QT_VERSION < 0x040400
QWebNetworkRequest r(request);
#else
- QNetworkRequest r(request.toNetworkRequest());
+ QNetworkRequest r(request.toNetworkRequest(m_webFrame));
#endif
QWebPage*page = m_webFrame->page();
@@ -946,8 +1010,7 @@ void FrameLoaderClientQt::startDownload(const WebCore::ResourceRequest& request)
if (!m_webFrame)
return;
- QWebPage *page = m_webFrame->page();
- emit m_webFrame->page()->downloadRequested(request.toNetworkRequest());
+ emit m_webFrame->page()->downloadRequested(request.toNetworkRequest(m_webFrame));
#endif
}
@@ -976,9 +1039,6 @@ PassRefPtr<Frame> FrameLoaderClientQt::createFrame(const KURL& url, const String
// ### set override encoding if we have one
- FrameLoadType loadType = m_frame->loader()->loadType();
- FrameLoadType childLoadType = FrameLoadTypeRedirectWithLockedBackForwardList;
-
frameData.frame->loader()->loadURLIntoChildFrame(frameData.url, frameData.referrer, frameData.frame.get());
// The frame's onload handler may have removed it from the document.
@@ -1037,7 +1097,11 @@ const unsigned numqStyleSheetProperties = sizeof(qstyleSheetProperties) / sizeof
class QtPluginWidget: public Widget
{
public:
- QtPluginWidget(QWidget* w = 0): Widget(w) {}
+ QtPluginWidget(QWidget* w = 0)
+ : Widget(w)
+ , m_visible(false)
+ {}
+
~QtPluginWidget()
{
if (platformWidget())
@@ -1068,11 +1132,85 @@ public:
QRegion clipRegion = QRegion(clipRect);
platformWidget()->setMask(clipRegion);
+ handleVisibility();
+ }
+
+ virtual void hide()
+ {
+ m_visible = false;
+ Widget::hide();
+ }
+
+ virtual void show()
+ {
+ m_visible = true;
+ if (!platformWidget())
+ return;
+
+ handleVisibility();
+ }
+
+private:
+ void handleVisibility()
+ {
+ if (!m_visible)
+ return;
+
// if setMask is set with an empty QRegion, no clipping will
// be performed, so in that case we hide the platformWidget
- platformWidget()->setVisible(!clipRegion.isEmpty());
+ QRegion mask = platformWidget()->mask();
+ platformWidget()->setVisible(!mask.isEmpty());
+ }
+
+ bool m_visible;
+};
+
+#if QT_VERSION >= 0x040600
+class QtPluginGraphicsWidget: public Widget
+{
+public:
+ static RefPtr<QtPluginGraphicsWidget> create(QGraphicsWidget* w = 0)
+ {
+ return adoptRef(new QtPluginGraphicsWidget(w));
+ }
+
+ ~QtPluginGraphicsWidget()
+ {
+ if (graphicsWidget)
+ graphicsWidget->deleteLater();
+ }
+ virtual void invalidateRect(const IntRect& r)
+ {
+ QGraphicsScene* scene = graphicsWidget ? graphicsWidget->scene() : 0;
+ if (scene)
+ scene->update(QRect(r));
+ }
+ virtual void frameRectsChanged()
+ {
+ if (!graphicsWidget)
+ return;
+
+ IntRect windowRect = convertToContainingWindow(IntRect(0, 0, frameRect().width(), frameRect().height()));
+ graphicsWidget->setGeometry(QRect(windowRect));
+
+ // FIXME: clipping of graphics widgets
+ }
+ virtual void show()
+ {
+ if (graphicsWidget)
+ graphicsWidget->show();
}
+ virtual void hide()
+ {
+ if (graphicsWidget)
+ graphicsWidget->hide();
+ }
+private:
+ QtPluginGraphicsWidget(QGraphicsWidget* w = 0): Widget(0), graphicsWidget(w) {}
+
+ QGraphicsWidget* graphicsWidget;
};
+#endif
PassRefPtr<Widget> FrameLoaderClientQt::createPlugin(const IntSize& pluginSize, HTMLPlugInElement* element, const KURL& url, const Vector<String>& paramNames,
const Vector<String>& paramValues, const String& mimeType, bool loadManually)
@@ -1087,12 +1225,12 @@ PassRefPtr<Widget> FrameLoaderClientQt::createPlugin(const IntSize& pluginSize,
QStringList values;
QString classid(element->getAttribute("classid"));
- for (int i = 0; i < paramNames.size(); ++i) {
+ for (unsigned i = 0; i < paramNames.size(); ++i) {
params.append(paramNames[i]);
if (paramNames[i] == "classid")
classid = paramValues[i];
}
- for (int i = 0; i < paramValues.size(); ++i)
+ for (unsigned i = 0; i < paramValues.size(); ++i)
values.append(paramValues[i]);
QString urlStr(url.string());
@@ -1110,7 +1248,7 @@ PassRefPtr<Widget> FrameLoaderClientQt::createPlugin(const IntSize& pluginSize,
if (!styleSheet.isEmpty())
styleSheet += QLatin1Char(';');
- for (int i = 0; i < numqStyleSheetProperties; ++i) {
+ for (unsigned i = 0; i < numqStyleSheetProperties; ++i) {
CSSPropertyID property = qstyleSheetProperties[i];
styleSheet += QString::fromLatin1(::getPropertyName(property));
@@ -1135,15 +1273,33 @@ PassRefPtr<Widget> FrameLoaderClientQt::createPlugin(const IntSize& pluginSize,
if (object) {
QWidget* widget = qobject_cast<QWidget*>(object);
if (widget) {
- QWidget* view = m_webFrame->page()->view();
- if (view)
- widget->setParent(view);
+ QWidget* parentWidget = 0;
+ if (m_webFrame->page()->d->client)
+ parentWidget = qobject_cast<QWidget*>(m_webFrame->page()->d->client->pluginParent());
+ if (parentWidget) // don't reparent to nothing (i.e. keep whatever parent QWebPage::createPlugin() chose.
+ widget->setParent(parentWidget);
+ widget->hide();
RefPtr<QtPluginWidget> w = adoptRef(new QtPluginWidget());
w->setPlatformWidget(widget);
// Make sure it's invisible until properly placed into the layout
w->setFrameRect(IntRect(0, 0, 0, 0));
return w;
}
+#if QT_VERSION >= 0x040600
+ QGraphicsWidget* graphicsWidget = qobject_cast<QGraphicsWidget*>(object);
+ if (graphicsWidget) {
+ QGraphicsObject* parentWidget = 0;
+ if (m_webFrame->page()->d->client)
+ parentWidget = qobject_cast<QGraphicsObject*>(m_webFrame->page()->d->client->pluginParent());
+ graphicsWidget->hide();
+ if (parentWidget) // don't reparent to nothing (i.e. keep whatever parent QWebPage::createPlugin() chose.
+ graphicsWidget->setParentItem(parentWidget);
+ RefPtr<QtPluginGraphicsWidget> w = QtPluginGraphicsWidget::create(graphicsWidget);
+ // Make sure it's invisible until properly placed into the layout
+ w->setFrameRect(IntRect(0, 0, 0, 0));
+ return w;
+ }
+#endif
// FIXME: make things work for widgetless plugins as well
delete object;
} else { // NPAPI Plugins
@@ -1162,8 +1318,8 @@ void FrameLoaderClientQt::redirectDataToPlugin(Widget* pluginWidget)
m_hasSentResponseToPlugin = false;
}
-PassRefPtr<Widget> FrameLoaderClientQt::createJavaAppletWidget(const IntSize&, HTMLAppletElement*, const KURL& baseURL,
- const Vector<String>& paramNames, const Vector<String>& paramValues)
+PassRefPtr<Widget> FrameLoaderClientQt::createJavaAppletWidget(const IntSize&, HTMLAppletElement*, const KURL&,
+ const Vector<String>&, const Vector<String>&)
{
notImplemented();
return 0;
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
index 754d8bc7c..66c425286 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
@@ -59,6 +59,7 @@ namespace WebCore {
friend class ::QWebFrame;
void callPolicyFunction(FramePolicyFunction function, PolicyAction action);
+ void callErrorPageExtension(const ResourceError&);
signals:
void loadStarted();
void loadProgress(int d);
@@ -148,6 +149,9 @@ namespace WebCore {
virtual void updateGlobalHistoryRedirectLinks();
virtual bool shouldGoToHistoryItem(HistoryItem*) const;
+ virtual void didDisplayInsecureContent();
+ virtual void didRunInsecureContent(SecurityOrigin*);
+
virtual ResourceError cancelledError(const ResourceRequest&);
virtual ResourceError blockedError(const ResourceRequest&);
virtual ResourceError cannotShowURLError(const ResourceRequest&);
@@ -211,7 +215,7 @@ namespace WebCore {
WebCore::PluginView* m_pluginView;
bool m_hasSentResponseToPlugin;
- bool m_loadSucceeded;
+ ResourceError m_loadError;
};
}
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
index fe4d43ad6..7a1bfd579 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
@@ -31,10 +31,13 @@
#include "config.h"
#include "InspectorClientQt.h"
+#include "qwebinspector.h"
+#include "qwebinspector_p.h"
#include "qwebpage.h"
#include "qwebpage_p.h"
#include "qwebview.h"
+#include <QtCore/QSettings>
#include <QtCore/QCoreApplication>
#include "InspectorController.h"
@@ -44,49 +47,32 @@
namespace WebCore {
-class InspectorClientWebPage : public QWebPage
-{
- Q_OBJECT
- friend class InspectorClientQt;
-public:
- QWebPage* createWindow(QWebPage::WebWindowType)
- {
- QWidget *w = new QWebView(0);
- QWebPage *page = new QWebPage(w);
- page->setView(w);
- connect(page, SIGNAL(destroyed()), w, SLOT(deleteLater()));
- return page;
- }
-
-Q_SIGNALS:
- void attachRequested();
- void detachRequested();
-};
+static const QLatin1String settingStoragePrefix("Qt/QtWebKit/QWebInspector/");
+static const QLatin1String settingStorageTypeSuffix(".type");
+static InspectorController::Setting variantToSetting(const QVariant& qvariant);
+static QVariant settingToVariant(const InspectorController::Setting& icSetting);
-class InspectorClientView : public QWebView {
+class InspectorClientWebPage : public QWebPage {
+ Q_OBJECT
+ friend class InspectorClientQt;
public:
- InspectorClientView(InspectorController* controller)
- : QWebView(0)
- , m_controller(controller)
+ InspectorClientWebPage(QObject* parent = 0)
+ : QWebPage(parent)
{
- setPage(new InspectorClientWebPage);
- connect(page(), SIGNAL(destroyed()), SLOT(deleteLater()));
+ settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, false);
}
-protected:
-
- void closeEvent(QCloseEvent* ev)
+ QWebPage* createWindow(QWebPage::WebWindowType)
{
- QWidget::closeEvent(ev);
- m_controller->setWindowVisible(false);
+ QWebView* view = new QWebView;
+ QWebPage* page = new QWebPage;
+ view->setPage(page);
+ view->setAttribute(Qt::WA_DeleteOnClose);
+ return page;
}
-
-private:
- InspectorController* m_controller;
};
-
InspectorClientQt::InspectorClientQt(QWebPage* page)
: m_inspectedWebPage(page)
{}
@@ -98,14 +84,16 @@ void InspectorClientQt::inspectorDestroyed()
Page* InspectorClientQt::createPage()
{
- if (m_webPage)
- return m_webPage->d->page;
+ QWebView* inspectorView = new QWebView;
+ InspectorClientWebPage* inspectorPage = new InspectorClientWebPage(inspectorView);
+ inspectorView->setPage(inspectorPage);
+ m_inspectorView.set(inspectorView);
- InspectorClientView* view = new InspectorClientView(m_inspectedWebPage->d->page->inspectorController());
- m_webPage.set(qobject_cast<InspectorClientWebPage*>(view->page()));
- m_webPage->mainFrame()->load(QString::fromLatin1("qrc:/webkit/inspector/inspector.html"));
- m_webPage->view()->setMinimumSize(400,300);
- return m_webPage->d->page;
+ inspectorPage->mainFrame()->load(QString::fromLatin1("qrc:/webkit/inspector/inspector.html"));
+ m_inspectedWebPage->d->inspectorFrontend = inspectorView;
+ m_inspectedWebPage->d->getOrCreateInspector()->d->setFrontend(inspectorView);
+
+ return m_inspectorView->page()->d->page;
}
String InspectorClientQt::localizedStringsURL()
@@ -122,52 +110,37 @@ String InspectorClientQt::hiddenPanels()
void InspectorClientQt::showWindow()
{
- if (!m_webPage)
- return;
-
updateWindowTitle();
- m_webPage->view()->show();
- m_inspectedWebPage->d->page->inspectorController()->setWindowVisible(true);
-}
-void InspectorClientQt::closeWindow()
-{
- if (!m_webPage)
- return;
-
- m_webPage->view()->hide();
- m_inspectedWebPage->d->page->inspectorController()->setWindowVisible(false);
+ m_inspectedWebPage->d->inspectorController()->setWindowVisible(true, true);
+ // We don't allow the inspector to ask for widget visibility itself because showWindow is
+ // not always called when we want.
+ // Inspecting an element or calling QWebInspector::show() should already have made the
+ // widget visible.
}
-bool InspectorClientQt::windowVisible()
+void InspectorClientQt::closeWindow()
{
- if (!m_webPage)
- return false;
- return m_webPage->view()->isVisible();
+ if (m_inspectedWebPage->d->inspector)
+ m_inspectedWebPage->d->inspector->close();
}
void InspectorClientQt::attachWindow()
{
- if (!m_webPage)
- return;
-
- emit m_webPage->attachRequested();
+ notImplemented();
}
void InspectorClientQt::detachWindow()
{
- if (!m_webPage)
- return;
-
- emit m_webPage->detachRequested();
+ notImplemented();
}
-void InspectorClientQt::setAttachedWindowHeight(unsigned height)
+void InspectorClientQt::setAttachedWindowHeight(unsigned)
{
notImplemented();
}
-void InspectorClientQt::highlight(Node* node)
+void InspectorClientQt::highlight(Node*)
{
notImplemented();
}
@@ -183,30 +156,118 @@ void InspectorClientQt::inspectedURLChanged(const String& newURL)
updateWindowTitle();
}
-void InspectorClientQt::updateWindowTitle()
+void InspectorClientQt::inspectorWindowObjectCleared()
{
- if (!m_webPage)
- return;
+ notImplemented();
+}
- QString caption = QCoreApplication::translate("QWebPage", "Web Inspector - %2");
- m_webPage->view()->setWindowTitle(caption.arg(m_inspectedURL));
+void InspectorClientQt::updateWindowTitle()
+{
+ if (m_inspectedWebPage->d->inspector) {
+ QString caption = QCoreApplication::translate("QWebPage", "Web Inspector - %2").arg(m_inspectedURL);
+ m_inspectedWebPage->d->inspector->setWindowTitle(caption);
+ }
}
void InspectorClientQt::populateSetting(const String& key, InspectorController::Setting& setting)
{
- notImplemented();
+ QSettings qsettings;
+ if (qsettings.status() == QSettings::AccessError) {
+ // QCoreApplication::setOrganizationName and QCoreApplication::setApplicationName haven't been called
+ qWarning("QWebInspector: QSettings couldn't read configuration setting [%s].",
+ qPrintable(static_cast<QString>(key)));
+ return;
+ }
+
+ QString settingKey(settingStoragePrefix + key);
+ QString storedValueType = qsettings.value(settingKey + settingStorageTypeSuffix).toString();
+ QVariant storedValue = qsettings.value(settingKey);
+ storedValue.convert(QVariant::nameToType(storedValueType.toAscii().data()));
+ setting = variantToSetting(storedValue);
}
void InspectorClientQt::storeSetting(const String& key, const InspectorController::Setting& setting)
{
- notImplemented();
+ QSettings qsettings;
+ if (qsettings.status() == QSettings::AccessError) {
+ qWarning("QWebInspector: QSettings couldn't persist configuration setting [%s].",
+ qPrintable(static_cast<QString>(key)));
+ return;
+ }
+
+ QVariant valueToStore = settingToVariant(setting);
+ QString settingKey(settingStoragePrefix + key);
+ qsettings.setValue(settingKey, valueToStore);
+ qsettings.setValue(settingKey + settingStorageTypeSuffix, QVariant::typeToName(valueToStore.type()));
}
-void InspectorClientQt::removeSetting(const String& key)
+void InspectorClientQt::removeSetting(const String&)
{
notImplemented();
}
+static InspectorController::Setting variantToSetting(const QVariant& qvariant)
+{
+ InspectorController::Setting retVal;
+
+ switch (qvariant.type()) {
+ case QVariant::Bool:
+ retVal.set(qvariant.toBool());
+ break;
+ case QVariant::Double:
+ retVal.set(qvariant.toDouble());
+ break;
+ case QVariant::Int:
+ retVal.set((long)qvariant.toInt());
+ break;
+ case QVariant::String:
+ retVal.set(qvariant.toString());
+ break;
+ case QVariant::StringList: {
+ QStringList qsList = qvariant.toStringList();
+ int listCount = qsList.count();
+ Vector<String> vector(listCount);
+ for (int i = 0; i < listCount; ++i)
+ vector[i] = qsList[i];
+ retVal.set(vector);
+ break;
+ }
+ }
+
+ return retVal;
+}
+
+static QVariant settingToVariant(const InspectorController::Setting& icSetting)
+{
+ QVariant retVal;
+
+ switch (icSetting.type()) {
+ case InspectorController::Setting::StringType:
+ retVal.setValue(static_cast<QString>(icSetting.string()));
+ break;
+ case InspectorController::Setting::StringVectorType: {
+ const Vector<String>& vector = icSetting.stringVector();
+ Vector<String>::const_iterator iter;
+ QStringList qsList;
+ for (iter = vector.begin(); iter != vector.end(); ++iter)
+ qsList << *iter;
+ retVal.setValue(qsList);
+ break;
+ }
+ case InspectorController::Setting::DoubleType:
+ retVal.setValue(icSetting.doubleValue());
+ break;
+ case InspectorController::Setting::IntegerType:
+ retVal.setValue((int)icSetting.integerValue());
+ break;
+ case InspectorController::Setting::BooleanType:
+ retVal.setValue(icSetting.booleanValue());
+ break;
+ }
+
+ return retVal;
+}
+
}
#include "InspectorClientQt.moc"
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.h b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.h
index 60ed77a6b..ccf8b69b4 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.h
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.h
@@ -35,12 +35,12 @@
#include <QtCore/QString>
class QWebPage;
+class QWebView;
namespace WebCore {
class Node;
class Page;
class String;
- class InspectorClientWebPage;
class InspectorClientQt : public InspectorClient {
public:
@@ -56,7 +56,6 @@ namespace WebCore {
virtual void showWindow();
virtual void closeWindow();
- virtual bool windowVisible();
virtual void attachWindow();
virtual void detachWindow();
@@ -71,10 +70,12 @@ namespace WebCore {
virtual void storeSetting(const String& key, const InspectorController::Setting&);
virtual void removeSetting(const String& key);
+ virtual void inspectorWindowObjectCleared();
+
private:
void updateWindowTitle();
QWebPage* m_inspectedWebPage;
- OwnPtr<InspectorClientWebPage> m_webPage;
+ OwnPtr<QWebView> m_inspectorView;
QString m_inspectedURL;
};
}
diff --git a/src/3rdparty/webkit/WebKit/qt/docs/docs.pri b/src/3rdparty/webkit/WebKit/qt/docs/docs.pri
index 4a8c165a3..804817b12 100644
--- a/src/3rdparty/webkit/WebKit/qt/docs/docs.pri
+++ b/src/3rdparty/webkit/WebKit/qt/docs/docs.pri
@@ -1,9 +1,9 @@
include(../../../WebKit.pri)
unix {
- QDOC = SRCDIR=$$PWD/../../.. OUTPUT_DIR=$$OUTPUT_DIR $$(QTDIR)/tools/qdoc3/qdoc3
+ QDOC = SRCDIR=$$PWD/../../.. OUTPUT_DIR=$$OUTPUT_DIR $$(QTDIR)/bin/qdoc3
} else {
- QDOC = $$(QTDIR)\tools\qdoc3\release\qdoc3.exe
+ QDOC = $$(QTDIR)\bin\qdoc3.exe
}
unix {
diff --git a/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc b/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc
index f3681ee62..411762abe 100644
--- a/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc
+++ b/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc
@@ -1,18 +1,67 @@
/*!
\module QtWebKit
\title QtWebKit Module
- \contentspage Qt's Modules
+ \contentspage All Qt Modules
\previouspage QtSvg
\nextpage QtXml
- \ingroup architecture
\ingroup modules
- \brief An introduction to the QtWebKit module.
+ \brief The QtWebKit module provides a web browser engine as well as
+ classes to render and interact with web content.
- \keyword Browser
- \keyword Web Browser
+ To include the definitions of the module's classes, use the
+ following directive:
+
+ \snippet webkitsnippets/qtwebkit_build_snippet.qdoc 1
+
+ To link against the module, add this line to your \l qmake \c
+ .pro file:
+
+ \snippet webkitsnippets/qtwebkit_build_snippet.qdoc 0
+
+ \section1 License Information
+
+ This is a snapshot of the Qt port of WebKit. The exact version information
+ can be found in the \c{src/3rdparty/webkit/VERSION} file supplied with Qt.
+
+ Qt Commercial Edition licensees that wish to distribute applications that
+ use the QtWebKit module need to be aware of their obligations under the
+ GNU Library General Public License (LGPL).
+
+ Developers using the Open Source Edition can choose to redistribute
+ the module under the appropriate version of the GNU LGPL.
+
+ \legalese
+ WebKit is licensed under the GNU Library General Public License.
+ Individual contributor names and copyright dates can be found
+ inline in the code.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+ \endlegalese
+*/
+
+/*!
+ \page webintegration.html
+ \title Integrating Web Content with QtWebKit
\since 4.4
+ \ingroup frameworks-technologies
+
+ \keyword Browser
+ \keyword Web Browser
+
QtWebKit provides a Web browser engine that makes it easy to embed content
from the World Wide Web into your Qt application. At the same time Web
content can be enhanced with native controls.
@@ -55,20 +104,6 @@
\tableofcontents
- \section1 Configuring the Build Process
-
- Applications using QtWebKit's classes need to be configured to be built
- against the QtWebKit module. The following declaration in a \c qmake
- project file ensures that an application is compiled and linked
- appropriately:
-
- \snippet webkitsnippets/qtwebkit_build_snippet.qdoc 0
-
- To include the definitions of the module's classes, use the following
- directive:
-
- \snippet webkitsnippets/qtwebkit_build_snippet.qdoc 1
-
\section1 Architecture
The easiest way to render content is through the QWebView class. As a
@@ -101,15 +136,18 @@
\section1 Netscape Plugin Support
+ \note Netscape plugin support is only available on desktop platforms.
+
Since WebKit supports the Netscape Plugin API, Qt applications can display
- Web pages that embed common plugins, as long as the user has the appropriate
+ Web pages that embed common plugins on platforms for which those plugins
+ are available. To enable plugin support, the user must have the appropriate
binary files for those plugins installed and the \l{QWebSettings::PluginsEnabled}
- attribute is enabled for the application.
+ attribute must be enabled for the application.
The following locations are searched for plugins:
\table
- \header \o Linux/Unix \o Windows
+ \header \o Linux/Unix (X11) \o Windows
\row \o{1,3}
\list
\o \c{.mozilla/plugins} in the user's home directory
@@ -158,40 +196,4 @@
\o The system \c{/Library/Internet Plug-Ins} directory
\endlist
\endtable
-
- \section1 License Information
-
- This is a snapshot of the Qt port of WebKit. The exact version information
- can be found in the \c{src/3rdparty/webkit/VERSION} file supplied with Qt.
-
- Qt Commercial Edition licensees that wish to distribute applications that
- use the QtWebKit module need to be aware of their obligations under the
- GNU Lesser General Public License (LGPL).
-
- Developers using the Open Source Edition can choose to redistribute
- the module under the appropriate version of the GNU LGPL; version 2.1
- for applications and libraries licensed under the GNU GPL version 2,
- or version 3 for applications and libraries licensed under the GNU
- GPL version 2.
-
- \legalese
- WebKit is licensed under the GNU Library General Public License.
- Individual contributor names and copyright dates can be found
- inline in the code.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- along with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
- \endlegalese
*/
diff --git a/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/qtwebkit_qwebinspector_snippet.cpp b/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/qtwebkit_qwebinspector_snippet.cpp
new file mode 100644
index 000000000..a6b662096
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/qtwebkit_qwebinspector_snippet.cpp
@@ -0,0 +1,17 @@
+
+void wrapInFunction()
+{
+
+//! [0]
+ // ...
+ QWebPage *page = new QWebPage;
+ // ...
+
+ QWebInspector *inspector = new QWebInspector;
+ inspector->setPage(page);
+
+ connect(page, SIGNAL(webInspectorTriggered(QWebElement)), inspector, SLOT(show()));
+//! [0]
+
+}
+
diff --git a/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/simple/main.cpp b/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/simple/main.cpp
index 82f5b6ce4..408630eb1 100644
--- a/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/simple/main.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/simple/main.cpp
@@ -27,7 +27,7 @@ int main(int argc, char *argv[])
QWidget *parent = 0;
//! [Using QWebView]
QWebView *view = new QWebView(parent);
- view->load(QUrl("http://qtsoftware.com/"));
+ view->load(QUrl("http://qt.nokia.com/"));
view->show();
//! [Using QWebView]
return app.exec();
diff --git a/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/webelement/main.cpp b/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/webelement/main.cpp
index d437a6f7c..2707ffbc3 100644
--- a/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/webelement/main.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/webelement/main.cpp
@@ -22,7 +22,6 @@
#include <qwebview.h>
#include <qwebframe.h>
#include <qwebelement.h>
-#include <qdebug.h>
static QWebFrame *frame;
@@ -53,9 +52,10 @@ static void findAll()
</p>
*/
+//! [FindAll intro]
QList<QWebElement> allSpans = document.findAll("span");
QList<QWebElement> introSpans = document.findAll("p.intro span");
-//! [FindAll]
+//! [FindAll intro] //! [FindAll]
}
int main(int argc, char *argv[])
diff --git a/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/webelement/webelement.pro b/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/webelement/webelement.pro
index f9b403b25..8ca4b59da 100644
--- a/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/webelement/webelement.pro
+++ b/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/webelement/webelement.pro
@@ -1,5 +1,8 @@
TEMPLATE = app
CONFIG -= app_bundle
+CONFIG(QTDIR_build) {
+ QT += webkit
+}
SOURCES = main.cpp
include(../../../../../WebKit.pri)
QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
diff --git a/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/webpage/main.cpp b/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/webpage/main.cpp
index b91bc301a..393b16a4d 100644
--- a/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/webpage/main.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/webpage/main.cpp
@@ -45,7 +45,7 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
- Thumbnailer thumbnail(QUrl("http://qtsoftware.com"));
+ Thumbnailer thumbnail(QUrl("http://qt.nokia.com"));
QObject::connect(&thumbnail, SIGNAL(finished()),
&app, SLOT(quit()));
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/benchmarks/loading/tst_loading.pro b/src/3rdparty/webkit/WebKit/qt/tests/benchmarks/loading/tst_loading.pro
index af0387eb7..bc5e75f20 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/benchmarks/loading/tst_loading.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/benchmarks/loading/tst_loading.pro
@@ -4,3 +4,8 @@ include(../../../../../WebKit.pri)
SOURCES += tst_loading.cpp
QT += testlib network
QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
+
+symbian {
+ TARGET.UID3 = 0xA000E541
+ TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices
+}
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/benchmarks/painting/tst_painting.pro b/src/3rdparty/webkit/WebKit/qt/tests/benchmarks/painting/tst_painting.pro
index 496210e0d..48c707227 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/benchmarks/painting/tst_painting.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/benchmarks/painting/tst_painting.pro
@@ -4,3 +4,8 @@ include(../../../../../WebKit.pri)
SOURCES += tst_painting.cpp
QT += testlib network
QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
+
+symbian {
+ TARGET.UID3 = 0xA000E542
+ TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices
+}
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/qgraphicswebview.pro b/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/qgraphicswebview.pro
new file mode 100644
index 000000000..57b44375f
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/qgraphicswebview.pro
@@ -0,0 +1,10 @@
+TEMPLATE = app
+TARGET = tst_qgraphicswebview
+include(../../../../WebKit.pri)
+SOURCES += tst_qgraphicswebview.cpp
+QT += testlib network
+QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
+
+symbian {
+ TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices
+}
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp
new file mode 100644
index 000000000..a52e167c2
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp
@@ -0,0 +1,130 @@
+/*
+ Copyright (C) 2009 Jakub Wieczorek <faw217@gmail.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <QtTest/QtTest>
+
+#include <QGraphicsView>
+#include <qgraphicswebview.h>
+#include <qwebpage.h>
+#include <qwebframe.h>
+
+/**
+ * Starts an event loop that runs until the given signal is received.
+ * Optionally the event loop
+ * can return earlier on a timeout.
+ *
+ * \return \p true if the requested signal was received
+ * \p false on timeout
+ */
+static bool waitForSignal(QObject* obj, const char* signal, int timeout = 10000)
+{
+ QEventLoop loop;
+ QObject::connect(obj, signal, &loop, SLOT(quit()));
+ QTimer timer;
+ QSignalSpy timeoutSpy(&timer, SIGNAL(timeout()));
+ if (timeout > 0) {
+ QObject::connect(&timer, SIGNAL(timeout()), &loop, SLOT(quit()));
+ timer.setSingleShot(true);
+ timer.start(timeout);
+ }
+ loop.exec();
+ return timeoutSpy.isEmpty();
+}
+
+class tst_QGraphicsWebView : public QObject
+{
+ Q_OBJECT
+
+private slots:
+ void qgraphicswebview();
+ void crashOnViewlessWebPages();
+};
+
+void tst_QGraphicsWebView::qgraphicswebview()
+{
+ QGraphicsWebView item;
+ item.url();
+ item.title();
+ item.icon();
+ item.zoomFactor();
+ item.history();
+ item.settings();
+ item.page();
+ item.setPage(0);
+ item.page();
+ item.setUrl(QUrl());
+ item.setZoomFactor(0);
+ item.load(QUrl());
+ item.setHtml(QString());
+ item.setContent(QByteArray());
+ item.isModified();
+}
+
+class WebPage : public QWebPage
+{
+ Q_OBJECT
+
+public:
+ WebPage(QObject* parent = 0): QWebPage(parent)
+ {
+ }
+
+ QGraphicsWebView* webView;
+
+private slots:
+ // Force a webview deletion during the load.
+ // It should not cause WebPage to crash due to
+ // it accessing invalid pageClient pointer.
+ void aborting()
+ {
+ delete webView;
+ }
+};
+
+void tst_QGraphicsWebView::crashOnViewlessWebPages()
+{
+ QGraphicsScene scene;
+ QGraphicsView view(&scene);
+
+ QGraphicsWebView* webView = new QGraphicsWebView;
+ WebPage* page = new WebPage;
+ webView->setPage(page);
+ page->webView = webView;
+ connect(page->mainFrame(), SIGNAL(initialLayoutCompleted()), page, SLOT(aborting()));
+
+ scene.addItem(webView);
+
+ view.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
+ view.resize(600, 480);
+ webView->resize(view.geometry().size());
+ QTest::qWait(200);
+ view.show();
+
+ page->mainFrame()->setHtml(QString("data:text/html,"
+ "<frameset cols=\"25%,75%\">"
+ "<frame src=\"data:text/html,foo \">"
+ "<frame src=\"data:text/html,bar\">"
+ "</frameset>"));
+
+ QVERIFY(::waitForSignal(page, SIGNAL(loadFinished(bool))));
+}
+
+QTEST_MAIN(tst_QGraphicsWebView)
+
+#include "tst_qgraphicswebview.moc"
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/image.png b/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/image.png
new file mode 100644
index 000000000..8d703640c
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/image.png
Binary files differ
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/qwebelement.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/qwebelement.pro
index dd0b88af4..c45a9ac5a 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/qwebelement.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/qwebelement.pro
@@ -5,3 +5,8 @@ SOURCES += tst_qwebelement.cpp
RESOURCES += qwebelement.qrc
QT += testlib network
QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
+
+symbian {
+ TARGET.UID3 = 0xA000E53A
+ TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices
+}
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/qwebelement.qrc b/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/qwebelement.qrc
index ed014407a..28b9d7b3a 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/qwebelement.qrc
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/qwebelement.qrc
@@ -2,5 +2,6 @@
<qresource prefix="/">
<file>style.css</file>
<file>style2.css</file>
+<file>image.png</file>
</qresource>
</RCC>
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp
index 0819a3ad8..e9dae18cd 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp
@@ -68,18 +68,20 @@ private slots:
void simpleCollection();
void attributes();
void attributesNS();
+ void listAttributes();
void classes();
void namespaceURI();
+ void iteration();
+ void nonConstIterator();
+ void constIterator();
void foreachManipulation();
- void evaluateScript();
- void callFunction();
- void callFunctionSubmitForm();
- void functionNames();
+ void emptyCollection();
+ void appendCollection();
+ void evaluateJavaScript();
void documentElement();
void frame();
void style();
void computedStyle();
- void properties();
void appendAndPrepend();
void insertBeforeAndAfter();
void remove();
@@ -90,6 +92,8 @@ private slots:
void nullSelect();
void firstChildNextSibling();
void lastChildPreviousSibling();
+ void hasSetFocus();
+ void render();
private:
QWebView* m_view;
@@ -136,7 +140,7 @@ void tst_QWebElement::simpleCollection()
m_mainFrame->setHtml(html);
QWebElement body = m_mainFrame->documentElement();
- QList<QWebElement> list = body.findAll("p");
+ QWebElementCollection list = body.findAll("p");
QCOMPARE(list.count(), 2);
QCOMPARE(list.at(0).toPlainText(), QString("first para"));
QCOMPARE(list.at(1).toPlainText(), QString("second para"));
@@ -184,6 +188,29 @@ void tst_QWebElement::attributesNS()
QCOMPARE(svg.attributeNS("http://www.w3.org/2000/svg", "foobar", "defaultblah"), QString("true"));
}
+void tst_QWebElement::listAttributes()
+{
+ QString content = "<html xmlns=\"http://www.w3.org/1999/xhtml\" "
+ "xmlns:svg=\"http://www.w3.org/2000/svg\">"
+ "<body><svg:svg foo=\"\" svg:bar=\"\">"
+ "</svg:svg></body></html>";
+
+ m_mainFrame->setContent(content.toUtf8(), "application/xhtml+xml");
+
+ QWebElement svg = m_mainFrame->findFirstElement("svg");
+ QVERIFY(!svg.isNull());
+
+ QVERIFY(svg.attributeNames().contains("foo"));
+ QVERIFY(svg.attributeNames("http://www.w3.org/2000/svg").contains("bar"));
+
+ svg.setAttributeNS("http://www.w3.org/2000/svg", "svg:foobar", "true");
+ QVERIFY(svg.attributeNames().contains("foo"));
+ QStringList attributes = svg.attributeNames("http://www.w3.org/2000/svg");
+ QCOMPARE(attributes.size(), 2);
+ QVERIFY(attributes.contains("bar"));
+ QVERIFY(attributes.contains("foobar"));
+}
+
void tst_QWebElement::classes()
{
m_mainFrame->setHtml("<body><p class=\"a b c d a c\">Test");
@@ -269,6 +296,72 @@ void tst_QWebElement::namespaceURI()
}
+void tst_QWebElement::iteration()
+{
+ QString html = "<body><p>first para</p><p>second para</p></body>";
+ m_mainFrame->setHtml(html);
+ QWebElement body = m_mainFrame->documentElement();
+
+ QWebElementCollection paras = body.findAll("p");
+ QList<QWebElement> referenceList = paras.toList();
+
+ QList<QWebElement> foreachList;
+ foreach(QWebElement p, paras) {
+ foreachList.append(p);
+ }
+ QVERIFY(foreachList.count() == 2);
+ QCOMPARE(foreachList.count(), referenceList.count());
+ QCOMPARE(foreachList.at(0), referenceList.at(0));
+ QCOMPARE(foreachList.at(1), referenceList.at(1));
+
+ QList<QWebElement> forLoopList;
+ for (int i = 0; i < paras.count(); ++i) {
+ forLoopList.append(paras.at(i));
+ }
+ QVERIFY(foreachList.count() == 2);
+ QCOMPARE(foreachList.count(), referenceList.count());
+ QCOMPARE(foreachList.at(0), referenceList.at(0));
+ QCOMPARE(foreachList.at(1), referenceList.at(1));
+
+ for (int i = 0; i < paras.count(); ++i) {
+ QCOMPARE(paras.at(i), paras[i]);
+ }
+
+ QCOMPARE(paras.at(0), paras.first());
+ QCOMPARE(paras.at(1), paras.last());
+}
+
+void tst_QWebElement::nonConstIterator()
+{
+ QString html = "<body><p>first para</p><p>second para</p></body>";
+ m_mainFrame->setHtml(html);
+ QWebElement body = m_mainFrame->documentElement();
+ QWebElementCollection paras = body.findAll("p");
+
+ QWebElementCollection::iterator it = paras.begin();
+ QCOMPARE(*it, paras.at(0));
+ ++it;
+ (*it).encloseWith("<div>");
+ QCOMPARE(*it, paras.at(1));
+ ++it;
+ QCOMPARE(it, paras.end());
+}
+
+void tst_QWebElement::constIterator()
+{
+ QString html = "<body><p>first para</p><p>second para</p></body>";
+ m_mainFrame->setHtml(html);
+ QWebElement body = m_mainFrame->documentElement();
+ const QWebElementCollection paras = body.findAll("p");
+
+ QWebElementCollection::const_iterator it = paras.begin();
+ QCOMPARE(*it, paras.at(0));
+ ++it;
+ QCOMPARE(*it, paras.at(1));
+ ++it;
+ QCOMPARE(it, paras.end());
+}
+
void tst_QWebElement::foreachManipulation()
{
QString html = "<body><p>first para</p><p>second para</p></body>";
@@ -282,69 +375,68 @@ void tst_QWebElement::foreachManipulation()
QCOMPARE(body.findAll("div").count(), 4);
}
-void tst_QWebElement::evaluateScript()
+void tst_QWebElement::emptyCollection()
+{
+ QWebElementCollection emptyCollection;
+ QCOMPARE(emptyCollection.count(), 0);
+}
+
+void tst_QWebElement::appendCollection()
+{
+ QString html = "<body><span class='a'>aaa</span><p>first para</p><div>foo</div>"
+ "<span class='b'>bbb</span><p>second para</p><div>bar</div></body>";
+ m_mainFrame->setHtml(html);
+ QWebElement body = m_mainFrame->documentElement();
+
+ QWebElementCollection collection = body.findAll("p");
+ QCOMPARE(collection.count(), 2);
+
+ collection.append(body.findAll("div"));
+ QCOMPARE(collection.count(), 4);
+
+ collection += body.findAll("span.a");
+ QCOMPARE(collection.count(), 5);
+
+ QWebElementCollection all = collection + body.findAll("span.b");
+ QCOMPARE(all.count(), 6);
+ QCOMPARE(collection.count(), 5);
+
+ all += collection;
+ QCOMPARE(all.count(), 11);
+
+ QCOMPARE(collection.count(), 5);
+ QWebElementCollection test;
+ test.append(collection);
+ QCOMPARE(test.count(), 5);
+ test.append(QWebElementCollection());
+ QCOMPARE(test.count(), 5);
+}
+
+void tst_QWebElement::evaluateJavaScript()
{
QVariant result;
m_mainFrame->setHtml("<body><p>test");
QWebElement para = m_mainFrame->findFirstElement("p");
- result = para.evaluateScript("this.tagName");
+ result = para.evaluateJavaScript("this.tagName");
QVERIFY(result.isValid());
QVERIFY(result.type() == QVariant::String);
QCOMPARE(result.toString(), QLatin1String("P"));
- QVERIFY(para.functions().contains("hasAttributes"));
- result = para.evaluateScript("this.hasAttributes()");
+ result = para.evaluateJavaScript("this.hasAttributes()");
QVERIFY(result.isValid());
QVERIFY(result.type() == QVariant::Bool);
QVERIFY(!result.toBool());
- para.evaluateScript("this.setAttribute('align', 'left');");
+ para.evaluateJavaScript("this.setAttribute('align', 'left');");
QCOMPARE(para.attribute("align"), QLatin1String("left"));
- result = para.evaluateScript("this.hasAttributes()");
+ result = para.evaluateJavaScript("this.hasAttributes()");
QVERIFY(result.isValid());
QVERIFY(result.type() == QVariant::Bool);
QVERIFY(result.toBool());
}
-void tst_QWebElement::callFunction()
-{
- m_mainFrame->setHtml("<body><p>test");
- QWebElement body = m_mainFrame->documentElement();
- QVERIFY(body.functions().contains("hasChildNodes"));
- QVariant result = body.callFunction("hasChildNodes");
- QVERIFY(result.isValid());
- QVERIFY(result.type() == QVariant::Bool);
- QVERIFY(result.toBool());
-
- body.callFunction("setAttribute", QVariantList() << "foo" << "bar");
- QCOMPARE(body.attribute("foo"), QString("bar"));
-}
-
-void tst_QWebElement::callFunctionSubmitForm()
-{
- m_mainFrame->setHtml(QString("<html><body><form name='tstform' action='data:text/html,foo'method='get'>"
- "<input type='text'><input type='submit'></form></body></html>"), QUrl());
-
- QWebElement form = m_mainFrame->documentElement().findAll("form").at(0);
- QVERIFY(form.functions().contains("submit"));
- QVERIFY(!form.isNull());
- form.callFunction("submit");
-
- waitForSignal(m_page, SIGNAL(loadFinished(bool)));
- QCOMPARE(m_mainFrame->url().toString(), QString("data:text/html,foo?"));
-}
-
-void tst_QWebElement::functionNames()
-{
- m_mainFrame->setHtml("<body><p>Test");
-
- QWebElement body = m_mainFrame->documentElement();
-
- QVERIFY(body.functions().contains("setAttribute"));
-}
-
void tst_QWebElement::documentElement()
{
m_mainFrame->setHtml("<body><p>Test");
@@ -398,27 +490,27 @@ void tst_QWebElement::style()
m_mainFrame->setHtml(html);
QWebElement p = m_mainFrame->documentElement().findAll("p").at(0);
- QCOMPARE(p.styleProperty("color"), QLatin1String("blue"));
- QVERIFY(p.styleProperty("cursor").isEmpty());
+ QCOMPARE(p.styleProperty("color", QWebElement::InlineStyle), QLatin1String("blue"));
+ QVERIFY(p.styleProperty("cursor", QWebElement::InlineStyle).isEmpty());
p.setStyleProperty("color", "red");
p.setStyleProperty("cursor", "auto");
- QCOMPARE(p.styleProperty("color"), QLatin1String("red"));
- QCOMPARE(p.styleProperty("color", QWebElement::RespectCascadingStyles), QLatin1String("yellow"));
- QCOMPARE(p.styleProperty("cursor"), QLatin1String("auto"));
+ QCOMPARE(p.styleProperty("color", QWebElement::InlineStyle), QLatin1String("red"));
+ QCOMPARE(p.styleProperty("color", QWebElement::CascadedStyle), QLatin1String("yellow"));
+ QCOMPARE(p.styleProperty("cursor", QWebElement::InlineStyle), QLatin1String("auto"));
p.setStyleProperty("color", "green !important");
- QCOMPARE(p.styleProperty("color"), QLatin1String("green"));
- QCOMPARE(p.styleProperty("color", QWebElement::RespectCascadingStyles), QLatin1String("green"));
+ QCOMPARE(p.styleProperty("color", QWebElement::InlineStyle), QLatin1String("green"));
+ QCOMPARE(p.styleProperty("color", QWebElement::CascadedStyle), QLatin1String("green"));
p.setStyleProperty("color", "blue");
- QCOMPARE(p.styleProperty("color"), QLatin1String("green"));
- QCOMPARE(p.styleProperty("color", QWebElement::RespectCascadingStyles), QLatin1String("green"));
+ QCOMPARE(p.styleProperty("color", QWebElement::InlineStyle), QLatin1String("green"));
+ QCOMPARE(p.styleProperty("color", QWebElement::CascadedStyle), QLatin1String("green"));
- p.setStyleProperty("color", "blue", QWebElement::ImportantStylePriority);
- QCOMPARE(p.styleProperty("color"), QLatin1String("blue"));
- QCOMPARE(p.styleProperty("color", QWebElement::RespectCascadingStyles), QLatin1String("blue"));
+ p.setStyleProperty("color", "blue !important");
+ QCOMPARE(p.styleProperty("color", QWebElement::InlineStyle), QLatin1String("blue"));
+ QCOMPARE(p.styleProperty("color", QWebElement::CascadedStyle), QLatin1String("blue"));
QString html2 = "<head>"
"<style type='text/css'>"
@@ -434,8 +526,8 @@ void tst_QWebElement::style()
m_mainFrame->setHtml(html2);
p = m_mainFrame->documentElement().findAll("p").at(0);
- QCOMPARE(p.styleProperty("color"), QLatin1String("blue"));
- QCOMPARE(p.styleProperty("color", QWebElement::RespectCascadingStyles), QLatin1String("blue"));
+ QCOMPARE(p.styleProperty("color", QWebElement::InlineStyle), QLatin1String("blue"));
+ QCOMPARE(p.styleProperty("color", QWebElement::CascadedStyle), QLatin1String("blue"));
QString html3 = "<head>"
"<style type='text/css'>"
@@ -451,8 +543,8 @@ void tst_QWebElement::style()
m_mainFrame->setHtml(html3);
p = m_mainFrame->documentElement().findAll("p").at(0);
- QCOMPARE(p.styleProperty("color"), QLatin1String("blue"));
- QCOMPARE(p.styleProperty("color", QWebElement::RespectCascadingStyles), QLatin1String("blue"));
+ QCOMPARE(p.styleProperty("color", QWebElement::InlineStyle), QLatin1String("blue"));
+ QCOMPARE(p.styleProperty("color", QWebElement::CascadedStyle), QLatin1String("blue"));
QString html5 = "<head>"
"<style type='text/css'>"
@@ -468,8 +560,8 @@ void tst_QWebElement::style()
m_mainFrame->setHtml(html5);
p = m_mainFrame->documentElement().findAll("p").at(0);
- QCOMPARE(p.styleProperty("color"), QLatin1String(""));
- QCOMPARE(p.styleProperty("color", QWebElement::RespectCascadingStyles), QLatin1String("red"));
+ QCOMPARE(p.styleProperty("color", QWebElement::InlineStyle), QLatin1String(""));
+ QCOMPARE(p.styleProperty("color", QWebElement::CascadedStyle), QLatin1String("red"));
QString html6 = "<head>"
"<link rel='stylesheet' href='qrc:/style.css' type='text/css' />"
@@ -489,8 +581,8 @@ void tst_QWebElement::style()
QTest::qWait(200);
p = m_mainFrame->documentElement().findAll("p").at(0);
- QCOMPARE(p.styleProperty("color"), QLatin1String("blue"));
- QCOMPARE(p.styleProperty("color", QWebElement::RespectCascadingStyles), QLatin1String("black"));
+ QCOMPARE(p.styleProperty("color", QWebElement::InlineStyle), QLatin1String("blue"));
+ QCOMPARE(p.styleProperty("color", QWebElement::CascadedStyle), QLatin1String("black"));
QString html7 = "<head>"
"<style type='text/css'>"
@@ -507,15 +599,15 @@ void tst_QWebElement::style()
QTest::qWait(200);
p = m_mainFrame->documentElement().findAll("p").at(0);
- QCOMPARE(p.styleProperty("color", QWebElement::RespectCascadingStyles), QLatin1String("black"));
+ QCOMPARE(p.styleProperty("color", QWebElement::CascadedStyle), QLatin1String("black"));
QString html8 = "<body><p>some text</p></body>";
m_mainFrame->setHtml(html8);
p = m_mainFrame->documentElement().findAll("p").at(0);
- QCOMPARE(p.styleProperty("color"), QLatin1String(""));
- QCOMPARE(p.styleProperty("color", QWebElement::RespectCascadingStyles), QLatin1String(""));
+ QCOMPARE(p.styleProperty("color", QWebElement::InlineStyle), QLatin1String(""));
+ QCOMPARE(p.styleProperty("color", QWebElement::CascadedStyle), QLatin1String(""));
}
void tst_QWebElement::computedStyle()
@@ -524,47 +616,16 @@ void tst_QWebElement::computedStyle()
m_mainFrame->setHtml(html);
QWebElement p = m_mainFrame->documentElement().findAll("p").at(0);
- QCOMPARE(p.computedStyleProperty("cursor"), QLatin1String("auto"));
- QVERIFY(!p.computedStyleProperty("cursor").isEmpty());
- QVERIFY(p.styleProperty("cursor").isEmpty());
+ QCOMPARE(p.styleProperty("cursor", QWebElement::ComputedStyle), QLatin1String("auto"));
+ QVERIFY(!p.styleProperty("cursor", QWebElement::ComputedStyle).isEmpty());
+ QVERIFY(p.styleProperty("cursor", QWebElement::InlineStyle).isEmpty());
p.setStyleProperty("cursor", "text");
p.setStyleProperty("color", "red");
- QCOMPARE(p.computedStyleProperty("cursor"), QLatin1String("text"));
- QCOMPARE(p.computedStyleProperty("color"), QLatin1String("rgb(255, 0, 0)"));
- QCOMPARE(p.styleProperty("color"), QLatin1String("red"));
-}
-
-void tst_QWebElement::properties()
-{
- m_mainFrame->setHtml("<body><form><input type=checkbox id=ourcheckbox checked=true>");
-
- QWebElement checkBox = m_mainFrame->findFirstElement("#ourcheckbox");
- QVERIFY(!checkBox.isNull());
-
- QVERIFY(checkBox.scriptableProperties().contains("checked"));
-
- QCOMPARE(checkBox.scriptableProperty("checked"), QVariant(true));
- checkBox.setScriptableProperty("checked", false);
- QCOMPARE(checkBox.scriptableProperty("checked"), QVariant(false));
-
- QVERIFY(!checkBox.scriptableProperties().contains("non_existant"));
- QCOMPARE(checkBox.scriptableProperty("non_existant"), QVariant());
-
- checkBox.setScriptableProperty("non_existant", "test");
-
- QCOMPARE(checkBox.scriptableProperty("non_existant"), QVariant("test"));
- QVERIFY(checkBox.scriptableProperties().contains("non_existant"));
-
- // removing scriptableProperties is currently not supported. We should look into this
- // and consider the option of just allowing through the QtScript API only.
-#if 0
- checkBox.setScriptableProperty("non_existant", QVariant());
-
- QCOMPARE(checkBox.scriptableProperty("non_existant"), QVariant());
- QVERIFY(!checkBox.scriptableProperties().contains("non_existant"));
-#endif
+ QCOMPARE(p.styleProperty("cursor", QWebElement::ComputedStyle), QLatin1String("text"));
+ QCOMPARE(p.styleProperty("color", QWebElement::ComputedStyle), QLatin1String("rgb(255, 0, 0)"));
+ QCOMPARE(p.styleProperty("color", QWebElement::InlineStyle), QLatin1String("red"));
}
void tst_QWebElement::appendAndPrepend()
@@ -700,7 +761,7 @@ void tst_QWebElement::clear()
QCOMPARE(body.findAll("div").count(), 1);
QCOMPARE(body.findAll("p").count(), 3);
- body.findFirst("div").removeChildren();
+ body.findFirst("div").removeAllChildren();
QCOMPARE(body.findAll("div").count(), 1);
QCOMPARE(body.findAll("p").count(), 2);
}
@@ -844,7 +905,7 @@ void tst_QWebElement::nullSelect()
{
m_mainFrame->setHtml("<body><p>Test");
- QList<QWebElement> collection = m_mainFrame->findAllElements("invalid{syn(tax;;%#$f223e>>");
+ QWebElementCollection collection = m_mainFrame->findAllElements("invalid{syn(tax;;%#$f223e>>");
QVERIFY(collection.count() == 0);
}
@@ -878,5 +939,103 @@ void tst_QWebElement::lastChildPreviousSibling()
QVERIFY(p.previousSibling().isNull());
}
+void tst_QWebElement::hasSetFocus()
+{
+ m_mainFrame->setHtml("<html><body>" \
+ "<input type='text' id='input1'/>" \
+ "<br>"\
+ "<input type='text' id='input2'/>" \
+ "</body></html>");
+
+ QWebElementCollection inputs = m_mainFrame->documentElement().findAll("input");
+ QWebElement input1 = inputs.at(0);
+ input1.setFocus();
+ QVERIFY(input1.hasFocus());
+
+ QWebElement input2 = inputs.at(1);
+ input2.setFocus();
+ QVERIFY(!input1.hasFocus());
+ QVERIFY(input2.hasFocus());
+}
+
+void tst_QWebElement::render()
+{
+ QString html( "<html>"
+ "<head><style>"
+ "body, iframe { margin: 0px; border: none; }"
+ "</style></head>"
+ "<body><table width='300px' height='300px' border='1'>"
+ "<tr>"
+ "<td>test"
+ "</td>"
+ "<td><img src='qrc:///image.png'>"
+ "</td>"
+ "</tr>"
+ "</table>"
+ "</body>"
+ "</html>"
+ );
+
+ QWebPage page;
+ QSignalSpy loadSpy(&page, SIGNAL(loadFinished(bool)));
+ page.mainFrame()->setHtml(html);
+
+ waitForSignal(&page, SIGNAL(loadFinished(bool)));
+ QCOMPARE(loadSpy.count(), 1);
+
+ QSize size = page.mainFrame()->contentsSize();
+ page.setViewportSize(size);
+
+ QWebElementCollection imgs = page.mainFrame()->findAllElements("img");
+ QCOMPARE(imgs.count(), 1);
+
+ QImage resource(":/image.png");
+ QRect imageRect(0, 0, resource.width(), resource.height());
+
+ QImage testImage(resource.width(), resource.height(), QImage::Format_ARGB32);
+ QPainter painter0(&testImage);
+ painter0.fillRect(imageRect, Qt::white);
+ // render() uses pixmaps internally, and pixmaps might have bit depths
+ // other than 32, giving different pixel values due to rounding.
+ QPixmap pix = QPixmap::fromImage(resource);
+ painter0.drawPixmap(0, 0, pix);
+ painter0.end();
+
+ QImage image1(resource.width(), resource.height(), QImage::Format_ARGB32);
+ QPainter painter1(&image1);
+ painter1.fillRect(imageRect, Qt::white);
+ imgs[0].render(&painter1);
+ painter1.end();
+
+ QVERIFY(image1 == testImage);
+
+ // render image 2nd time to make sure that cached rendering works fine
+ QImage image2(resource.width(), resource.height(), QImage::Format_ARGB32);
+ QPainter painter2(&image2);
+ painter2.fillRect(imageRect, Qt::white);
+ imgs[0].render(&painter2);
+ painter2.end();
+
+ QVERIFY(image2 == testImage);
+
+ // compare table rendered through QWebElement::render to whole page table rendering
+ QRect tableRect(0, 0, 300, 300);
+ QWebElementCollection tables = page.mainFrame()->findAllElements("table");
+ QCOMPARE(tables.count(), 1);
+
+ QImage image3(300, 300, QImage::Format_ARGB32);
+ QPainter painter3(&image3);
+ painter3.fillRect(tableRect, Qt::white);
+ tables[0].render(&painter3);
+ painter3.end();
+
+ QImage image4(300, 300, QImage::Format_ARGB32);
+ QPainter painter4(&image4);
+ page.mainFrame()->render(&painter4, tableRect);
+ painter4.end();
+
+ QVERIFY(image3 == image4);
+}
+
QTEST_MAIN(tst_QWebElement)
#include "tst_qwebelement.moc"
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro
index e45e6dc20..b8734cd75 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro
@@ -5,3 +5,9 @@ SOURCES += tst_qwebframe.cpp
RESOURCES += qwebframe.qrc
QT += testlib network
QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
+!symbian:DEFINES += SRCDIR=\\\"$$PWD/resources\\\"
+
+symbian {
+ TARGET.UID3 = 0xA000E53D
+ TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices
+}
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/resources/image2.png b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/resources/image2.png
new file mode 100644
index 000000000..8d703640c
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/resources/image2.png
Binary files differ
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
index a3bcd20ca..8cc79538c 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
@@ -33,6 +33,15 @@
#include <QRegExp>
#include <QNetworkRequest>
#include <QNetworkReply>
+#ifndef QT_NO_OPENSSL
+#include <qsslerror.h>
+#endif
+#include "../util.h"
+
+#if defined(Q_OS_SYMBIAN)
+# define SRCDIR ""
+#endif
+
//TESTED_CLASS=
//TESTED_FILES=
@@ -576,8 +585,13 @@ private slots:
void urlChange();
void domCycles();
void requestedUrl();
+ void javaScriptWindowObjectCleared_data();
+ void javaScriptWindowObjectCleared();
+ void javaScriptWindowObjectClearedOnEvaluate();
void setHtml();
void setHtmlWithResource();
+ void setHtmlWithBaseURL();
+ void setHtmlWithJSAlert();
void ipv6HostEncoding();
void metaData();
void popupFocus();
@@ -590,6 +604,8 @@ private slots:
void hasSetFocus();
void render();
void scrollPosition();
+ void evaluateWillCauseRepaint();
+ void qObjectWrapperWithSameIdentity();
private:
QString evalJS(const QString&s) {
@@ -690,6 +706,7 @@ void tst_QWebFrame::init()
m_page = m_view->page();
m_myObject = new MyQObject();
m_page->mainFrame()->addToJavaScriptWindowObject("myObject", m_myObject);
+ QDir::setCurrent(SRCDIR);
}
void tst_QWebFrame::cleanup()
@@ -2167,56 +2184,77 @@ void tst_QWebFrame::domCycles()
class FakeReply : public QNetworkReply {
Q_OBJECT
- public:
- FakeReply(const QNetworkRequest& request, QObject* parent = 0)
- : QNetworkReply(parent)
- {
- setOperation(QNetworkAccessManager::GetOperation);
- setRequest(request);
- if (request.url() == QUrl("qrc:/test1.html")) {
- setHeader(QNetworkRequest::LocationHeader, QString("qrc:/test2.html"));
- setAttribute(QNetworkRequest::RedirectionTargetAttribute, QUrl("qrc:/test2.html"));
- } else
- setError(QNetworkReply::HostNotFoundError, tr("Invalid URL"));
-
- open(QIODevice::ReadOnly);
- QTimer::singleShot(0, this, SLOT(timeout()));
- }
- ~FakeReply()
- {
- close();
- }
- virtual void abort() {}
- virtual void close() {}
- protected:
- qint64 readData(char*, qint64)
- {
- return 0;
+public:
+ FakeReply(const QNetworkRequest& request, QObject* parent = 0)
+ : QNetworkReply(parent)
+ {
+ setOperation(QNetworkAccessManager::GetOperation);
+ setRequest(request);
+ if (request.url() == QUrl("qrc:/test1.html")) {
+ setHeader(QNetworkRequest::LocationHeader, QString("qrc:/test2.html"));
+ setAttribute(QNetworkRequest::RedirectionTargetAttribute, QUrl("qrc:/test2.html"));
}
- private slots:
- void timeout()
- {
- if (request().url() == QUrl("qrc://test1.html"))
- emit error(this->error());
- else if (request().url() == QUrl("http://abcdef.abcdef/"))
- emit metaDataChanged();
+#ifndef QT_NO_OPENSSL
+ else if (request.url() == QUrl("qrc:/fake-ssl-error.html"))
+ setError(QNetworkReply::SslHandshakeFailedError, tr("Fake error !")); // force a ssl error
+#endif
+ else if (request.url() == QUrl("http://abcdef.abcdef/"))
+ setError(QNetworkReply::HostNotFoundError, tr("Invalid URL"));
- emit readyRead();
- emit finished();
- }
+ open(QIODevice::ReadOnly);
+ QTimer::singleShot(0, this, SLOT(timeout()));
+ }
+ ~FakeReply()
+ {
+ close();
+ }
+ virtual void abort() {}
+ virtual void close() {}
+
+protected:
+ qint64 readData(char*, qint64)
+ {
+ return 0;
+ }
+
+private slots:
+ void timeout()
+ {
+ if (request().url() == QUrl("qrc://test1.html"))
+ emit error(this->error());
+ else if (request().url() == QUrl("http://abcdef.abcdef/"))
+ emit metaDataChanged();
+#ifndef QT_NO_OPENSSL
+ else if (request().url() == QUrl("qrc:/fake-ssl-error.html"))
+ return;
+#endif
+
+ emit readyRead();
+ emit finished();
+ }
};
class FakeNetworkManager : public QNetworkAccessManager {
+ Q_OBJECT
+
public:
FakeNetworkManager(QObject* parent) : QNetworkAccessManager(parent) { }
protected:
virtual QNetworkReply* createRequest(Operation op, const QNetworkRequest& request, QIODevice* outgoingData)
{
- if (op == QNetworkAccessManager::GetOperation
- && (request.url().toString() == "qrc:/test1.html"
- || request.url().toString() == "http://abcdef.abcdef/"))
- return new FakeReply(request, this);
+ QString url = request.url().toString();
+ if (op == QNetworkAccessManager::GetOperation)
+ if (url == "qrc:/test1.html" || url == "http://abcdef.abcdef/")
+ return new FakeReply(request, this);
+#ifndef QT_NO_OPENSSL
+ else if (url == "qrc:/fake-ssl-error.html") {
+ FakeReply* reply = new FakeReply(request, this);
+ QList<QSslError> errors;
+ emit sslErrors(reply, errors << QSslError(QSslError::UnspecifiedError));
+ return reply;
+ }
+#endif
return QNetworkAccessManager::createRequest(op, request, outgoingData);
}
@@ -2249,6 +2287,52 @@ void tst_QWebFrame::requestedUrl()
QCOMPARE(spy.count(), 3);
QCOMPARE(frame->requestedUrl(), QUrl("http://abcdef.abcdef/"));
QCOMPARE(frame->url(), QUrl("http://abcdef.abcdef/"));
+
+#ifndef QT_NO_OPENSSL
+ qRegisterMetaType<QList<QSslError> >("QList<QSslError>");
+ qRegisterMetaType<QNetworkReply* >("QNetworkReply*");
+
+ QSignalSpy spy2(page.networkAccessManager(), SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)));
+ frame->setUrl(QUrl("qrc:/fake-ssl-error.html"));
+ QTest::qWait(200);
+ QCOMPARE(spy2.count(), 1);
+ QCOMPARE(frame->requestedUrl(), QUrl("qrc:/fake-ssl-error.html"));
+ QCOMPARE(frame->url(), QUrl("qrc:/fake-ssl-error.html"));
+#endif
+}
+
+void tst_QWebFrame::javaScriptWindowObjectCleared_data()
+{
+ QTest::addColumn<QString>("html");
+ QTest::addColumn<int>("signalCount");
+ QTest::newRow("with <script>") << "<html><body><script></script><p>hello world</p></body></html>" << 1;
+ QTest::newRow("without <script>") << "<html><body><p>hello world</p></body></html>" << 0;
+}
+
+void tst_QWebFrame::javaScriptWindowObjectCleared()
+{
+ QWebPage page;
+ QWebFrame* frame = page.mainFrame();
+ QSignalSpy spy(frame, SIGNAL(javaScriptWindowObjectCleared()));
+ QFETCH(QString, html);
+ frame->setHtml(html);
+
+ QFETCH(int, signalCount);
+ QCOMPARE(spy.count(), signalCount);
+}
+
+void tst_QWebFrame::javaScriptWindowObjectClearedOnEvaluate()
+{
+ QWebPage page;
+ QWebFrame* frame = page.mainFrame();
+ QSignalSpy spy(frame, SIGNAL(javaScriptWindowObjectCleared()));
+ frame->setHtml("<html></html>");
+ QCOMPARE(spy.count(), 0);
+ frame->evaluateJavaScript("var a = 'a';");
+ QCOMPARE(spy.count(), 1);
+ // no new clear for a new script:
+ frame->evaluateJavaScript("var a = 1;");
+ QCOMPARE(spy.count(), 1);
}
void tst_QWebFrame::setHtml()
@@ -2291,7 +2375,56 @@ void tst_QWebFrame::setHtmlWithResource()
QCOMPARE(spy.size(), 2);
QWebElement p = frame->documentElement().findAll("p").at(0);
- QCOMPARE(p.styleProperty("color", QWebElement::RespectCascadingStyles), QLatin1String("red"));
+ QCOMPARE(p.styleProperty("color", QWebElement::CascadedStyle), QLatin1String("red"));
+}
+
+void tst_QWebFrame::setHtmlWithBaseURL()
+{
+ QString html("<html><body><p>hello world</p><img src='resources/image2.png'/></body></html>");
+
+ QWebPage page;
+ QWebFrame* frame = page.mainFrame();
+
+ // in few seconds, the image should be completey loaded
+ QSignalSpy spy(&page, SIGNAL(loadFinished(bool)));
+
+ frame->setHtml(html, QUrl::fromLocalFile(QDir::currentPath()));
+ QTest::qWait(200);
+ QCOMPARE(spy.count(), 1);
+
+ QCOMPARE(frame->evaluateJavaScript("document.images.length").toInt(), 1);
+ QCOMPARE(frame->evaluateJavaScript("document.images[0].width").toInt(), 128);
+ QCOMPARE(frame->evaluateJavaScript("document.images[0].height").toInt(), 128);
+
+ // no history item has to be added.
+ QCOMPARE(m_view->page()->history()->count(), 0);
+}
+
+class MyPage : public QWebPage
+{
+public:
+ MyPage() : QWebPage(), alerts(0) {}
+ int alerts;
+
+protected:
+ virtual void javaScriptAlert(QWebFrame*, const QString& msg)
+ {
+ alerts++;
+ QCOMPARE(msg, QString("foo"));
+ // Should not be enough to trigger deferred loading, since we've upped the HTML
+ // tokenizer delay in the Qt frameloader. See HTMLTokenizer::continueProcessing()
+ QTest::qWait(1000);
+ }
+};
+
+void tst_QWebFrame::setHtmlWithJSAlert()
+{
+ QString html("<html><head></head><body><script>alert('foo');</script><p>hello world</p></body></html>");
+ MyPage page;
+ m_view->setPage(&page);
+ page.mainFrame()->setHtml(html);
+ QCOMPARE(page.alerts, 1);
+ QCOMPARE(m_view->page()->mainFrame()->toHtml(), html);
}
class TestNetworkManager : public QNetworkAccessManager
@@ -2382,23 +2515,17 @@ void tst_QWebFrame::popupFocus()
view.resize(400, 100);
view.show();
view.setFocus();
- QTest::qWait(200);
- QVERIFY2(view.hasFocus(),
- "The WebView should be created");
+ QTRY_VERIFY(view.hasFocus());
// open the popup by clicking. check if focus is on the popup
QTest::mouseClick(&view, Qt::LeftButton, 0, QPoint(25, 25));
QObject* webpopup = firstChildByClassName(&view, "WebCore::QWebPopup");
QComboBox* combo = qobject_cast<QComboBox*>(webpopup);
- QTest::qWait(500);
- QVERIFY2(!view.hasFocus() && combo->view()->hasFocus(),
- "Focus sould be on the Popup");
+ QTRY_VERIFY(!view.hasFocus() && combo->view()->hasFocus()); // Focus should be on the popup
// hide the popup and check if focus is on the page
combo->hidePopup();
- QTest::qWait(500);
- QVERIFY2(view.hasFocus() && !combo->view()->hasFocus(),
- "Focus sould be back on the WebView");
+ QTRY_VERIFY(view.hasFocus() && !combo->view()->hasFocus()); // Focus should be back on the WebView
// triple the flashing time, should at least blink twice already
int delay = qApp->cursorFlashTime() * 3;
@@ -2566,16 +2693,16 @@ void tst_QWebFrame::hasSetFocus()
QCOMPARE(loadSpy.size(), 2);
m_page->mainFrame()->setFocus();
- QVERIFY(m_page->mainFrame()->hasFocus());
+ QTRY_VERIFY(m_page->mainFrame()->hasFocus());
for (int i = 0; i < children.size(); ++i) {
children.at(i)->setFocus();
- QVERIFY(children.at(i)->hasFocus());
+ QTRY_VERIFY(children.at(i)->hasFocus());
QVERIFY(!m_page->mainFrame()->hasFocus());
}
m_page->mainFrame()->setFocus();
- QVERIFY(m_page->mainFrame()->hasFocus());
+ QTRY_VERIFY(m_page->mainFrame()->hasFocus());
}
void tst_QWebFrame::render()
@@ -2597,26 +2724,24 @@ void tst_QWebFrame::render()
QPicture picture;
- // render clipping to Viewport
- frame->setClipRenderToViewport(true);
+ QSize size = page.mainFrame()->contentsSize();
+ page.setViewportSize(size);
+
+ // render contents layer only (the iframe is smaller than the image, so it will have scrollbars)
QPainter painter1(&picture);
- frame->render(&painter1);
+ frame->render(&painter1, QWebFrame::ContentsLayer);
painter1.end();
- QSize size = page.mainFrame()->contentsSize();
- page.setViewportSize(size);
- QCOMPARE(size.width(), picture.boundingRect().width()); // 100px
- QCOMPARE(size.height(), picture.boundingRect().height()); // 100px
+ QCOMPARE(size.width(), picture.boundingRect().width() + frame->scrollBarGeometry(Qt::Vertical).width());
+ QCOMPARE(size.height(), picture.boundingRect().height() + frame->scrollBarGeometry(Qt::Horizontal).height());
- // render without clipping to Viewport
- frame->setClipRenderToViewport(false);
+ // render everything, should be the size of the iframe
QPainter painter2(&picture);
- frame->render(&painter2);
+ frame->render(&painter2, QWebFrame::AllLayers);
painter2.end();
- QImage resource(":/image.png");
- QCOMPARE(resource.width(), picture.boundingRect().width()); // resource width: 128px
- QCOMPARE(resource.height(), picture.boundingRect().height()); // resource height: 128px
+ QCOMPARE(size.width(), picture.boundingRect().width()); // width: 100px
+ QCOMPARE(size.height(), picture.boundingRect().height()); // height: 100px
}
void tst_QWebFrame::scrollPosition()
@@ -2643,5 +2768,61 @@ void tst_QWebFrame::scrollPosition()
QCOMPARE(y, 29);
}
+void tst_QWebFrame::evaluateWillCauseRepaint()
+{
+ QWebView view;
+ QString html("<html><body>top<div id=\"junk\" style=\"display: block;\">"
+ "junk</div>bottom</body></html>");
+ view.setHtml(html);
+ view.show();
+
+ QTest::qWait(200);
+
+ view.page()->mainFrame()->evaluateJavaScript(
+ "document.getElementById('junk').style.display = 'none';");
+
+ ::waitForSignal(view.page(), SIGNAL(repaintRequested(QRect)));
+
+ QTest::qWait(2000);
+}
+
+class TestFactory : public QObject
+{
+ Q_OBJECT
+public:
+ TestFactory()
+ : obj(0), counter(0)
+ {}
+
+ Q_INVOKABLE QObject* getNewObject()
+ {
+ delete obj;
+ obj = new QObject(this);
+ obj->setObjectName(QLatin1String("test") + QString::number(++counter));
+ return obj;
+
+ }
+
+ QObject* obj;
+ int counter;
+};
+
+void tst_QWebFrame::qObjectWrapperWithSameIdentity()
+{
+ m_view->setHtml("<script>function triggerBug() { document.getElementById('span1').innerText = test.getNewObject().objectName; }</script>"
+ "<body><span id='span1'>test</span></body>");
+
+ QWebFrame* mainFrame = m_view->page()->mainFrame();
+ QCOMPARE(mainFrame->toPlainText(), QString("test"));
+
+ mainFrame->addToJavaScriptWindowObject("test", new TestFactory, QScriptEngine::ScriptOwnership);
+
+ mainFrame->evaluateJavaScript("triggerBug();");
+ QCOMPARE(mainFrame->toPlainText(), QString("test1"));
+
+ mainFrame->evaluateJavaScript("triggerBug();");
+ QCOMPARE(mainFrame->toPlainText(), QString("test2"));
+}
+
QTEST_MAIN(tst_QWebFrame)
#include "tst_qwebframe.moc"
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/qwebhistory.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/qwebhistory.pro
index fd1074c9a..7445e3bac 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/qwebhistory.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/qwebhistory.pro
@@ -5,3 +5,8 @@ SOURCES += tst_qwebhistory.cpp
RESOURCES += tst_qwebhistory.qrc
QT += testlib network
QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
+
+symbian {
+ TARGET.UID3 = 0xA000E53B
+ TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices
+}
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp
index 5b55613b0..ec2d497b0 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp
@@ -18,6 +18,7 @@
*/
#include <QtTest/QtTest>
+#include <QAction>
#include "qwebpage.h"
#include "qwebview.h"
@@ -55,9 +56,11 @@ private slots:
void serialize_1(); //QWebHistory countity
void serialize_2(); //QWebHistory index
void serialize_3(); //QWebHistoryItem
- void saveAndRestore_1(); //simple checks saveState and restoreState
- void saveAndRestore_2(); //bad parameters saveState and restoreState
- void saveAndRestore_3(); //try use different version
+ void saveAndRestore_crash_1();
+ void saveAndRestore_crash_2();
+ void saveAndRestore_crash_3();
+ void clear();
+
private:
QWebPage* page;
@@ -119,6 +122,8 @@ void tst_QWebHistory::back()
hist->back();
waitForLoadFinished.exec();
}
+ //try one more time (too many). crash test
+ hist->back();
}
/**
@@ -137,6 +142,8 @@ void tst_QWebHistory::forward()
hist->forward();
waitForLoadFinished.exec();
}
+ //try one more time (too many). crash test
+ hist->forward();
}
/**
@@ -284,42 +291,83 @@ void tst_QWebHistory::serialize_3()
QVERIFY(load.atEnd());
}
-/** Simple checks should be a bit redundant to streaming operators */
-void tst_QWebHistory::saveAndRestore_1()
+static void saveHistory(QWebHistory* history, QByteArray* in)
{
- hist->back();
- waitForLoadFinished.exec();
- QByteArray buffer(hist->saveState());
- hist->clear();
- QVERIFY(hist->count() == 1);
- hist->restoreState(buffer);
+ in->clear();
+ QDataStream save(in, QIODevice::WriteOnly);
+ save << *history;
+}
- //check only few values, do not make full test
- //because most of the code is shared with streaming operators
- //and these are checked before
- QCOMPARE(hist->count(), histsize);
- QCOMPARE(hist->currentItemIndex(), histsize - 2);
- QCOMPARE(hist->itemAt(0).title(), QString("page1"));
- QCOMPARE(hist->itemAt(histsize - 1).title(), QString("page") + QString::number(histsize));
+static void restoreHistory(QWebHistory* history, QByteArray* out)
+{
+ QDataStream load(out, QIODevice::ReadOnly);
+ load >> *history;
}
-/** Check returns value if there are bad parameters. Actually, result
- * is no so importent. The test shouldn't crash :-) */
-void tst_QWebHistory::saveAndRestore_2()
+/** The test shouldn't crash */
+void tst_QWebHistory::saveAndRestore_crash_1()
{
QByteArray buffer;
- hist->restoreState(buffer);
- QVERIFY(hist->count() == 1);
- QVERIFY(hist->itemAt(0).isValid());
+ saveHistory(hist, &buffer);
+ for (unsigned i = 0; i < 5; i++) {
+ restoreHistory(hist, &buffer);
+ saveHistory(hist, &buffer);
+ }
+}
+
+/** The test shouldn't crash */
+void tst_QWebHistory::saveAndRestore_crash_2()
+{
+ QByteArray buffer;
+ saveHistory(hist, &buffer);
+ QWebPage* page2 = new QWebPage(this);
+ QWebHistory* hist2 = page2->history();
+ for (unsigned i = 0; i < 5; i++) {
+ restoreHistory(hist2, &buffer);
+ saveHistory(hist2, &buffer);
+ }
+ delete page2;
+}
+
+/** The test shouldn't crash */
+void tst_QWebHistory::saveAndRestore_crash_3()
+{
+ QByteArray buffer;
+ saveHistory(hist, &buffer);
+ QWebPage* page2 = new QWebPage(this);
+ QWebHistory* hist1 = hist;
+ QWebHistory* hist2 = page2->history();
+ for (unsigned i = 0; i < 5; i++) {
+ restoreHistory(hist1, &buffer);
+ restoreHistory(hist2, &buffer);
+ QVERIFY(hist1->count() == hist2->count());
+ QVERIFY(hist1->count() == histsize);
+ hist2->back();
+ saveHistory(hist2, &buffer);
+ hist2->clear();
+ }
+ delete page2;
}
-/** Try to use bad version value */
-void tst_QWebHistory::saveAndRestore_3()
+/** ::clear */
+void tst_QWebHistory::clear()
{
- QByteArray tmp = hist->saveState((QWebHistory::HistoryStateVersion)29999);
- QVERIFY(hist->saveState((QWebHistory::HistoryStateVersion)29999).isEmpty());
- QVERIFY(hist->count() == histsize);
- QVERIFY(hist->itemAt(3).isValid());
+ QByteArray buffer;
+
+ QAction* actionBack = page->action(QWebPage::Back);
+ QVERIFY(actionBack->isEnabled());
+ saveHistory(hist, &buffer);
+ QVERIFY(hist->count() > 1);
+ hist->clear();
+ QVERIFY(hist->count() == 1); // Leave current item.
+ QVERIFY(!actionBack->isEnabled());
+
+ QWebPage* page2 = new QWebPage(this);
+ QWebHistory* hist2 = page2->history();
+ QVERIFY(hist2->count() == 0);
+ hist2->clear();
+ QVERIFY(hist2->count() == 0); // Do not change anything.
+ delete page2;
}
QTEST_MAIN(tst_QWebHistory)
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebhistoryinterface/qwebhistoryinterface.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebhistoryinterface/qwebhistoryinterface.pro
index af3b34861..764f806df 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebhistoryinterface/qwebhistoryinterface.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebhistoryinterface/qwebhistoryinterface.pro
@@ -4,3 +4,8 @@ include(../../../../WebKit.pri)
SOURCES += tst_qwebhistoryinterface.cpp
QT += testlib network
QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
+
+symbian {
+ TARGET.UID3 = 0xA000E53C
+ TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices
+}
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro
index 2f3a10897..7853b2876 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro
@@ -5,3 +5,9 @@ SOURCES += tst_qwebpage.cpp
RESOURCES += tst_qwebpage.qrc
QT += testlib network
QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
+!symbian:DEFINES += SRCDIR=\\\"$$PWD/\\\"
+
+symbian {
+ TARGET.UID3 = 0xA000E53E
+ TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices
+}
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
index 966f04992..ee1969d6e 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
@@ -1,5 +1,6 @@
/*
Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+ Copyright (C) 2009 Girish Ramakrishnan <girish@forwardbias.in>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
@@ -20,8 +21,13 @@
#include <QtTest/QtTest>
+#include <qgraphicsscene.h>
+#include <qgraphicsview.h>
+#include <qgraphicswebview.h>
+#include <qwebelement.h>
#include <qwebpage.h>
#include <qwidget.h>
+#include <QGraphicsWidget>
#include <qwebview.h>
#include <qwebframe.h>
#include <qwebhistory.h>
@@ -32,6 +38,11 @@
#include <qwebsecurityorigin.h>
#include <qwebdatabase.h>
#include <QPushButton>
+#include <QDir>
+
+#if defined(Q_OS_SYMBIAN)
+# define SRCDIR ""
+#endif
// Will try to wait for the condition while allowing event processing
#define QTRY_COMPARE(__expr, __expected) \
@@ -59,7 +70,7 @@
* \return \p true if the requested signal was received
* \p false on timeout
*/
-static bool waitForSignal(QObject* obj, const char* signal, int timeout = 0)
+static bool waitForSignal(QObject* obj, const char* signal, int timeout = 10000)
{
QEventLoop loop;
QObject::connect(obj, signal, &loop, SLOT(quit()));
@@ -74,6 +85,22 @@ static bool waitForSignal(QObject* obj, const char* signal, int timeout = 0)
return timeoutSpy.isEmpty();
}
+class EventSpy : public QObject, public QList<QEvent::Type>
+{
+ Q_OBJECT
+public:
+ EventSpy(QObject* objectToSpy)
+ {
+ objectToSpy->installEventFilter(this);
+ }
+
+ virtual bool eventFilter(QObject* receiver, QEvent* event)
+ {
+ append(event->type());
+ return false;
+ }
+};
+
class tst_QWebPage : public QObject
{
Q_OBJECT
@@ -100,7 +127,9 @@ private slots:
void contextMenuCrash();
void database();
void createPlugin();
+ void destroyPlugin_data();
void destroyPlugin();
+ void createViewlessPlugin_data();
void createViewlessPlugin();
void multiplePageGroupsAndLocalStorage();
void cursorMovements();
@@ -110,9 +139,21 @@ private slots:
void frameAt();
void requestCache();
void protectBindingsRuntimeObjectsFromCollector();
+ void localURLSchemes();
+ void testOptionalJSObjects();
+ void testEnablePersistentStorage();
+ void consoleOutput();
+ void inputMethods_data();
+ void inputMethods();
+ void defaultTextEncoding();
+ void errorPageExtension();
-private:
+ void crashTests_LazyInitializationOfMainFrame();
+ void screenshot_data();
+ void screenshot();
+
+ void originatingObjectInNetworkRequests();
private:
QWebView* m_view;
@@ -217,6 +258,8 @@ void tst_QWebPage::infiniteLoopJS()
void tst_QWebPage::loadFinished()
{
+ qRegisterMetaType<QWebFrame*>("QWebFrame*");
+ qRegisterMetaType<QNetworkRequest*>("QNetworkRequest*");
QSignalSpy spyLoadStarted(m_view, SIGNAL(loadStarted()));
QSignalSpy spyLoadFinished(m_view, SIGNAL(loadFinished(bool)));
@@ -238,6 +281,31 @@ void tst_QWebPage::loadFinished()
QCOMPARE(spyLoadFinished.count(), 1);
}
+class ConsolePage : public QWebPage
+{
+public:
+ ConsolePage(QObject* parent = 0) : QWebPage(parent) {}
+
+ virtual void javaScriptConsoleMessage(const QString& message, int lineNumber, const QString& sourceID)
+ {
+ messages.append(message);
+ lineNumbers.append(lineNumber);
+ sourceIDs.append(sourceID);
+ }
+
+ QStringList messages;
+ QList<int> lineNumbers;
+ QStringList sourceIDs;
+};
+
+void tst_QWebPage::consoleOutput()
+{
+ ConsolePage page;
+ page.mainFrame()->evaluateJavaScript("this is not valid JavaScript");
+ QCOMPARE(page.messages.count(), 1);
+ QCOMPARE(page.lineNumbers.at(0), 1);
+}
+
class TestPage : public QWebPage
{
public:
@@ -302,9 +370,11 @@ public:
TestNetworkManager(QObject* parent) : QNetworkAccessManager(parent) {}
QList<QUrl> requestedUrls;
+ QList<QNetworkRequest> requests;
protected:
virtual QNetworkReply* createRequest(Operation op, const QNetworkRequest &request, QIODevice* outgoingData) {
+ requests.append(request);
requestedUrls.append(request.url());
return QNetworkAccessManager::createRequest(op, request, outgoingData);
}
@@ -316,13 +386,13 @@ void tst_QWebPage::userStyleSheet()
m_page->setNetworkAccessManager(networkManager);
networkManager->requestedUrls.clear();
- m_page->settings()->setUserStyleSheetUrl(QUrl("data:text/css,p { background-image: url('http://does.not/exist.png');}"));
+ m_page->settings()->setUserStyleSheetUrl(QUrl("data:text/css;charset=utf-8;base64,"
+ + QByteArray("p { background-image: url('http://does.not/exist.png');}").toBase64()));
m_view->setHtml("<p>hello world</p>");
QVERIFY(::waitForSignal(m_view, SIGNAL(loadFinished(bool))));
- QVERIFY(networkManager->requestedUrls.count() >= 2);
- QCOMPARE(networkManager->requestedUrls.at(0), QUrl("data:text/css,p { background-image: url('http://does.not/exist.png');}"));
- QCOMPARE(networkManager->requestedUrls.at(1), QUrl("http://does.not/exist.png"));
+ QVERIFY(networkManager->requestedUrls.count() >= 1);
+ QCOMPARE(networkManager->requestedUrls.at(0), QUrl("http://does.not/exist.png"));
}
void tst_QWebPage::modified()
@@ -378,7 +448,7 @@ void tst_QWebPage::modified()
m_page->mainFrame()->setUrl(QUrl("data:text/html,<body>This is fourth page"));
QVERIFY(m_page->history()->count() == 2);
m_page->mainFrame()->setUrl(QUrl("data:text/html,<body>This is fifth page"));
- QVERIFY(::waitForSignal(m_page, SIGNAL(saveFrameStateRequested(QWebFrame*, QWebHistoryItem*))));
+ QVERIFY(::waitForSignal(m_page, SIGNAL(saveFrameStateRequested(QWebFrame*,QWebHistoryItem*))));
}
void tst_QWebPage::contextMenuCrash()
@@ -405,13 +475,16 @@ void tst_QWebPage::database()
QWebSettings::setOfflineStorageDefaultQuota(1024 * 1024);
QVERIFY(QWebSettings::offlineStorageDefaultQuota() == 1024 * 1024);
+ m_page->settings()->setAttribute(QWebSettings::LocalStorageEnabled, true);
+ m_page->settings()->setAttribute(QWebSettings::OfflineStorageDatabaseEnabled, true);
+
QString dbFileName = path + "Databases.db";
if (QFile::exists(dbFileName))
QFile::remove(dbFileName);
qRegisterMetaType<QWebFrame*>("QWebFrame*");
- QSignalSpy spy(m_page, SIGNAL(databaseQuotaExceeded(QWebFrame *, QString)));
+ QSignalSpy spy(m_page, SIGNAL(databaseQuotaExceeded(QWebFrame*,QString)));
m_view->setHtml(QString("<html><head><script>var db; db=openDatabase('testdb', '1.0', 'test database API', 50000); </script></head><body><div></div></body></html>"), QUrl("http://www.myexample.com"));
QTRY_COMPARE(spy.count(), 1);
m_page->mainFrame()->evaluateJavaScript("var db2; db2=openDatabase('testdb', '1.0', 'test database API', 50000);");
@@ -432,14 +505,19 @@ void tst_QWebPage::database()
m_page->mainFrame()->evaluateJavaScript("var db3; db3=openDatabase('testdb', '1.0', 'test database API', 50000);db3.transaction(function(tx) { tx.executeSql('CREATE TABLE IF NOT EXISTS Test (text TEXT)', []); }, function(tx, result) { }, function(tx, error) { });");
QTest::qWait(200);
+ // Remove all databases.
QWebSecurityOrigin origin = m_page->mainFrame()->securityOrigin();
QList<QWebDatabase> dbs = origin.databases();
- if (dbs.count() > 0) {
- QString fileName = dbs[0].fileName();
+ for (int i = 0; i < dbs.count(); i++) {
+ QString fileName = dbs[i].fileName();
QVERIFY(QFile::exists(fileName));
- QWebDatabase::removeDatabase(dbs[0]);
+ QWebDatabase::removeDatabase(dbs[i]);
QVERIFY(!QFile::exists(fileName));
}
+ QVERIFY(!origin.databases().size());
+ // Remove removed test :-)
+ QWebDatabase::removeAllDatabases();
+ QVERIFY(!origin.databases().size());
QTest::qWait(1000);
}
@@ -578,56 +656,121 @@ void tst_QWebPage::createPlugin()
QCOMPARE(newPage->calls.count(), 0);
}
-class PluginTrackedPage : public QWebPage
-{
+
+// Standard base class for template PluginTracerPage. In tests it is used as interface.
+class PluginCounterPage : public QWebPage {
public:
+ int m_count;
+ QPointer<QObject> m_widget;
+ QObject* m_pluginParent;
+ PluginCounterPage(QObject* parent = 0)
+ : QWebPage(parent)
+ , m_count(0)
+ , m_widget(0)
+ , m_pluginParent(0)
+ {
+ settings()->setAttribute(QWebSettings::PluginsEnabled, true);
+ }
+ ~PluginCounterPage()
+ {
+ if (m_pluginParent)
+ m_pluginParent->deleteLater();
+ }
+};
- int count;
- QPointer<QWidget> widget;
+template<class T>
+class PluginTracerPage : public PluginCounterPage {
+public:
+ PluginTracerPage(QObject* parent = 0)
+ : PluginCounterPage(parent)
+ {
+ // this is a dummy parent object for the created plugin
+ m_pluginParent = new T;
+ }
+ virtual QObject* createPlugin(const QString&, const QUrl&, const QStringList&, const QStringList&)
+ {
+ m_count++;
+ m_widget = new T;
+ // need a cast to the specific type, as QObject::setParent cannot be called,
+ // because it is not virtual. Instead it is necesary to call QWidget::setParent,
+ // which also takes a QWidget* instead of a QObject*. Therefore we need to
+ // upcast to T*, which is a QWidget.
+ static_cast<T*>(m_widget.data())->setParent(static_cast<T*>(m_pluginParent));
+ return m_widget;
+ }
+};
- PluginTrackedPage(QWidget *parent = 0) : QWebPage(parent), count(0) {
- settings()->setAttribute(QWebSettings::PluginsEnabled, true);
+class PluginFactory {
+public:
+ enum FactoredType {QWidgetType, QGraphicsWidgetType};
+ static PluginCounterPage* create(FactoredType type, QObject* parent = 0)
+ {
+ PluginCounterPage* result = 0;
+ switch (type) {
+ case QWidgetType:
+ result = new PluginTracerPage<QWidget>(parent);
+ break;
+ case QGraphicsWidgetType:
+ result = new PluginTracerPage<QGraphicsWidget>(parent);
+ break;
+ default: {/*Oops*/};
+ }
+ return result;
}
- virtual QObject* createPlugin(const QString&, const QUrl&, const QStringList&, const QStringList&) {
- count++;
- QWidget *w = new QWidget;
- widget = w;
- return w;
+ static void prepareTestData()
+ {
+ QTest::addColumn<int>("type");
+ QTest::newRow("QWidget") << (int)PluginFactory::QWidgetType;
+ QTest::newRow("QGraphicsWidget") << (int)PluginFactory::QGraphicsWidgetType;
}
};
+void tst_QWebPage::destroyPlugin_data()
+{
+ PluginFactory::prepareTestData();
+}
+
void tst_QWebPage::destroyPlugin()
{
- PluginTrackedPage* page = new PluginTrackedPage(m_view);
+ QFETCH(int, type);
+ PluginCounterPage* page = PluginFactory::create((PluginFactory::FactoredType)type, m_view);
m_view->setPage(page);
// we create the plugin, so the widget should be constructed
QString content("<html><body><object type=\"application/x-qt-plugin\" classid=\"QProgressBar\"></object></body></html>");
m_view->setHtml(content);
- QVERIFY(page->widget != 0);
- QCOMPARE(page->count, 1);
+ QVERIFY(page->m_widget);
+ QCOMPARE(page->m_count, 1);
// navigate away, the plugin widget should be destructed
m_view->setHtml("<html><body>Hi</body></html>");
QTestEventLoop::instance().enterLoop(1);
- QVERIFY(page->widget == 0);
+ QVERIFY(!page->m_widget);
+}
+
+void tst_QWebPage::createViewlessPlugin_data()
+{
+ PluginFactory::prepareTestData();
}
void tst_QWebPage::createViewlessPlugin()
{
- PluginTrackedPage* page = new PluginTrackedPage;
+ QFETCH(int, type);
+ PluginCounterPage* page = PluginFactory::create((PluginFactory::FactoredType)type);
QString content("<html><body><object type=\"application/x-qt-plugin\" classid=\"QProgressBar\"></object></body></html>");
page->mainFrame()->setHtml(content);
- QCOMPARE(page->count, 1);
- QVERIFY(page->widget != 0);
+ QCOMPARE(page->m_count, 1);
+ QVERIFY(page->m_widget);
+ QVERIFY(page->m_pluginParent);
+ QVERIFY(page->m_widget->parent() == page->m_pluginParent);
delete page;
+
}
// import private API
void QWEBKIT_EXPORT qt_webpage_setGroupName(QWebPage* page, const QString& groupName);
QString QWEBKIT_EXPORT qt_webpage_groupName(QWebPage* page);
-void QWEBKIT_EXPORT qt_websettings_setLocalStorageDatabasePath(QWebSettings* settings, const QString& path);
void tst_QWebPage::multiplePageGroupsAndLocalStorage()
{
@@ -638,9 +781,11 @@ void tst_QWebPage::multiplePageGroupsAndLocalStorage()
QWebView view1;
QWebView view2;
- qt_websettings_setLocalStorageDatabasePath(view1.page()->settings(), QDir::toNativeSeparators(QDir::currentPath() + "/path1"));
+ view1.page()->settings()->setAttribute(QWebSettings::LocalStorageEnabled, true);
+ view1.page()->settings()->setLocalStoragePath(QDir::toNativeSeparators(QDir::currentPath() + "/path1"));
qt_webpage_setGroupName(view1.page(), "group1");
- qt_websettings_setLocalStorageDatabasePath(view2.page()->settings(), QDir::toNativeSeparators(QDir::currentPath() + "/path2"));
+ view2.page()->settings()->setAttribute(QWebSettings::LocalStorageEnabled, true);
+ view2.page()->settings()->setLocalStoragePath(QDir::toNativeSeparators(QDir::currentPath() + "/path2"));
qt_webpage_setGroupName(view2.page(), "group2");
QCOMPARE(qt_webpage_groupName(view1.page()), QString("group1"));
QCOMPARE(qt_webpage_groupName(view2.page()), QString("group2"));
@@ -1165,6 +1310,201 @@ void tst_QWebPage::frameAt()
frameAtHelper(webPage, webPage->mainFrame(), webPage->mainFrame()->pos());
}
+void tst_QWebPage::inputMethods_data()
+{
+ QTest::addColumn<QString>("viewType");
+ QTest::newRow("QWebView") << "QWebView";
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+ QTest::newRow("QGraphicsWebView") << "QGraphicsWebView";
+#endif
+}
+
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+static Qt::InputMethodHints inputMethodHints(QObject* object)
+{
+ if (QGraphicsObject* o = qobject_cast<QGraphicsObject*>(object))
+ return o->inputMethodHints();
+ if (QWidget* w = qobject_cast<QWidget*>(object))
+ return w->inputMethodHints();
+ return Qt::InputMethodHints();
+}
+#endif
+
+static bool inputMethodEnabled(QObject* object)
+{
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+ if (QGraphicsObject* o = qobject_cast<QGraphicsObject*>(object))
+ return o->flags() & QGraphicsItem::ItemAcceptsInputMethod;
+#endif
+ if (QWidget* w = qobject_cast<QWidget*>(object))
+ return w->testAttribute(Qt::WA_InputMethodEnabled);
+ return false;
+}
+
+void tst_QWebPage::inputMethods()
+{
+ QFETCH(QString, viewType);
+ QWebPage* page = new QWebPage;
+ QObject* view = 0;
+ QObject* container = 0;
+ if (viewType == "QWebView") {
+ QWebView* wv = new QWebView;
+ wv->setPage(page);
+ view = wv;
+ container = view;
+ }
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+ else if (viewType == "QGraphicsWebView") {
+ QGraphicsWebView* wv = new QGraphicsWebView;
+ wv->setPage(page);
+ view = wv;
+
+ QGraphicsView* gv = new QGraphicsView;
+ QGraphicsScene* scene = new QGraphicsScene(gv);
+ gv->setScene(scene);
+ scene->addItem(wv);
+ wv->setGeometry(QRect(0, 0, 500, 500));
+
+ container = gv;
+ }
+#endif
+ else
+ QVERIFY2(false, "Unknown view type");
+
+ page->settings()->setFontFamily(QWebSettings::SerifFont, "FooSerifFont");
+ page->mainFrame()->setHtml("<html><body>" \
+ "<input type='text' id='input1' style='font-family: serif' value='' maxlength='20'/><br>" \
+ "<input type='password'/>" \
+ "</body></html>");
+ page->mainFrame()->setFocus();
+
+ EventSpy viewEventSpy(container);
+
+ QWebElementCollection inputs = page->mainFrame()->documentElement().findAll("input");
+
+ QMouseEvent evpres(QEvent::MouseButtonPress, inputs.at(0).geometry().center(), Qt::LeftButton, Qt::NoButton, Qt::NoModifier);
+ page->event(&evpres);
+ QMouseEvent evrel(QEvent::MouseButtonRelease, inputs.at(0).geometry().center(), Qt::LeftButton, Qt::NoButton, Qt::NoModifier);
+ page->event(&evrel);
+
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+ QVERIFY(!viewEventSpy.contains(QEvent::RequestSoftwareInputPanel));
+#endif
+ viewEventSpy.clear();
+
+ page->event(&evpres);
+ page->event(&evrel);
+
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+ QVERIFY(viewEventSpy.contains(QEvent::RequestSoftwareInputPanel));
+#endif
+
+ //ImMicroFocus
+ QVariant variant = page->inputMethodQuery(Qt::ImMicroFocus);
+ QRect focusRect = variant.toRect();
+ QVERIFY(inputs.at(0).geometry().contains(variant.toRect().topLeft()));
+
+ //ImFont
+ variant = page->inputMethodQuery(Qt::ImFont);
+ QFont font = variant.value<QFont>();
+ QCOMPARE(page->settings()->fontFamily(QWebSettings::SerifFont), font.family());
+
+ QList<QInputMethodEvent::Attribute> inputAttributes;
+
+ //Insert text.
+ {
+ QInputMethodEvent eventText("QtWebKit", inputAttributes);
+ QSignalSpy signalSpy(page, SIGNAL(microFocusChanged()));
+ page->event(&eventText);
+ QCOMPARE(signalSpy.count(), 0);
+ }
+
+ {
+ QInputMethodEvent eventText("", inputAttributes);
+ eventText.setCommitString(QString("QtWebKit"), 0, 0);
+ page->event(&eventText);
+ }
+
+#if QT_VERSION >= 0x040600
+ //ImMaximumTextLength
+ variant = page->inputMethodQuery(Qt::ImMaximumTextLength);
+ QCOMPARE(20, variant.toInt());
+
+ //Set selection
+ inputAttributes << QInputMethodEvent::Attribute(QInputMethodEvent::Selection, 3, 2, QVariant());
+ QInputMethodEvent eventSelection("",inputAttributes);
+ page->event(&eventSelection);
+
+ //ImAnchorPosition
+ variant = page->inputMethodQuery(Qt::ImAnchorPosition);
+ int anchorPosition = variant.toInt();
+ QCOMPARE(anchorPosition, 3);
+
+ //ImCursorPosition
+ variant = page->inputMethodQuery(Qt::ImCursorPosition);
+ int cursorPosition = variant.toInt();
+ QCOMPARE(cursorPosition, 5);
+
+ //ImCurrentSelection
+ variant = page->inputMethodQuery(Qt::ImCurrentSelection);
+ QString selectionValue = variant.value<QString>();
+ QCOMPARE(selectionValue, QString("eb"));
+#endif
+
+ //ImSurroundingText
+ variant = page->inputMethodQuery(Qt::ImSurroundingText);
+ QString value = variant.value<QString>();
+ QCOMPARE(value, QString("QtWebKit"));
+
+#if QT_VERSION >= 0x040600
+ {
+ QList<QInputMethodEvent::Attribute> attributes;
+ // Clear the selection, so the next test does not clear any contents.
+ QInputMethodEvent::Attribute newSelection(QInputMethodEvent::Selection, 0, 0, QVariant());
+ attributes.append(newSelection);
+ QInputMethodEvent event("composition", attributes);
+ page->event(&event);
+ }
+
+ // A ongoing composition should not change the surrounding text before it is committed.
+ variant = page->inputMethodQuery(Qt::ImSurroundingText);
+ value = variant.value<QString>();
+ QCOMPARE(value, QString("QtWebKit"));
+#endif
+
+ //ImhHiddenText
+ QMouseEvent evpresPassword(QEvent::MouseButtonPress, inputs.at(1).geometry().center(), Qt::LeftButton, Qt::NoButton, Qt::NoModifier);
+ page->event(&evpresPassword);
+ QMouseEvent evrelPassword(QEvent::MouseButtonRelease, inputs.at(1).geometry().center(), Qt::LeftButton, Qt::NoButton, Qt::NoModifier);
+ page->event(&evrelPassword);
+
+ QVERIFY(inputMethodEnabled(view));
+#if QT_VERSION >= 0x040600
+ QVERIFY(inputMethodHints(view) & Qt::ImhHiddenText);
+
+ page->event(&evpres);
+ page->event(&evrel);
+ QVERIFY(!(inputMethodHints(view) & Qt::ImhHiddenText));
+#endif
+
+ page->mainFrame()->setHtml("<html><body><p>nothing to input here");
+ viewEventSpy.clear();
+
+ QWebElement para = page->mainFrame()->findFirstElement("p");
+ {
+ QMouseEvent evpres(QEvent::MouseButtonPress, para.geometry().center(), Qt::LeftButton, Qt::NoButton, Qt::NoModifier);
+ page->event(&evpres);
+ QMouseEvent evrel(QEvent::MouseButtonRelease, para.geometry().center(), Qt::LeftButton, Qt::NoButton, Qt::NoModifier);
+ page->event(&evrel);
+ }
+
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+ QVERIFY(!viewEventSpy.contains(QEvent::RequestSoftwareInputPanel));
+#endif
+
+ delete container;
+}
+
// import a little DRT helper function to trigger the garbage collector
void QWEBKIT_EXPORT qt_drt_garbageCollector_collect();
@@ -1190,5 +1530,256 @@ void tst_QWebPage::protectBindingsRuntimeObjectsFromCollector()
newPage->mainFrame()->evaluateJavaScript("testme('bar')");
}
+void tst_QWebPage::localURLSchemes()
+{
+ int i = QWebSecurityOrigin::localSchemes().size();
+ QWebSecurityOrigin::removeLocalScheme("file");
+ QTRY_COMPARE(QWebSecurityOrigin::localSchemes().size(), i);
+ QWebSecurityOrigin::addLocalScheme("file");
+ QTRY_COMPARE(QWebSecurityOrigin::localSchemes().size(), i);
+ QString myscheme = "myscheme";
+ QWebSecurityOrigin::addLocalScheme(myscheme);
+ QTRY_COMPARE(QWebSecurityOrigin::localSchemes().size(), i + 1);
+ QVERIFY(QWebSecurityOrigin::localSchemes().contains(myscheme));
+ QWebSecurityOrigin::removeLocalScheme(myscheme);
+ QTRY_COMPARE(QWebSecurityOrigin::localSchemes().size(), i);
+ QWebSecurityOrigin::removeLocalScheme(myscheme);
+ QTRY_COMPARE(QWebSecurityOrigin::localSchemes().size(), i);
+}
+
+static inline bool testFlag(QWebPage& webPage, QWebSettings::WebAttribute settingAttribute, const QString& jsObjectName, bool settingValue)
+{
+ webPage.settings()->setAttribute(settingAttribute, settingValue);
+ return webPage.mainFrame()->evaluateJavaScript(QString("(window.%1 != undefined)").arg(jsObjectName)).toBool();
+}
+
+void tst_QWebPage::testOptionalJSObjects()
+{
+ // Once a feature is enabled and the JS object is accessed turning off the setting will not turn off
+ // the visibility of the JS object any more. For this reason this test uses two QWebPage instances.
+ // Part of the test is to make sure that the QWebPage instances do not interfere with each other so turning on
+ // a feature for one instance will not turn it on for another.
+
+ QWebPage webPage1;
+ QWebPage webPage2;
+
+ webPage1.currentFrame()->setHtml(QString("<html><body>test</body></html>"), QUrl());
+ webPage2.currentFrame()->setHtml(QString("<html><body>test</body></html>"), QUrl());
+
+ QEXPECT_FAIL("","Feature enabled/disabled checking problem. Look at bugs.webkit.org/show_bug.cgi?id=29867", Continue);
+ QCOMPARE(testFlag(webPage1, QWebSettings::OfflineWebApplicationCacheEnabled, "applicationCache", false), false);
+ QCOMPARE(testFlag(webPage2, QWebSettings::OfflineWebApplicationCacheEnabled, "applicationCache", true), true);
+ QEXPECT_FAIL("","Feature enabled/disabled checking problem. Look at bugs.webkit.org/show_bug.cgi?id=29867", Continue);
+ QCOMPARE(testFlag(webPage1, QWebSettings::OfflineWebApplicationCacheEnabled, "applicationCache", false), false);
+ QCOMPARE(testFlag(webPage2, QWebSettings::OfflineWebApplicationCacheEnabled, "applicationCache", false), true);
+
+ QCOMPARE(testFlag(webPage1, QWebSettings::LocalStorageEnabled, "localStorage", false), false);
+ QCOMPARE(testFlag(webPage2, QWebSettings::LocalStorageEnabled, "localStorage", true), true);
+ QCOMPARE(testFlag(webPage1, QWebSettings::LocalStorageEnabled, "localStorage", false), false);
+ QCOMPARE(testFlag(webPage2, QWebSettings::LocalStorageEnabled, "localStorage", false), true);
+}
+
+void tst_QWebPage::testEnablePersistentStorage()
+{
+ QWebPage webPage;
+
+ // By default all persistent options should be disabled
+ QCOMPARE(webPage.settings()->testAttribute(QWebSettings::LocalStorageEnabled), false);
+ QCOMPARE(webPage.settings()->testAttribute(QWebSettings::OfflineStorageDatabaseEnabled), false);
+ QCOMPARE(webPage.settings()->testAttribute(QWebSettings::OfflineWebApplicationCacheEnabled), false);
+ QVERIFY(webPage.settings()->iconDatabasePath().isEmpty());
+
+ QWebSettings::enablePersistentStorage();
+
+ // Give it some time to initialize - icon database needs it
+ QTest::qWait(1000);
+
+ QCOMPARE(webPage.settings()->testAttribute(QWebSettings::LocalStorageEnabled), true);
+ QCOMPARE(webPage.settings()->testAttribute(QWebSettings::OfflineStorageDatabaseEnabled), true);
+ QCOMPARE(webPage.settings()->testAttribute(QWebSettings::OfflineWebApplicationCacheEnabled), true);
+
+ QVERIFY(!webPage.settings()->offlineStoragePath().isEmpty());
+ QVERIFY(!webPage.settings()->offlineWebApplicationCachePath().isEmpty());
+ QVERIFY(!webPage.settings()->iconDatabasePath().isEmpty());
+}
+
+void tst_QWebPage::defaultTextEncoding()
+{
+ QWebFrame* mainFrame = m_page->mainFrame();
+
+ QString defaultCharset = mainFrame->evaluateJavaScript("document.defaultCharset").toString();
+ QVERIFY(!defaultCharset.isEmpty());
+ QCOMPARE(QWebSettings::globalSettings()->defaultTextEncoding(), defaultCharset);
+
+ m_page->settings()->setDefaultTextEncoding(QString("utf-8"));
+ QString charset = mainFrame->evaluateJavaScript("document.defaultCharset").toString();
+ QCOMPARE(charset, QString("utf-8"));
+ QCOMPARE(m_page->settings()->defaultTextEncoding(), charset);
+
+ m_page->settings()->setDefaultTextEncoding(QString());
+ charset = mainFrame->evaluateJavaScript("document.defaultCharset").toString();
+ QVERIFY(!charset.isEmpty());
+ QCOMPARE(charset, defaultCharset);
+
+ QWebSettings::globalSettings()->setDefaultTextEncoding(QString("utf-8"));
+ charset = mainFrame->evaluateJavaScript("document.defaultCharset").toString();
+ QCOMPARE(charset, QString("utf-8"));
+ QCOMPARE(QWebSettings::globalSettings()->defaultTextEncoding(), charset);
+}
+
+class ErrorPage : public QWebPage
+{
+public:
+
+ ErrorPage(QWidget* parent = 0): QWebPage(parent)
+ {
+ }
+
+ virtual bool supportsExtension(Extension extension) const
+ {
+ return extension == ErrorPageExtension;
+ }
+
+ virtual bool extension(Extension, const ExtensionOption* option, ExtensionReturn* output)
+ {
+ const ErrorPageExtensionOption* info = static_cast<const ErrorPageExtensionOption*>(option);
+ ErrorPageExtensionReturn* errorPage = static_cast<ErrorPageExtensionReturn*>(output);
+
+ if (info->frame == mainFrame()) {
+ errorPage->content = "data:text/html,error";
+ return true;
+ }
+
+ return false;
+ }
+};
+
+void tst_QWebPage::errorPageExtension()
+{
+ ErrorPage* page = new ErrorPage;
+ m_view->setPage(page);
+
+ QSignalSpy spyLoadFinished(m_view, SIGNAL(loadFinished(bool)));
+
+ page->mainFrame()->load(QUrl("qrc:///frametest/index.html"));
+ QTRY_COMPARE(spyLoadFinished.count(), 1);
+
+ page->mainFrame()->setUrl(QUrl("http://non.existent/url"));
+ QTest::qWait(2000);
+ QTRY_COMPARE(spyLoadFinished.count(), 2);
+ QCOMPARE(page->mainFrame()->toPlainText(), QString("data:text/html,error"));
+ QCOMPARE(page->history()->count(), 2);
+ QCOMPARE(page->history()->currentItem().url(), QUrl("http://non.existent/url"));
+ QCOMPARE(page->history()->canGoBack(), true);
+ QCOMPARE(page->history()->canGoForward(), false);
+
+ page->triggerAction(QWebPage::Back);
+ QTest::qWait(2000);
+ QCOMPARE(page->history()->canGoBack(), false);
+ QCOMPARE(page->history()->canGoForward(), true);
+
+ page->triggerAction(QWebPage::Forward);
+ QTest::qWait(2000);
+ QCOMPARE(page->history()->canGoBack(), true);
+ QCOMPARE(page->history()->canGoForward(), false);
+
+ page->triggerAction(QWebPage::Back);
+ QTest::qWait(2000);
+ QCOMPARE(page->history()->canGoBack(), false);
+ QCOMPARE(page->history()->canGoForward(), true);
+ QCOMPARE(page->history()->currentItem().url(), QUrl("qrc:///frametest/index.html"));
+
+ m_view->setPage(0);
+}
+
+void tst_QWebPage::crashTests_LazyInitializationOfMainFrame()
+{
+ {
+ QWebPage webPage;
+ }
+ {
+ QWebPage webPage;
+ webPage.selectedText();
+ }
+ {
+ QWebPage webPage;
+ webPage.triggerAction(QWebPage::Back, true);
+ }
+ {
+ QWebPage webPage;
+ QPoint pos(10,10);
+ webPage.updatePositionDependentActions(pos);
+ }
+}
+
+static void takeScreenshot(QWebPage* page)
+{
+ QWebFrame* mainFrame = page->mainFrame();
+ page->setViewportSize(mainFrame->contentsSize());
+ QImage image(page->viewportSize(), QImage::Format_ARGB32);
+ QPainter painter(&image);
+ mainFrame->render(&painter);
+ painter.end();
+}
+
+void tst_QWebPage::screenshot_data()
+{
+ QTest::addColumn<QString>("html");
+ QTest::newRow("WithoutPlugin") << "<html><body id='b'>text</body></html>";
+ QTest::newRow("WindowedPlugin") << QString("<html><body id='b'>text<embed src='resources/test.swf'></embed></body></html>");
+ QTest::newRow("WindowlessPlugin") << QString("<html><body id='b'>text<embed src='resources/test.swf' wmode='transparent'></embed></body></html>");
+}
+
+void tst_QWebPage::screenshot()
+{
+ QDir::setCurrent(SRCDIR);
+
+ QFETCH(QString, html);
+ QWebPage* page = new QWebPage;
+ page->settings()->setAttribute(QWebSettings::PluginsEnabled, true);
+ QWebFrame* mainFrame = page->mainFrame();
+ mainFrame->setHtml(html, QUrl::fromLocalFile(QDir::currentPath()));
+ if (html.contains("</embed>")) {
+ // some reasonable time for the PluginStream to feed test.swf to flash and start painting
+ QTest::qWait(2000);
+ }
+
+ // take screenshot without a view
+ takeScreenshot(page);
+
+ QWebView* view = new QWebView;
+ view->setPage(page);
+
+ // take screenshot when attached to a view
+ takeScreenshot(page);
+
+ delete page;
+ delete view;
+
+ QDir::setCurrent(QApplication::applicationDirPath());
+}
+
+void tst_QWebPage::originatingObjectInNetworkRequests()
+{
+ TestNetworkManager* networkManager = new TestNetworkManager(m_page);
+ m_page->setNetworkAccessManager(networkManager);
+ networkManager->requests.clear();
+
+ m_view->setHtml(QString("data:text/html,<frameset cols=\"25%,75%\"><frame src=\"data:text/html,"
+ "<head><meta http-equiv='refresh' content='1'></head>foo \">"
+ "<frame src=\"data:text/html,bar\"></frameset>"), QUrl());
+ QVERIFY(::waitForSignal(m_view, SIGNAL(loadFinished(bool))));
+
+ QCOMPARE(networkManager->requests.count(), 2);
+
+ QList<QWebFrame*> childFrames = m_page->mainFrame()->childFrames();
+ QCOMPARE(childFrames.count(), 2);
+
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+ for (int i = 0; i < 2; ++i)
+ QVERIFY(qobject_cast<QWebFrame*>(networkManager->requests.at(i).originatingObject()) == childFrames.at(i));
+#endif
+}
+
QTEST_MAIN(tst_QWebPage)
#include "tst_qwebpage.moc"
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebplugindatabase/qwebplugindatabase.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebplugindatabase/qwebplugindatabase.pro
new file mode 100644
index 000000000..569146abd
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebplugindatabase/qwebplugindatabase.pro
@@ -0,0 +1,11 @@
+TEMPLATE = app
+TARGET = tst_qwebplugindatabase
+include(../../../../WebKit.pri)
+SOURCES += tst_qwebplugindatabase.cpp
+QT += testlib network
+QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
+
+symbian {
+ TARGET.UID3 = 0xA000E540
+ TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices
+}
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebplugindatabase/tst_qwebplugindatabase.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebplugindatabase/tst_qwebplugindatabase.cpp
new file mode 100644
index 000000000..1ee6206c5
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebplugindatabase/tst_qwebplugindatabase.cpp
@@ -0,0 +1,437 @@
+/*
+ Copyright (C) 2009 Jakub Wieczorek <faw217@gmail.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <QtTest/QtTest>
+
+#include <qdir.h>
+#include <qwebframe.h>
+#include <qwebpage.h>
+#include <qwebplugindatabase.h>
+#include <qwebsettings.h>
+#include <qvariant.h>
+
+class tst_QWebPluginDatabase : public QObject
+{
+ Q_OBJECT
+
+private slots:
+ void installedPlugins();
+ void searchPaths();
+ void null_data();
+ void null();
+ void pluginForMimeType();
+ void enabled();
+ void operatorequal_data();
+ void operatorequal();
+ void preferredPlugin();
+ void operatorassign_data();
+ void operatorassign();
+};
+
+typedef QWebPluginInfo::MimeType MimeType;
+
+void tst_QWebPluginDatabase::installedPlugins()
+{
+ QWebPage page;
+ page.settings()->setAttribute(QWebSettings::PluginsEnabled, true);
+ QWebFrame* frame = page.mainFrame();
+
+ QVariantMap jsPluginsMap = frame->evaluateJavaScript("window.navigator.plugins").toMap();
+ QList<QWebPluginInfo> plugins = QWebSettings::pluginDatabase()->plugins();
+ QCOMPARE(plugins, QWebSettings::pluginDatabase()->plugins());
+
+ int length = jsPluginsMap["length"].toInt();
+ QCOMPARE(length, plugins.count());
+
+ for (int i = 0; i < length; ++i) {
+ QWebPluginInfo plugin = plugins.at(i);
+
+ QVariantMap jsPlugin = frame->evaluateJavaScript(QString("window.navigator.plugins[%1]").arg(i)).toMap();
+ QString name = jsPlugin["name"].toString();
+ QString description = jsPlugin["description"].toString();
+ QString fileName = jsPlugin["filename"].toString();
+
+ QCOMPARE(plugin.name(), name);
+ QCOMPARE(plugin.description(), description);
+ QCOMPARE(QFileInfo(plugin.path()).fileName(), fileName);
+
+ QList<MimeType> mimeTypes;
+ int mimeTypesCount = jsPlugin["length"].toInt();
+
+ for (int j = 0; j < mimeTypesCount; ++j) {
+ QVariantMap jsMimeType = frame->evaluateJavaScript(QString("window.navigator.plugins[%1][%2]").arg(i).arg(j)).toMap();
+
+ MimeType mimeType;
+ mimeType.name = jsMimeType["type"].toString();
+ mimeType.description = jsMimeType["description"].toString();
+ mimeType.fileExtensions = jsMimeType["suffixes"].toString().split(',', QString::SkipEmptyParts);
+
+ mimeTypes.append(mimeType);
+ QVERIFY(plugin.supportsMimeType(mimeType.name));
+ }
+
+ QCOMPARE(plugin.mimeTypes(), mimeTypes);
+
+ QVERIFY(!plugin.isNull());
+ QVERIFY(plugin.isEnabled());
+ }
+}
+
+void tst_QWebPluginDatabase::searchPaths()
+{
+ QWebPluginDatabase* database = QWebSettings::pluginDatabase();
+ QList<QWebPluginInfo> plugins = database->plugins();
+ QStringList directories = database->searchPaths();
+ QCOMPARE(QWebPluginDatabase::defaultSearchPaths(), directories);
+
+ database->setSearchPaths(directories);
+ QCOMPARE(QWebPluginDatabase::defaultSearchPaths(), directories);
+ QCOMPARE(database->searchPaths(), directories);
+ QCOMPARE(database->plugins(), plugins);
+ database->refresh();
+ QCOMPARE(database->plugins(), plugins);
+
+ database->setSearchPaths(QStringList());
+ QCOMPARE(QWebPluginDatabase::defaultSearchPaths(), directories);
+ QCOMPARE(database->searchPaths(), QStringList());
+ QCOMPARE(database->plugins().count(), 0);
+
+ database->setSearchPaths(directories);
+ QCOMPARE(database->searchPaths(), directories);
+ database->addSearchPath(QDir::tempPath());
+ QCOMPARE(database->searchPaths().count(), directories.count() + 1);
+ QVERIFY(database->searchPaths().contains(QDir::tempPath()));
+ directories.append(QDir::tempPath());
+ QCOMPARE(database->searchPaths(), directories);
+
+ // As an empty set of search paths has been set, the database has been rebuilt
+ // from scratch after bringing the old path set back.
+ // Because the QWebPlugins no longer point to the same PluginPackages,
+ // the list is also no longer equal to the older one, even though it contains
+ // the same information.
+ QCOMPARE(database->plugins().count(), plugins.count());
+ plugins = database->plugins();
+ QCOMPARE(database->plugins(), plugins);
+
+ for (int i = (directories.count() - 1); i >= 0; --i) {
+ QDir directory(directories.at(i));
+ if (!directory.exists() || !directory.count())
+ directories.removeAt(i);
+ }
+
+ database->setSearchPaths(directories);
+ QCOMPARE(database->plugins(), plugins);
+ database->refresh();
+ QCOMPARE(database->plugins(), plugins);
+
+ database->setSearchPaths(QWebPluginDatabase::defaultSearchPaths());
+ directories = QWebPluginDatabase::defaultSearchPaths();
+ QCOMPARE(QWebPluginDatabase::defaultSearchPaths(), directories);
+ QCOMPARE(database->searchPaths(), directories);
+ QCOMPARE(database->plugins(), plugins);
+}
+
+Q_DECLARE_METATYPE(QWebPluginInfo)
+void tst_QWebPluginDatabase::null_data()
+{
+ QTest::addColumn<QWebPluginInfo>("plugin");
+ QTest::addColumn<bool>("null");
+
+ QTest::newRow("null") << QWebPluginInfo() << true;
+ QTest::newRow("foo") << QWebSettings::pluginDatabase()->pluginForMimeType("foobarbaz") << true;
+
+ QList<QWebPluginInfo> plugins = QWebSettings::pluginDatabase()->plugins();
+ for (int i = 0; i < plugins.count(); ++i)
+ QTest::newRow(QString::number(i).toUtf8().constData()) << plugins.at(i) << false;
+}
+
+void tst_QWebPluginDatabase::null()
+{
+ QFETCH(QWebPluginInfo, plugin);
+ QFETCH(bool, null);
+
+ QCOMPARE(plugin.isNull(), null);
+}
+
+void tst_QWebPluginDatabase::pluginForMimeType()
+{
+ QMultiMap<QString, QWebPluginInfo> pluginsMap;
+ QWebPluginDatabase* database = QWebSettings::pluginDatabase();
+ QList<QWebPluginInfo> plugins = database->plugins();
+
+ for (int i = 0; i < plugins.count(); ++i) {
+ QWebPluginInfo plugin = plugins.at(i);
+
+ QList<MimeType> mimeTypes = plugin.mimeTypes();
+ for (int j = 0; j < mimeTypes.count(); ++j) {
+ QString mimeType = mimeTypes.at(j).name;
+ pluginsMap.insert(mimeType, plugin);
+ QVERIFY(plugin.supportsMimeType(mimeType));
+ }
+ }
+
+ for (int i = 0; i < plugins.count(); ++i) {
+ QWebPluginInfo plugin = plugins.at(i);
+
+ QList<MimeType> mimeTypes = plugin.mimeTypes();
+ for (int j = 0; j < mimeTypes.count(); ++j) {
+ QString mimeType = mimeTypes.at(j).name;
+
+ QVERIFY(pluginsMap.count(mimeType) > 0);
+ if (pluginsMap.count(mimeType) > 1)
+ continue;
+
+ QWebPluginInfo pluginForMimeType = database->pluginForMimeType(mimeType);
+ QCOMPARE(pluginForMimeType, plugin);
+ database->setSearchPaths(database->searchPaths());
+ QCOMPARE(pluginForMimeType, plugin);
+ QCOMPARE(pluginForMimeType, database->pluginForMimeType(mimeType.toUpper()));
+ QCOMPARE(pluginForMimeType, database->pluginForMimeType(mimeType.toLower()));
+ QVERIFY(plugin.supportsMimeType(mimeType));
+ QVERIFY(!pluginForMimeType.isNull());
+ QVERIFY(!plugin.isNull());
+ }
+ }
+}
+
+void tst_QWebPluginDatabase::enabled()
+{
+ QMultiMap<QString, QWebPluginInfo> pluginsMap;
+ QWebPluginDatabase* database = QWebSettings::pluginDatabase();
+ QList<QWebPluginInfo> plugins = database->plugins();
+
+ for (int i = 0; i < plugins.count(); ++i) {
+ QWebPluginInfo plugin = plugins.at(i);
+
+ QList<MimeType> mimeTypes = plugin.mimeTypes();
+ for (int j = 0; j < mimeTypes.count(); ++j) {
+ QString mimeType = mimeTypes.at(j).name;
+ pluginsMap.insert(mimeType, plugin);
+ QVERIFY(plugin.supportsMimeType(mimeType));
+ }
+ }
+
+ QMultiMap<QString, QWebPluginInfo>::iterator it = pluginsMap.begin();
+ while (it != pluginsMap.end()) {
+ QString mimeType = it.key();
+ QWebPluginInfo plugin = it.value();
+ QWebPluginInfo pluginForMimeType = database->pluginForMimeType(mimeType);
+
+ QVERIFY(pluginsMap.count(mimeType) > 0);
+
+ if (pluginsMap.count(mimeType) == 1) {
+ QCOMPARE(plugin, pluginForMimeType);
+
+ QVERIFY(plugin.isEnabled());
+ QVERIFY(pluginForMimeType.isEnabled());
+ plugin.setEnabled(false);
+ QVERIFY(!plugin.isEnabled());
+ QVERIFY(!pluginForMimeType.isEnabled());
+ } else {
+ QVERIFY(plugin.isEnabled());
+ QVERIFY(pluginForMimeType.isEnabled());
+ plugin.setEnabled(false);
+ QVERIFY(!plugin.isEnabled());
+ }
+
+ QVERIFY(!plugin.isNull());
+ QVERIFY(!pluginForMimeType.isNull());
+
+ QWebPluginInfo pluginForMimeType2 = database->pluginForMimeType(mimeType);
+ if (pluginsMap.count(mimeType) == 1) {
+ QVERIFY(pluginForMimeType2 != plugin);
+ QVERIFY(pluginForMimeType2.isNull());
+ } else {
+ QVERIFY(pluginForMimeType2 != plugin);
+ QVERIFY(!pluginForMimeType2.isNull());
+ }
+
+ plugin.setEnabled(true);
+
+ ++it;
+ }
+}
+
+void tst_QWebPluginDatabase::operatorequal_data()
+{
+ QTest::addColumn<QWebPluginInfo>("first");
+ QTest::addColumn<QWebPluginInfo>("second");
+ QTest::addColumn<bool>("equal");
+
+ QWebPluginDatabase* database = QWebSettings::pluginDatabase();
+ QTest::newRow("null") << QWebPluginInfo() << QWebPluginInfo() << true;
+ QTest::newRow("application/x-shockwave-flash") << database->pluginForMimeType("application/x-shockwave-flash")
+ << database->pluginForMimeType("application/x-shockwave-flash") << true;
+ QTest::newRow("foo/bar-baz") << database->pluginForMimeType("foo/bar-baz")
+ << database->pluginForMimeType("foo/bar-baz") << true;
+
+ QList<QWebPluginInfo> plugins = database->plugins();
+ for (int i = 0; i < (plugins.count() - 1); ++i) {
+ QWebPluginInfo first = plugins.at(i);
+ QWebPluginInfo second = plugins.at(i + 1);
+
+ QTest::newRow(QString("%1==%2").arg(first.name(), second.name()).toUtf8().constData())
+ << first << second << false;
+ }
+}
+
+void tst_QWebPluginDatabase::operatorequal()
+{
+ QFETCH(QWebPluginInfo, first);
+ QFETCH(QWebPluginInfo, second);
+ QFETCH(bool, equal);
+
+ QCOMPARE(first == second, equal);
+}
+
+void tst_QWebPluginDatabase::preferredPlugin()
+{
+ QMultiMap<QString, QWebPluginInfo> pluginsMap;
+ QWebPluginDatabase* database = QWebSettings::pluginDatabase();
+ QList<QWebPluginInfo> plugins = database->plugins();
+
+ for (int i = 0; i < plugins.count(); ++i) {
+ QWebPluginInfo plugin = plugins.at(i);
+
+ QList<MimeType> mimeTypes = plugin.mimeTypes();
+ for (int j = 0; j < mimeTypes.count(); ++j) {
+ QString mimeType = mimeTypes.at(j).name;
+ pluginsMap.insert(mimeType, plugin);
+ }
+ }
+
+ QMultiMap<QString, QWebPluginInfo>::iterator it = pluginsMap.begin();
+ while (it != pluginsMap.end()) {
+ QString mimeType = it.key();
+
+ if (pluginsMap.count(mimeType) > 1) {
+ QList<QWebPluginInfo> pluginsForMimeType = pluginsMap.values(mimeType);
+ QWebPluginInfo plugin = database->pluginForMimeType(mimeType);
+ QVERIFY(plugin.supportsMimeType(mimeType));
+
+ pluginsForMimeType.removeAll(plugin);
+ for (int i = 0; i < pluginsForMimeType.count(); ++i) {
+ QWebPluginInfo anotherPlugin = pluginsForMimeType.at(i);
+ QVERIFY(plugin.supportsMimeType(mimeType));
+ QVERIFY(plugin != anotherPlugin);
+
+ QCOMPARE(database->pluginForMimeType(mimeType), plugin);
+ database->setPreferredPluginForMimeType(mimeType, anotherPlugin);
+ QCOMPARE(database->pluginForMimeType(mimeType), anotherPlugin);
+
+ anotherPlugin.setEnabled(false);
+ QCOMPARE(database->pluginForMimeType(mimeType), plugin);
+
+ anotherPlugin.setEnabled(true);
+ QCOMPARE(database->pluginForMimeType(mimeType), anotherPlugin);
+ database->setSearchPaths(database->searchPaths());
+ QCOMPARE(database->pluginForMimeType(mimeType), anotherPlugin);
+
+ database->setPreferredPluginForMimeType(mimeType, QWebPluginInfo());
+ QCOMPARE(database->pluginForMimeType(mimeType), plugin);
+ }
+ } else {
+ QWebPluginInfo plugin = database->pluginForMimeType(mimeType);
+ QCOMPARE(pluginsMap.value(mimeType), plugin);
+
+ database->setPreferredPluginForMimeType(mimeType, plugin);
+ QCOMPARE(database->pluginForMimeType(mimeType), plugin);
+
+ plugin.setEnabled(false);
+ QCOMPARE(database->pluginForMimeType(mimeType), QWebPluginInfo());
+ plugin.setEnabled(true);
+
+ database->setPreferredPluginForMimeType(mimeType, QWebPluginInfo());
+ QCOMPARE(database->pluginForMimeType(mimeType), plugin);
+ }
+
+ ++it;
+ }
+
+ if (pluginsMap.keys().count() >= 2) {
+ QStringList mimeTypes = pluginsMap.uniqueKeys();
+
+ QString mimeType1 = mimeTypes.at(0);
+ QString mimeType2 = mimeTypes.at(1);
+ QWebPluginInfo plugin1 = database->pluginForMimeType(mimeType1);
+ QWebPluginInfo plugin2 = database->pluginForMimeType(mimeType2);
+
+ int i = 2;
+ while (plugin2.supportsMimeType(mimeType1)
+ && !mimeType2.isEmpty()
+ && i < mimeTypes.count()) {
+ mimeType2 = mimeTypes.at(i);
+ plugin2 = database->pluginForMimeType(mimeType2);
+ ++i;
+ }
+
+ plugin1 = database->pluginForMimeType(mimeType1);
+ QVERIFY(plugin1.supportsMimeType(mimeType1));
+ QVERIFY(!plugin1.isNull());
+ plugin2 = database->pluginForMimeType(mimeType2);
+ QVERIFY(plugin2.supportsMimeType(mimeType2));
+ QVERIFY(!plugin2.isNull());
+
+ database->setPreferredPluginForMimeType(mimeType2, plugin1);
+ QVERIFY(!plugin1.supportsMimeType(mimeType2));
+ QCOMPARE(database->pluginForMimeType(mimeType2), plugin2);
+
+ database->setPreferredPluginForMimeType(mimeType1, plugin1);
+ QVERIFY(!plugin2.supportsMimeType(mimeType1));
+ QCOMPARE(database->pluginForMimeType(mimeType2), plugin2);
+ }
+}
+
+void tst_QWebPluginDatabase::operatorassign_data()
+{
+ QTest::addColumn<QWebPluginInfo>("first");
+ QTest::addColumn<QWebPluginInfo>("second");
+
+ QWebPluginDatabase* database = QWebSettings::pluginDatabase();
+ QTest::newRow("null") << QWebPluginInfo() << QWebPluginInfo();
+
+ QList<QWebPluginInfo> plugins = database->plugins();
+ for (int i = 0; i < (plugins.count() - 1); ++i) {
+ QWebPluginInfo first = plugins.at(i);
+ QWebPluginInfo second = plugins.at(i + 1);
+
+ QTest::newRow(QString("%1=%2").arg(first.name(), second.name()).toUtf8().constData()) << first << second;
+ }
+}
+
+void tst_QWebPluginDatabase::operatorassign()
+{
+ QFETCH(QWebPluginInfo, first);
+ QFETCH(QWebPluginInfo, second);
+
+ QWebPluginInfo info;
+ QCOMPARE(info.mimeTypes(), QList<MimeType>());
+ QCOMPARE(info = first, first);
+ QCOMPARE(info, first);
+ QCOMPARE(info.mimeTypes(), first.mimeTypes());
+ QCOMPARE(info = second, second);
+ QCOMPARE(info, second);
+ QCOMPARE(info.mimeTypes(), second.mimeTypes());
+ QCOMPARE(info = QWebPluginInfo(), QWebPluginInfo());
+ QCOMPARE(info.mimeTypes(), QList<MimeType>());
+}
+
+QTEST_MAIN(tst_QWebPluginDatabase)
+
+#include "tst_qwebplugindatabase.moc"
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/data/frame_a.html b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/data/frame_a.html
new file mode 100644
index 000000000..9ff68f13a
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/data/frame_a.html
@@ -0,0 +1,2 @@
+<a href="http://google.com" target="frame_b"><img src="" width=100 height=100 alt="Google"></a>
+<a href="http://yahoo.com" target="frame_b"><img src="" width=100 height=100 alt="Yahoo"></a>
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/data/index.html b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/data/index.html
new file mode 100644
index 000000000..c53ad09a7
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/data/index.html
@@ -0,0 +1,4 @@
+<frameset cols="25%,75%">
+ <frame src="frame_a.html" name="frame_a">
+ <frame src="frame_b.html" name="frame_b">
+</frameset>
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/qwebview.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/qwebview.pro
index 799ccfb32..735537ba2 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/qwebview.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/qwebview.pro
@@ -4,3 +4,10 @@ include(../../../../WebKit.pri)
SOURCES += tst_qwebview.cpp
QT += testlib network
QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
+RESOURCES += tst_qwebview.qrc
+DEFINES += SRCDIR=\\\"$$PWD/\\\"
+
+symbian {
+ TARGET.UID3 = 0xA000E53F
+ TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices
+}
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.cpp
index 6501bfc3e..27daf3841 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.cpp
@@ -1,6 +1,7 @@
/*
Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
Copyright (C) 2009 Torch Mobile Inc.
+ Copyright (C) 2009 Girish Ramakrishnan <girish@forwardbias.in>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
@@ -19,12 +20,15 @@
*/
#include <qtest.h>
+#include "../util.h"
#include <qpainter.h>
#include <qwebview.h>
#include <qwebpage.h>
#include <qnetworkrequest.h>
#include <qdiriterator.h>
+#include <qwebkitversion.h>
+#include <qwebframe.h>
class tst_QWebView : public QObject
{
@@ -38,8 +42,12 @@ public slots:
private slots:
void renderHints();
- void guessUrlFromString_data();
- void guessUrlFromString();
+ void getWebKitVersion();
+
+ void reusePage_data();
+ void reusePage();
+
+ void crashTests();
};
// This will be called before the first test function is executed.
@@ -98,68 +106,91 @@ void tst_QWebView::renderHints()
QVERIFY(!(webView.renderHints() & QPainter::HighQualityAntialiasing));
}
-void tst_QWebView::guessUrlFromString_data()
+void tst_QWebView::getWebKitVersion()
{
- QTest::addColumn<QString>("string");
- QTest::addColumn<QUrl>("guessUrlFromString");
-
- // Null
- QTest::newRow("null") << QString() << QUrl();
-
- // File
- QDirIterator it(QDir::homePath());
- QString fileString;
- int c = 0;
- while (it.hasNext()) {
- it.next();
- QTest::newRow(QString("file-%1").arg(c++).toLatin1()) << it.filePath() << QUrl::fromLocalFile(it.filePath());
- }
+ QVERIFY(qWebKitVersion().toDouble() > 0);
+}
- // basic latin1
- QTest::newRow("unicode-0") << QString::fromUtf8("å.com/") << QUrl::fromEncoded(QString::fromUtf8("http://å.com/").toUtf8(), QUrl::TolerantMode);
- // unicode
- QTest::newRow("unicode-1") << QString::fromUtf8("λ.com/") << QUrl::fromEncoded(QString::fromUtf8("http://λ.com/").toUtf8(), QUrl::TolerantMode);
-
- // no scheme
- QTest::newRow("add scheme-0") << "webkit.org" << QUrl("http://webkit.org");
- QTest::newRow("add scheme-1") << "www.webkit.org" << QUrl("http://www.webkit.org");
- QTest::newRow("add scheme-2") << "ftp.webkit.org" << QUrl("ftp://ftp.webkit.org");
- QTest::newRow("add scheme-3") << "webkit" << QUrl("webkit");
-
- // QUrl's tolerant parser should already handle this
- QTest::newRow("not-encoded-0") << "http://webkit.org/test page.html" << QUrl("http://webkit.org/test%20page.html");
-
- // Make sure the :80, i.e. port doesn't screw anything up
- QUrl portUrl("http://webkit.org");
- portUrl.setPort(80);
- QTest::newRow("port-0") << "webkit.org:80" << portUrl;
- QTest::newRow("port-1") << "http://webkit.org:80" << portUrl;
-
- // mailto doesn't have a ://, but is valid
- QUrl mailto("ben@meyerhome.net");
- mailto.setScheme("mailto");
- QTest::newRow("mailto") << "mailto:ben@meyerhome.net" << mailto;
-
- // misc
- QTest::newRow("localhost-0") << "localhost" << QUrl("http://localhost");
- QTest::newRow("localhost-1") << "localhost:80" << QUrl("http://localhost:80");
- QTest::newRow("spaces-0") << " http://webkit.org/test page.html " << QUrl("http://webkit.org/test%20page.html");
-
- // FYI: The scheme in the resulting url user
- QUrl authUrl("user:pass@domain.com");
- QTest::newRow("misc-1") << "user:pass@domain.com" << authUrl;
+void tst_QWebView::reusePage_data()
+{
+ QTest::addColumn<QString>("html");
+ QTest::newRow("WithoutPlugin") << "<html><body id='b'>text</body></html>";
+ QTest::newRow("WindowedPlugin") << QString("<html><body id='b'>text<embed src='resources/test.swf'></embed></body></html>");
+ QTest::newRow("WindowlessPlugin") << QString("<html><body id='b'>text<embed src='resources/test.swf' wmode=\"transparent\"></embed></body></html>");
}
-// public static QUrl guessUrlFromString(QString const& string)
-void tst_QWebView::guessUrlFromString()
+void tst_QWebView::reusePage()
{
- QFETCH(QString, string);
- QFETCH(QUrl, guessUrlFromString);
+ QDir::setCurrent(SRCDIR);
+
+ QFETCH(QString, html);
+ QWebView* view1 = new QWebView;
+ QPointer<QWebPage> page = new QWebPage;
+ view1->setPage(page);
+ page->settings()->setAttribute(QWebSettings::PluginsEnabled, true);
+ QWebFrame* mainFrame = page->mainFrame();
+ mainFrame->setHtml(html, QUrl::fromLocalFile(QDir::currentPath()));
+ if (html.contains("</embed>")) {
+ // some reasonable time for the PluginStream to feed test.swf to flash and start painting
+ QTest::qWait(2000);
+ }
- QUrl url = QWebView::guessUrlFromString(string);
- QCOMPARE(url, guessUrlFromString);
+ view1->show();
+ QTest::qWait(2000);
+ delete view1;
+ QVERIFY(page != 0); // deleting view must not have deleted the page, since it's not a child of view
+
+ QWebView *view2 = new QWebView;
+ view2->setPage(page);
+ view2->show(); // in Windowless mode, you should still be able to see the plugin here
+ QTest::qWait(2000);
+ delete view2;
+
+ delete page; // must not crash
+
+ QDir::setCurrent(QApplication::applicationDirPath());
}
+// Class used in crashTests
+class WebViewCrashTest : public QObject {
+ Q_OBJECT
+ QWebView* m_view;
+public:
+ bool m_executed;
+
+
+ WebViewCrashTest(QWebView* view)
+ : m_view(view)
+ , m_executed(false)
+ {
+ view->connect(view, SIGNAL(loadProgress(int)), this, SLOT(loading(int)));
+ }
+
+private slots:
+ void loading(int progress)
+ {
+ if (progress >= 20 && progress < 90) {
+ QVERIFY(!m_executed);
+ m_view->stop();
+ m_executed = true;
+ }
+ }
+};
+
+
+// Should not crash.
+void tst_QWebView::crashTests()
+{
+ // Test if loading can be stopped in loadProgress handler without crash.
+ // Test page should have frames.
+ QWebView view;
+ WebViewCrashTest tester(&view);
+ QUrl url("qrc:///data/index.html");
+ view.load(url);
+ QTRY_VERIFY(tester.m_executed); // If fail it means that the test wasn't executed.
+}
+
+
QTEST_MAIN(tst_QWebView)
#include "tst_qwebview.moc"
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.qrc b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.qrc
new file mode 100644
index 000000000..ede34a983
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.qrc
@@ -0,0 +1,7 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>data/index.html</file>
+ <file>data/frame_a.html</file>
+</qresource>
+</RCC>
+
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/resources/test.swf b/src/3rdparty/webkit/WebKit/qt/tests/resources/test.swf
new file mode 100644
index 000000000..895298271
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/tests/resources/test.swf
Binary files differ
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/tests.pro b/src/3rdparty/webkit/WebKit/qt/tests/tests.pro
index 7000d32f0..939cd224a 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/tests.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/tests.pro
@@ -1,4 +1,4 @@
TEMPLATE = subdirs
-SUBDIRS = qwebframe qwebpage qwebelement qwebhistoryinterface qwebview qwebhistory
-SUBDIRS += benchmarks/painting/tst_painting.pro benchmarks/loading/tst_loading.pro
+SUBDIRS = qwebframe qwebpage qwebelement qgraphicswebview qwebhistoryinterface qwebview qwebhistory
+greaterThan(QT_MINOR_VERSION, 4): SUBDIRS += benchmarks/painting/tst_painting.pro benchmarks/loading/tst_loading.pro
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/util.h b/src/3rdparty/webkit/WebKit/qt/tests/util.h
new file mode 100644
index 000000000..7f7e6137b
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/tests/util.h
@@ -0,0 +1,48 @@
+/*
+ Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+// Functions and macros that really need to be in QTestLib
+
+// Will try to wait for the condition while allowing event processing
+#define QTRY_VERIFY(__expr) \
+ do { \
+ const int __step = 50; \
+ const int __timeout = 5000; \
+ if (!(__expr)) { \
+ QTest::qWait(0); \
+ } \
+ for (int __i = 0; __i < __timeout && !(__expr); __i+=__step) { \
+ QTest::qWait(__step); \
+ } \
+ QVERIFY(__expr); \
+ } while(0)
+
+// Will try to wait for the condition while allowing event processing
+#define QTRY_COMPARE(__expr, __expected) \
+ do { \
+ const int __step = 50; \
+ const int __timeout = 5000; \
+ if ((__expr) != (__expected)) { \
+ QTest::qWait(0); \
+ } \
+ for (int __i = 0; __i < __timeout && ((__expr) != (__expected)); __i+=__step) { \
+ QTest::qWait(__step); \
+ } \
+ QCOMPARE(__expr, __expected); \
+ } while(0)
+
diff --git a/src/3rdparty/webkit/WebKit/scripts/generate-webkitversion.pl b/src/3rdparty/webkit/WebKit/scripts/generate-webkitversion.pl
new file mode 100644
index 000000000..0feb7707d
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/scripts/generate-webkitversion.pl
@@ -0,0 +1,136 @@
+#!/usr/bin/perl
+
+# Based on make_names.pl
+#
+# Copyright (C) 2005, 2006, 2007, 2009 Apple Inc. All rights reserved.
+# Copyright (C) 2009, Julien Chaffraix <jchaffraix@webkit.org>
+# Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
+# Copyright (C) 2009 Robert Hogan <robert@roberthogan.net>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+# its contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# This script reads Version.xcconfig and returns either or both of the major and minor
+# WebKit version numbers. It is currently used by WebKit.pri.
+
+use strict;
+
+use Config;
+use Getopt::Long;
+use File::Path;
+use Switch;
+
+my $usage = "generate-webkitversion --config WebKit/mac/Configurations/Version.xcconfig --outputDir <outputdir>";
+
+my $major_version = "";
+my $minor_version = "";
+# The appropriate Apple-maintained Version.xcconfig file for WebKit version information is in WebKit/mac/Configurations/.
+my $configFile = "./WebKit/mac/Configurations/Version.xcconfig";
+my $outputDir = "";
+
+GetOptions('config=s' => \$configFile,
+ 'outputDir=s' => \$outputDir);
+
+die "You must specify a --config <file> " unless (length($configFile));
+die "You must specify a --outputDir <outputdir> " unless (length($outputDir));
+
+die "./WebKit/mac/Configurations/Version.xcconfig does not exist: use --config <file> to specify its correct location." unless (-e $configFile);
+die "$outputDir/ does not exist: use --outputDir <directory> to specify the location of an output directory that exists" unless (-e "$outputDir");
+
+unless (open INPUT, "<", $configFile) { print STDERR "File does not exist: $configFile\n";}
+while (my $line = <INPUT>) {
+ chomp $line;
+ if ($line =~ /^MAJOR_VERSION\s+=\s+\d+;/) {
+ $line =~ s/^(MAJOR_VERSION)\s+(=)\s+(\d+);/$3/;
+ $major_version = $line;
+ }
+ if ($line =~ /^MINOR_VERSION\s+=\s+\d+;/) {
+ $line =~ s/^(MINOR_VERSION)\s+(=)\s+(\d+);/$3/;
+ $minor_version = $line;
+ }
+}
+
+$major_version = "531" unless (length($major_version));
+$minor_version = "3" unless (length($minor_version));
+
+my $webKitVersionPath = "$outputDir/WebKitVersion.h";
+
+printWebKitVersionHeaderFile("$webKitVersionPath");
+
+sub printLicenseHeader
+{
+ my $F = shift;
+ print F "/*
+ * THIS FILE IS AUTOMATICALLY GENERATED, DO NOT EDIT.
+ *
+ *
+ * Copyright (C) 2009 Apple Computer, Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+";
+}
+
+sub printWebKitVersionHeaderFile
+{
+ my $headerPath = shift;
+ my $F;
+ open F, ">$headerPath";
+
+ printLicenseHeader($F);
+
+ print F "#ifndef WebKitVersion_h\n";
+ print F "#define WebKitVersion_h\n\n";
+
+ print F "#define WEBKIT_MAJOR_VERSION $major_version\n";
+ print F "#define WEBKIT_MINOR_VERSION $minor_version\n\n";
+
+ print F "#endif //WebKitVersion_h\n";
+
+ close F;
+}
+
+
+