summaryrefslogtreecommitdiffstats
path: root/src/webengine
Commit message (Collapse)AuthorAgeFilesLines
* Add findText to Quick APIPeter Varga2014-08-072-1/+33
| | | | | Change-Id: Ic0de45c1fe2a5537d61ad446c96fe8fda7c30966 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Get rid of QOpenGLContextPrivate::setGlobalShareContexJocelyn Turcotte2014-08-061-2/+4
| | | | | | | | | | | Manually import qt_(set_)gl_global_share_context from QtGui instead. The binary compatibility of those symbols should be maintained in QtGui, allowing us to avoid depending on private API. Change-Id: I1f954ec10a793c3195d3aec01409dde1bc767d64 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Use QSGEngine instead of the private QSGRenderContextJocelyn Turcotte2014-08-061-2/+1
| | | | | | | | | QSGEngine was added in Qt 5.4 to allow using the scene graph without QQuickWindow. Use it for our FBO as well as for the QOpenGLWidget rendering. Change-Id: If4665d4f33c9dad69d2d4269309163bb5ffbd8e3 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Move the runJavaScript function from experimental to public APIAndras Becsi2014-08-064-10/+25
| | | | | | | This is essential API that should be public. Change-Id: Ifbd86171933936112e2495ebed074faa2e52464d Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Clean up opaque pointer handling for QQuickWebEngineLoadRequestAndras Becsi2014-08-062-20/+30
| | | | | | | | | Hide QObject's d_ptr member and use the macros when accessing the private class. This patch also adds missing qt namespace macros to the implementation. Change-Id: I004e3ea52bf21618835724d218f2a405f77ca4d1 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Add QQuick API for intercepting navigation requestsAndras Becsi2014-08-067-0/+233
| | | | | | | | | | | | Add missing navigationRequested API to be able to intercept navigation requests. This is useful for ignoring requests for example in kiosk-like applications that want to restrinct navigation to a specific url or domain, or want to disable specific types of navigation requests (e.g. reloading, clicking links, form submissions). Change-Id: Ie375e635a3c3566527972d05f5d99b39489c5ca8 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Expose better error information in loadRequest.Pierre Rossi2014-08-041-0/+4
| | | | | | | | | | | | Use the chromium localized error strings for that purpose, otherwise the error description is always empty. While we're at it, let's tap into the chromium error pages, which should hopefully make sense for most errors, and add some static asserts to check that the qt quick enum and the core one are in sync. Change-Id: Icf8fa7c3bf4a674c60a10950422135fb6930447a Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* s/QWebEngine/QtWebEngine/gPierre Rossi2014-08-042-5/+10
| | | | | | | and make it a namespace Change-Id: I15c1af8c7d0d8ab213cdf7945109263fe461d2ac Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Don't inherit from Qt private typesJocelyn Turcotte2014-08-044-5/+10
| | | | | | | | | | | | | Do the d_ptr magic ourselves to avoid having to include private headers from qtcore, qtgui and qtdeclarative. It is hackish to hide QObject's d_ptr member to have the macros working in a public class, but if anything goes wrong we just need to replace the private macro convenience while maintaining the binary compatibility of the stored extra opaque pointer. Change-Id: Idb92f4f902826bef9068a5c2ef6ea31fc3fa15b2 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Don't use the private QQmlMetaType::defaultPropertyJocelyn Turcotte2014-08-013-6/+17
| | | | | | | | | Duplicate the small implementation of that function, which uses QMetaObject public API together with the semi-public fact that the meta class info named DefaultProperty needs to be fetched. Change-Id: I37413bd28a0b0ead55853e4e3db5864dfc39966b Reviewed-by: Michael Bruning <michael.bruning@digia.com>
* Fix tab focus in the widgets and QML webviewsJocelyn Turcotte2014-08-013-13/+0
| | | | | | | | | | | | | | | | | | | | Fixes: - Make sure that we call SetInitialFocus when giving focus through Tab This does the same as would WebContents::FocusThroughTabTraversal - Implement QWebEnginePagePrivate::passOnFocus - Set each new RWHVQtDelegate as the focus proxy of the QWebEngineView - Make sure that the widgets delegate accepts the tab focus policy Cleaups: - RenderWidgetHostViewQtDelegateQuick doesn't need to be a focus scope, it doesn't have any children - We don't need to reimplement QQuickWebEngineView::forceActiveFocus since the view is now a focus scope - Do not explicitly setFocus(true) on the QQuickWebEngineView, the application should decide this through the API Change-Id: I817dc2c895d4fff4aa3536c71ecc5d306bb3bee0 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Don't use the private QQuickItemPrivate::focusNextPrevJocelyn Turcotte2014-08-011-1/+3
| | | | | | | | | | Do what focusNextPrev does internally. Also fix the tab-focus by getting the next item relatively to the delegate (the scopedFocusItem()) instead of the view itself. Change-Id: I0d35a12bd5ef54d69df35b29ccdd55ac2301eec8 Reviewed-by: Michael Bruning <michael.bruning@digia.com> Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Don't use the private QGuiApplicationPrivate::platformIntegration()Jocelyn Turcotte2014-08-011-3/+1
| | | | | | | | Querying the platform names directly will be just as reliable as we are still only supporting a limited number of platforms. Change-Id: I9feba66b6ac23281db4d0ba675cc9a1e5560daea Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Drop 5.2 supportJocelyn Turcotte2014-08-011-5/+0
| | | | | | | We actually already depend on dev (5.4) in other areas. Change-Id: Iab297a51ab06209a96f11f97c74463d38203eda8 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Add loadVisuallyCommitted signal to the experimental Quick APISzabolcs David2014-08-013-0/+16
| | | | | | | | | This fixes the flaky QQuickWebEngineViewGraphics test and extends it with a new test case. Change-Id: I2d8a0762716cb9232fdea6473760e67ac2e7146d Reviewed-by: Andras Becsi <andras.becsi@digia.com> Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Qt Quick based accessibility glue codeFrederik Gladhorn2014-07-263-0/+77
| | | | | | | | With this patch the accessibility hierarchy inside webengine becomes accessible when navigating from Qt Quick based web views. Change-Id: Ic1c8caaa908bd32e4175ee9dcdb7a6bef89818b6 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Fix warnings produced by QT_ASCII_CAST_WARNINGS in ui delegatesAdam Kallai2014-07-241-1/+1
| | | | | Change-Id: Iffb04ff0c61e7a5e0c42ca224b1b04d0a62c66f8 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* RWHVQDQ::contentsRect can be called by chromium before the view has a window.Zeno Albisser2014-07-211-1/+3
| | | | | | | Change-Id: I50e3a2ba95b3c0b49af2139f763f11154defe503 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com> Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com> Reviewed-by: Michael Bruning <michael.bruning@digia.com>
* Fix contentsRect calculation.Zeno Albisser2014-07-211-1/+1
| | | | | | | | | QRectF takes either two points (top left / bottom right), or separate coordinates (x/y) together with dimensions for width and height. Change-Id: Iac20e2abaa4a273ddf7605ffa306220717ae283a Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Fix RenderWidgetHostViewQt::GetViewBoundsFrederik Gladhorn2014-07-144-0/+14
| | | | | | | | | | GetViewBounds should return the bounds of the view, not the screen rect. The view bounds are for example used to calculate the screen position of accessible objects (which gets fixed with this patch). Change-Id: I5b342113af737847c1756a13183cd2b8b8db648a Reviewed-by: Andras Becsi <andras.becsi@digia.com> Reviewed-by: Michael Bruning <michael.bruning@digia.com>
* Add core accessibilityFrederik Gladhorn2014-07-092-0/+7
| | | | | | | | | | | | | | | | This commit adds the basics to bridge the blink accessibility classes to QAccessibleInterfaces. Note that it needs two follow up commits to implement the bridging from the QWidget/Qt Quick worlds. [ChangeLog][Accessibility] QtWebEngine now has accessibility support, enabling assistive technology such as screen readers to work with it. Change-Id: Ied1d97e61a024115ac7a9245331211f6d9fac1b4 Reviewed-by: Zeno Albisser <zeno.albisser@digia.com> Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Fix the build with recent qtbaseAndras Becsi2014-07-071-0/+2
| | | | | | | | | | | | Since 3cd70c11bc7bbe3c5e9e4972d2273cf51bbdc30e in qtbase Qt modules require cmake tests to be present which makes QtWebEngine fail with "Missing CMake tests." We do not support building with cmake at this point, so disable these tests by setting CMAKE_MODULE_TESTS to '-' for module pro files. Change-Id: I777e6b2c7ce975ad021281800987f9d3ce173399 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Fix requests for audio and video permissionsFrederik Gladhorn2014-07-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Requesting MediaAudioCapture would unconditionally ask for QQuickWebEngineViewExperimental::MediaAudioVideoDevices instead of MediaAudioDevices since the if wrongly tested for the same condition twice. In addition fix a warning: variable 'feature' is used uninitialized whenever 'if' condition is false api/qquickwebengineview.cpp:369:13: warning: variable 'feature' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] else if (requestFlags.testFlag(WebContentsAdapterClient::MediaVideoCapture)) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ api/qquickwebengineview.cpp:371:57: note: uninitialized use occurs here Q_EMIT e->featurePermissionRequested(securityOrigin, feature); ^~~~~~~ api/qquickwebengineview.cpp:369:9: note: remove the 'if' if its condition is always true else if (requestFlags.testFlag(WebContentsAdapterClient::MediaVideoCapture)) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ api/qquickwebengineview.cpp:364:4: note: variable 'feature' is declared here QQuickWebEngineViewExperimental::Feature feature; ^ Change-Id: If63fbb5a59a71dede1d1829695f66c22849a4dcd Reviewed-by: Michael Bruning <michael.bruning@digia.com>
* OS X: Fix the build with the Qt SDKAndras Becsi2014-06-271-1/+1
| | | | | Change-Id: Icc4219ace4121a4b30302e0348e48dc75cae54cb Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Fix crash when loading context menu on Windows.Michael Brüning2014-06-261-1/+1
| | | | | | | | | | | Use QUrl::fromLocalFile to load components from the installation Qml directory. Using just the absolute file path wasn't a problem on Linux, but did not work on Windows. Other Qt modules are also using QUrl::fromLocalFile to do this. Change-Id: I689c516dc63a6c966435eedb94441d7c9246dd25 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Fix a crash when running witout UI delegates.Pierre Rossi2014-05-201-8/+23
| | | | | | | | | Lookup the correct UIDelegates import path once lazily, and reuse this information. If there is none, then we don't expect any UI delegation to work, but it should not crash. Change-Id: I73be7273d83b8d89b74641dc550341cf2b7eb602 Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Set the QtWebEngine modules version to 0.9.0Jocelyn Turcotte2014-05-161-3/+16
| | | | | | | | | | | | | | | | | | | | Also make sure that this version number appears in the user agent string and in the QML imports. The plan, unlike other Qt modules, is to keep our module and QML versions in sync to make it easy for developers to figure out what API is available in a given version. The QTWEBENGINECORE_VERSION_STR define is explicitly set in the .pro file since we don't call syncqt to generate a version header for the core module. The 0-major version currently causes the library name to start with libQt0 instead of libQt5, but this is something that we can fix in qtbase once we want to officially support linux desktop with QtWebEngine 1.0.0. Change-Id: I31915e84869b4db456416ef1f85a2296b8a06c99 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove the xPath argument from runJavaScriptJocelyn Turcotte2014-05-121-2/+2
| | | | | | | | | | | | | | 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-122-110/+35
| | | | | | | | | | 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>
* Move the WebEngineView.inspectable property to experimentalJocelyn Turcotte2014-05-093-15/+15
| | | | | | | | The property is still not properly implemented and we'll make it first go through the experimental tryout like other APIs we add. Change-Id: I6eb99fcebb7ca1fc33338d786585cfe7fbc0afd4 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Fix double clicks needing three presses in QWebEngineViewJocelyn Turcotte2014-05-082-6/+0
| | | | | | | | | | | | | | 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-083-8/+4
| | | | | | | | 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>
* Add linkHovered signal to the QQuickWebEngineViewSzabolcs David2014-05-053-0/+8
| | | | | | | | 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>
* Simple experimental WebRTC API for QtQuickPierre Rossi2014-04-292-1/+45
| | | | | Change-Id: I18059c2894893d28c03dc790037bdd3ff28cfd07 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-4/+8
| | | | | | | | 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>
* Do not assume that the webview only contains RWHV delegatesAndras Becsi2014-04-251-3/+2
| | | | | | | | | | | | | | This fixes an assertion for QML code like: WebEngineView { ... MouseArea { ... } } Change-Id: I7a9bfb801c81ea53c1cc830b44fe224a0b78db2d Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Fix how NewPopupDisposition is exposed in QQuickWebEngineViewJocelyn Turcotte2014-04-155-12/+13
| | | | | | | | | | | | | | | | | | 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-4/+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>
* Remove the RenderWidgetHostViewQtDelegateQuickBase templateJocelyn Turcotte2014-04-084-189/+206
| | | | | | | We now only have a QQuickItem subclass and this isn't needed anymore. Change-Id: I3a10943e54f52d1554dc76ccc1841aaacd5171e2 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Get rid of the BackingStore rendering pathJocelyn Turcotte2014-04-086-87/+17
| | | | | | | | | 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-082-4/+10
| | | | | | | | | | | | | | | 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-084-18/+18
| | | | | | | | | | | 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>
* Fix reseting of the quick history list modelPeter Varga2014-04-034-11/+10
| | | | | | | With this fix the quick history list is updated like in the widget API. Change-Id: I19127a0055a3f1ab8a04da63d847249f6c4c23d9 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Make WebUI popups work with QtQuickPierre Rossi2014-04-027-15/+270
| | | | | | | | | | | | | This is used by popups for select elements and date pickers among other things. We can keep using the same RenderWidgetHostViewQtDelegate implementations for that purpose, and query QPA to decide if they should be wrapped into their own QQuickWindow. Longer term, we might want to optionally delegate that functionality to QML. Change-Id: I88540ca32a9a707d380dfbf486b7f7806b5b65ff Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Centralize OpenGL initializationSimon Hausmann2014-03-313-0/+82
| | | | | | | | | | We now require the user to use QWebEngine::initialize() in main (preferably) and print out an error message if this wasn't set up accordingly. This limits the use of private scene graph API to inside QWebEngine and offers public API for users of the API. Change-Id: I787c176a85ab7784dbc8787d9876960b4872959e Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Rough port of the documentation to QtWebEngineJocelyn Turcotte2014-03-314-49/+101
| | | | | | | | | | | | | | | 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-312-0/+433
| | | | | | | | | | | | 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>
* Fix QQuickWebEngineForwardHistoryListModelPeter Varga2014-03-281-1/+1
| | | | | | | | | | The index calculation was wrong for the history items in the forward list model: model contained the current item too. Test has been added for check the previous and next element in the back and forward lists. Change-Id: I0e05881f05b67752e47b01236ffb9636d31a7dc2 Reviewed-by: Andras Becsi <andras.becsi@digia.com>