From 72cfbd7664f21fcc0e62b869a6b01bf73eb5e7da Mon Sep 17 00:00:00 2001 From: Konstantin Tokarev Date: Sat, 20 Jan 2018 16:23:23 +0300 Subject: Import WebKit commit 025cd3fc8d29620535309aa3e2ab7075aad36044 Change-Id: I39d60de0f241abc52c0c4eb174eba7882d576f24 Reviewed-by: Konstantin Tokarev --- Source/WebCore/page/Performance.cpp | 2 +- Source/WebCore/rendering/style/NinePieceImage.cpp | 2 ++ Source/WebKit/CMakeLists.txt | 12 +++++++- Source/WebKit/PlatformQt.cmake | 3 +- Source/cmake/FindICU.cmake | 4 +-- Source/cmake/OptionsQt.cmake | 35 ++++++++++++++++++++++- Tools/qmake/projects/run_cmake.pro | 2 ++ 7 files changed, 54 insertions(+), 6 deletions(-) diff --git a/Source/WebCore/page/Performance.cpp b/Source/WebCore/page/Performance.cpp index 1c491da5d..aa18fe063 100644 --- a/Source/WebCore/page/Performance.cpp +++ b/Source/WebCore/page/Performance.cpp @@ -233,7 +233,7 @@ void Performance::webkitClearMeasures(const String& measureName) double Performance::now() const { double nowSeconds = monotonicallyIncreasingTime() - m_referenceTime; - const double resolutionSeconds = 0.0001; + const double resolutionSeconds = 0.001; return 1000.0 * floor(nowSeconds / resolutionSeconds) * resolutionSeconds; } diff --git a/Source/WebCore/rendering/style/NinePieceImage.cpp b/Source/WebCore/rendering/style/NinePieceImage.cpp index b4c33f4f0..3c32a8a59 100644 --- a/Source/WebCore/rendering/style/NinePieceImage.cpp +++ b/Source/WebCore/rendering/style/NinePieceImage.cpp @@ -25,6 +25,7 @@ #include "NinePieceImage.h" #include "GraphicsContext.h" +#include "ImageQualityController.h" #include "LengthFunctions.h" #include "RenderStyle.h" #include @@ -209,6 +210,7 @@ void NinePieceImage::paint(GraphicsContext& graphicsContext, RenderElement* rend if (!image) return; + InterpolationQualityMaintainer interpolationMaintainer(graphicsContext, ImageQualityController::interpolationQualityFromStyle(style)); for (ImagePiece piece = MinPiece; piece < MaxPiece; ++piece) { if ((piece == MiddlePiece && !fill()) || isEmptyPieceRect(piece, destinationRects, sourceRects)) continue; diff --git a/Source/WebKit/CMakeLists.txt b/Source/WebKit/CMakeLists.txt index 82dc1e662..04117d563 100644 --- a/Source/WebKit/CMakeLists.txt +++ b/Source/WebKit/CMakeLists.txt @@ -70,11 +70,21 @@ if (${PORT} STREQUAL "Qt") if (MACOS_BUILD_FRAMEWORKS) set_target_properties(WebKit PROPERTIES - FRAMEWORK_VERSION 5 + FRAMEWORK_VERSION ${PROJECT_VERSION_MAJOR} + SOVERSION ${MACOS_COMPATIBILITY_VERSION} MACOSX_FRAMEWORK_IDENTIFIER org.qt-project.QtWebKit ) endif () + if (USE_LINKER_VERSION_SCRIPT) + set(VERSION_SCRIPT "${CMAKE_BINARY_DIR}/QtWebKit.version") + add_custom_command(TARGET WebKit PRE_LINK + COMMAND ${PERL_EXECUTABLE} ${TOOLS_DIR}/qt/generate-version-script.pl ${Qt5_VERSION} > ${VERSION_SCRIPT} + VERBATIM + ) + set_target_properties(WebKit PROPERTIES LINK_FLAGS -Wl,--version-script,${VERSION_SCRIPT}) + endif () + if (ENABLE_WEBKIT2) add_dependencies(WebKit WebKit2) endif () diff --git a/Source/WebKit/PlatformQt.cmake b/Source/WebKit/PlatformQt.cmake index 3792def6f..6fe440be8 100644 --- a/Source/WebKit/PlatformQt.cmake +++ b/Source/WebKit/PlatformQt.cmake @@ -861,7 +861,8 @@ endif () if (MACOS_BUILD_FRAMEWORKS) set_target_properties(WebKitWidgets PROPERTIES - FRAMEWORK_VERSION 5 + FRAMEWORK_VERSION ${PROJECT_VERSION_MAJOR} + SOVERSION ${MACOS_COMPATIBILITY_VERSION} MACOSX_FRAMEWORK_IDENTIFIER org.qt-project.QtWebKitWidgets ) endif () diff --git a/Source/cmake/FindICU.cmake b/Source/cmake/FindICU.cmake index c0de36338..4e93286f3 100644 --- a/Source/cmake/FindICU.cmake +++ b/Source/cmake/FindICU.cmake @@ -24,7 +24,7 @@ mark_as_advanced(ICU_INCLUDE_DIR) # Look for the library. find_library( ICU_LIBRARY - NAMES sicuuc icuuc cygicuuc cygicuuc32 + NAMES icuuc cygicuuc cygicuuc32 HINTS ${PC_ICU_LIBRARY_DIRS} ${PC_ICU_LIBDIR} DOC "Libraries to link against for the common parts of ICU") @@ -49,7 +49,7 @@ if (ICU_INCLUDE_DIR AND ICU_LIBRARY) pkg_check_modules(PC_ICU_I18N icu-i18n) find_library( ICU_I18N_LIBRARY - NAMES sicui18n sicuin icui18n icuin cygicuin cygicuin32 + NAMES icui18n icuin cygicuin cygicuin32 HINTS ${PC_ICU_I18N_LIBRARY_DIRS} ${PC_ICU_I18N_LIBDIR} DOC "Libraries to link against for ICU internationalization") diff --git a/Source/cmake/OptionsQt.cmake b/Source/cmake/OptionsQt.cmake index 559b2ab8b..003fdca41 100644 --- a/Source/cmake/OptionsQt.cmake +++ b/Source/cmake/OptionsQt.cmake @@ -1,3 +1,4 @@ +include(CheckCXXSourceCompiles) include(FeatureSummary) include(ECMEnableSanitizers) include(ECMPackageConfigHelpers) @@ -53,6 +54,30 @@ macro(CONVERT_PRL_LIBS_TO_CMAKE _qt_component) endif () endmacro() +macro(CHECK_QT5_PRIVATE_INCLUDE_DIRS _qt_component _header) + set(INCLUDE_TEST_SOURCE + " + #include <${_header}> + int main() { return 0; } + " + ) + set(CMAKE_REQUIRED_INCLUDES ${Qt5${_qt_component}_PRIVATE_INCLUDE_DIRS}) + set(CMAKE_REQUIRED_LIBRARIES Qt5::${_qt_component}) + + # Avoid check_include_file_cxx() because it performs linking but doesn't support CMAKE_REQUIRED_LIBRARIES (doh!) + check_cxx_source_compiles("${INCLUDE_TEST_SOURCE}" Qt5${_qt_component}_PRIVATE_HEADER_FOUND) + + unset(INCLUDE_TEST_SOURCE) + unset(CMAKE_REQUIRED_INCLUDES) + unset(CMAKE_REQUIRED_LIBRARIES) + + if (NOT Qt5${_qt_component}_PRIVATE_HEADER_FOUND) + message(FATAL_ERROR "Header ${_header} is not found. Please make sure that: + 1. Private headers of Qt5${_qt_component} are installed + 2. Qt5${_qt_component}_PRIVATE_INCLUDE_DIRS is correctly defined in Qt5${_qt_component}Config.cmake") + endif () +endmacro() + macro(QT_ADD_EXTRA_WEBKIT_TARGET_EXPORT target) if (QT_STATIC_BUILD OR SHARED_CORE) install(TARGETS ${target} EXPORT WebKitTargets @@ -131,11 +156,13 @@ endif () WEBKIT_OPTION_BEGIN() if (APPLE) + set(MACOS_COMPATIBILITY_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}" CACHE STRING "Compatibility version that macOS dylibs should have") + option(MACOS_FORCE_SYSTEM_XML_LIBRARIES "Use system installation of libxml2 and libxslt on macOS" ON) option(MACOS_USE_SYSTEM_ICU "Use system installation of ICU on macOS" ON) option(USE_UNIX_DOMAIN_SOCKETS "Use Unix domain sockets instead of native IPC code on macOS" OFF) option(USE_APPSTORE_COMPLIANT_CODE "Avoid using private macOS APIs which are not allowed on App Store (experimental)" OFF) - set(MACOS_BUILD_FRAMEWORKS ON) # TODO: Make it an option + option(MACOS_BUILD_FRAMEWORKS "Build QtWebKit as framework bundles" ON) if (USE_APPSTORE_COMPLIANT_CODE) set(MACOS_USE_SYSTEM_ICU OFF) @@ -581,6 +608,12 @@ if (ENABLE_QT_WEBCHANNEL) endif () find_package(Qt5 ${REQUIRED_QT_VERSION} REQUIRED COMPONENTS ${QT_REQUIRED_COMPONENTS}) + +CHECK_QT5_PRIVATE_INCLUDE_DIRS(Gui private/qhexstring_p.h) +if (ENABLE_WEBKIT2) + CHECK_QT5_PRIVATE_INCLUDE_DIRS(Quick private/qsgrendernode_p.h) +endif () + if (QT_STATIC_BUILD) foreach (qt_module ${QT_REQUIRED_COMPONENTS}) CONVERT_PRL_LIBS_TO_CMAKE(${qt_module}) diff --git a/Tools/qmake/projects/run_cmake.pro b/Tools/qmake/projects/run_cmake.pro index f63fcd658..b9d0f08a2 100644 --- a/Tools/qmake/projects/run_cmake.pro +++ b/Tools/qmake/projects/run_cmake.pro @@ -83,6 +83,8 @@ build_pass|!debug_and_release { debug_and_release:build_all:CONFIG(debug, debug|release) { CMAKE_CONFIG += CMAKE_INSTALL_PREFIX=\"$$[QT_INSTALL_PREFIX]/debug\" } + + !qt_framework: CMAKE_CONFIG += MACOS_BUILD_FRAMEWORKS=OFF } !isEmpty(use_ninja): cmake_args += "-G Ninja" -- cgit v1.2.1