Skip to content

Commit

Permalink
Merge branch 'qtwebkit-stable' into qtwebkit-5.212
Browse files Browse the repository at this point in the history
  • Loading branch information
annulen committed Jun 15, 2017
2 parents 3ea862a + 521772a commit 6d0ad27
Show file tree
Hide file tree
Showing 23 changed files with 190 additions and 10 deletions.
13 changes: 13 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
2017-06-15 Konstantin Tokarev <[email protected]>

[cmake] ADD_PRECOMPILED_HEADER should append OBJECT_DEPENDS, not overwrite it
https://bugs.webkit.org/show_bug.cgi?id=173428

Reviewed by Michael Catanzaro.

Right now, if any of source files that are passed to
ADD_PRECOMPILED_HEADER have non-empty OBJECT_DEPENDS property (e.g.
changed with ADD_SOURCE_DEPENDENCIES call), its value is lost.

* Source/cmake/WebKitMacros.cmake:

2017-05-31 Adrian Perez de Castro <[email protected]>

[CMake] Do not pass -Wno-expansion-to-defined to Clang <4.0.0
Expand Down
43 changes: 43 additions & 0 deletions ReadMe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Qt Port of WebKit

WebKit is an open source web browser engine. WebKit's HTML and JavaScript code began as a branch of the KHTML and KJS libraries from KDE. As part of KDE framework KHTML was based on Qt but during their porting efforts Apple's engineers made WebKit toolkit independent. QtWebKit is a project aiming at porting this fabulous engine back to Qt.

The Qt port of WebKit currently compiles and runs on Linux, *BSD, Windows and macOS.

## Structure of the project

There are several code repositories associated with QtWebKit

### This repository (development)

Development of code specific to the Qt port happens here. You should clone this repository if you are planning to contribute.

Branches:

* `master` - mirror of WebKit upstream, without any Qt-specific code
* `qtwebkit-stable` - Qt-specific fixes and improvements are integrated here first
* `qtwebkit-5.212` - current release branch, which is `qtwebkit-stable` with commits backported from `master`

### End-user repository (snapshots)

Development repository is very large and contains lots of data that is not required for building and using QtWebKit. Use the following repository if you need to get latest snapshots of QtWebKit code:

http://code.qt.io/cgit/qt/qtwebkit.git/

Branches:

* `5.212` - code snapshots from `qtwebkit-5.212`

### Upstream

Development of the WebKit engine happens at https://webkit.org. All development of cross-platform code, including JavaScript engine and Web platform features, happens there. Code from upstream is getting into QtWebKit development via cherry-picks or merges.

## More information

See https:/annulen/webkit/wiki

## Contacts

* Mailing list: [email protected]
* IRC: #qtwebkit on irc.freenode.net
* Blog: http://qtwebkit.blogspot.com
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include "JSObject.h"
#include "JSTypedArrayViewPrototype.h"
#include "JSTypedArrays.h"
#include "TypedArrayInlines.h"

namespace JSC {

Expand Down
14 changes: 14 additions & 0 deletions Source/PlatformQt.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Automoc

set(TARGETS_WITH_AUTOMOC
WebKit
WebKitWidgets
)
if (ENABLE_WEBKIT2)
list(APPEND TARGETS_WITH_AUTOMOC
WebKit2
)
endif ()
set_property(TARGET ${TARGETS_WITH_AUTOMOC} PROPERTY AUTOMOC ON)


# Minimal debug

# Builds with debug flags result in a huge amount of symbols with the GNU toolchain,
Expand Down
2 changes: 2 additions & 0 deletions Source/WTF/wtf/PlatformQt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ list(APPEND WTF_SOURCES

text/qt/StringQt.cpp
)
QTWEBKIT_GENERATE_MOC_FILES_CPP(qt/MainThreadQt.cpp qt/RunLoopQt.cpp)

list(APPEND WTF_SYSTEM_INCLUDE_DIRECTORIES
${Qt5Core_INCLUDE_DIRS}
Expand Down Expand Up @@ -32,6 +33,7 @@ if (UNIX AND NOT APPLE)

qt/WorkQueueQt.cpp
)
QTWEBKIT_GENERATE_MOC_FILES_CPP(qt/WorkQueueQt.cpp)
endif ()

if (USE_GLIB)
Expand Down
16 changes: 16 additions & 0 deletions Source/WebCore/PlatformQt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,20 @@ list(APPEND WebCore_SOURCES
platform/text/qt/TextBreakIteratorInternalICUQt.cpp
)

QTWEBKIT_GENERATE_MOC_FILES_CPP(
platform/network/qt/DNSQt.cpp
platform/qt/MainThreadSharedTimerQt.cpp
)

QTWEBKIT_GENERATE_MOC_FILES_H(
platform/network/qt/CookieJarQt.h
platform/network/qt/QNetworkReplyHandler.h
platform/network/qt/QtMIMETypeSniffer.h
)

QTWEBKIT_GENERATE_MOC_FILE_H(platform/network/qt/NetworkStateNotifierPrivate.h platform/network/qt/NetworkStateNotifierQt.cpp)
QTWEBKIT_GENERATE_MOC_FILE_H(platform/network/qt/SocketStreamHandlePrivate.h platform/network/qt/SocketStreamHandleQt.cpp)

if (COMPILER_IS_GCC_OR_CLANG)
set_source_files_properties(
platform/graphics/qt/ImageBufferDataQt.cpp
Expand All @@ -183,6 +197,7 @@ if (ENABLE_GAMEPAD_DEPRECATED)
list(APPEND WebCore_SOURCES
platform/qt/GamepadsQt.cpp
)
QTWEBKIT_GENERATE_MOC_FILES_CPP(platform/qt/GamepadsQt.cpp)
endif ()

if (ENABLE_GRAPHICS_CONTEXT_3D)
Expand Down Expand Up @@ -359,6 +374,7 @@ if (USE_QT_MULTIMEDIA)
list(APPEND WebCore_LIBRARIES
${Qt5Multimedia_LIBRARIES}
)
QTWEBKIT_GENERATE_MOC_FILES_H(platform/graphics/qt/MediaPlayerPrivateQt.h)
endif ()

if (ENABLE_VIDEO)
Expand Down
1 change: 1 addition & 0 deletions Source/WebCore/platform/mock/mediasource/MockBox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <runtime/ArrayBuffer.h>
#include <runtime/DataView.h>
#include <runtime/Int8Array.h>
#include <runtime/TypedArrayInlines.h>
#include <wtf/NeverDestroyed.h>
#include <wtf/text/StringBuilder.h>

Expand Down
2 changes: 2 additions & 0 deletions Source/WebKit/qt/declarative/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ set_target_properties(qmlwebkitplugin PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${qmlwebkit_output_dir}
LIBRARY_OUTPUT_DIRECTORY_RELEASE ${qmlwebkit_output_dir}
RUNTIME_OUTPUT_DIRECTORY_RELEASE ${qmlwebkit_output_dir}

AUTOMOC ON
)

add_custom_target(
Expand Down
2 changes: 2 additions & 0 deletions Source/WebKit/qt/declarative/experimental/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ set_target_properties(qmlwebkitexperimentalplugin PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${qmlwebkitexperimental_output_dir}
LIBRARY_OUTPUT_DIRECTORY_RELEASE ${qmlwebkitexperimental_output_dir}
RUNTIME_OUTPUT_DIRECTORY_RELEASE ${qmlwebkitexperimental_output_dir}

AUTOMOC ON
)

add_custom_target(
Expand Down
2 changes: 1 addition & 1 deletion Source/WebKit/qt/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ foreach (testName ${QtWK1ApiTests})
add_executable(tst_${testName} ${tst_${testName}_SOURCES})
target_include_directories(tst_${testName} PRIVATE ${testName})
target_link_libraries(tst_${testName} ${QtWK1ApiTests_LIBRARIES})
set_target_properties(tst_${testName} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${QtWK1ApiTests_RUNTIME_OUTPUT_DIRECTORY})
set_target_properties(tst_${testName} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${QtWK1ApiTests_RUNTIME_OUTPUT_DIRECTORY} AUTOMOC ON)

add_test(${testName} "${QtWK1ApiTests_RUNTIME_OUTPUT_DIRECTORY}/tst_${testName}")
set_tests_properties(${testName} PROPERTIES TIMEOUT 60)
Expand Down
4 changes: 4 additions & 0 deletions Source/WebKit2/Shared/qt/NativeWebTouchEventQt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include "config.h"
#include "NativeWebTouchEvent.h"

#if ENABLE(TOUCH_EVENTS)

#include "WebEventFactory.h"

namespace WebKit {
Expand All @@ -37,3 +39,5 @@ NativeWebTouchEvent::NativeWebTouchEvent(const QTouchEvent* event, const QTransf
}

} // namespace WebKit

#endif // ENABLE(TOUCH_EVENTS)
2 changes: 2 additions & 0 deletions Source/WebKit2/UIProcess/API/qt/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ set(qmltests_LIBRARIES
add_executable(tst_qmltests_WebView ${qmltests_SOURCES})
target_compile_definitions(tst_qmltests_WebView PRIVATE ${tst_qmltests_WebView_DEFINITIONS})
target_link_libraries(tst_qmltests_WebView ${qmltests_LIBRARIES})
set_target_properties(tst_qmltests_WebView PROPERTIES AUTOMOC ON)

add_executable(tst_qmltests_DesktopBehavior ${qmltests_SOURCES})
target_compile_definitions(tst_qmltests_DesktopBehavior PRIVATE ${tst_qmltests_DesktopBehavior_DEFINITIONS})
target_link_libraries(tst_qmltests_DesktopBehavior ${qmltests_LIBRARIES})
set_target_properties(tst_qmltests_DesktopBehavior PROPERTIES AUTOMOC ON)
2 changes: 2 additions & 0 deletions Source/WebKit2/UIProcess/qt/QtPageClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,12 @@ void QtPageClient::didChangeViewportProperties(const WebCore::ViewportAttributes
QQuickWebViewPrivate::get(m_webView)->didChangeViewportProperties(attr);
}

#if ENABLE(DRAG_SUPPORT)
void QtPageClient::startDrag(const WebCore::DragData& dragData, PassRefPtr<ShareableBitmap> dragImage)
{
m_eventHandler->startDrag(dragData, dragImage);
}
#endif

void QtPageClient::handleDownloadRequest(DownloadProxy* download)
{
Expand Down
2 changes: 2 additions & 0 deletions Source/WebKit2/UIProcess/qt/QtPageClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ class QtPageClient final : public PageClient
void updateAcceleratedCompositingMode(const LayerTreeContext&) override;
void pageClosed() override { }
void preferencesDidChange() override { }
#if ENABLE(DRAG_SUPPORT)
void startDrag(const WebCore::DragData&, PassRefPtr<ShareableBitmap> dragImage) override;
#endif
void setCursor(const WebCore::Cursor&) override;
void setCursorHiddenUntilMouseMoves(bool) override;
void toolTipChanged(const String&, const String&) override;
Expand Down
21 changes: 21 additions & 0 deletions Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,16 +184,21 @@ void QtWebPageEventHandler::handleHoverMoveEvent(QHoverEvent* ev)

void QtWebPageEventHandler::handleDragEnterEvent(QDragEnterEvent* ev)
{
#if ENABLE(DRAG_SUPPORT)
m_webPageProxy->resetCurrentDragInformation();
QTransform fromItemTransform = m_webPage->transformFromItem();
// FIXME: Should not use QCursor::pos()
DragData dragData(ev->mimeData(), fromItemTransform.map(ev->pos()), QCursor::pos(), dropActionToDragOperation(ev->possibleActions()));
m_webPageProxy->dragEntered(dragData);
ev->acceptProposedAction();
#else
Q_UNUSED(ev);
#endif
}

void QtWebPageEventHandler::handleDragLeaveEvent(QDragLeaveEvent* ev)
{
#if ENABLE(DRAG_SUPPORT)
bool accepted = ev->isAccepted();

// FIXME: Should not use QCursor::pos()
Expand All @@ -202,10 +207,14 @@ void QtWebPageEventHandler::handleDragLeaveEvent(QDragLeaveEvent* ev)
m_webPageProxy->resetCurrentDragInformation();

ev->setAccepted(accepted);
#else
Q_UNUSED(ev);
#endif
}

void QtWebPageEventHandler::handleDragMoveEvent(QDragMoveEvent* ev)
{
#if ENABLE(DRAG_SUPPORT)
bool accepted = ev->isAccepted();

QTransform fromItemTransform = m_webPage->transformFromItem();
Expand All @@ -217,10 +226,14 @@ void QtWebPageEventHandler::handleDragMoveEvent(QDragMoveEvent* ev)
ev->accept();

ev->setAccepted(accepted);
#else
Q_UNUSED(ev);
#endif
}

void QtWebPageEventHandler::handleDropEvent(QDropEvent* ev)
{
#if ENABLE(DRAG_SUPPORT)
bool accepted = ev->isAccepted();
QTransform fromItemTransform = m_webPage->transformFromItem();
// FIXME: Should not use QCursor::pos()
Expand All @@ -232,6 +245,9 @@ void QtWebPageEventHandler::handleDropEvent(QDropEvent* ev)
ev->accept();

ev->setAccepted(accepted);
#else
Q_UNUSED(ev);
#endif
}

void QtWebPageEventHandler::activateTapHighlight(const QTouchEvent::TouchPoint& point)
Expand Down Expand Up @@ -615,6 +631,7 @@ void QtWebPageEventHandler::didFindZoomableArea(const IntPoint& target, const In

void QtWebPageEventHandler::startDrag(const WebCore::DragData& dragData, PassRefPtr<ShareableBitmap> dragImage)
{
#if ENABLE(DRAG_SUPPORT)
QImage dragQImage;
if (dragImage)
dragQImage = dragImage->createQImage();
Expand All @@ -639,6 +656,10 @@ void QtWebPageEventHandler::startDrag(const WebCore::DragData& dragData, PassRef
}

m_webPageProxy->dragEnded(clientPosition, globalPosition, dropActionToDragOperation(actualDropAction));
#else
Q_UNUSED(dragData);
Q_UNUSED(dragImage);
#endif
}

} // namespace WebKit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include "config.h"
#include "WebDragClient.h"

#if ENABLE(DRAG_SUPPORT)

#include "DataTransfer.h"
#include "DragData.h"
#include "GraphicsContext.h"
Expand Down Expand Up @@ -67,3 +69,5 @@ void WebDragClient::startDrag(DragImageRef dragImage, const IntPoint& clientPosi
}

}

#endif // ENABLE(DRAG_SUPPORT)
45 changes: 42 additions & 3 deletions Source/cmake/OptionsQt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,40 @@ macro(QT_ADD_EXTRA_WEBKIT_TARGET_EXPORT target)
endif ()
endmacro()

macro(QTWEBKIT_GENERATE_MOC_FILES_CPP)
foreach (_file ${ARGN})
get_filename_component(_ext ${_file} EXT)
if (NOT _ext STREQUAL ".cpp")
message(FATAL_ERROR "QTWEBKIT_GENERATE_MOC_FILES_CPP must be used for .cpp files only")
endif ()
get_filename_component(_name_we ${_file} NAME_WE)
set(_moc_name "${CMAKE_CURRENT_BINARY_DIR}/${_name_we}.moc")
qt5_generate_moc(${_file} ${_moc_name})
ADD_SOURCE_DEPENDENCIES(${_file} ${_moc_name})
endforeach ()
endmacro()

macro(QTWEBKIT_GENERATE_MOC_FILE_H _header _source)
get_filename_component(_header_ext ${_header} EXT)
get_filename_component(_source_ext ${_source} EXT)
if ((NOT _header_ext STREQUAL ".h") OR (NOT _source_ext STREQUAL ".cpp"))
message(FATAL_ERROR "QTWEBKIT_GENERATE_MOC_FILE_H must be called with arguments being .h and .cpp files")
endif ()
get_filename_component(_name_we ${_header} NAME_WE)
set(_moc_name "${CMAKE_CURRENT_BINARY_DIR}/moc_${_name_we}.cpp")
qt5_generate_moc(${_header} ${_moc_name})
ADD_SOURCE_DEPENDENCIES(${_source} ${_moc_name})
endmacro()

macro(QTWEBKIT_GENERATE_MOC_FILES_H)
foreach (_header ${ARGN})
get_filename_component(_header_dir ${_header} DIRECTORY)
get_filename_component(_name_we ${_header} NAME_WE)
set(_source "${_header_dir}/${_name_we}.cpp")
QTWEBKIT_GENERATE_MOC_FILE_H(${_header} ${_source})
endforeach ()
endmacro()

set(CMAKE_MACOSX_RPATH ON)

add_definitions(-DBUILDING_QT__=1)
Expand Down Expand Up @@ -98,6 +132,13 @@ else ()
set(USE_QT_MULTIMEDIA_DEFAULT OFF)
endif ()

if (MSVC)
set(USE_QT_MULTIMEDIA_DEFAULT OFF)
set(USE_MEDIA_FOUNDATION_DEFAULT ON)
else ()
set(USE_MEDIA_FOUNDATION_DEFAULT OFF)
endif ()

if (CMAKE_SYSTEM_NAME MATCHES "Linux")
set(ENABLE_GAMEPAD_DEPRECATED_DEFAULT ON)
else ()
Expand Down Expand Up @@ -130,7 +171,7 @@ endif ()
# and the option is not relevant to any other WebKit ports.
WEBKIT_OPTION_DEFINE(USE_GSTREAMER "Use GStreamer implementation of MediaPlayer" PUBLIC ${USE_GSTREAMER_DEFAULT})
WEBKIT_OPTION_DEFINE(USE_LIBHYPHEN "Use automatic hyphenation with LibHyphen" PUBLIC ${USE_LIBHYPHEN_DEFAULT})
WEBKIT_OPTION_DEFINE(USE_MEDIA_FOUNDATION "Use MediaFoundation implementation of MediaPlayer" PUBLIC OFF)
WEBKIT_OPTION_DEFINE(USE_MEDIA_FOUNDATION "Use MediaFoundation implementation of MediaPlayer" PUBLIC ${USE_MEDIA_FOUNDATION_DEFAULT})
WEBKIT_OPTION_DEFINE(USE_QT_MULTIMEDIA "Use Qt Multimedia implementation of MediaPlayer" PUBLIC ${USE_QT_MULTIMEDIA_DEFAULT})
WEBKIT_OPTION_DEFINE(USE_WOFF2 "Include support of WOFF2 fonts format" PUBLIC ON)
WEBKIT_OPTION_DEFINE(ENABLE_INSPECTOR_UI "Include Inspector UI into resources" PUBLIC ON)
Expand Down Expand Up @@ -490,8 +531,6 @@ option(USE_LINKER_VERSION_SCRIPT "Use linker script for ABI compatibility with Q

# Find includes in corresponding build directories
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# Instruct CMake to run moc automatically when needed.
set(CMAKE_AUTOMOC ON)

# TODO: figure out if we can run automoc only on Qt sources

Expand Down
Loading

0 comments on commit 6d0ad27

Please sign in to comment.