summaryrefslogtreecommitdiffstats
path: root/src/webenginewidgets
Commit message (Collapse)AuthorAgeFilesLines
* Avoid black flashes when showing a new QWebEngineViewJocelyn Turcotte2014-05-281-1/+1
| | | | | | | | | | | | | | QPlatformBackingStore still doesn't enable blending when compositing a QOpenGLWidget with the rest of the widget tree. This means that a tranparent pixel will show as black. Until we get to properly go through the work of making it possible to render a transparent webview, set the glClear color to white in order to avoid seeing any black background before we get our first frame from Chromium. Change-Id: Idf7bb831a3b0d62b02f2527e2a15d830bf1e8ad4 Reviewed-by: Michael Bruning <michael.bruning@digia.com>
* Fix some more documentation.Michael Brüning2014-05-194-110/+132
| | | | | | | | | Adds the license for Chromium to the legalese part. Adds some missing documentation to QWebEngineView and QWebEnginePage. Change-Id: Ie81aaa87db85bb72efb83680defbdb101a134df0 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* [Widgets] Tooltip word wrap fixupPierre Rossi2014-05-161-1/+6
| | | | | | | | | | | QTooltip's documentation states that "rich text displayed in a tool tip is implicitly word-wrapped". This seems to be a more desirable behavior for our needs. To mitigate any potential malicious tooltip contents, we escape any eventual html entities, and truncate to a reasonable size. Change-Id: Iae3ea80e7660840aae39d228d1177dcc56f4a032 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Remove the webpage snippet for now.Michael Brüning2014-05-163-115/+0
| | | | | | | | | | This snippet contains API that we might not support at all. It is better to remove it and add a new version in case we reintroduce this than to present a snippet that does not work or only works partially. Change-Id: Ia47ad69108ddcbe529aecff8e4f235b17d80514f Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Add linkHovered support for Widgets APISzabolcs David2014-05-153-1/+8
| | | | | | | | Drop hovered title and link text parameters, as we did in the Quick API. Change-Id: Ia1a38e0d728afbcbb6858a890486772da74aa813 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Remove the xPath argument from runJavaScriptJocelyn Turcotte2014-05-122-6/+6
| | | | | | | | | | | | | | This value is only used internally by Chromium and risks being removed at anytime, for which we would then have to maintain a downstream implementation. Chromium also only supports frame values, while a complete support of the interface would require also supporting this xPath to point to individual document element by affecting the value of "this", the same way that QWebElement::evaluateJavaScript allowed in QtWebKit. Change-Id: Id0cb1b8e3bdf9a6db0ca786fb5eb46ffd726d165 Reviewed-by: Michael Bruning <michael.bruning@digia.com>
* Fix up some more documentation.Michael Brüning2014-05-124-158/+95
| | | | | | | | | | Removes methods from the documentation that no longer exist. Removes left over instance of Qt WebKit / WebKit instead of Qt WebEngine / Chromium in the documentation. Change-Id: I27e1d41fc16116a60f94c3369f76ddfed60e4380 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Append MessageLevel postfix to the JavaScriptConsoleMessageLevel.Michael Brüning2014-05-121-3/+3
| | | | | | | This keeps consistency with the other enum names. Change-Id: Idaedb8566fd770b05effeeba377b09a84bf0af12 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Fix double clicks needing three presses in QWebEngineViewJocelyn Turcotte2014-05-081-1/+14
| | | | | | | | | | | | | | Since Qt 5.3 QWidget has the same behavior as Qt 4 where it will replace a second MouseButtonPress event with a MouseButtonDblClick instead of sending both. Fix the issue by moving the MouseButtonDblClick ignore code up to the QtQuick code, assume that upper layers will not send MouseButtonDblClick events, and re-replace the MouseButtonDblClick event with a MouseButtonPress in the QtWidgets code. Change-Id: I529dad2de538f486b00eb900ea6d2ed849a3b1f0 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Add test_baseUrlAfterLoadHtml QML test caseSzabolcs David2014-05-081-1/+1
| | | | | | | | Remove unreachableUrl support from WebContentsAdapter::setContent, because this argument behaves exactly the same as baseUrl. Change-Id: I36f92b99b7045c6d3b831481bb04d51a0e05772f Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Properly cleanup the old page when attaching a new oneJocelyn Turcotte2014-05-072-0/+8
| | | | | | | | | | | | | | | | | | | This patch fixes two issues: - The RWHV delegate of the old page would not be detached from the view when attaching a new page to that view. Call reattachRWHV as we do on the new page to make sure that the delegate gets unparented from the view. - QtWebKit documents that a page having the view as its QObject parent should be deleted when setPage is called with a new page. This would cause QupZilla to leak the page when opening a new window through a link. This also adds a workaround to avoid a crash when unparenting the delegate where QOpenGLWidget would try to call paintGL without a valid QSurface. Change-Id: Icd2659f441d2220c26dc175d66424e6c26125861 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Add linkHovered signal to the QQuickWebEngineViewSzabolcs David2014-05-051-0/+1
| | | | | | | | I dropped hovered title support from the QtWebKit API, it seems we don't need that logic. Change-Id: I5617c295344512a35aa526a6f1307f0b21f866d6 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* WebRTC Widgets APIPierre Rossi2014-04-293-1/+61
| | | | | | | | Simply reuse the existing feature request approach that was used for geolocation and notifications in QtWebKit. Change-Id: I8fec4f4e9e81b491163912fadb4ce17d343864dd Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Add WebRTC supportPierre Rossi2014-04-291-0/+1
| | | | | | | | | | | | | Reuse the MediaCaptureDevicesDispatcher from the chrome layer, pretty much as is, and wire it in with WebContentsDelegateQt and WebContentsAdapter/WebContentsAdapterClient for API delegation. We also need to ensure that our user agent string mentions Chrome and the Chrome version we're based on, in order to please websites that detect feature support that way. Change-Id: I0ddf8cd34e4add96bc36f59adfe8e0384e728d93 Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Add a way of using UI dialogs for authorizationPierre Rossi2014-04-291-0/+3
| | | | | | | | We could use this to prompt the user for various feature permissions that we are not ready to expose in our API. Change-Id: If6e6a16aca4142b0564121dfc7677b7c4996f742 Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Cleanup the QtWebEngineWidgets public headers and APIJocelyn Turcotte2014-04-1518-3404/+8
| | | | | | | | | | | | | Headers were left intact to leave a trace of the evolution compared to the QtWebKit API and to make it easier to work until we had a basic subset of the API implemented. With the upcoming release, this patch removes this convenience in the aim of starting polishing the headers and the documentation for the upcoming release. Change-Id: Iae436b4ec041d771a7002575e122835802bc9f3e Reviewed-by: Michael Bruning <michael.bruning@digia.com>
* Replace uses of QWebEngineFrame with a security origin URLJocelyn Turcotte2014-04-153-18/+18
| | | | | | | | This changes implemented methods. The rest of the references will go away with the public headers cleanup. Change-Id: I82340cd7a4488c4b463489ae98cd9c16de4e7487 Reviewed-by: Michael Bruning <michael.bruning@digia.com>
* Update QWebEnginePage::WebWindowTypeJocelyn Turcotte2014-04-153-4/+21
| | | | | | | | | | | Expose the same values as currently available in QQuickWebEngineView::NewViewDestination. Rename the WebModalDialog to WebDialog, which actually replaces the tool/status/menuBarVisibilityChangeRequested signals. Change-Id: Icc103f434fb3eca49f1a53e476e101c3d6fffd36 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Fix how NewPopupDisposition is exposed in QQuickWebEngineViewJocelyn Turcotte2014-04-152-2/+3
| | | | | | | | | | | | | | | | | | I initially misintepreted the meaning of the enum, assuming that it meant that the window should possibly be blocked. The user_gesture parameter in WebContentsDelegate::AddNewContents is actually doing this, while the popup disposition means that JavaScript requested the window to be opened without one of the standard decoration (i.e. status bar, menu bar, tool bar, etc.). Update the QtQuick API to reflect this, renaming the "isPopup" parameter to a more familiar "isUserInitiated". The popup disposition is named "dialog" to match the previous QWebPage::WebModalDialog enum. Change-Id: Ib0c4bc53671fcf0dd9499aa1be2bbc8c494ba49e Reviewed-by: Michael Bruning <michael.bruning@digia.com>
* Map Javascript console message level to enum values.Michael Brüning2014-04-143-5/+12
| | | | | | | | Translates the internally used LogSeverity values to enums defined by the QtWebEngine integration layer. Change-Id: I7da0983d4fb5c199e1a2436b5899a43cf6698784 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* First iteration of adujsting widgets docs and snipperts.Michael Brüning2014-04-104-26/+18
| | | | | | | | * Removes inappropriate licensing info. * Corrects simple snippet. Change-Id: I9ac7738d8da22957aa32c91fdcbf81ddedefed72 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Fix an false positive assertion with context menuPierre Rossi2014-04-101-0/+3
| | | | | | | | | | | | Due to the asynchronous nature of context menu events in chromium, we need to filter out the Qt generated events, and rely of what comes back from the chromium side. We keep a flag to ensure we're always in a consistent state, but the part re-setting it in QWEView went missing. This simply re-adds it together with initializing it to false upon view construction. Change-Id: I5d187faf93742898c96a1951b7dc477ce1b3f5bd Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* Widgets: Fix a crash on shutdownJocelyn Turcotte2014-04-092-2/+3
| | | | | | | | | The root node doesn't clean itself up immediately inside the SG renderer when destroyed. Just avoid the issue by destroying the renderer first. Change-Id: I833b7fdc411f149631fd13d1c1fca515b9402bf4 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Get rid of the BackingStore rendering pathJocelyn Turcotte2014-04-084-14/+7
| | | | | | | | | Now that the widgets view is also using the delegated renderer, there are no supported configuration that use the BackingStore rendering path, itself on the way of deprecation in Chromium. Change-Id: I4ab889f6a7c65e8447c259faf2c7a98b88c1acf5 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Render the widgets view using the scene graph into a QOpenGLWidgetJocelyn Turcotte2014-04-086-37/+121
| | | | | | | | | | | | | | | This means that widgets application now need to setup the GL context sharing as well. QWebEngineWidgets::initialize() must be called, which has the same effect as QWebEngine::initialize(). The QtWebEngineWidgets now depends on the QtWebEngine module to make this happen. Since QOpenGLWidget is only available in Qt 5.3, this patch also disables the webenginewidgets module completely when building using Qt 5.2. Change-Id: I0e99a779d1eb080f2ccf5a338ff0763ad64e6eba Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Revert part of the RenderWidgetHostViewQtDelegate refactoringJocelyn Turcotte2014-04-089-414/+98
| | | | | | | | | | | This reverts parts of commit 9c198939be1ef064d1a2430a4b9991f2fe16f359. This does keeps the popup fixes and removes support for QWebEnginePage::setViewportSize and QWebEnginePage::render until we can evaluate the needs vs the cost of such feature. Change-Id: I1b55b751d463717b1462393ea8cd353422f8fdbb Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Prevent an embarassing crashPierre Rossi2014-03-311-1/+1
| | | | | | | if people do something as nasty as "return this;" in createWindow. Change-Id: Id9c3e22607e4676b7ea286a6f85816b347262615 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Implement QWebEngineHistoryItem::lastVisitedJocelyn Turcotte2014-03-311-2/+2
| | | | | | Change-Id: I105cb2a0a2479b146e2ab68db6d194ac2ac2d3f9 Reviewed-by: Andras Becsi <andras.becsi@digia.com> Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Fix tst_QWebEngineHistory::clear()Jocelyn Turcotte2014-03-311-0/+1
| | | | | | | Make sure that the navigation actions are updated when clearing the history. Change-Id: I663d2b68164dd695005165595ea08d051aae9fab Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Implement QWebEngineHistory serializationJocelyn Turcotte2014-03-313-4/+12
| | | | | | | | | | | | | | This does uses logic taken from Chromium's state save and restore code. The history version is incremented from the same method in QtWebKit in cases where the application would try loading a stream from a previous version using QtWebKit. In all cases where Chromium does a restore of a serialized history, it does so on a fresh WebContents instance, thus we must do the same and some of the initialization code has to be updated. Change-Id: I45abb052073bd44c9cb47bc2abcf4b558fe3dbbd Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Do not store a WebContentsAdapter directly in QWebEngineHistoryJocelyn Turcotte2014-03-314-31/+31
| | | | | | | | The adapter might change, while the page association should always remain. Change-Id: Ib2b49c599d497864484dd6758f47473d70fe4cb3 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Rough port of the documentation to QtWebEngineJocelyn Turcotte2014-03-3111-742/+669
| | | | | | | | | | | | | | | This is a gross mechanical modification of the documentation, along with build system bindings to allow it to generate. This should allow doing iterative improvements to the documentation from now on. This fixes project-related qdoc warnings but we still need to do some serious work to get the documentation better fitting QtWebEngine. All the documentation is ported to match the current state of our headers (without trying to adapt to modified APIs yet) and we should clear the part of the documentation that we don't need at the same time that we clean up our public headers. Change-Id: I6fb4e10e8b4c1c53be7bc7c581286248ac04d4da Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Import the QtWebKit documentationJocelyn Turcotte2014-03-3117-0/+4308
| | | | | | | | | | | | This places the documentation in separates .qdoc files with the original license header preserved. We don't want to contaminate our implementation yet just for the documentation, so keep it separate for now. New documentation that isn't attached to the QtWebKit LGPL license should go inline in the code as usual. Change-Id: I113a9ad2b826ed7cea053be065f201b637070d28 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Base load signals on Blink loader eventsJocelyn Turcotte2014-03-212-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | This mainly remove the use of the LoadingStateChanged callback, which is tied to DidStartLoading and DidStopLoading. Those signals are handled from the browser process side, also wrapping the time where the render process is initialized. We can't rely on those signals for loadStarted, but afterward rely on the Blink loader for loadFinished. We must use the same source for both. Instead only rely on Blink callbacks ultimately related to network events. This gives us a behavior closer to QtWebKit. The major compromise that this forces us to to accept is that loadStarted is now triggered asynchronously. This will basically break anything expecting loadStarted to be emitted synchronously from the load method. This also adjust autotests to get a few more passing. Initial-patch-by: Pierre Rossi <pierre.rossi@digia.com> Change-Id: Ib6c0170df891d1b7f8ed4dc1d483985523e267dc Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Tooltip support.Pierre Rossi2014-03-145-2/+19
| | | | | | | | | | Basic tooltip support for widgets relying on the existing QToolTip mechanism. Left unimplemented on the Qt Quick side for now since ToolTip support is still very much a work in progress there. Change-Id: Ia4bfd715a224e0cbc147c8860e131d1545cebe1e Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Deploy QtWebEngineCore as a Qt moduleJocelyn Turcotte2014-03-071-18/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This delegates the linking step from ninja to qmake so that we can let qmake decide the destination of the target itself, easing the deployment and installation logic across platforms. The module is only deployed as a binary and no header are available outside of the source tree. This is only to make sure that the dependence of the QtWebEngine and QtWebEngineWidgets libraries on it is resolved at runtime exactly the same way as with other Qt modules, on all platforms. Ninja still takes care of the compilation and gyp lets qmake know how and what to link by dumping the list of flags and input files in a generated .pri file. This has to be done in a separate .pro file so that we can make sure that ninja is run inconditionally before make reaches the dependency check in core_module.pro, ensured by the parent Makefile. Note 1: This patch removes RPATH hacks that are no longer necessary Note 2: Other targets like ffmpegsumo are still linked by ninja. The same logic could be moved to a qmake file but this require some more work to make sure that some switches (e.g. -stdlib=libc++) are coordinated between gyp and qmake. Change-Id: If65968547bde5b9cf732e31e97931c17ae1921a7 Reviewed-by: Zoltan Arvai <zarvai@inf.u-szeged.hu> Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Add HTTP and proxy authentication signals directly to QWebEnginePageJocelyn Turcotte2014-02-284-2/+23
| | | | | | | | | | | | | | | | | | This allows handling calls that would be signaled by QNetworkAccessManager in QtWebKit. This pulls QtNetwork as a dependency of the QtWebEngineWidgets module to be able to use QAuthenticator, but isn't required otherwise. Only the request URL is available in the case of HTTP authentication (no access to HTTP request headers that the QNetworkReply would allow) and only the proxy host name in the case case of proxy authentication. This keeps the API synchronous the same way, as QtWebKit did, in favor of source compatibility at the cost of requiring a modal dialog, even though the implementation doesn't require it. Change-Id: I9e021def38e6107c9e66d2de8f86bd0328d543df Reviewed-by: Michael Bruning <michael.bruning@digia.com>
* Implement QWebEnginePage::viewportSizeJocelyn Turcotte2014-02-216-10/+24
| | | | | | | | | | Keep the size in the page itself, and ask the optionally attached QWebEngineView only for the rect position. When the view size change, call setViewportSize on the page like QtWebKit does. Change-Id: I735f1509cab9ef9b5d32bf31249a59c919939804 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Fix a crash when using the history on an adopted pageJocelyn Turcotte2014-02-201-0/+1
| | | | | | | | We also need to update the WebContentsAdapter pointer in QWebEngineHistoryPrivate. Change-Id: I8251e9834b179747b6b65630cf4ced5c2b1af27f Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Implement basic editing actions for QWebEnginePageJocelyn Turcotte2014-02-201-1/+43
| | | | | Change-Id: I1b58d2b2e86f60e296ae48095ed8d5e8172e0d1e Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Add project's directory to includepath on WindowsZoltan Arvai2014-02-191-1/+1
| | | | | | | | | Unlike other OSes, project's directory is not included by default to includepath on Windows. This would cause missing file errors while building. Change-Id: I64b83e13adaae1ee1730caebcf7442973b573c3b Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Implement QWebEnginePage::findTextJocelyn Turcotte2014-02-135-6/+59
| | | | | | | | | | | | | | | | | | | A few changes to the API: - Return the success result asynchronously. - FindWrapsAroundDocument and HighlightAllOccurrences are enabled by defaults and cannot be disabled. - Found text isn't updating the selection on the page like QtWebKit did, but triggers a separate state not available. A find count and current index could be exposed, but isn't in this case to keep the API delta lower. This also adds the possibility to pass bool results through the CallbackDirectory and add a new tst_QWebEnginePage::findTextResult test since the old test relied on the selection to be updated when the searched text is found. Change-Id: I8189b5aea8d832df183c6c1ae03e3f08198a9c45 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Implement QWebEnginePage::selectedTextJocelyn Turcotte2014-02-133-0/+29
| | | | | Change-Id: Idebde8da0befbea7ccc5942de1e09fcc61ce16d4 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Refactor the way callbacks are storedJocelyn Turcotte2014-02-132-22/+120
| | | | | | | | | | | | | | | | With the upcoming addition of a new type of callback result, this patch allows storing multiple callback types in the same QHash instead or requiring a different hash table just to please the type system. This does so by managing the ref-counted callback pointers directly instead of relying on a templated QExplicitlySharedDataPointer that requires a different type for each different callback pointer type. The ref-counting, construction and destruction is managed through a run-time type enum. Change-Id: I90ab2e1efc0c9703fc5b6ef57b38204ac8eea828 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move the requestID argument before the resultJocelyn Turcotte2014-02-132-6/+6
| | | | | | | | | | This tries to get the order of declaration to be consistent. It also follows the order used by Chromium in some places where the routing_id usually comes first, then the request_id and then the result of the asynchronous request. Change-Id: I88e164dee67e1631161a222f7dd7a4679c3d3acd Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix a warning in QWebEnginePage::setHtmlJocelyn Turcotte2014-02-131-1/+0
| | | | | Change-Id: I87c18edb89658433d6dc3487ab92d2ff7bd6c986 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Cleanup on webenginewidgets.proZoltan Arvai2014-02-131-6/+0
| | | | | | | Remove unneeded parts that handled by load(qt_module) already. Change-Id: I50646d754d1eec96342ba2f7c45f1a023a7257ae Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Fix QNetworkRequest usage in WebEngineWidgets on WindowsZoltan Arvai2014-02-132-2/+2
| | | | | | | | | Changing unused variable suppression in acceptNavigationRequest is required for MSVC otherwise it fail with undefined type error. Also adding more suppression for unused wariable warning. Change-Id: Ic449973bc8166f18655e40bf57041b8f02869266 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Make QWebEnginePage support symetrical url and setUrlJocelyn Turcotte2014-02-122-1/+7
| | | | | | | | Unlike load, the value passed to setUrl should be returned by url until the url is updated by the page (load finished or url changed). Change-Id: Ica80941754fcf57d68071123daa28f5ddd1359fe Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Implement QWebEnginePage::requestedUrlJocelyn Turcotte2014-02-121-0/+6
| | | | | Change-Id: I6accd8fd40ad72041770439aa6a7aa59ba904418 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>