diff options
author | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2017-11-20 13:49:26 +0100 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2017-11-20 13:49:26 +0100 |
commit | 0bcff4da6a22acdc522e7c27607ad4d2a2ffe843 (patch) | |
tree | bb66a5ccc65c3094235230b301cc5bfb7e47af8d | |
parent | f841341a22d5b460c81f8e7ee7fa9434500404c8 (diff) | |
parent | f1003c50652c1f5ef9ae0e16036b175fe3e8f215 (diff) |
Merge 5.10 into 5.10.0
Change-Id: I05f7952ea887536674045ed0779967e23388c5d1
53 files changed, 837 insertions, 332 deletions
diff --git a/config_help.txt b/config_help.txt index 6ff24f8c8..8055de910 100644 --- a/config_help.txt +++ b/config_help.txt @@ -1,13 +1,23 @@ Webengine options: - - -alsa ................ Enable ALSA support [auto] (Linux only) - -webengine-icu ....... Select used ICU libraries [system/qt] (Linux only) - -ffmpeg .............. Select used FFmpeg libraries [system/qt] (Linux only) - -opus ................ Select used Opus libraries [system/qt] (Linux only) - -webp ................ Select used WebP libraries [system/qt] (Linux only) - -pepper-plugins ...... Enable use of Pepper Flash and Widevine plugins [auto] - -printing-and-pdf .... Enable use of printing and output to PDF [auto] - -proprietary-codecs .. Enable support for proprietary codecs [no] - -pulseaudio .......... Enable PulseAudio support [auto] (Linux only) - -spellchecker ........ Enable support for spellchecker [yes] - -webrtc .............. Enable support for WebRTC [auto] + -webengine-alsa ................ Enable ALSA support [auto] (Linux only) + -webengine-pulseaudio .......... Enable PulseAudio support [auto] + (Linux only) + -webengine-embedded-build ...... Enable Linux embedded build [auto] + (Linux only) + -webengine-icu ................. Use system ICU libraries [system/qt] + (Linux only) + -webengine-ffmpeg .............. Use system FFmpeg libraries [system/qt] + (Linux only) + -webengine-opus ................ Use system Opus libraries [system/qt] + (Linux only) + -webengine-webp ................ Use system WebP libraries [system/qt] + (Linux only) + -webengine-pepper-plugins ...... Enable use of Pepper Flash and Widevine + plugins [auto] + -webengine-printing-and-pdf .... Enable use of printing and output to PDF + [auto] + -webengine-proprietary-codecs .. Enable support for proprietary codecs [no] + -webengine-spellchecker ........ Enable support for spellchecker [yes] + -webengine-native-spellchecker . Enable support for native spellchecker [no] + (macOS only) + -webengine-webrtc .............. Enable support for WebRTC [auto] diff --git a/configure.json b/configure.json index ecf6e1132..d0d172835 100644 --- a/configure.json +++ b/configure.json @@ -8,115 +8,126 @@ "commandline": { "options": { - "alsa": "boolean", - "embedded": "boolean", - "webengine-icu": { "type": "enum", "name": "system-icu", "values": { "system": "yes", "qt": "no" } }, - "ffmpeg": { "type": "enum", "name": "system-ffmpeg", "values": { "system": "yes", "qt": "no" } }, - "opus": { "type": "enum", "name": "system-opus", "values": { "system": "yes", "qt": "no" } }, - "webp": { "type": "enum", "name": "system-libwebp", "values": { "system": "yes", "qt": "no" } }, - "pepper-plugins": "boolean", - "printing-and-pdf": "boolean", - "proprietary-codecs": "boolean", - "pulseaudio": "boolean", - "spellchecker": "boolean", - "native-spellchecker": "boolean", - "webrtc": "boolean", - "geolocation" : "boolean" + "webengine-alsa": "boolean", + "webengine-embedded-build": "boolean", + "webengine-icu": { "type": "enum", "name": "webengine-system-icu", "values": { "system": "yes", "qt": "no" } }, + "webengine-ffmpeg": { "type": "enum", "name": "webengine-system-ffmpeg", "values": { "system": "yes", "qt": "no" } }, + "webengine-opus": { "type": "enum", "name": "webengine-system-opus", "values": { "system": "yes", "qt": "no" } }, + "webengine-webp": { "type": "enum", "name": "webengine-system-libwebp", "values": { "system": "yes", "qt": "no" } }, + "webengine-pepper-plugins": "boolean", + "webengine-printing-and-pdf": "boolean", + "webengine-proprietary-codecs": "boolean", + "webengine-pulseaudio": "boolean", + "webengine-spellchecker": "boolean", + "webengine-native-spellchecker": "boolean", + "webengine-webrtc": "boolean", + "webengine-geolocation" : "boolean", + + "alsa": { "type": "boolean", "name": "webengine-alsa" }, + "pulseaudio": { "type": "boolean", "name": "webengine-pulseaudio" }, + "ffmpeg": { "type": "enum", "name": "webengine-system-ffmpeg", "values": { "system": "yes", "qt": "no" } }, + "opus": { "type": "enum", "name": "webengine-system-opus", "values": { "system": "yes", "qt": "no" } }, + "webp": { "type": "enum", "name": "webengine-system-libwebp", "values": { "system": "yes", "qt": "no" } }, + "pepper-plugins": { "type": "boolean", "name": "webengine-pepper-plugins" }, + "printing-and-pdf": { "type": "boolean", "name": "webengine-printing-and-pdf" }, + "proprietary-codecs": { "type": "boolean", "name": "webengine-proprietary-codecs" }, + "spellchecker": { "type": "boolean", "name": "webengine-spellchecker" }, + "webrtc": { "type": "boolean", "name": "webengine-webrtc" } } }, "libraries": { - "dbus": { + "webengine-dbus": { "label": "d-bus", "sources": [ { "type": "pkgConfig", "args": "dbus-1" } ] }, - "fontconfig": { + "webengine-fontconfig": { "label": "fontconfig", "sources": [ { "type": "pkgConfig", "args": "fontconfig" } ] }, - "libdrm": { + "webengine-libdrm": { "label": "libdrm", "sources": [ { "type": "pkgConfig", "args": "libdrm" } ] }, - "xcomposite": { + "webengine-xcomposite": { "label": "xcomposite", "sources": [ { "type": "pkgConfig", "args": "xcomposite" } ] }, - "xcursor": { + "webengine-xcursor": { "label": "xcursor", "sources": [ { "type": "pkgConfig", "args": "xcursor" } ] }, - "xi": { + "webengine-xi": { "label": "xi", "sources": [ { "type": "pkgConfig", "args": "xi" } ] }, - "xrandr": { + "webengine-xrandr": { "label": "xrandr", "sources": [ { "type": "pkgConfig", "args": "xrandr" } ] }, - "xtst": { + "webengine-xtst": { "label": "xtst", "sources": [ { "type": "pkgConfig", "args": "xtst" } ] }, - "harfbuzz": { + "webengine-harfbuzz": { "label": "harfbuzz >= 1.4.2", "sources": [ { "type": "pkgConfig", "args": "harfbuzz >= 1.4.2" } ] }, - "glib": { + "webengine-glib": { "label": "glib-2.0 >= 2.32.0", "sources": [ { "type": "pkgConfig", "args": "glib-2.0 >= 2.32.0" } ] }, - "zlib": { + "webengine-zlib": { "label": "zlib", "sources": [ { "type": "pkgConfig", "args": "zlib" } ] }, - "minizip": { + "webengine-minizip": { "label": "minizip", "sources": [ { "type": "pkgConfig", "args": "minizip" } ] }, - "libevent": { + "webengine-libevent": { "label": "libevent", "sources": [ { "type": "pkgConfig", "args": "libevent" } ] }, - "libxml2": { + "webengine-libxml2": { "label": "libxml2 and libxslt", "sources": [ { "type": "pkgConfig", "args": "libxml-2.0 libxslt" } ] }, - "jsoncpp": { + "webengine-jsoncpp": { "label": "jsoncpp", "sources": [ { "type": "pkgConfig", "args": "jsoncpp" } ] }, - "protobuf": { + "webengine-protobuf": { "label": "protobuf", "sources": [ { "type": "pkgConfig", "args": "protobuf" } @@ -128,41 +139,47 @@ { "type": "pkgConfig", "args": "libpulse >= 0.9.10 libpulse-mainloop-glib" } ] }, - "icu": { + "webengine-icu": { "label": "icu >= 53", "sources": [ { "type": "pkgConfig", "args": "icu-uc >= 53 icu-i18n >= 53" } ] }, - "ffmpeg": { + "webengine-ffmpeg": { "label": "libavcodec libavformat libavutil", "sources": [ { "type": "pkgConfig", "args": "libavcodec libavformat libavutil" } ] }, - "opus": { + "webengine-opus": { "label": "opus", "sources": [ { "type": "pkgConfig", "args": "opus" } ] }, - "webp": { + "webengine-webp": { "label": "libwebp, libwebpmux and libwebpdemux", "sources": [ { "type": "pkgConfig", "args": "libwebp libwebpmux libwebpdemux" } ] }, - "nss": { + "webengine-nss": { "label": "nss", "sources": [ { "type": "pkgConfig", "args": "nss" } ] }, - "png": { + "webengine-png": { "label": "libpng >= 1.6.0", "sources": [ { "type": "pkgConfig", "args": "libpng >= 1.6.0" } ] + }, + "webengine-lcms2": { + "label": "lcms2", + "sources": [ + { "type": "pkgConfig", "args": "lcms2" } + ] } }, @@ -172,352 +189,353 @@ "test": "alsa", "type": "compile" }, - "khr": { + "webengine-khr": { "label": "khr", "test": "khr", "type": "compile" }, - "libvpx": { + "webengine-libvpx": { "label": "libvpx", "test": "libvpx", "type": "compile" }, - "snappy": { + "webengine-snappy": { "label": "snappy", "test": "snappy", "type": "compile" }, - "srtp": { + "webengine-srtp": { "label": "srtp", "test": "srtp", "type": "compile" }, - "winversion": { + "webengine-winversion": { "label": "winversion", "test": "winversion", "type": "compile" }, - "protoc": { + "webengine-protoc": { "label": "protoc", "type": "detectProtoc" }, - "python2": { + "webengine-python2": { "label": "python2", "type": "detectPython2", "log": "location" }, - "gperf": { + "webengine-gperf": { "label": "gperf", "type": "detectGperf" }, - "bison": { + "webengine-bison": { "label": "bison", "type": "detectBison" }, - "flex": { + "webengine-flex": { "label": "flex", "type": "detectFlex" }, - "ninja": { + "webengine-ninja": { "label": "system ninja", "type": "detectNinja" }, - "gn": { + "webengine-gn": { "label": "system gn", "type": "detectGn" }, - "embedded": { + "webengine-embedded-build": { "label": "embedded", "type": "embedded" }, - "re2": { + "webengine-re2": { "label": "re2", "test": "re2", "type": "compile" }, - "glibc": { + "webengine-glibc": { "label": "glibc > 2.16", "type": "detectGlibc" }, - "icuuc": { + "webengine-icuuc": { "label" : "libxml2 configured with icuuc", "type": "detectIcuuc" }, - "sanitizer": { + "webengine-sanitizer": { "label" : "sanitizer support", "type": "isSanitizerSupported" } }, "features": { - "system-fontconfig": { + "webengine-system-fontconfig": { "label": "fontconfig", - "condition": "libs.fontconfig", + "condition": "libs.webengine-fontconfig", "output": [ "privateFeature" ] }, - "system-dbus": { + "webengine-system-dbus": { "label": "dbus", - "condition": "libs.dbus", + "condition": "libs.webengine-dbus", "output": [ "privateFeature" ] }, - "system-libdrm": { + "webengine-system-libdrm": { "label": "libdrm", - "condition": "libs.libdrm", + "condition": "libs.webengine-libdrm", "output": [ "privateFeature" ] }, - "system-xcomposite": { + "webengine-system-xcomposite": { "label": "xcomposite", - "condition": "libs.xcomposite", + "condition": "libs.webengine-xcomposite", "output": [ "privateFeature" ] }, - "system-xcursor": { + "webengine-system-xcursor": { "label": "xcursor", - "condition": "libs.xcursor", + "condition": "libs.webengine-xcursor", "output": [ "privateFeature" ] }, - "system-xi": { + "webengine-system-xi": { "label": "xi", - "condition": "libs.xi", + "condition": "libs.webengine-xi", "output": [ "privateFeature" ] }, - "system-xrandr": { + "webengine-system-xrandr": { "label": "xrandr", - "condition": "libs.xrandr", + "condition": "libs.webengine-xrandr", "output": [ "privateFeature" ] }, - "system-xtst": { + "webengine-system-xtst": { "label": "xtst", - "condition": "libs.xtst", + "condition": "libs.webengine-xtst", "output": [ "privateFeature" ] }, "webengine-system-harfbuzz": { "label": "harfbuzz", - "condition": "config.unix && features.system-harfbuzz && libs.harfbuzz", + "condition": "config.unix && features.system-harfbuzz && libs.webengine-harfbuzz", "output": [ "privateFeature" ] }, - "system-glib" : { + "webengine-system-glib" : { "label": "glib", - "condition": "config.unix && libs.glib", + "condition": "config.unix && libs.webengine-glib", "output": [ "privateFeature" ] }, - "system-minizip" : { + "webengine-system-minizip" : { "label": "minizip", - "condition": "config.unix && libs.minizip", + "condition": "config.unix && libs.webengine-minizip", "output": [ "privateFeature" ] }, "webengine-system-zlib" : { "label": "zlib", - "condition": "config.unix && features.system-zlib && libs.zlib", + "condition": "config.unix && features.system-zlib && libs.webengine-zlib", "output": [ "privateFeature" ] }, - "system-libevent" : { + "webengine-system-libevent" : { "label": "libevent", - "condition": "config.unix && libs.libevent", + "condition": "config.unix && libs.webengine-libevent", "output": [ "privateFeature" ] }, - "system-jsoncpp" : { + "webengine-system-jsoncpp" : { "label": "jsoncpp", - "condition": "config.unix && libs.jsoncpp", + "condition": "config.unix && libs.webengine-jsoncpp", "output": [ "privateFeature" ] }, - "system-protobuf" : { + "webengine-system-protobuf" : { "label": "protobuf", - "condition": "config.unix && libs.protobuf && tests.protoc", + "condition": "config.unix && libs.webengine-protobuf && tests.webengine-protoc", "output": [ "privateFeature" ] }, "webengine-system-png" : { "label": "png", - "condition": "config.unix && features.system-png && libs.png", + "condition": "config.unix && features.system-png && libs.webengine-png", "output": [ "privateFeature" ] }, - "python2": { + "webengine-python2": { "label": "python2", - "condition": "tests.python2", + "condition": "tests.webengine-python2", "output": [ "privateFeature", - { "type": "varAssign", "name": "QMAKE_PYTHON2", "value": "tests.python2.location" } + { "type": "varAssign", "name": "QMAKE_PYTHON2", "value": "tests.webengine-python2.location" } ] }, - "gperf": { + "webengine-gperf": { "label": "gperf", - "condition": "tests.gperf", + "condition": "tests.webengine-gperf", "output": [ "privateFeature" ] }, - "bison": { + "webengine-bison": { "label": "bison", - "condition": "tests.bison", + "condition": "tests.webengine-bison", "output": [ "privateFeature" ] }, - "flex": { + "webengine-flex": { "label": "flex", - "condition": "tests.flex", + "condition": "tests.webengine-flex", "output": [ "privateFeature" ] }, - "embedded": { + "webengine-embedded-build": { "label": "Embedded build", "purpose": "Enables the embedded build configuration.", "section": "WebEngine", "condition": "config.unix", - "autoDetect": "tests.embedded", + "autoDetect": "tests.webengine-embedded-build", "output": [ "privateFeature" ] }, - "alsa": { + "webengine-alsa": { "label": "Use ALSA", "condition": "config.unix && tests.alsa", "output": [ "privateFeature" ] }, - "system-khr" : { + "webengine-system-khr" : { "label": "khr", - "condition": "config.unix && tests.khr", + "condition": "config.unix && tests.webengine-khr", "output": [ "privateFeature" ] }, - "system-libvpx" : { + "webengine-system-libvpx" : { "label": "libvpx", - "condition": "config.unix && tests.libvpx", + "condition": "config.unix && tests.webengine-libvpx", "output": [ "privateFeature" ] }, - "system-snappy" : { + "webengine-system-snappy" : { "label": "snappy", - "condition": "config.unix && tests.snappy", + "condition": "config.unix && tests.webengine-snappy", "output": [ "privateFeature" ] }, - "system-libsrtp" : { + "webengine-system-libsrtp" : { "label": "libsrtp", - "condition": "config.unix && tests.srtp", + "condition": "config.unix && tests.webengine-srtp", "output": [ "privateFeature" ] }, - "system-libxml2" : { - "label": "libxml2", - "condition": "config.unix && tests.libxml2", - "output": [ "privateFeature" ] - }, - "winversion" : { + "webengine-winversion" : { "label": "winversion", - "condition": "config.win32 && tests.winversion", + "condition": "config.win32 && tests.webengine-winversion", "output": [ "privateFeature" ] }, - "geolocation": { + "webengine-geolocation": { "label": "Geolocation", "condition": "module.positioning", "output": [ "privateFeature" ] }, - "pulseaudio": { + "webengine-pulseaudio": { "label": "Use PulseAudio", "autoDetect": "config.unix", "condition": "libs.pulseaudio", "output": [ "privateFeature" ] }, - "pepper-plugins": { + "webengine-pepper-plugins": { "label": "Pepper Plugins", "purpose": "Enables use of Pepper Flash and Widevine plugins.", "section": "WebEngine", - "autoDetect": "!features.embedded", + "autoDetect": "!features.webengine-embedded-build", "output": [ "privateFeature" ] }, - "printing-and-pdf": { + "webengine-printing-and-pdf": { "label": "Printing and PDF", "purpose": "Provides printing and output to PDF.", "section": "WebEngine", "condition": "module.printsupport && features.printer", - "autoDetect": "!features.embedded", + "autoDetect": "!features.webengine-embedded-build", "output": [ "privateFeature" ] }, - "proprietary-codecs": { + "webengine-proprietary-codecs": { "label": "Proprietary Codecs", "purpose": "Enables the use of proprietary codecs such as h.264/h.265 and MP3.", "section": "WebEngine", "autoDetect": false, "output": [ "privateFeature" ] }, - "spellchecker": { + "webengine-spellchecker": { "label": "Spellchecker", "purpose": "Provides a spellchecker.", "section": "WebEngine", "output": [ "publicFeature" ] }, - "native-spellchecker": { + "webengine-native-spellchecker": { "label": "Native Spellchecker", "purpose": "Use the system's native spellchecking engine.", "section": "WebEngine", "autoDetect": false, - "condition": "config.macos && features.spellchecker", + "condition": "config.macos && features.webengine-spellchecker", "output": [ "publicFeature" ] }, - "ui-delegates": { + "webengine-ui-delegates": { "label": "UI Delegates", "output": [ "privateFeature" ] }, - "testsupport": { + "webengine-testsupport": { "label": "Test Support", "autoDetect": "features.private_tests || call.isTestsInBuildParts", "output": [ "privateFeature" ] }, - "webrtc": { + "webengine-webrtc": { "label": "WebRTC", "purpose": "Provides WebRTC support.", "section": "WebEngine", - "autoDetect": "!features.embedded", + "autoDetect": "!features.webengine-embedded-build", "output": [ "privateFeature" ] }, - "system-nss": { + "webengine-system-nss": { "label": "nss", - "condition": "config.unix && !config.darwin && libs.nss", + "condition": "config.unix && !config.darwin && libs.webengine-nss", "output": [ "privateFeature" ] }, - "system-libwebp": { + "webengine-system-libwebp": { "label": "libwebp, libwebpmux and libwebpdemux", "autoDetect": "config.unix", - "condition": "libs.webp", + "condition": "libs.webengine-webp", "output": [ "privateFeature" ] }, - "system-opus": { + "webengine-system-opus": { "label": "opus", "autoDetect": "config.unix", - "condition": "libs.opus", + "condition": "libs.webengine-opus", "output": [ "privateFeature" ] }, - "system-ffmpeg": { + "webengine-system-ffmpeg": { "label": "ffmpeg", "autoDetect": false, - "condition": "libs.ffmpeg && features.system-opus && features.system-libwebp", + "condition": "libs.webengine-ffmpeg && features.webengine-system-opus && features.webengine-system-libwebp", "output": [ "privateFeature" ] }, - "system-icu": { + "webengine-system-icu": { "label": "icu", "autoDetect": false, - "condition": "libs.icu", + "condition": "libs.webengine-icu", "output": [ "privateFeature" ] }, - "system-re2": { + "webengine-system-re2": { "label": "re2", "autoDetect": "config.unix", - "condition": "tests.re2", + "condition": "tests.webengine-re2", "output": [ "privateFeature" ] }, - "system-ninja": { + "webengine-system-ninja": { "label": "Use System Ninja", - "condition": "tests.ninja", + "condition": "tests.webengine-ninja", "output": [ "privateFeature" ] }, - "system-gn": { + "webengine-system-gn": { "label": "Use System Gn", "autoDetect": false, - "condition": "tests.gn", + "condition": "tests.webengine-gn", "output": [ "privateFeature" ] }, - "system-glibc": { + "webengine-system-glibc": { "label": "glibc", - "condition": "config.linux && tests.glibc", + "condition": "config.linux && tests.webengine-glibc", "output": [ "privateFeature" ] }, - "system-libxml2": { + "webengine-system-libxml2": { "label": "libxml2 and libxslt", - "condition": "config.unix && libs.libxml2 && tests.icuuc", + "condition": "config.unix && libs.webengine-libxml2 && tests.webengine-icuuc", + "output": [ "privateFeature" ] + }, + "webengine-system-lcms2" : { + "label": "lcms2", + "autoDetect": "libs.webengine-lcms2", + "condition": "config.unix && features.printing-and-pdf", "output": [ "privateFeature" ] }, "webengine-sanitizer" : { "label": "Sanitizer ", - "autoDetect": "config.sanitizer && tests.sanitizer", + "autoDetect": "config.sanitizer && tests.webengine-sanitizer", "condition": "config.sanitizer", "output": [ "privateFeature" ] } @@ -526,22 +544,22 @@ "report": [ { "type": "warning", - "condition": "!features.python2", + "condition": "!features.webengine-python2", "message": "Python version 2 (2.7.5 or later) is required to build QtWebEngine." }, { "type": "warning", - "condition": "!features.gperf", + "condition": "!features.webengine-gperf", "message": "gperf is required to build QtWebEngine." }, { "type": "warning", - "condition": "!features.bison", + "condition": "!features.webengine-bison", "message": "bison is required to build QtWebEngine." }, { "type": "warning", - "condition": "!features.flex", + "condition": "!features.webengine-flex", "message": "flex is required to build QtWebEngine." } ], @@ -550,44 +568,45 @@ { "section": "Qt WebEngine", "entries": [ - "embedded", - "pepper-plugins", - "printing-and-pdf", - "proprietary-codecs", - "spellchecker", - "native-spellchecker", - "webrtc", - "system-ninja", - "geolocation", + "webengine-embedded-build", + "webengine-pepper-plugins", + "webengine-printing-and-pdf", + "webengine-proprietary-codecs", + "webengine-spellchecker", + "webengine-native-spellchecker", + "webengine-webrtc", + "webengine-system-ninja", + "webengine-geolocation", { "type": "feature", - "args": "alsa", + "args": "webengine-alsa", "condition": "config.unix" }, { "type": "feature", - "args": "pulseaudio", + "args": "webengine-pulseaudio", "condition": "config.unix" }, { "section": "Optional system libraries used", "condition": "config.unix", "entries": [ - "system-re2", - "system-icu", - "system-libwebp", - "system-opus", - "system-ffmpeg", - "system-libvpx", - "system-snappy", - "system-libsrtp", - "system-glib", + "webengine-system-re2", + "webengine-system-icu", + "webengine-system-libwebp", + "webengine-system-opus", + "webengine-system-ffmpeg", + "webengine-system-libvpx", + "webengine-system-snappy", + "webengine-system-libsrtp", + "webengine-system-glib", "webengine-system-zlib", - "system-minizip", - "system-libevent", - "system-jsoncpp", - "system-protobuf", - "system-libxml2", + "webengine-system-minizip", + "webengine-system-libevent", + "webengine-system-jsoncpp", + "webengine-system-protobuf", + "webengine-system-libxml2", + "webengine-system-lcms2", "webengine-system-png", "webengine-system-harfbuzz" ] @@ -596,23 +615,23 @@ "section": "Required system libraries", "condition": "config.unix && !config.macos", "entries": [ - "system-fontconfig", - "system-dbus", - "system-nss", - "system-khr", - "system-glibc" + "webengine-system-fontconfig", + "webengine-system-dbus", + "webengine-system-nss", + "webengine-system-khr", + "webengine-system-glibc" ] }, { "section": "Required system libraries for qpa-xcb", "condition": "config.unix && !config.macos", "entries": [ - "system-libdrm", - "system-xcomposite", - "system-xcursor", - "system-xi", - "system-xrandr", - "system-xtst" + "webengine-system-libdrm", + "webengine-system-xcomposite", + "webengine-system-xcursor", + "webengine-system-xi", + "webengine-system-xrandr", + "webengine-system-xtst" ] } ] diff --git a/dist/changes-5.9.3 b/dist/changes-5.9.3 new file mode 100644 index 000000000..9144fae79 --- /dev/null +++ b/dist/changes-5.9.3 @@ -0,0 +1,52 @@ +Qt 5.9.3 is a bug-fix release. It maintains both forward and backward +compatibility (source and binary) with Qt 5.9.0. + +For more details, refer to the online documentation included in this +distribution. The documentation is also available online: + +http://doc.qt.io/qt-5/index.html + +The Qt version 5.9 series is binary compatible with the 5.8.x series. +Applications compiled for 5.8 will continue to run with 5.9. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + +https://bugreports.qt.io/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + +**************************************************************************** +* Qt 5.9.3 Changes * +**************************************************************************** + + - This release contains only minor code improvements. + * Security fixes from Chromium up to version 62.0.3202.89 + Including: CVE-2017-5124, CVE-2017-5126, CVE-2017-5127, CVE-2017-5128, CVE-2017-5129, + CVE-2017-5132, CVE-2017-5133, CVE-2017-15386, CVE-2017-15387, CVE-2017-15388, + CVE-2017-15390, CVE-2017-15392, CVE-2017-15394, CVE-2017-15396, CVE-2017-15398. + + - QtWebEngineCore: + * [QTBUG-64032] Fix crash after resizing view to be empty. + + - QtWebEngine[QML]: + * Fix loading some favicons including qt.io's + + - QtWebEngineWidgets: + * [QTBUG-62147] Fix crash on shutdown if a QWebEngineProfile was child + of QApplication. + +**************************************************************************** +* Platform Specific Changes * +**************************************************************************** + + - Windows: + * Fix build issues with newer VS 2017 updates + + - Linux: + * Fix build issue with clang 3.9 + * [QTBUG-63675] Fix build issue with gcc 7.2 + + - macOS: + * Support for 10.13 High Sierra internals diff --git a/examples/webenginewidgets/spellchecker/spellchecker.pro b/examples/webenginewidgets/spellchecker/spellchecker.pro index a5f59974a..d41f2c4f7 100644 --- a/examples/webenginewidgets/spellchecker/spellchecker.pro +++ b/examples/webenginewidgets/spellchecker/spellchecker.pro @@ -5,7 +5,7 @@ TARGET = spellchecker QT += webenginewidgets CONFIG += c++11 -qtConfig(native-spellchecker) { +qtConfig(webengine-native-spellchecker) { error("Spellcheck example can not be built when using native OS dictionaries.") } diff --git a/examples/webenginewidgets/webenginewidgets.pro b/examples/webenginewidgets/webenginewidgets.pro index 8e91c530b..ed8fa2561 100644 --- a/examples/webenginewidgets/webenginewidgets.pro +++ b/examples/webenginewidgets/webenginewidgets.pro @@ -14,7 +14,7 @@ SUBDIRS += \ qtHaveModule(positioning): SUBDIRS += maps -qtConfig(spellchecker):!qtConfig(native-spellchecker):!cross_compile { +qtConfig(webengine-spellchecker):!qtConfig(webengine-native-spellchecker):!cross_compile { SUBDIRS += spellchecker } else { message("Spellcheck example will not be built because it depends on usage of Hunspell dictionaries.") diff --git a/mkspecs/features/configure.prf b/mkspecs/features/configure.prf index ed9882735..904e7b1c0 100644 --- a/mkspecs/features/configure.prf +++ b/mkspecs/features/configure.prf @@ -30,19 +30,19 @@ defineTest(runConfigure) { include($$QTWEBENGINE_OUT_ROOT/qtwebengine-config.pri) QT_FOR_CONFIG += webengine-private - !qtConfig(gperf) { + !qtConfig(webengine-gperf) { skipBuild("Required gperf could not be found.") return(false) } - !qtConfig(bison) { + !qtConfig(webengine-bison) { skipBuild("Required bison could not be found.") return(false) } - !qtConfig(flex) { + !qtConfig(webengine-flex) { skipBuild("Required flex could not be found.") return(false) } - !qtConfig(python2) { + !qtConfig(webengine-python2) { skipBuild("A suitable version of python2 could not be found.") return(false) } @@ -53,28 +53,28 @@ defineTest(runConfigure) { } linux { - !qtConfig(system-glibc) { + !qtConfig(webengine-system-glibc) { skipBuild("A suitable version of libc could not be found. See: https://sourceware.org/bugzilla/show_bug.cgi?id=14898") return(false) } QT_FOR_CONFIG += gui-private - !qtConfig(system-khr) { + !qtConfig(webengine-system-khr) { skipBuild("khronos development headers appear to be missing (mesa/libegl1-mesa-dev)") return(false) } for(package, $$list("nss dbus fontconfig")) { - !qtConfig(system-$$package) { + !qtConfig(webengine-system-$$package) { skipBuild("A suitable version of $$package could not be found.") return(false) } } - !qtConfig(embedded): qtConfig(xcb) { + !qtConfig(webengine-embedded-build): qtConfig(xcb) { for(package, $$list("libdrm xcomposite xcursor xi xrandr xtst")) { - !qtConfig(system-$$package) { + !qtConfig(webengine-system-$$package) { skipBuild("A suitable version of $$package could not be found.") return(false) } diff --git a/mkspecs/features/functions.prf b/mkspecs/features/functions.prf index c15b5118d..3b9a400b1 100644 --- a/mkspecs/features/functions.prf +++ b/mkspecs/features/functions.prf @@ -78,7 +78,7 @@ defineReplace(gnPath) { defineReplace(gnArgs) { linux { - qtConfig(embedded): include($$QTWEBENGINE_ROOT/src/core/config/embedded_linux.pri) + qtConfig(webengine-embedded-build): include($$QTWEBENGINE_ROOT/src/core/config/embedded_linux.pri) else: include($$QTWEBENGINE_ROOT/src/core/config/desktop_linux.pri) } macos: include($$QTWEBENGINE_ROOT/src/core/config/mac_osx.pri) diff --git a/mkspecs/features/platform.prf b/mkspecs/features/platform.prf index 0b0bb6746..bb171f753 100644 --- a/mkspecs/features/platform.prf +++ b/mkspecs/features/platform.prf @@ -33,7 +33,7 @@ defineTest(isPlatformSupported) { skipBuild("Qt WebEngine on Windows requires a Windows SDK version 10.0.10586 or newer.") return(false) } - !qtConfig(winversion) { + !qtConfig(webengine-winversion) { skipBuild("Needs VS 2015 Update 3 with Cumulative Servicing Release or higher") return(false) } diff --git a/src/3rdparty b/src/3rdparty -Subproject c34649b6774ea6cd162049e1242abece13f3a1a +Subproject 2366767e6c6f333ef090667aa6838d6781725a7 diff --git a/src/buildtools/gn.pro b/src/buildtools/gn.pro index 9d9af9eb8..f66f4bd68 100644 --- a/src/buildtools/gn.pro +++ b/src/buildtools/gn.pro @@ -7,11 +7,11 @@ include($$QTWEBENGINE_OUT_ROOT/qtwebengine-config.pri) QT_FOR_CONFIG += webengine webengine-private build_pass|!debug_and_release { - !qtConfig(system-gn): CONFIG(release, debug|release) { + !qtConfig(webengine-system-gn): CONFIG(release, debug|release) { buildgn.target = build_gn gn_args = $$gnArgs() out = $$gnPath() - !qtConfig(system-ninja): ninja_path = "--path $$ninjaPath()" + !qtConfig(webengine-system-ninja): ninja_path = "--path $$ninjaPath()" # check if it is not already build !exists($$out) { mkpath($$dirname(out)) diff --git a/src/buildtools/ninja.pro b/src/buildtools/ninja.pro index c99513f85..1b15bcb6b 100644 --- a/src/buildtools/ninja.pro +++ b/src/buildtools/ninja.pro @@ -7,7 +7,7 @@ QT_FOR_CONFIG += webengine-private build_pass|!debug_and_release { - !qtConfig(system-ninja): CONFIG(release, debug|release) { + !qtConfig(webengine-system-ninja): CONFIG(release, debug|release) { out = $$ninjaPath() # check if it is not already build !exists($$out) { diff --git a/src/core/config/common.pri b/src/core/config/common.pri index e7010a13a..c1d5331ab 100644 --- a/src/core/config/common.pri +++ b/src/core/config/common.pri @@ -14,7 +14,7 @@ gn_args += \ enable_swiftshader=false \ use_custom_libcxx=false -qtConfig(printing-and-pdf) { +qtConfig(webengine-printing-and-pdf) { gn_args += enable_basic_printing=true enable_print_preview=true gn_args += enable_pdf=true } else { @@ -22,25 +22,25 @@ qtConfig(printing-and-pdf) { gn_args += enable_pdf=false } -qtConfig(pepper-plugins) { +qtConfig(webengine-pepper-plugins) { gn_args += enable_plugins=true enable_widevine=true } else { gn_args += enable_plugins=false enable_widevine=false } -qtConfig(spellchecker) { +qtConfig(webengine-spellchecker) { gn_args += enable_spellcheck=true } else { gn_args += enable_spellcheck=false } -qtConfig(webrtc) { +qtConfig(webengine-webrtc) { gn_args += enable_webrtc=true } else { gn_args += enable_webrtc=false } -qtConfig(proprietary-codecs): gn_args += proprietary_codecs=true ffmpeg_branding=\"Chrome\" +qtConfig(webengine-proprietary-codecs): gn_args += proprietary_codecs=true ffmpeg_branding=\"Chrome\" CONFIG(release, debug|release) { force_debug_info { diff --git a/src/core/config/linux.pri b/src/core/config/linux.pri index 78f3e5093..c5329dfcc 100644 --- a/src/core/config/linux.pri +++ b/src/core/config/linux.pri @@ -115,20 +115,21 @@ host_build { gn_args += host_pkg_config=\"pkg-config\" } - qtConfig(webengine-system-zlib): qtConfig(system-minizip) { + qtConfig(webengine-system-zlib): qtConfig(webengine-system-minizip) { gn_args += use_system_zlib=true use_system_minizip=true + qtConfig(printing-and-pdf): gn_args += pdfium_use_system_zlib=true } qtConfig(webengine-system-png): gn_args += use_system_libpng=true qtConfig(system-jpeg): gn_args += use_system_libjpeg=true qtConfig(system-freetype): gn_args += use_system_freetype=true qtConfig(webengine-system-harfbuzz): gn_args += use_system_harfbuzz=true - qtConfig(system-glib): gn_args += use_glib=false - qtConfig(pulseaudio) { + qtConfig(webengine-system-glib): gn_args += use_glib=false + qtConfig(webengine-pulseaudio) { gn_args += use_pulseaudio=true } else { gn_args += use_pulseaudio=false } - qtConfig(alsa) { + qtConfig(webengine-alsa) { gn_args += use_alsa=true } else { gn_args += use_alsa=false @@ -138,18 +139,19 @@ host_build { !packagesExist(libpci): gn_args += use_libpci=false !packagesExist(xscrnsaver): gn_args += use_xscrnsaver=false - qtConfig(system-libevent): gn_args += use_system_libevent=true - qtConfig(system-libwebp): gn_args += use_system_libwebp=true - qtConfig(system-libxml2): gn_args += use_system_libxml=true use_system_libxslt=true - qtConfig(system-opus): gn_args += use_system_opus=true - qtConfig(system-snappy): gn_args += use_system_snappy=true - qtConfig(system-libvpx): gn_args += use_system_libvpx=true - qtConfig(system-icu): gn_args += use_system_icu=true icu_use_data_file=false - qtConfig(system-ffmpeg): gn_args += use_system_ffmpeg=true - qtConfig(system-re2): gn_args += use_system_re2=true + qtConfig(webengine-system-libevent): gn_args += use_system_libevent=true + qtConfig(webengine-system-libwebp): gn_args += use_system_libwebp=true + qtConfig(webengine-system-libxml2): gn_args += use_system_libxml=true use_system_libxslt=true + qtConfig(webengine-system-opus): gn_args += use_system_opus=true + qtConfig(webengine-system-snappy): gn_args += use_system_snappy=true + qtConfig(webengine-system-libvpx): gn_args += use_system_libvpx=true + qtConfig(webengine-system-icu): gn_args += use_system_icu=true icu_use_data_file=false + qtConfig(webengine-system-ffmpeg): gn_args += use_system_ffmpeg=true + qtConfig(webengine-system-re2): gn_args += use_system_re2=true + qtConfig(webengine-system-lcms2): gn_args += use_system_lcms2=true # FIXME: - #qtConfig(system-protobuf): gn_args += use_system_protobuf=true - #qtConfig(system-jsoncpp): gn_args += use_system_jsoncpp=true - #qtConfig(system-libsrtp: gn_args += use_system_libsrtp=true + #qtConfig(webengine-system-protobuf): gn_args += use_system_protobuf=true + #qtConfig(webengine-system-jsoncpp): gn_args += use_system_jsoncpp=true + #qtConfig(webengine-system-libsrtp: gn_args += use_system_libsrtp=true } diff --git a/src/core/config/mac_osx.pri b/src/core/config/mac_osx.pri index 57f301f18..2d820c889 100644 --- a/src/core/config/mac_osx.pri +++ b/src/core/config/mac_osx.pri @@ -32,8 +32,8 @@ gn_args += \ toolkit_views=false \ use_external_popup_menu=false -qtConfig(spellchecker) { - qtConfig(native-spellchecker): gn_args += use_browser_spellchecker=true +qtConfig(webengine-spellchecker) { + qtConfig(webengine-native-spellchecker): gn_args += use_browser_spellchecker=true else: gn_args += use_browser_spellchecker=false } else { gn_args += use_browser_spellchecker=false diff --git a/src/core/content_client_qt.cpp b/src/core/content_client_qt.cpp index 1016db0d5..a3a460cb4 100644 --- a/src/core/content_client_qt.cpp +++ b/src/core/content_client_qt.cpp @@ -236,6 +236,7 @@ void AddPepperWidevine(std::vector<content::PepperPluginInfo>* plugins) #elif defined(Q_OS_LINUX) pluginPaths << QStringLiteral("/opt/google/chrome/libwidevinecdmadapter.so") // Google Chrome << QStringLiteral("/usr/lib/chromium/libwidevinecdmadapter.so") // Arch + << QStringLiteral("/usr/lib/chromium-browser/libwidevinecdmadapter.so") // Ubuntu/neon << QStringLiteral("/usr/lib64/chromium/libwidevinecdmadapter.so"); // OpenSUSE style #endif } @@ -257,7 +258,7 @@ void AddPepperWidevine(std::vector<content::PepperPluginInfo>* plugins) std::vector<std::string> codecs; codecs.push_back(kCdmSupportedCodecVp8); codecs.push_back(kCdmSupportedCodecVp9); -#if defined(USE_PROPRIETARY_CODECS) +#if BUILDFLAG(USE_PROPRIETARY_CODECS) codecs.push_back(kCdmSupportedCodecAvc1); #endif // defined(USE_PROPRIETARY_CODECS) std::string codec_string = diff --git a/src/core/core_chromium.pri b/src/core/core_chromium.pri index 8e24645f0..0ec6979c8 100644 --- a/src/core/core_chromium.pri +++ b/src/core/core_chromium.pri @@ -28,7 +28,7 @@ RCC_DIR = $$OUT_PWD/$$getConfigDir()/.rcc # Assume that we want mobile touch and low-end hardware behaviors # whenever we are cross compiling. -qtConfig(embedded): DEFINES += QTWEBENGINE_EMBEDDED_SWITCHES +qtConfig(webengine-embedded-build): DEFINES += QTWEBENGINE_EMBEDDED_SWITCHES qtConfig(egl): CONFIG += egl @@ -186,7 +186,7 @@ HEADERS = \ web_engine_settings.h \ web_event_factory.h -qtConfig(pepper-plugins) { +qtConfig(webengine-pepper-plugins) { SOURCES += \ renderer_host/pepper/pepper_flash_browser_host_qt.cpp \ @@ -203,7 +203,7 @@ qtConfig(pepper-plugins) { renderer/pepper/pepper_renderer_host_factory_qt.h } -qtConfig(printing-and-pdf) { +qtConfig(webengine-printing-and-pdf) { SOURCES += \ printing_message_filter_qt.cpp \ diff --git a/src/core/core_module.pro b/src/core/core_module.pro index 78bb8baee..2409ccb12 100644 --- a/src/core/core_module.pro +++ b/src/core/core_module.pro @@ -115,7 +115,7 @@ icu.files = $$OUT_PWD/$$getConfigDir()/icudtl.dat resources.path = $$[QT_INSTALL_DATA]/resources INSTALLS += locales resources - !qtConfig(system-icu) { + !qtConfig(webengine-system-icu) { icu.CONFIG += no_check_exist icu.path = $$[QT_INSTALL_DATA]/resources INSTALLS += icu @@ -127,7 +127,7 @@ icu.files = $$OUT_PWD/$$getConfigDir()/icudtl.dat # Copy essential files to the qtbase build directory for non-prefix builds # - !qtConfig(system-icu) { + !qtConfig(webengine-system-icu) { COPIES += icu } diff --git a/src/core/gn_run.pro b/src/core/gn_run.pro index a9089c569..dbf859100 100644 --- a/src/core/gn_run.pro +++ b/src/core/gn_run.pro @@ -5,7 +5,7 @@ TEMPLATE = aux qtConfig(debug_and_release): CONFIG += debug_and_release build_all -qtConfig(system-ninja) { +qtConfig(webengine-system-ninja) { QT_TOOL.ninja.binary = ninja } else { QT_TOOL.ninja.binary = $$shell_quote($$shell_path($$ninjaPath())) @@ -35,7 +35,7 @@ build_pass|!debug_and_release { gn_args += "qtwebengine_target=\"$$system_path($$OUT_PWD/$$getConfigDir()):QtWebEngineCore\"" - !qtConfig(system-gn) { + !qtConfig(webengine-system-gn) { gn_binary = $$system_quote($$system_path($$gnPath())) } diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp index 0f071f89e..80c9121f5 100644 --- a/src/core/render_widget_host_view_qt.cpp +++ b/src/core/render_widget_host_view_qt.cpp @@ -291,7 +291,7 @@ public: float GetHistoricalTouchMajor(size_t pointer_index, size_t historical_index) const override { return 0; } float GetHistoricalX(size_t pointer_index, size_t historical_index) const override { return 0; } float GetHistoricalY(size_t pointer_index, size_t historical_index) const override { return 0; } - ToolType GetToolType(size_t pointer_index) const override { return ui::MotionEvent::TOOL_TYPE_UNKNOWN; } + ToolType GetToolType(size_t pointer_index) const override { return ui::MotionEvent::TOOL_TYPE_FINGER; } int GetButtonState() const override { return 0; } private: @@ -1067,6 +1067,10 @@ bool RenderWidgetHostViewQt::forwardEvent(QEvent *event) case QEvent::InputMethodQuery: handleInputMethodQueryEvent(static_cast<QInputMethodQueryEvent*>(event)); break; + case QEvent::HoverLeave: + case QEvent::Leave: + m_host->ForwardMouseEvent(WebEventFactory::toWebMouseEvent(event)); + break; default: return false; } diff --git a/src/core/renderer/content_renderer_client_qt.cpp b/src/core/renderer/content_renderer_client_qt.cpp index 83c4d719e..5980d7b84 100644 --- a/src/core/renderer/content_renderer_client_qt.cpp +++ b/src/core/renderer/content_renderer_client_qt.cpp @@ -262,11 +262,11 @@ public: return true; case media::EmeInitDataType::CENC: -#if defined(USE_PROPRIETARY_CODECS) +#if BUILDFLAG(USE_PROPRIETARY_CODECS) return true; #else return false; -#endif // defined(USE_PROPRIETARY_CODECS) +#endif // BUILDFLAG(USE_PROPRIETARY_CODECS) case media::EmeInitDataType::UNKNOWN: return false; @@ -277,7 +277,7 @@ public: media::SupportedCodecs GetSupportedCodecs() const override { -#if defined(USE_PROPRIETARY_CODECS) +#if BUILDFLAG(USE_PROPRIETARY_CODECS) return media::EME_CODEC_MP4_ALL | media::EME_CODEC_WEBM_ALL; #else return media::EME_CODEC_WEBM_ALL; @@ -390,10 +390,10 @@ static void AddPepperBasedWidevine(std::vector<std::unique_ptr<media::KeySystemP supported_codecs |= media::EME_CODEC_WEBM_VORBIS; supported_codecs |= media::EME_CODEC_WEBM_VP8; supported_codecs |= media::EME_CODEC_WEBM_VP9; -#if defined(USE_PROPRIETARY_CODECS) +#if BUILDFLAG(USE_PROPRIETARY_CODECS) supported_codecs |= media::EME_CODEC_MP4_AVC1; supported_codecs |= media::EME_CODEC_MP4_AAC; -#endif // defined(USE_PROPRIETARY_CODECS) +#endif // BUILDFLAG(USE_PROPRIETARY_CODECS) using Robustness = cdm::WidevineKeySystemProperties::Robustness; concrete_key_systems->emplace_back(new cdm::WidevineKeySystemProperties( diff --git a/src/core/renderer/web_channel_ipc_transport.cpp b/src/core/renderer/web_channel_ipc_transport.cpp index 554bda2a8..94a7baa1d 100644 --- a/src/core/renderer/web_channel_ipc_transport.cpp +++ b/src/core/renderer/web_channel_ipc_transport.cpp @@ -186,7 +186,7 @@ void WebChannelIPCTransport::installWebChannel(uint worldId) void WebChannelIPCTransport::uninstallWebChannel(uint worldId) { - Q_ASSERT(worldId = m_installedWorldId); + Q_ASSERT(worldId == m_installedWorldId); blink::WebView *webView = render_view()->GetWebView(); if (!webView) return; diff --git a/src/core/url_request_qrc_job_qt.cpp b/src/core/url_request_qrc_job_qt.cpp index b4e960921..a2712653d 100644 --- a/src/core/url_request_qrc_job_qt.cpp +++ b/src/core/url_request_qrc_job_qt.cpp @@ -112,7 +112,7 @@ int URLRequestQrcJobQt::ReadRawData(IOBuffer *buf, int bufSize) void URLRequestQrcJobQt::startGetHead() { // Get qrc file path. - QString qrcFilePath = ':' + toQt(request_->url()).path(QUrl::RemovePath | QUrl::RemoveQuery); + QString qrcFilePath = ':' + toQt(request_->url()).path(); m_file.setFileName(qrcFilePath); QFileInfo qrcFileInfo(m_file); // Get qrc file mime type. diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp index effd6e340..812a6f1c0 100644 --- a/src/core/web_contents_adapter.cpp +++ b/src/core/web_contents_adapter.cpp @@ -594,6 +594,8 @@ void WebContentsAdapter::load(const QWebEngineHttpRequest &request) } d->webContents->GetController().LoadURLWithParams(params); + // Follow chrome::Navigate and invalidate the URL immediately. + d->webContentsDelegate->NavigationStateChanged(d->webContents.get(), content::INVALIDATE_TYPE_URL); focusIfNecessary(); } @@ -635,7 +637,7 @@ void WebContentsAdapter::save(const QString &filePath, int savePageFormat) QUrl WebContentsAdapter::activeUrl() const { Q_D(const WebContentsAdapter); - return toQt(d->webContents->GetLastCommittedURL()); + return d->webContentsDelegate->url(); } QUrl WebContentsAdapter::requestedUrl() const @@ -670,7 +672,7 @@ QUrl WebContentsAdapter::iconUrl() const QString WebContentsAdapter::pageTitle() const { Q_D(const WebContentsAdapter); - return toQt(d->webContents->GetTitle()); + return d->webContentsDelegate->title(); } QString WebContentsAdapter::selectedText() const @@ -1463,6 +1465,12 @@ void WebContentsAdapter::focusIfNecessary() d->webContents->Focus(); } +bool WebContentsAdapter::isFindTextInProgress() const +{ + Q_D(const WebContentsAdapter); + return d->lastFindRequestId != d->webContentsDelegate->lastReceivedFindReply(); +} + WebContentsAdapterClient::RenderProcessTerminationStatus WebContentsAdapterClient::renderProcessExitStatus(int terminationStatus) { auto status = WebContentsAdapterClient::RenderProcessTerminationStatus(-1); diff --git a/src/core/web_contents_adapter.h b/src/core/web_contents_adapter.h index 67fcbe7af..51fd2891d 100644 --- a/src/core/web_contents_adapter.h +++ b/src/core/web_contents_adapter.h @@ -184,6 +184,7 @@ public: void viewSource(); bool canViewSource(); void focusIfNecessary(); + bool isFindTextInProgress() const; private: diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp index f35620c86..96c7c4c41 100644 --- a/src/core/web_contents_delegate_qt.cpp +++ b/src/core/web_contents_delegate_qt.cpp @@ -131,10 +131,21 @@ content::WebContents *WebContentsDelegateQt::OpenURLFromTab(content::WebContents void WebContentsDelegateQt::NavigationStateChanged(content::WebContents* source, content::InvalidateTypes changed_flags) { - if (changed_flags & content::INVALIDATE_TYPE_URL) - m_viewClient->urlChanged(toQt(source->GetVisibleURL())); - if (changed_flags & content::INVALIDATE_TYPE_TITLE) - m_viewClient->titleChanged(toQt(source->GetTitle())); + if (changed_flags & content::INVALIDATE_TYPE_URL) { + QUrl newUrl = toQt(source->GetVisibleURL()); + if (m_url != newUrl) { + m_url = newUrl; + m_viewClient->urlChanged(m_url); + } + } + + if (changed_flags & content::INVALIDATE_TYPE_TITLE) { + QString newTitle = toQt(source->GetTitle()); + if (m_title != newTitle) { + m_title = newTitle; + m_viewClient->titleChanged(m_title); + } + } // NavigationStateChanged gets called with INVALIDATE_TYPE_TAB by AudioStateProvider::Notify, // whenever an audio sound gets played or stopped, this is the only way to actually figure out @@ -146,20 +157,6 @@ void WebContentsDelegateQt::NavigationStateChanged(content::WebContents* source, } } -bool WebContentsDelegateQt::ShouldPreserveAbortedURLs(content::WebContents *source) -{ - Q_UNUSED(source) - - // Allow failed URLs to stick around in the URL bar, but only when the error-page is enabled. - WebEngineSettings *settings = m_viewClient->webEngineSettings(); - bool isErrorPageEnabled = settings->testAttribute(settings->Attribute::ErrorPageEnabled); - - if (isErrorPageEnabled) - return true; - - return false; -} - void WebContentsDelegateQt::AddNewContents(content::WebContents* source, content::WebContents* new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, bool user_gesture, bool* was_blocked) { Q_UNUSED(source) diff --git a/src/core/web_contents_delegate_qt.h b/src/core/web_contents_delegate_qt.h index 44fb93093..8440ec053 100644 --- a/src/core/web_contents_delegate_qt.h +++ b/src/core/web_contents_delegate_qt.h @@ -97,6 +97,9 @@ public: void setLastSearchedString(const QString &s) { m_lastSearchedString = s; } int lastReceivedFindReply() const { return m_lastReceivedFindReply; } + QUrl url() const { return m_url; } + QString title() const { return m_title; } + // WebContentsDelegate overrides content::WebContents *OpenURLFromTab(content::WebContents *source, const content::OpenURLParams ¶ms) override; void NavigationStateChanged(content::WebContents* source, content::InvalidateTypes changed_flags) override; @@ -119,7 +122,6 @@ public: bool IsPopupOrPanel(const content::WebContents *source) const override; void UpdateTargetURL(content::WebContents* source, const GURL& url) override; void RequestToLockMouse(content::WebContents *web_contents, bool user_gesture, bool last_unlocked_by_target) override; - bool ShouldPreserveAbortedURLs(content::WebContents *source) override; void ShowValidationMessage(content::WebContents *web_contents, const gfx::Rect &anchor_in_root_view, const base::string16 &main_text, const base::string16 &sub_text) override; void HideValidationMessage(content::WebContents *web_contents) override; void MoveValidationMessage(content::WebContents *web_contents, const gfx::Rect &anchor_in_root_view) override; @@ -165,6 +167,9 @@ private: QSharedPointer<FilePickerController> m_filePickerController; QUrl m_initialTargetUrl; int m_lastLoadProgress; + + QUrl m_url; + QString m_title; }; } // namespace QtWebEngineCore diff --git a/src/core/web_event_factory.cpp b/src/core/web_event_factory.cpp index 8c997335c..3193f885a 100644 --- a/src/core/web_event_factory.cpp +++ b/src/core/web_event_factory.cpp @@ -1019,12 +1019,14 @@ static ui::DomKey getDomKeyFromQKeyEvent(QKeyEvent *ev) } } -static inline double currentTimeForEvent(const QInputEvent* event) +static inline double currentTimeForEvent(const QEvent *event) { Q_ASSERT(event); - if (event->timestamp()) - return static_cast<double>(event->timestamp()) / 1000; + if (const QInputEvent *inputEvent = static_cast<const QInputEvent *>(event)) { + if (inputEvent->timestamp()) + return static_cast<double>(inputEvent->timestamp()) / 1000; + } static QElapsedTimer timer; if (!timer.isValid()) @@ -1190,6 +1192,7 @@ WebMouseEvent WebEventFactory::toWebMouseEvent(QMouseEvent *ev, double dpiScale) webKitEvent.button = mouseButtonForEvent(ev); webKitEvent.click_count = 0; + webKitEvent.pointer_type = WebPointerProperties::PointerType::kMouse; return webKitEvent; } @@ -1204,7 +1207,18 @@ WebMouseEvent WebEventFactory::toWebMouseEvent(QHoverEvent *ev, double dpiScale) webKitEvent.SetPositionInWidget(ev->pos().x() / dpiScale, ev->pos().y() / dpiScale); webKitEvent.movement_x = ev->pos().x() - ev->oldPos().x(); webKitEvent.movement_y = ev->pos().y() - ev->oldPos().y(); + webKitEvent.pointer_type = WebPointerProperties::PointerType::kMouse; + + return webKitEvent; +} +WebMouseEvent WebEventFactory::toWebMouseEvent(QEvent *ev) +{ + Q_ASSERT(ev->type() == QEvent::Leave || ev->type() == QEvent::HoverLeave); + + WebMouseEvent webKitEvent; + webKitEvent.SetTimeStampSeconds(currentTimeForEvent(ev)); + webKitEvent.SetType(WebInputEvent::kMouseLeave); return webKitEvent; } diff --git a/src/core/web_event_factory.h b/src/core/web_event_factory.h index f4ce417cd..5b8f08968 100644 --- a/src/core/web_event_factory.h +++ b/src/core/web_event_factory.h @@ -50,6 +50,7 @@ #include <QtGlobal> QT_BEGIN_NAMESPACE +class QEvent; class QHoverEvent; class QKeyEvent; class QMouseEvent; @@ -64,6 +65,7 @@ class WebEventFactory { public: static blink::WebMouseEvent toWebMouseEvent(QMouseEvent*, double dpiScale); static blink::WebMouseEvent toWebMouseEvent(QHoverEvent*, double dpiScale); + static blink::WebMouseEvent toWebMouseEvent(QEvent *); #ifndef QT_NO_GESTURES static blink::WebGestureEvent toWebGestureEvent(QNativeGestureEvent *, double dpiScale); #endif diff --git a/src/src.pro b/src/src.pro index 76d342c8d..d675f1f13 100644 --- a/src/src.pro +++ b/src/src.pro @@ -20,20 +20,20 @@ SUBDIRS += buildtools \ plugins -qtConfig(spellchecker):!qtConfig(native-spellchecker):!cross_compile { +qtConfig(webengine-spellchecker):!qtConfig(webengine-native-spellchecker):!cross_compile { SUBDIRS += qwebengine_convert_dict qwebengine_convert_dict.subdir = tools/qwebengine_convert_dict qwebengine_convert_dict.depends = core } -qtConfig(testsupport) { +qtConfig(webengine-testsupport) { webengine_testsupport_plugin.subdir = webengine/plugin/testsupport webengine_testsupport_plugin.target = sub-webengine-testsupport-plugin webengine_testsupport_plugin.depends = webengine SUBDIRS += webengine_testsupport_plugin } -qtConfig(ui-delegates) { +qtConfig(webengine-ui-delegates) { SUBDIRS += webengine/ui \ webengine/ui2 } diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp index f5d3646d8..addb7d6df 100644 --- a/src/webengine/api/qquickwebengineview.cpp +++ b/src/webengine/api/qquickwebengineview.cpp @@ -338,7 +338,7 @@ void QQuickWebEngineViewPrivate::navigationRequested(int navigationType, const Q Q_EMIT q->navigationRequested(&navigationRequest); navigationRequestAction = navigationRequest.action(); - if ((navigationRequestAction == WebContentsAdapterClient::AcceptRequest) && adapter) + if ((navigationRequestAction == WebContentsAdapterClient::AcceptRequest) && adapter && adapter->isFindTextInProgress()) adapter->stopFinding(); } diff --git a/src/webengine/render_widget_host_view_qt_delegate_quick.cpp b/src/webengine/render_widget_host_view_qt_delegate_quick.cpp index 0e06ddbce..0a31811d9 100644 --- a/src/webengine/render_widget_host_view_qt_delegate_quick.cpp +++ b/src/webengine/render_widget_host_view_qt_delegate_quick.cpp @@ -316,6 +316,11 @@ void RenderWidgetHostViewQtDelegateQuick::hoverMoveEvent(QHoverEvent *event) m_client->forwardEvent(event); } +void RenderWidgetHostViewQtDelegateQuick::hoverLeaveEvent(QHoverEvent *event) +{ + m_client->forwardEvent(event); +} + QVariant RenderWidgetHostViewQtDelegateQuick::inputMethodQuery(Qt::InputMethodQuery query) const { return m_client->inputMethodQuery(query); diff --git a/src/webengine/render_widget_host_view_qt_delegate_quick.h b/src/webengine/render_widget_host_view_qt_delegate_quick.h index d93fd539a..7426dc16d 100644 --- a/src/webengine/render_widget_host_view_qt_delegate_quick.h +++ b/src/webengine/render_widget_host_view_qt_delegate_quick.h @@ -90,6 +90,7 @@ protected: virtual void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE; virtual void touchEvent(QTouchEvent *event) Q_DECL_OVERRIDE; virtual void hoverMoveEvent(QHoverEvent *event) Q_DECL_OVERRIDE; + virtual void hoverLeaveEvent(QHoverEvent *event) Q_DECL_OVERRIDE; virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const Q_DECL_OVERRIDE; virtual void inputMethodEvent(QInputMethodEvent *event) Q_DECL_OVERRIDE; virtual void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) Q_DECL_OVERRIDE; diff --git a/src/webengine/ui_delegates_manager.cpp b/src/webengine/ui_delegates_manager.cpp index 43e6e8817..fb23f5db7 100644 --- a/src/webengine/ui_delegates_manager.cpp +++ b/src/webengine/ui_delegates_manager.cpp @@ -257,7 +257,7 @@ QObject *UIDelegatesManager::addMenu(QObject *parentMenu, const QString &title, if (!title.isEmpty()) QQmlProperty(menu, QStringLiteral("title")).write(title); if (!pos.isNull()) - QQmlProperty(menu, QStringLiteral("pos")).write(pos); + menu->setProperty("pos", pos); menu->setParent(parentMenu); @@ -496,9 +496,38 @@ void UIDelegatesManager::showFilePicker(QSharedPointer<FilePickerController> con QMetaObject::invokeMethod(filePicker, "open"); } +class TemporaryCursorMove +{ +public: + TemporaryCursorMove(const QQuickItem *item, const QPoint &pos) + { + if (pos.isNull() || !item->contains(pos)) + return; + const QPoint oldPos = QCursor::pos(); + const QPoint globalPos = item->mapToGlobal(QPointF(pos)).toPoint(); + if (oldPos == globalPos) + return; + m_oldCursorPos = oldPos; + QCursor::setPos(globalPos); + } + + ~TemporaryCursorMove() + { + if (!m_oldCursorPos.isNull()) + QCursor::setPos(m_oldCursorPos); + } + +private: + QPoint m_oldCursorPos; +}; + void UIDelegatesManager::showMenu(QObject *menu) { - QMetaObject::invokeMethod(menu, "popup"); + // QtQuick.Controls.Menu.popup() always shows the menu under the mouse cursor, i.e. the menu's + // position we set above is ignored. Work around the problem by moving the mouse cursor + // temporarily to the right position. + TemporaryCursorMove tcm(m_view, menu->property("pos").toPoint()); + QMetaObject::invokeMethod(menu, "popup"); } void UIDelegatesManager::showMessageBubble(const QRect &anchor, const QString &mainText, const QString &subText) diff --git a/src/webengine/webengine.pro b/src/webengine/webengine.pro index 24fa2d9d8..58e1263a7 100644 --- a/src/webengine/webengine.pro +++ b/src/webengine/webengine.pro @@ -58,7 +58,7 @@ HEADERS = \ render_widget_host_view_qt_delegate_quickwindow.h \ ui_delegates_manager.h -qtConfig(testsupport) { +qtConfig(webengine-testsupport) { QT += testlib SOURCES += api/qquickwebenginetestsupport.cpp @@ -67,11 +67,11 @@ qtConfig(testsupport) { DEFINES += ENABLE_QML_TESTSUPPORT_API } -qtConfig(spellchecker) { +qtConfig(webengine-spellchecker) { DEFINES += ENABLE_SPELLCHECK } -qtConfig(printing-and-pdf) { +qtConfig(webengine-printing-and-pdf) { DEFINES += ENABLE_PDF } diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp index c048a49f4..420057651 100644 --- a/src/webenginewidgets/api/qwebenginepage.cpp +++ b/src/webenginewidgets/api/qwebenginepage.cpp @@ -1489,7 +1489,7 @@ void QWebEnginePagePrivate::navigationRequested(int navigationType, const QUrl & { Q_Q(QWebEnginePage); bool accepted = q->acceptNavigationRequest(url, static_cast<QWebEnginePage::NavigationType>(navigationType), isMainFrame); - if (accepted && adapter) + if (accepted && adapter && adapter->isFindTextInProgress()) adapter->stopFinding(); navigationRequestAction = accepted ? WebContentsAdapterClient::AcceptRequest : WebContentsAdapterClient::IgnoreRequest; } diff --git a/src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc index d3b16a935..3fe87082a 100644 --- a/src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc +++ b/src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc @@ -163,7 +163,8 @@ origins to access Geolocation again. Disabled by default. (Added in Qt 5.9) \value AllowWindowActivationFromJavaScript - Allows the window.focus() method in JavaScript. Disallowed by default. + Allows activating windows by using the window.focus() JavaScript + method. Disabled by default. (Added in Qt 5.10) \value ShowScrollBars Shows scroll bars. diff --git a/src/webenginewidgets/webenginewidgets.pro b/src/webenginewidgets/webenginewidgets.pro index ffe9cc0de..540c4d538 100644 --- a/src/webenginewidgets/webenginewidgets.pro +++ b/src/webenginewidgets/webenginewidgets.pro @@ -44,17 +44,17 @@ HEADERS = \ api/qwebengineview_p.h \ render_widget_host_view_qt_delegate_widget.h -qtConfig(ui-delegates) { +qtConfig(webengine-ui-delegates) { SOURCES += ui/messagebubblewidget.cpp HEADERS += ui/messagebubblewidget_p.h DEFINES += QT_UI_DELEGATES } -qtConfig(spellchecker) { +qtConfig(webengine-spellchecker) { DEFINES += ENABLE_SPELLCHECK } -qtConfig(printing-and-pdf) { +qtConfig(webengine-printing-and-pdf) { DEFINES += ENABLE_PRINTING DEFINES += ENABLE_PDF QT += printsupport diff --git a/tests/auto/quick/qmltests/BLACKLIST b/tests/auto/quick/qmltests/BLACKLIST index 19d75dfb7..f449f4949 100644 --- a/tests/auto/quick/qmltests/BLACKLIST +++ b/tests/auto/quick/qmltests/BLACKLIST @@ -19,3 +19,6 @@ linux [WebEngineViewSingleFileUpload::test_acceptSingleFileSelection] * + +[WebViewFindText::test_findTextInterruptedByLoad] +* diff --git a/tests/auto/quick/qmltests/data/tst_mouseMove.qml b/tests/auto/quick/qmltests/data/tst_mouseMove.qml new file mode 100644 index 000000000..adb937139 --- /dev/null +++ b/tests/auto/quick/qmltests/data/tst_mouseMove.qml @@ -0,0 +1,96 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtWebEngine module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 +import QtTest 1.0 +import QtWebEngine 1.4 + +Rectangle { + id: root + width: 200 + height: 200 + + Column { + anchors.fill: parent + Rectangle { + id: placeHolder + width: parent.width + height: 100 + color: "red" + } + + TestWebEngineView { + id: webEngineView + width: parent.width + height: 100 + + function getInnerText(element) { + var innerText; + runJavaScript("document.getElementById('" + element + "').innerText", function(result) { + innerText = result; + }); + testCase.tryVerify(function() { return innerText != undefined; }); + return innerText; + } + } + } + + TestCase { + id: testCase + name: "WebEngineViewMouseMove" + when: windowShown + + function test_mouseLeave() { + mouseMove(root, 0, 0); + webEngineView.loadHtml( + "<html>" + + "<head><script>" + + "function init() {" + + " var div = document.getElementById('testDiv');" + + " div.onmouseenter = function(e) { div.innerText = 'Mouse IN' };" + + " div.onmouseleave = function(e) { div.innerText = 'Mouse OUT' };" + + "}" + + "</script></head>" + + "<body onload='init()' style='margin: 0px; padding: 0px'>" + + " <div id='testDiv' style='width: 100%; height: 100%; background-color: green' />" + + "</body>" + + "</html>"); + verify(webEngineView.waitForLoadSucceeded()); + verify(!webEngineView.getInnerText("testDiv")); + + for (var i = 90; i < 110; ++i) + mouseMove(root, 50, i); + tryVerify(function() { return webEngineView.getInnerText("testDiv") == "Mouse IN" }); + + for (var i = 110; i > 90; --i) + mouseMove(root, 50, i); + tryVerify(function() { return webEngineView.getInnerText("testDiv") == "Mouse OUT" }); + } + } +} + diff --git a/tests/auto/quick/qmltests/data/tst_viewSource.qml b/tests/auto/quick/qmltests/data/tst_viewSource.qml index 22c3947d3..576035ef2 100644 --- a/tests/auto/quick/qmltests/data/tst_viewSource.qml +++ b/tests/auto/quick/qmltests/data/tst_viewSource.qml @@ -63,7 +63,7 @@ TestWebEngineView { name: "WebEngineViewSource" function init() { - webEngineView.url = Qt.resolvedUrl("about:blank"); + webEngineView.url = Qt.resolvedUrl("test1.html"); verify(webEngineView.waitForLoadSucceeded()); newViewRequestedSpy.clear(); @@ -103,8 +103,8 @@ TestWebEngineView { { tag: "view-source:about:blank", userInputUrl: "view-source:about:blank", loadSucceed: true, url: "view-source:about:blank", title: "view-source:about:blank" }, { tag: testLocalUrl, userInputUrl: testLocalUrl, loadSucceed: true, url: testLocalUrl, title: "test1.html" }, { tag: testLocalUrlWithoutScheme, userInputUrl: testLocalUrlWithoutScheme, loadSucceed: true, url: testLocalUrl, title: "test1.html" }, - { tag: "view-source:http://non.existent", userInputUrl: "view-source:http://non.existent", loadSucceed: false, url: "view-source:http://non.existent/", title: "non.existent" }, - { tag: "view-source:non.existent", userInputUrl: "view-source:non.existent", loadSucceed: false, url: "view-source:http://non.existent/", title: "non.existent" }, + { tag: "view-source:http://non.existent", userInputUrl: "view-source:http://non.existent", loadSucceed: false, url: "http://non.existent/", title: "non.existent" }, + { tag: "view-source:non.existent", userInputUrl: "view-source:non.existent", loadSucceed: false, url: "http://non.existent/", title: "non.existent" }, ]; } @@ -114,11 +114,10 @@ TestWebEngineView { if (row.loadSucceed) { verify(webEngineView.waitForLoadSucceeded()); - tryVerify(function() { return titleChangedSpy.count >= 1; }); } else { verify(webEngineView.waitForLoadFailed()); - tryVerify(function() { return titleChangedSpy.count >= 2; }); } + tryVerify(function() { return titleChangedSpy.count == 1; }); compare(webEngineView.url, row.url); tryCompare(webEngineView, "title", row.title); diff --git a/tests/auto/quick/qmltests/qmltests.pro b/tests/auto/quick/qmltests/qmltests.pro index 9530e115c..bb209a70c 100644 --- a/tests/auto/quick/qmltests/qmltests.pro +++ b/tests/auto/quick/qmltests/qmltests.pro @@ -62,6 +62,7 @@ OTHER_FILES += \ $$PWD/data/tst_loadRecursionCrash.qml \ $$PWD/data/tst_loadUrl.qml \ $$PWD/data/tst_mouseClick.qml \ + $$PWD/data/tst_mouseMove.qml \ $$PWD/data/tst_navigationHistory.qml \ $$PWD/data/tst_navigationRequested.qml \ $$PWD/data/tst_newViewRequest.qml \ @@ -100,7 +101,7 @@ OTHER_FILES += \ load(qt_build_paths) DEFINES += QUICK_TEST_SOURCE_DIR=\\\"$$re_escape($$PWD$${QMAKE_DIR_SEP}data)\\\" -!qtConfig(testsupport) { +!qtConfig(webengine-testsupport) { PLUGIN_EXTENSION = .so PLUGIN_PREFIX = lib osx: PLUGIN_PREFIX = .dylib diff --git a/tests/auto/quick/qquickwebengineview/qquickwebengineview.pro b/tests/auto/quick/qquickwebengineview/qquickwebengineview.pro index 0f62ec21d..25bf44597 100644 --- a/tests/auto/quick/qquickwebengineview/qquickwebengineview.pro +++ b/tests/auto/quick/qquickwebengineview/qquickwebengineview.pro @@ -5,7 +5,7 @@ QT_PRIVATE += webengine-private gui-private HEADERS += ../shared/util.h -qtConfig(printing-and-pdf) { +qtConfig(webengine-printing-and-pdf) { DEFINES += ENABLE_PDF } diff --git a/tests/auto/quick/quick.pro b/tests/auto/quick/quick.pro index 2e6343469..e67cf0ed0 100644 --- a/tests/auto/quick/quick.pro +++ b/tests/auto/quick/quick.pro @@ -8,7 +8,7 @@ SUBDIRS += \ qquickwebenginedefaultsurfaceformat \ qquickwebengineview -qtConfig(testsupport) { +qtConfig(webengine-testsupport) { SUBDIRS += \ qmltests \ qquickwebengineviewgraphics diff --git a/tests/auto/quick/tests.pri b/tests/auto/quick/tests.pri index 15f6517a4..7983a248f 100644 --- a/tests/auto/quick/tests.pri +++ b/tests/auto/quick/tests.pri @@ -19,7 +19,7 @@ QT += testlib network quick webengine # This define is used by some tests to look up resources in the source tree DEFINES += TESTS_SOURCE_DIR=\\\"$$PWD/\\\" -qtConfig(testsupport) { +qtConfig(webengine-testsupport) { DEFINES += ENABLE_QML_TESTSUPPORT_API } diff --git a/tests/auto/widgets/qwebenginedownloads/tst_qwebenginedownloads.cpp b/tests/auto/widgets/qwebenginedownloads/tst_qwebenginedownloads.cpp index 9531d0cf4..7094c8e4b 100644 --- a/tests/auto/widgets/qwebenginedownloads/tst_qwebenginedownloads.cpp +++ b/tests/auto/widgets/qwebenginedownloads/tst_qwebenginedownloads.cpp @@ -27,6 +27,7 @@ ****************************************************************************/ #include <QCoreApplication> +#include <QSignalSpy> #include <QStandardPaths> #include <QTemporaryDir> #include <QTest> @@ -37,6 +38,18 @@ #include <httpserver.h> #include <waitforsignal.h> +static std::unique_ptr<HttpReqRep> waitForFaviconRequest(HttpServer *server) +{ + auto rr = waitForRequest(server); + if (!rr || + rr->requestMethod() != QByteArrayLiteral("GET") || + rr->requestPath() != QByteArrayLiteral("/favicon.ico")) + return nullptr; + rr->setResponseStatus(404); + rr->sendResponse(); + return std::move(rr); +} + class tst_QWebEngineDownloads : public QObject { Q_OBJECT @@ -46,6 +59,7 @@ private Q_SLOTS: void downloadTwoLinks(); void downloadPage_data(); void downloadPage(); + void downloadViaSetUrl(); }; enum DownloadTestUserAction { @@ -317,12 +331,8 @@ void tst_QWebEngineDownloads::downloadLink() QVERIFY(loadOk); // 1.1. Ignore favicon request - auto favIconRR = waitForRequest(&server); + auto favIconRR = waitForFaviconRequest(&server); QVERIFY(favIconRR); - QCOMPARE(favIconRR->requestMethod(), QByteArrayLiteral("GET")); - QCOMPARE(favIconRR->requestPath(), QByteArrayLiteral("/favicon.ico")); - favIconRR->setResponseStatus(404); - favIconRR->sendResponse(); // 2. Simulate user action // @@ -439,12 +449,8 @@ void tst_QWebEngineDownloads::downloadTwoLinks() QVERIFY(waitForSignal(&page, &QWebEnginePage::loadFinished, [&](bool ok){ loadOk = ok; })); QVERIFY(loadOk); - auto favIconRR = waitForRequest(&server); + auto favIconRR = waitForFaviconRequest(&server); QVERIFY(favIconRR); - QCOMPARE(favIconRR->requestMethod(), QByteArrayLiteral("GET")); - QCOMPARE(favIconRR->requestPath(), QByteArrayLiteral("/favicon.ico")); - favIconRR->setResponseStatus(404); - favIconRR->sendResponse(); QTRY_VERIFY(view.focusWidget()); QWidget *renderWidget = view.focusWidget(); @@ -541,12 +547,8 @@ void tst_QWebEngineDownloads::downloadPage() QVERIFY(waitForSignal(&page, &QWebEnginePage::loadFinished, [&](bool ok){ loadOk = ok; })); QVERIFY(loadOk); - auto favIconRR = waitForRequest(&server); + auto favIconRR = waitForFaviconRequest(&server); QVERIFY(favIconRR); - QCOMPARE(favIconRR->requestMethod(), QByteArrayLiteral("GET")); - QCOMPARE(favIconRR->requestPath(), QByteArrayLiteral("/favicon.ico")); - favIconRR->setResponseStatus(404); - favIconRR->sendResponse(); QTemporaryDir tmpDir; QVERIFY(tmpDir.isValid()); @@ -593,5 +595,70 @@ void tst_QWebEngineDownloads::downloadPage() QVERIFY(file.exists()); } +void tst_QWebEngineDownloads::downloadViaSetUrl() +{ + // Reproduce the scenario described in QTBUG-63388 by triggering downloads + // of the same file multiple times via QWebEnginePage::setUrl + + HttpServer server; + QWebEngineProfile profile; + QWebEnginePage page(&profile); + QSignalSpy loadSpy(&page, &QWebEnginePage::loadFinished); + QSignalSpy urlSpy(&page, &QWebEnginePage::urlChanged); + const QUrl indexUrl = server.url(); + const QUrl fileUrl = server.url(QByteArrayLiteral("/file")); + + // Set up the test scenario by trying to load some unrelated HTML. + + page.setUrl(indexUrl); + + auto indexRR = waitForRequest(&server); + QVERIFY(indexRR); + QCOMPARE(indexRR->requestMethod(), QByteArrayLiteral("GET")); + QCOMPARE(indexRR->requestPath(), QByteArrayLiteral("/")); + indexRR->setResponseHeader(QByteArrayLiteral("content-type"), QByteArrayLiteral("text/html")); + indexRR->setResponseBody(QByteArrayLiteral("<html><body>Hello</body></html>")); + indexRR->sendResponse(); + + auto indexFavRR = waitForFaviconRequest(&server); + QVERIFY(indexFavRR); + + QTRY_COMPARE(loadSpy.count(), 1); + QTRY_COMPARE(urlSpy.count(), 1); + QCOMPARE(loadSpy.takeFirst().value(0).toBool(), true); + QCOMPARE(urlSpy.takeFirst().value(0).toUrl(), indexUrl); + + // Download files via setUrl. With QTBUG-63388 after the first iteration the + // downloads would be triggered for indexUrl and not fileUrl. + + QVector<QUrl> downloadUrls; + QObject::connect(&profile, &QWebEngineProfile::downloadRequested, [&](QWebEngineDownloadItem *item) { + downloadUrls.append(item->url()); + }); + + for (int i = 0; i != 3; ++i) { + page.setUrl(fileUrl); + QCOMPARE(page.url(), fileUrl); + + auto fileRR = waitForRequest(&server); + QVERIFY(fileRR); + fileRR->setResponseHeader(QByteArrayLiteral("content-disposition"), QByteArrayLiteral("attachment")); + fileRR->setResponseBody(QByteArrayLiteral("redacted")); + fileRR->sendResponse(); + + auto fileFavRR = waitForFaviconRequest(&server); + QVERIFY(fileFavRR); + + QTRY_COMPARE(loadSpy.count(), 1); + QTRY_COMPARE(urlSpy.count(), 2); + QTRY_COMPARE(downloadUrls.count(), 1); + QCOMPARE(loadSpy.takeFirst().value(0).toBool(), false); + QCOMPARE(urlSpy.takeFirst().value(0).toUrl(), fileUrl); + QCOMPARE(urlSpy.takeFirst().value(0).toUrl(), indexUrl); + QCOMPARE(downloadUrls.takeFirst(), fileUrl); + QCOMPARE(page.url(), indexUrl); + } +} + QTEST_MAIN(tst_QWebEngineDownloads) #include "tst_qwebenginedownloads.moc" diff --git a/tests/auto/widgets/qwebenginepage/qwebenginepage.pro b/tests/auto/widgets/qwebenginepage/qwebenginepage.pro index a2dbd4d70..47c09e1ce 100644 --- a/tests/auto/widgets/qwebenginepage/qwebenginepage.pro +++ b/tests/auto/widgets/qwebenginepage/qwebenginepage.pro @@ -1,4 +1,4 @@ include(../tests.pri) QT *= core-private -qtConfig(printing-and-pdf): DEFINES+=QWEBENGINEPAGE_PDFPRINTINGENABLED +qtConfig(webengine-printing-and-pdf): DEFINES+=QWEBENGINEPAGE_PDFPRINTINGENABLED diff --git a/tests/auto/widgets/qwebenginepage/resources/bar.txt b/tests/auto/widgets/qwebenginepage/resources/bar.txt new file mode 100644 index 000000000..5716ca598 --- /dev/null +++ b/tests/auto/widgets/qwebenginepage/resources/bar.txt @@ -0,0 +1 @@ +bar diff --git a/tests/auto/widgets/qwebenginepage/resources/foo.txt b/tests/auto/widgets/qwebenginepage/resources/foo.txt new file mode 100644 index 000000000..257cc5642 --- /dev/null +++ b/tests/auto/widgets/qwebenginepage/resources/foo.txt @@ -0,0 +1 @@ +foo diff --git a/tests/auto/widgets/qwebenginepage/resources/path with spaces.txt b/tests/auto/widgets/qwebenginepage/resources/path with spaces.txt new file mode 100644 index 000000000..4f79cb0dd --- /dev/null +++ b/tests/auto/widgets/qwebenginepage/resources/path with spaces.txt @@ -0,0 +1 @@ +contents with spaces diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp index b4b1abc8c..1c9b668ae 100644 --- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp +++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp @@ -193,6 +193,8 @@ private Q_SLOTS: void setUrlWithPendingLoads(); void setUrlToEmpty(); void setUrlToInvalid(); + void setUrlToBadDomain(); + void setUrlToBadPort(); void setUrlHistory(); void setUrlUsingStateObject(); void setUrlThenLoads_data(); @@ -200,6 +202,7 @@ private Q_SLOTS: void loadFinishedAfterNotFoundError(); void loadInSignalHandlers_data(); void loadInSignalHandlers(); + void loadFromQrc(); void restoreHistory(); void toPlainTextLoadFinishedRace_data(); @@ -2655,18 +2658,19 @@ Q_OBJECT public: GetUserMediaTestPage() : m_gotRequest(false) + , m_loadSucceeded(false) { connect(this, &QWebEnginePage::featurePermissionRequested, this, &GetUserMediaTestPage::onFeaturePermissionRequested); - + connect(this, &QWebEnginePage::loadFinished, [this](bool success){ + m_loadSucceeded = success; + }); // We need to load content from a resource in order for the securityOrigin to be valid. - QSignalSpy loadSpy(this, SIGNAL(loadFinished(bool))); load(QUrl("qrc:///resources/content.html")); - QTRY_COMPARE(loadSpy.count(), 1); } void jsGetUserMedia(const QString & constraints) { - runJavaScript( + evaluateJavaScriptSync(this, QStringLiteral( "var promiseFulfilled = false;" "var promiseRejected = false;" @@ -2707,6 +2711,11 @@ public: return m_gotRequest; } + bool loadSucceeded() const + { + return m_loadSucceeded; + } + private Q_SLOTS: void onFeaturePermissionRequested(const QUrl &securityOrigin, QWebEnginePage::Feature feature) { @@ -2717,6 +2726,7 @@ private Q_SLOTS: private: bool m_gotRequest; + bool m_loadSucceeded; QWebEnginePage::Feature m_requestedFeature; QUrl m_requestSecurityOrigin; @@ -2747,6 +2757,7 @@ void tst_QWebEnginePage::getUserMediaRequest() QFETCH(QWebEnginePage::Feature, feature); GetUserMediaTestPage page; + QTRY_VERIFY_WITH_TIMEOUT(page.loadSucceeded(), 20000); page.settings()->setAttribute(QWebEngineSettings::ScreenCaptureEnabled, true); // 1. Rejecting request on C++ side should reject promise on JS side. @@ -2775,6 +2786,7 @@ void tst_QWebEnginePage::getUserMediaRequest() void tst_QWebEnginePage::getUserMediaRequestDesktopAudio() { GetUserMediaTestPage page; + QTRY_VERIFY_WITH_TIMEOUT(page.loadSucceeded(), 20000); page.settings()->setAttribute(QWebEngineSettings::ScreenCaptureEnabled, true); // Audio-only desktop capture is not supported. JS Promise should be @@ -2792,6 +2804,7 @@ void tst_QWebEnginePage::getUserMediaRequestDesktopAudio() void tst_QWebEnginePage::getUserMediaRequestSettingDisabled() { GetUserMediaTestPage page; + QTRY_VERIFY_WITH_TIMEOUT(page.loadSucceeded(), 20000); page.settings()->setAttribute(QWebEngineSettings::ScreenCaptureEnabled, false); // With the setting disabled, the JS Promise should be rejected without @@ -3180,21 +3193,19 @@ void tst_QWebEnginePage::progressSignal() void tst_QWebEnginePage::urlChange() { - QSignalSpy urlSpy(m_page, SIGNAL(urlChanged(QUrl))); + QSignalSpy urlSpy(m_page, &QWebEnginePage::urlChanged); QUrl dataUrl("data:text/html,<h1>Test"); m_view->setUrl(dataUrl); - QVERIFY(urlSpy.wait()); - - QCOMPARE(urlSpy.size(), 1); + QTRY_COMPARE(urlSpy.size(), 1); + QCOMPARE(urlSpy.takeFirst().value(0).toUrl(), dataUrl); QUrl dataUrl2("data:text/html,<html><head><title>title</title></head><body><h1>Test</body></html>"); m_view->setUrl(dataUrl2); - QVERIFY(urlSpy.wait()); - - QCOMPARE(urlSpy.size(), 2); + QTRY_COMPARE(urlSpy.size(), 1); + QCOMPARE(urlSpy.takeFirst().value(0).toUrl(), dataUrl2); } class FakeReply : public QNetworkReply { @@ -3305,7 +3316,7 @@ void tst_QWebEnginePage::requestedUrlAfterSetAndLoadFailures() page.load(second); QTRY_COMPARE_WITH_TIMEOUT(spy.count(), 2, 12000); - QCOMPARE(page.url(), first); + QCOMPARE(page.url(), second); QCOMPARE(page.requestedUrl(), second); QVERIFY(!spy.at(1).first().toBool()); } @@ -3819,6 +3830,90 @@ void tst_QWebEnginePage::setUrlToInvalid() QCOMPARE(baseUrlSync(&page), aboutBlank); } +void tst_QWebEnginePage::setUrlToBadDomain() +{ + // Failing to load a URL should still emit a urlChanged signal. + // + // This test is based on the scenario in QTBUG-48995 where the second setUrl + // call first triggers an unexpected additional urlChanged signal with the + // original url before the expected signal with the new url. + + // RFC 2606 says the .invalid TLD should be invalid. + const QUrl url1 = QStringLiteral("http://this.is.definitely.invalid/"); + const QUrl url2 = QStringLiteral("http://this.is.also.invalid/"); + QWebEnginePage page; + QSignalSpy urlSpy(&page, &QWebEnginePage::urlChanged); + QSignalSpy titleSpy(&page, &QWebEnginePage::titleChanged); + QSignalSpy loadSpy(&page, &QWebEnginePage::loadFinished); + + page.setUrl(url1); + + QTRY_COMPARE(urlSpy.count(), 1); + QTRY_COMPARE(titleSpy.count(), 1); + QTRY_COMPARE(loadSpy.count(), 1); + + QCOMPARE(urlSpy.takeFirst().value(0).toUrl(), url1); + QCOMPARE(titleSpy.takeFirst().value(0).toString(), url1.host()); + QCOMPARE(loadSpy.takeFirst().value(0).toBool(), false); + + QCOMPARE(page.url(), url1); + QCOMPARE(page.title(), url1.host()); + + page.setUrl(url2); + + QTRY_COMPARE(urlSpy.count(), 1); + QTRY_COMPARE(titleSpy.count(), 1); + QTRY_COMPARE(loadSpy.count(), 1); + + QCOMPARE(urlSpy.takeFirst().value(0).toUrl(), url2); + QCOMPARE(titleSpy.takeFirst().value(0).toString(), url2.host()); + QCOMPARE(loadSpy.takeFirst().value(0).toBool(), false); + + QCOMPARE(page.url(), url2); + QCOMPARE(page.title(), url2.host()); +} + +void tst_QWebEnginePage::setUrlToBadPort() +{ + // Failing to load a URL should still emit a urlChanged signal. + + // Ports 244-245 are hopefully unbound (marked unassigned in RFC1700). + const QUrl url1 = QStringLiteral("http://127.0.0.1:244/"); + const QUrl url2 = QStringLiteral("http://127.0.0.1:245/"); + QWebEnginePage page; + QSignalSpy urlSpy(&page, &QWebEnginePage::urlChanged); + QSignalSpy titleSpy(&page, &QWebEnginePage::titleChanged); + QSignalSpy loadSpy(&page, &QWebEnginePage::loadFinished); + + page.setUrl(url1); + + QTRY_COMPARE(urlSpy.count(), 1); + QTRY_COMPARE(titleSpy.count(), 2); + QTRY_COMPARE(loadSpy.count(), 1); + + QCOMPARE(urlSpy.takeFirst().value(0).toUrl(), url1); + QCOMPARE(titleSpy.takeFirst().value(0).toString(), url1.authority()); + QCOMPARE(titleSpy.takeFirst().value(0).toString(), url1.host()); + QCOMPARE(loadSpy.takeFirst().value(0).toBool(), false); + + QCOMPARE(page.url(), url1); + QCOMPARE(page.title(), url1.host()); + + page.setUrl(url2); + + QTRY_COMPARE(urlSpy.count(), 1); + QTRY_COMPARE(titleSpy.count(), 2); + QTRY_COMPARE(loadSpy.count(), 1); + + QCOMPARE(urlSpy.takeFirst().value(0).toUrl(), url2); + QCOMPARE(titleSpy.takeFirst().value(0).toString(), url2.authority()); + QCOMPARE(titleSpy.takeFirst().value(0).toString(), url2.host()); + QCOMPARE(loadSpy.takeFirst().value(0).toBool(), false); + + QCOMPARE(page.url(), url2); + QCOMPARE(page.title(), url2.host()); +} + static QStringList collectHistoryUrls(QWebEngineHistory *history) { QStringList urls; @@ -3979,9 +4074,8 @@ void tst_QWebEnginePage::setUrlThenLoads() const QUrl urlToLoad1("qrc:/resources/test2.html"); const QUrl urlToLoad2("qrc:/resources/test1.html"); - // Just after first load. URL didn't changed yet. m_page->load(urlToLoad1); - QCOMPARE(m_page->url(), url); + QCOMPARE(m_page->url(), urlToLoad1); QCOMPARE(m_page->requestedUrl(), urlToLoad1); // baseUrlSync spins an event loop and this sometimes return the next result. // QCOMPARE(baseUrlSync(m_page), baseUrl); @@ -3995,9 +4089,8 @@ void tst_QWebEnginePage::setUrlThenLoads() QCOMPARE(m_page->requestedUrl(), urlToLoad1); QCOMPARE(baseUrlSync(m_page), extractBaseUrl(urlToLoad1)); - // Just after second load. URL didn't changed yet. m_page->load(urlToLoad2); - QCOMPARE(m_page->url(), urlToLoad1); + QCOMPARE(m_page->url(), urlToLoad2); QCOMPARE(m_page->requestedUrl(), urlToLoad2); QCOMPARE(baseUrlSync(m_page), extractBaseUrl(urlToLoad1)); QTRY_COMPARE(startedSpy.count(), 3); @@ -4120,6 +4213,41 @@ void tst_QWebEnginePage::loadInSignalHandlers() QCOMPARE(m_page->url(), urlForSetter); } +void tst_QWebEnginePage::loadFromQrc() +{ + QWebEnginePage page; + QSignalSpy spy(&page, &QWebEnginePage::loadFinished); + + // Standard case. + page.load(QStringLiteral("qrc:///resources/foo.txt")); + QTRY_COMPARE(spy.count(), 1); + QCOMPARE(spy.takeFirst().value(0).toBool(), true); + QCOMPARE(toPlainTextSync(&page), QStringLiteral("foo\n")); + + // Query and fragment parts are ignored. + page.load(QStringLiteral("qrc:///resources/bar.txt?foo=1#bar")); + QTRY_COMPARE(spy.count(), 1); + QCOMPARE(spy.takeFirst().value(0).toBool(), true); + QCOMPARE(toPlainTextSync(&page), QStringLiteral("bar\n")); + + // Literal spaces are OK. + page.load(QStringLiteral("qrc:///resources/path with spaces.txt")); + QTRY_COMPARE(spy.count(), 1); + QCOMPARE(spy.takeFirst().value(0).toBool(), true); + QCOMPARE(toPlainTextSync(&page), QStringLiteral("contents with spaces\n")); + + // Escaped spaces are OK too. + page.load(QStringLiteral("qrc:///resources/path%20with%20spaces.txt")); + QTRY_COMPARE(spy.count(), 1); + QCOMPARE(spy.takeFirst().value(0).toBool(), true); + QCOMPARE(toPlainTextSync(&page), QStringLiteral("contents with spaces\n")); + + // Resource not found, loading fails. + page.load(QStringLiteral("qrc:///nope")); + QTRY_COMPARE(spy.count(), 1); + QCOMPARE(spy.takeFirst().value(0).toBool(), false); +} + void tst_QWebEnginePage::restoreHistory() { QWebChannel channel; diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.qrc b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.qrc index 4fddd7a3f..fc83aefa5 100644 --- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.qrc +++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.qrc @@ -19,5 +19,8 @@ <file>resources/test2.html</file> <file>resources/testiframe.html</file> <file>resources/testiframe2.html</file> + <file>resources/foo.txt</file> + <file>resources/bar.txt</file> + <file>resources/path with spaces.txt</file> </qresource> </RCC> diff --git a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp index c3c8f9b28..8d2f92d96 100644 --- a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp +++ b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp @@ -35,6 +35,7 @@ #include <qtemporarydir.h> #include <QClipboard> #include <QCompleter> +#include <QLabel> #include <QLineEdit> #include <QHBoxLayout> #include <QMenu> @@ -172,6 +173,9 @@ private Q_SLOTS: void imeCompositionQueryEvent_data(); void imeCompositionQueryEvent(); void newlineInTextarea(); + + void mouseLeave(); + #ifndef QT_NO_CLIPBOARD void globalMouseSelection(); #endif @@ -2423,5 +2427,55 @@ void tst_QWebEngineView::contextMenu() QTRY_COMPARE(view.findChildren<QMenu *>().count(), childrenCount); } +void tst_QWebEngineView::mouseLeave() +{ + QScopedPointer<QWidget> containerWidget(new QWidget); + + QLabel *label = new QLabel(containerWidget.data()); + label->setStyleSheet("background-color: red;"); + label->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); + label->setMinimumHeight(100); + + QWebEngineView *view = new QWebEngineView(containerWidget.data()); + view->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); + view->setMinimumHeight(100); + + QVBoxLayout *layout = new QVBoxLayout; + layout->setAlignment(Qt::AlignTop); + layout->setSpacing(0); + layout->setMargin(0); + layout->addWidget(label); + layout->addWidget(view); + containerWidget->setLayout(layout); + containerWidget->show(); + QVERIFY(QTest::qWaitForWindowExposed(containerWidget.data())); + QTest::mouseMove(containerWidget->windowHandle(), QPoint(0, 0)); + + auto innerText = [view]() -> QString { + return evaluateJavaScriptSync(view->page(), "document.getElementById('testDiv').innerText").toString(); + }; + + QSignalSpy loadFinishedSpy(view, SIGNAL(loadFinished(bool))); + view->setHtml("<html>" + "<head><script>" + "function init() {" + " var div = document.getElementById('testDiv');" + " div.onmouseenter = function(e) { div.innerText = 'Mouse IN' };" + " div.onmouseleave = function(e) { div.innerText = 'Mouse OUT' };" + "}" + "</script></head>" + "<body onload='init()' style='margin: 0px; padding: 0px'>" + " <div id='testDiv' style='width: 100%; height: 100%; background-color: green' />" + "</body>" + "</html>"); + QVERIFY(loadFinishedSpy.wait()); + QVERIFY(innerText().isEmpty()); + + QTest::mouseMove(containerWidget->windowHandle(), QPoint(50, 150)); + QTRY_COMPARE(innerText(), QStringLiteral("Mouse IN")); + QTest::mouseMove(containerWidget->windowHandle(), QPoint(50, 50)); + QTRY_COMPARE(innerText(), QStringLiteral("Mouse OUT")); +} + QTEST_MAIN(tst_QWebEngineView) #include "tst_qwebengineview.moc" diff --git a/tests/auto/widgets/widgets.pro b/tests/auto/widgets/widgets.pro index 027eeb235..32a7806fe 100644 --- a/tests/auto/widgets/widgets.pro +++ b/tests/auto/widgets/widgets.pro @@ -19,8 +19,8 @@ qtConfig(accessibility) { SUBDIRS += qwebengineaccessibility } -qtConfig(spellchecker):!cross_compile { - !qtConfig(native-spellchecker) { +qtConfig(webengine-spellchecker):!cross_compile { + !qtConfig(webengine-native-spellchecker) { SUBDIRS += qwebenginespellcheck } else { message("Spellcheck test will not be built because it depends on usage of Hunspell dictionaries.") |