diff options
author | Konstantin Tokarev <annulen@yandex.ru> | 2017-06-01 15:54:01 +0300 |
---|---|---|
committer | Konstantin Tokarev <annulen@yandex.ru> | 2017-06-02 14:07:43 +0000 |
commit | 0a3506ebe5d7f431f0dd4dffa24ac32063b90ff1 (patch) | |
tree | f3d0b92fe7bc5b31426a838c354616fff335e82b /Tools | |
parent | 881da28418d380042aa95a97f0cbd42560a64f7c (diff) | |
download | qtwebkit-0a3506ebe5d7f431f0dd4dffa24ac32063b90ff1.tar.gz |
Import WebKit commit 3ca7a25a550e473d60bbbe321475c6c0ef114b31
Change-Id: I480668a0cb8114dccf7a1195190a993282875759
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'Tools')
-rw-r--r-- | Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp | 3 | ||||
-rw-r--r-- | Tools/DumpRenderTree/qt/TestRunnerQt.cpp | 5 | ||||
-rw-r--r-- | Tools/MiniBrowser/qt/MiniBrowserApplication.cpp | 7 | ||||
-rw-r--r-- | Tools/QtTestBrowser/launcherwindow.cpp | 6 | ||||
-rw-r--r-- | Tools/QtTestBrowser/launcherwindow.h | 1 | ||||
-rwxr-xr-x | Tools/Scripts/build-webkit | 9 | ||||
-rw-r--r-- | Tools/TestWebKitAPI/Tests/WebCore/TransformationMatrix.cpp | 53 | ||||
-rw-r--r-- | Tools/qmake/projects/generate_forwarding_pris.pro | 44 | ||||
-rw-r--r-- | Tools/qt/manifest.txt | 4 |
9 files changed, 128 insertions, 4 deletions
diff --git a/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp b/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp index e72ee703a..8f1829e3f 100644 --- a/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp +++ b/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp @@ -1019,7 +1019,8 @@ void DumpRenderTree::dump() QImage image; if (!m_jscController->isPrinting()) { - image = QImage(m_page->viewportSize(), QImage::Format_ARGB32); + image = QImage(m_page->viewportSize() * m_page->devicePixelRatio(), QImage::Format_ARGB32); + image.setDevicePixelRatio(m_page->devicePixelRatio()); image.fill(Qt::white); QPainter painter(&image); painter.setRenderHints(renderHints); diff --git a/Tools/DumpRenderTree/qt/TestRunnerQt.cpp b/Tools/DumpRenderTree/qt/TestRunnerQt.cpp index 09f1d09dc..145a4f01a 100644 --- a/Tools/DumpRenderTree/qt/TestRunnerQt.cpp +++ b/Tools/DumpRenderTree/qt/TestRunnerQt.cpp @@ -71,6 +71,8 @@ void TestRunnerQt::reset() m_geolocationPermission = false; m_audioData.clear(); + m_drt->webPage()->setDevicePixelRatio(1); + DumpRenderTreeSupportQt::dumpEditingCallbacks(false); DumpRenderTreeSupportQt::dumpFrameLoader(false); DumpRenderTreeSupportQt::dumpProgressFinishedCallback(false); @@ -869,8 +871,9 @@ void TestRunner::focusWebView() { } -void TestRunner::setBackingScaleFactor(double) +void TestRunner::setBackingScaleFactor(double scale) { + DumpRenderTree::instance()->webPage()->setDevicePixelRatio(scale); } void TestRunner::removeChromeInputField() diff --git a/Tools/MiniBrowser/qt/MiniBrowserApplication.cpp b/Tools/MiniBrowser/qt/MiniBrowserApplication.cpp index 7dbb4c519..f36621922 100644 --- a/Tools/MiniBrowser/qt/MiniBrowserApplication.cpp +++ b/Tools/MiniBrowser/qt/MiniBrowserApplication.cpp @@ -303,6 +303,7 @@ static void printHelp(const QString& programName) qDebug() << "Usage:" << programName.toLatin1().data() << "[--desktop]" << "[-r list]" + << "[--remote-inspector [port|addr]]" << "[--robot-timeout seconds]" << "[--robot-extra-time seconds]" << "[--window-size (width)x(height)]" @@ -348,6 +349,12 @@ void MiniBrowserApplication::handleUserOptions() m_windowOptions.setRequestedWindowSize(QSize(list.at(0).toInt(), list.at(1).toInt())); } + if (args.contains("--remote-inspector")) { + QString value = takeOptionValue(&args, "--remote-inspector"); + if (!value.isEmpty()) + qputenv("QTWEBKIT_INSPECTOR_SERVER", value.toUtf8()); + } + #if HAVE(QTTESTSUPPORT) if (takeOptionFlag(&args, QStringLiteral("--use-test-fonts"))) WebKit::QtTestSupport::initializeTestFonts(); diff --git a/Tools/QtTestBrowser/launcherwindow.cpp b/Tools/QtTestBrowser/launcherwindow.cpp index 3d3414272..26b6dce79 100644 --- a/Tools/QtTestBrowser/launcherwindow.cpp +++ b/Tools/QtTestBrowser/launcherwindow.cpp @@ -262,6 +262,7 @@ void LauncherWindow::createChrome() editMenu->addAction(page()->action(QWebPage::Paste)); editMenu->addSeparator(); editMenu->addAction(page()->action(QWebPage::SelectAll)); + editMenu->addAction("Unselect", this, SLOT(clearPageSelection()), QKeySequence::Deselect); editMenu->addSeparator(); #ifndef QT_NO_LINEEDIT editMenu->addAction("&Find", this, SLOT(showFindBar()), QKeySequence(Qt::CTRL | Qt::Key_F)); @@ -1178,6 +1179,11 @@ void LauncherWindow::clearMemoryCaches() qDebug() << "Memory caches were cleared"; } +void LauncherWindow::clearPageSelection() +{ + page()->triggerAction(QWebPage::Unselect); +} + void LauncherWindow::updateFPS(int fps) { QString fpsStatusText = QString("Current FPS: %1").arg(fps); diff --git a/Tools/QtTestBrowser/launcherwindow.h b/Tools/QtTestBrowser/launcherwindow.h index 9020109db..0b5ea32db 100644 --- a/Tools/QtTestBrowser/launcherwindow.h +++ b/Tools/QtTestBrowser/launcherwindow.h @@ -176,6 +176,7 @@ protected Q_SLOTS: #endif void clearMemoryCaches(); + void clearPageSelection(); public Q_SLOTS: LauncherWindow* newWindow(); diff --git a/Tools/Scripts/build-webkit b/Tools/Scripts/build-webkit index d9ea259c7..b8a4bd1e2 100755 --- a/Tools/Scripts/build-webkit +++ b/Tools/Scripts/build-webkit @@ -56,6 +56,7 @@ my $minimal = 0; my $installHeaders; my $installLibs; my $prefixPath; +my $shouldInstall = 0; my $makeArgs = ""; my $cmakeArgs = ""; my $onlyWebKitProject = 0; @@ -100,14 +101,14 @@ Usage: $programName [options] [options to pass to build system] --inspector-frontend Copy Web Inspector user interface resources to the build directory - --prefix=<path> Set installation prefix to the given path (Gtk/Efl only) + --prefix=<path> Set installation prefix to the given path (Gtk/Efl/Qt only) + --install Install into given prefix after compilation --makeargs=<arguments> Optional Makefile flags --cmakeargs=<arguments> Optional CMake flags (e.g. --cmakeargs="-DFOO=bar -DCMAKE_PREFIX_PATH=/usr/local") --minimal No optional features, unless explicitly enabled --only-webkit Build only the WebKit project - EOF my %options = ( @@ -116,6 +117,7 @@ my %options = ( 'install-headers=s' => \$installHeaders, 'install-libs=s' => \$installLibs, 'prefix=s' => \$prefixPath, + 'install' => \$shouldInstall, 'makeargs=s' => \$makeArgs, 'cmakeargs=s' => \$cmakeArgs, 'minimal' => \$minimal, @@ -238,6 +240,9 @@ if (isInspectorFrontend()) { } if (isCMakeBuild() && (!isAnyWindows() || isQt())) { + if ($shouldInstall) { + $makeArgs .= ($makeArgs ? " " : "") . "install"; + } # Visual Studio generator doesn't support -j switch if (canUseNinja() || !isAnyWindows()) { diff --git a/Tools/TestWebKitAPI/Tests/WebCore/TransformationMatrix.cpp b/Tools/TestWebKitAPI/Tests/WebCore/TransformationMatrix.cpp new file mode 100644 index 000000000..67c85e0e0 --- /dev/null +++ b/Tools/TestWebKitAPI/Tests/WebCore/TransformationMatrix.cpp @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2013, Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include <WebCore/TransformationMatrix.h> + +using namespace WebCore; + +namespace TestWebKitAPI { + +TEST(TransformationMatrix, NonInvertableBlend) +{ + TransformationMatrix from; + TransformationMatrix to(2.7133590938, 0.0, 0.0, 0.0, 0.0, 2.4645137761, 0.0, 0.0, 0.0, 0.0, 0.00, 0.01, 0.02, 0.03, 0.04, 0.05); + TransformationMatrix result; + + result = to; + result.blend(from, 0.25); + EXPECT_TRUE(result == from); + + result = to; + result.blend(from, 0.75); + EXPECT_TRUE(result == to); +} + +} diff --git a/Tools/qmake/projects/generate_forwarding_pris.pro b/Tools/qmake/projects/generate_forwarding_pris.pro new file mode 100644 index 000000000..3618699d8 --- /dev/null +++ b/Tools/qmake/projects/generate_forwarding_pris.pro @@ -0,0 +1,44 @@ +load(functions) +load(qt_build_paths) + +TEMPLATE = aux + +qtConfig(debug_and_release): CONFIG += debug_and_release build_all + +defineTest(writeForwardingPri) { + module = $$1 + configuration = $$2 + cmake_build_dir = $$ROOT_BUILD_DIR/$$configuration + forwarding_pri_name = $$MODULE_QMAKE_OUTDIR/mkspecs/modules/qt_lib_$${module}.pri + + FORWARDING_PRI_CONTENTS += \ + "QT_MODULE_BIN_BASE = $$cmake_build_dir/bin" \ + "QT_MODULE_INCLUDE_BASE = $$cmake_build_dir/DerivedSources/ForwardingHeaders" \ + "QT_MODULE_LIB_BASE = $$cmake_build_dir/lib" \ + "QT_MODULE_HOST_LIB_BASE = $$cmake_build_dir/lib" \ + "include($$cmake_build_dir/Source/WebKit/qt_lib_$${module}.pri)" + + FORWARDING_PRI_CONTENTS += \ + "QT.$${module}.priority = 1" \ + "QT.$${module}.includes += $$ROOT_WEBKIT_DIR/Source" + + message("Writing $$forwarding_pri_name") + write_file($$forwarding_pri_name, FORWARDING_PRI_CONTENTS)|error() +} + + +debug_and_release { + !build_pass { + # Use release build in case of debug_and_release + writeForwardingPri(webkit, release) + writeForwardingPri(webkitwidgets, release) + } +} else { + CONFIG(debug, debug|release) { + configuration = debug + } else { + configuration = release + } + writeForwardingPri(webkit, $$configuration) + writeForwardingPri(webkitwidgets, $$configuration) +} diff --git a/Tools/qt/manifest.txt b/Tools/qt/manifest.txt index cd60a6299..b7aeadcea 100644 --- a/Tools/qt/manifest.txt +++ b/Tools/qt/manifest.txt @@ -111,8 +111,12 @@ file Source/WebCore/Resources/plugIns.js # WebCore.qrc file Source/WebCore/Resources/missingImage.png +file Source/WebCore/Resources/missingImage@2x.png +file Source/WebCore/Resources/missingImage@3x.png file Source/WebCore/Resources/nullPlugin.png +file Source/WebCore/Resources/nullPlugin@2x.png file Source/WebCore/Resources/textAreaResizeCorner.png +file Source/WebCore/Resources/textAreaResizeCorner@2x.png file Source/WebCore/Resources/urlIcon.png file Source/WebCore/Resources/zoomInCursor.png file Source/WebCore/Resources/zoomOutCursor.png |