Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
GSoC '17 Product - GNUstep - "Make WebCore run on top of GNUstep"

GNUstep Port of WebKit

Proposal

This project's proposal for Google Summer of Code was targeted at the GNUstep project. GNUstep is a free reimplementation of Apple's Cocoa APIs (such as Foundation, CoreFoundation, AppKit...). Cocoa is used for development of macOS and iOS applications, and through GNUstep it can be used for developing GNU/Linux and Windows applications as well.

Currently, GNUstep does not provide a WebView component for its applications, which is a major factor stopping greater adoption of the framework for cross-platform development.

This project aimed to build the Mac port of the WebKit web engine with the GNUstep framework with two purposes in mind:

  • Push GNUstep APIs forward by testing them against an extremely complex use case of Cocoa;
  • Have the WebKit product as part of the GNUstep APIs, enabling WebViews in GNUstep apps.

WebKit is supported on macOS, Windows, and GNU/Linux (through Qt and Gtk backends), and platform-specific backends exist for each of those. This project aimed to build the pure macOS port on a Linux installation using the GNUstep APIs.

While the initial proposition's goal was to make WebCore workable with a GNUstep backend, further investigation proved the framework would only be testable if we also compiled the WebKit framework, expanding the original proposition's already very large goals.

To make the build work, a series of new definitions and stubs were added to several GNUstep libraries, as well as a fair amount of actual working code. Conversely, many patches had to be done to the WebKit tree itself. A very common reason for such is the Mac port's reliance on Darwin-only features, such as Mach ports, XPC and dyld APIs. These were replaced with Linux equivalents.

In the "GNUstep-PATCHES.md" file, a comprehensive list of all patches submitted as part of this project to GNUstep is presented. The changes made to WebKit are in "webkit.diff", an admittedly big and disorganized patchfile.

State of the port

Currently, the GNUstep port of WebKit is still incomplete. If you follow these instructions, you will be able to build WebKit successfully using the GNUstep libraries, but you will not have an usable product.

Currently, JavaScriptCore mostly works, and passes most tests. The only feature that is not supported is the JS<-->ObjC bridge, which requires the implementation of a private Apple Objective-C runtime feature both in the Clang GNU ObjC emitter and on libobjc2. This issue is currently being tracked at https://github.com/gnustep/libobjc2/issues/37.

WebCore is being built with most ENABLE_* flags disabled for experimental purposes. However, re-enabling most of these flags should not generate any issue, or few issues at best. Notable exceptions are:

  • Remote Inspector: the Mac implementation of remote inspection relies heavily on Mach APIs and XPC, which is completely unimplemented on Linux.
  • Multimedia: GNUstep has no short-term plans of implementing AVFoundation, CoreVideo and other multimedia Cocoa frameworks. If the GS port ever supports multimedia, it should likely do so by integrating with the Gtk implementation for it.

In not so frequent cases, some features only used in edge cases have been commented out to avoid strenuous build effort for a seldom used quirk. A notable example is support for macOS' dictionary feature.

A notable choice has been to use the Gtk port's libsoup networking backend for the GNUstep rather than Foundation's. The reason for this was immaturity in newer Cocoa networking APIs in gnustep-base as well as the lack of CFNetwork, Security and SystemConfiguration frameworks in GNUstep. A hacky, dead simple NSURL*<-->Soup bridge was created in WebCore to support this.

WebKit2.framework relies heavily on newer APIs that are not implemented in GNUstep. For greater ease in building, we have chosen to build WebKitLegacy instead. The Mac port has been slightly modified with the addition of some ENABLE() checks, and with some PDF- and plugin-related features being commented out.

This build was attained thanks to the creation of some stubs in GNUstep libraries. We chose to create stubs for features that are used in edge cases and to actually implement general-use APIs. It should be noted that these stubs are very likely to generate issues in the future.

An unexpected factor which will likely impact future work on this port is the Mac port's enormous reliance on Apple internal APIs, some of which will likely have to be implemented without any behavior specification.

Technical notes on the port

When building WebKit with the configuration supplied here, these preprocessor conditions should be true:

  • PLATFORM(COCOA)
  • PLATFORM(MAC)
  • PLATFORM(GNUSTEP)
  • OS(LINUX)

Build instructions

  1. Install the latest release of Arch Linux

  2. Install the dependencies for the WebKit port:

$ pacman -S clang cairo libkqueue libpthread_workqueue lcms glu libxt gperf ruby glib2 libsoup libbsd
  1. Do a dirty hack to make WebKit compile against our header setup:
$ ln -s /usr/include/glib-2.0/* /usr/local/include
$ ln -s /usr/lib/glib-2.0/include/glibconfig.h /usr/local/include/
$ ln -s /usr/include/libsoup-2.4/libsoup/ /usr/local/include/libsoup
$ ln -s /usr/include/GL /usr/local/include/OpenGL
  1. Install gnustep-make, setting clang as the compiler.

  2. Build and install GNUstep libobjc2 from source using clang as a compiler (https://github.com/gnustep/libobjc2).

  3. Build and install libdispatch from source (github.com/nickhutchinson/libdispatch), making sure to link against libobjc2 for block support. DO NOT install libBlocksRuntime.

$ cmake -H. -Bbuild -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DBLOCKS_RUNTIME_LIBRARIES="/usr/local/lib/libobjc.so"
  1. Install Apple ICU.

    1. download from https://opensource.apple.com/tarballs/ICU/ICU-57163.0.1.tar.gz
    2. make LINUX=YES ARCH64=YES CC=clang CXX=clang++
    3. copy ./build/obj64/libicucore.so into /usr/local/lib.

DO NOT install the Apple ICU headers into your system.

  1. Build and install the following GNUstep components from source, making sure to always use clang as a compiler and libobjc2 as the ObjC runtime:

Having -fobjc-runtime=gnustep-1.7 in the compiler flags is a good way to guarantee that the correct runtime is being used.

  1. Checkout the WebKit Git repository at commit f1d75cec792c730cde5d85d6fdf6891b2098ea70 (see https://webkit.org for the checkout URL).

  2. Apply webkit.diff to the WebKit upstream:

$ cd WebKit; patch -p1 < ../webkit.diff
  1. Create an empty library file stub:
$ echo "void x(){}" > stub.c; gcc -o /usr/local/lib/libempty.so -shared stub.c;
  1. Build the webkit-system-interface library for some needed stubs:
$ git clone https://github.com/theiostream/webkit-system-interface
$ cd webkit-system-interface; make
$ cp libWebKitSystemInterfaceLinux.a $WEBKIT/WebKitLibraries
  1. Patch libobjc2 headers:

    1. In objc/runtime.h, change #define nil ((id)_OBJC_NULL_PTR) into #define nil (_OBJC_NULL_PTR)
    2. Wrap objc/objc-arc.h around an extern "C" {} block if we're compiling with C++. This second step should be very temporary.
  2. Patch CoreGraphics headers by adding the following to /usr/local/include/CoreGraphics/CGGeometry.h:

#define NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES 1
  1. Create an empty file at /usr/local/include/TargetConditionals.h

  2. Add a required stub typedef to /usr/local/include/CFNetwork/CFNetwork.h:

typedef struct __CFHTTPMessage *CFHTTPMessageRef;
  1. Setup the WebKit build with CMake:
$ cd WebKit
$ cmake -H. -Bbuildstep -DPORT=Mac -DWTF_LINUX=ON \
  -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_STANDARD=14 \
  -DCMAKE_C_FLAGS="-fobjc-runtime=gnustep-1.7 -fblocks -fPIC -DBUILDING_GNUSTEP__=1 -DENABLE_INSPECTOR_ALTERNATE_DISPATCHERS=0 -DJSC_OBJC_API_ENABLED=1" \
  -DCMAKE_CXX_FLAGS="-fobjc-runtime=gnustep-1.7 -fblocks -fPIC -DBUILDING_GNUSTEP__=1 -DENABLE_INSPECTOR_ALTERNATE_DISPATCHERS=0 -DJSC_OBJC_API_ENABLED=1" \
  \
  -DACCELERATE_LIBRARY=/usr/local/lib/libempty.so \
  -DAUDIOTOOLBOX_LIBRARY=/usr/local/lib/libempty.so \
  -DAUDIOUNIT_LIBRARY=/usr/local/lib/libempty.so \
  -DAVFOUNDATION_LIBRARY=/usr/local/lib/libempty.so \
  -DCARBON_LIBRARY=/usr/local/lib/libgnustep-boron.so \
  -DCOCOA_LIBRARY=/usr/local/lib/libgnustep-gui.so \
  -DCOREAUDIO_LIBRARY=/usr/local/lib/libempty.so \
  -DCOREFOUNDATION_LIBRARY=/usr/local/lib/libgnustep-corebase.so \
  -DDATADETECTORSCORE_FRAMEWORK=/usr/local/lib/libempty.so \
  -DDISKARBITRATION_LIBRARY=/usr/local/lib/libempty.so \
  -DIOKIT_LIBRARY=/usr/local/lib/libempty.so \
  -DIOSURFACE_LIBRARY=/usr/local/lib/libempty.so \
  -DLOOKUP_FRAMEWORK=/usr/local/lib/libempty.so \
  -DMETAL_LIBRARY=/usr/local/lib/libempty.so \
  -DOPENGL_LIBRARY=/usr/lib/libglapi.so \
  -DQUARTZCORE_LIBRARY=/usr/local/lib/libempty.so \
  -DQUARTZ_LIBRARY=/usr/local/lib/libempty.so \
  -DREADLINE_LIBRARY=/usr/lib/libreadline.so \
  -DSECURITY_LIBRARY=/usr/local/lib/libempty.so \
  -DSYSTEMCONFIGURATION_LIBRARY=/usr/local/lib/libempty.so \
  -DXML2_LIBRARY=/usr/lib/libxml2.so \
  \
  -DENABLE_REMOTE_INSPECTOR=OFF -DENABLE_MEDIA_CONTROLS_SCRIPT=OFF \
  -DENABLE_WEBKIT=OFF -DENABLE_WEBKIT_LEGACY=ON -DENABLE_SUBTLE_CRYPTO=OFF \
  -DENABLE_WEBGPU=0 -DENABLE_LEGACY_ENCRYPTED_MEDIA=0 \
  -DENABLE_IOSURFACE_CANVAS_BACKING_STORE=0 -DENABLE_WEB_AUDIO=0 \
  -DENABLE_VIDEO_TRACK=0 -DENABLE_PDFKIT_PLUGIN=0 \
  -DENABLE_WEBGL=0 -DENABLE_WEBGL2=0 \
  -DENABLE_VIDEO=0 -DENABLE_MEDIA_SOURCE=0 \
  -DENABLE_MINIBROWSER=ON -DENABLE_3D_TRANSFORMS=OFF \
  -DENABLE_ACCELERATED_OVERFLOW_SCROLLING=OFF -DENABLE_API_TESTS=OFF \
  -DENABLE_ASYNC_SCROLLING=OFF -DENABLE_ATTACHMENT_ELEMENT=OFF \
  -DENABLE_AVF_CAPTIONS=OFF -DENABLE_CACHE_PARTITIONING=OFF \
  -DENABLE_CANVAS_PATH=OFF \
  -DENABLE_CHANNEL_MESSAGING=OFF \
  -DENABLE_CONTENT_FILTERING=OFF \
  -DENABLE_CONTEXT_MENUS=OFF \
  -DENABLE_CSS_BOX_DECORATION_BREAK=OFF \
  -DENABLE_CSS_COMPOSITING=OFF \
  -DENABLE_CSS_REGIONS=OFF \
  -DENABLE_CSS_SCROLL_SNAP=OFF \
  -DENABLE_CURSOR_VISIBILITY=OFF \
  -DENABLE_DASHBOARD_SUPPORT=OFF \
  -DENABLE_DATACUE_VALUE=OFF \
  -DENABLE_DRAG_SUPPORT=OFF \
  -DENABLE_FETCH_API=OFF \
  -DENABLE_FILTERS_LEVEL_2=OFF \
  -DENABLE_FTPDIR=OFF \
  -DENABLE_FULLSCREEN_API=OFF \
  -DENABLE_GEOLOCATION=OFF \
  -DENABLE_ICONDATABASE=OFF \
  -DENABLE_INDEXED_DATABASE=OFF \
  -DENABLE_INDIE_UI=OFF \
  -DENABLE_INPUT_TYPE_COLOR=OFF \
  -DENABLE_INPUT_TYPE_COLOR_POPOVER=OFF \
  -DENABLE_INPUT_TYPE_DATE=OFF \
  -DENABLE_INPUT_TYPE_DATETIMELOCAL=OFF \
  -DENABLE_INPUT_TYPE_MONTH=OFF \
  -DENABLE_INPUT_TYPE_TIME=OFF \
  -DENABLE_INTERSECTION_OBSERVER=OFF \
  -DENABLE_INTL=OFF \
  -DENABLE_IOS_AIRPLAY=OFF \
  -DENABLE_LEGACY_CSS_VENDOR_PREFIXES=OFF \
  -DENABLE_LEGACY_VENDOR_PREFIXES=OFF \
  -DENABLE_LETTERPRESS=OFF \
  -DENABLE_MAC_LONG_PRESS=OFF \
  -DENABLE_MATHML=OFF \
  -DENABLE_MEMORY_SAMPLER=OFF \
  -DENABLE_METER_ELEMENT=OFF \
  -DENABLE_MOUSE_CURSOR_SCALE=OFF \
  -DENABLE_NETSCAPE_PLUGIN_API=OFF \
  -DENABLE_NOTIFICATIONS=OFF \
  -DENABLE_PUBLIC_SUFFIX_LIST=OFF \
  -DENABLE_RESOURCE_USAGE=OFF \
  -DENABLE_RUBBER_BANDING=OFF \
  -DENABLE_SAMPLING_PROFILER=OFF \
  -DENABLE_SERVICE_CONTROLS=OFF \
  -DENABLE_SMOOTH_SCROLLING=OFF \
  -DENABLE_SPEECH_SYNTHESIS=OFF \
  -DENABLE_STREAMS_API=OFF \
  -DENABLE_SVG_FONTS=OFF \
  -DENABLE_TELEPHONE_NUMBER_DETECTION=OFF \
  -DENABLE_USERSELECT_ALL=OFF \
  -DENABLE_USER_MESSAGE_HANDLERS=OFF \
  -DENABLE_WEBASSEMBLY=OFF \
  -DENABLE_WEBVTT_REGIONS=OFF \
  -DENABLE_WEB_SOCKETS=OFF \
  -DENABLE_XSLT=OFF
  1. Build WebKit:
$ make -C buildstep/

The build should only fail when we get to the MiniBrowser subproject, but by then we should have already generated libWebKitLegacy.so and be able to experiment with a WebView class supplied by it.

Next steps

With WebKit built, the next step is to link against libWebKitLegacy.so and try to get WebView to display a page. Currently, even initialization of the view causes a crash, and getting it to work should be a fun challenge.

Most work should likely happen at GNUstep GUI, which lacks many APIs that WebKit requires; and on QuartzCore, which lacks most APIs exposed by Apple.

Once this is attained, the next step is to enable the ENABLE_* flags that had been disabled in WebCore. As previously states, most should cause no or little issues; although few should cause enough trouble.

Tips

For building WebKit, we used a m4.xlarge instance at AWS for faster build times.

Here follows a list of patches submitted to GNUstep:

New libraries

gnustep-boron (a reimplementation of some non-deprecated Carbon APIs)

All work on this library is part of this GSoC project. This project contains stubs and a working reimplementation of macOS Universal Type Identifier APIs.

webkit-system-interface (a free reimplementation of a WebKit closed-source component)

Currently, this project only possesses stubs, and is a means to get WebKit linking.

Patched libraries

libobjc2 (reimplementation of the Objective-C 2 runtime)

Merged:

Unmerged:

gnustep-base (reimplementation of Foundation, a collection of general-purpose Objective-C APIs)

Merged:

gnustep-corebase (reimplementation of CoreFoundation, a collection of general-purpose APIs in C)

Merged:

gnustep-gui

Merged:

gnustep-back

Merged:

opal

Unmerged:

Merged:

quartzcore

Unmerged:

From 9999deea9ca85fefb3f7e01b8c8ac17036f3b397 Mon Sep 17 00:00:00 2001
From: Daniel Ferreira <dtf@stanford.edu>
Date: Fri, 4 Aug 2017 15:51:45 +0000
Subject: [PATCH 1/3] First patch round
---
Source/JavaScriptCore/API/JSContext.mm | 2 +
Source/JavaScriptCore/API/JSValueRef.cpp | 6 +-
Source/JavaScriptCore/API/JSWrapperMap.mm | 8 +-
Source/JavaScriptCore/API/ObjcRuntimeExtras.h | 10 ++
Source/JavaScriptCore/API/tests/Regress141275.mm | 1 +
Source/JavaScriptCore/API/tests/testapi.mm | 9 +-
Source/JavaScriptCore/PlatformMac.cmake | 2 +-
Source/JavaScriptCore/inspector/EventLoop.cpp | 4 +
Source/JavaScriptCore/runtime/Options.cpp | 8 +-
Source/JavaScriptCore/shell/CMakeLists.txt | 4 +-
Source/JavaScriptCore/shell/PlatformMac.cmake | 2 +-
Source/WTF/wtf/Assertions.cpp | 2 +-
Source/WTF/wtf/MD5.cpp | 2 +-
Source/WTF/wtf/MD5.h | 4 +-
Source/WTF/wtf/MainThread.h | 2 +-
Source/WTF/wtf/OSObjectPtr.h | 14 +++
Source/WTF/wtf/ObjcRuntimeExtras.h | 3 +
Source/WTF/wtf/Platform.h | 54 ++++++---
Source/WTF/wtf/PlatformMac.cmake | 52 +++++---
.../WTF/wtf/PlatformUserPreferredLanguagesMac.mm | 7 ++
Source/WTF/wtf/RetainPtr.h | 4 +
Source/WTF/wtf/SHA1.cpp | 2 +-
Source/WTF/wtf/SHA1.h | 4 +-
Source/WTF/wtf/SchedulePairMac.mm | 4 +-
Source/WTF/wtf/glib/GRefPtr.cpp | 2 +-
Source/WTF/wtf/glib/GRefPtr.h | 4 +-
Source/WTF/wtf/glib/GUniquePtr.h | 5 +-
.../WTF/wtf/mac/AppKitCompatibilityDeclarations.h | 2 +-
Source/WTF/wtf/mac/MainThreadMac.mm | 11 ++
Source/WTF/wtf/spi/cf/CFBundleSPI.h | 4 +-
Source/WTF/wtf/spi/cocoa/SecuritySPI.h | 2 +-
.../text/mac/TextBreakIteratorInternalICUMac.mm | 8 ++
Source/WebCore/PAL/pal/PlatformMac.cmake | 3 +-
Source/WebCore/PlatformMac.cmake | 134 +++++++++++++--------
.../WebCore/accessibility/mac/AXObjectCacheMac.mm | 1 +
.../mac/WebAccessibilityObjectWrapperMac.mm | 9 ++
Source/WebCore/crypto/keys/CryptoKeyEC.h | 2 +-
Source/WebCore/crypto/keys/CryptoKeyRSA.h | 2 +-
Source/WebCore/css/StyleResolver.cpp | 2 +
Source/WebCore/dom/DataTransferMac.mm | 4 +
Source/WebCore/editing/mac/FrameSelectionMac.mm | 2 +
Source/WebCore/fileapi/FileCocoa.mm | 2 +
Source/WebCore/html/HTMLMediaElement.cpp | 6 +-
Source/WebCore/inspector/InspectorNetworkAgent.cpp | 4 +-
Source/WebCore/page/MemoryRelease.cpp | 2 +-
Source/WebCore/page/PerformanceLogging.cpp | 2 +-
Source/WebCore/page/Settings.cpp | 2 +-
Source/WebCore/page/cocoa/SettingsCocoa.mm | 1 +
.../page/scrolling/ScrollingMomentumCalculator.cpp | 4 +
.../scrolling/mac/ScrollingMomentumCalculatorMac.h | 4 +
.../mac/ScrollingMomentumCalculatorMac.mm | 4 +
Source/WebCore/platform/Logging.cpp | 4 +-
Source/WebCore/platform/PlatformScreen.h | 5 +-
Source/WebCore/platform/SleepDisabler.cpp | 2 +-
.../audio/mac/AudioHardwareListenerMac.cpp | 4 +-
.../audio/mac/CAAudioStreamDescription.cpp | 5 +
.../platform/audio/mac/MediaSessionManagerMac.mm | 2 +
.../platform/cf/MainThreadSharedTimerCF.cpp | 4 +-
.../cocoa/ContentFilterUnblockHandlerCocoa.mm | 1 +
.../WebCore/platform/cocoa/CoreVideoSoftLink.cpp | 4 +
Source/WebCore/platform/cocoa/CoreVideoSoftLink.h | 4 +
Source/WebCore/platform/cocoa/FileMonitorCocoa.mm | 4 +
Source/WebCore/platform/cocoa/FileSystemCocoa.mm | 2 +-
Source/WebCore/platform/cocoa/MachSendRight.h | 4 +
.../platform/cocoa/NetworkExtensionContentFilter.h | 5 +-
.../platform/cocoa/VideoToolboxSoftLink.cpp | 4 +
.../WebCore/platform/cocoa/WebCoreNSErrorExtras.mm | 4 +-
.../platform/graphics/ComplexTextController.h | 5 +
Source/WebCore/platform/graphics/FloatPoint.h | 5 +-
Source/WebCore/platform/graphics/FloatRect.h | 5 +-
Source/WebCore/platform/graphics/FloatSize.h | 5 +-
.../WebCore/platform/graphics/FontPlatformData.h | 4 +-
Source/WebCore/platform/graphics/IntPoint.h | 5 +-
Source/WebCore/platform/graphics/IntRect.h | 5 +-
Source/WebCore/platform/graphics/IntSize.h | 5 +-
.../avfoundation/objc/MediaSampleAVFObjC.mm | 5 +
.../WebCore/platform/graphics/ca/GraphicsLayerCA.h | 1 +
.../graphics/ca/cocoa/PlatformCALayerCocoa.mm | 24 ++--
.../WebCore/platform/graphics/cg/ImageBufferCG.cpp | 4 +
.../platform/graphics/cg/ImageBufferDataCG.h | 2 +-
.../platform/graphics/cg/PDFDocumentImage.h | 4 +-
.../platform/graphics/cocoa/FontCacheCoreText.cpp | 17 +--
.../WebCore/platform/graphics/cocoa/FontCocoa.mm | 4 +-
.../cocoa/FontFamilySpecificationCoreText.h | 4 +
.../platform/graphics/cocoa/GPUDeviceMetal.mm | 4 +-
.../cocoa/WebActionDisablingCALayerDelegate.mm | 1 +
.../graphics/cv/PixelBufferConformerCV.cpp | 5 +
.../WebCore/platform/graphics/cv/TextureCacheCV.mm | 5 +
.../platform/graphics/cv/VideoTextureCopierCV.cpp | 4 +
.../graphics/mac/ComplexTextControllerCoreText.mm | 4 +-
.../platform/graphics/mac/FontCustomPlatformData.h | 5 +
Source/WebCore/platform/graphics/mac/ImageMac.mm | 2 +
.../WebCore/platform/graphics/mac/UTIUtilities.h | 37 ++++++
Source/WebCore/platform/mac/BlacklistUpdater.mm | 8 ++
Source/WebCore/platform/mac/DragDataMac.mm | 2 +
Source/WebCore/platform/mac/FileSystemMac.mm | 3 +-
Source/WebCore/platform/mac/PasteboardMac.mm | 1 +
Source/WebCore/platform/mac/PasteboardWriter.mm | 1 +
.../platform/mac/PlatformEventFactoryMac.mm | 7 +-
.../WebCore/platform/mac/PlatformPasteboardMac.mm | 1 +
Source/WebCore/platform/mac/ScrollbarThemeMac.mm | 6 +-
Source/WebCore/platform/mac/ThemeMac.mm | 37 +++---
Source/WebCore/platform/mac/ThreadCheck.mm | 11 ++
.../platform/mac/WebCoreFullScreenWarningView.mm | 4 +
.../WebCore/platform/mac/WebCoreSystemInterface.h | 18 ++-
Source/WebCore/platform/mac/WebGLBlacklist.mm | 2 +-
.../platform/network/NetworkStorageSession.h | 4 +-
.../platform/network/ResourceHandleInternal.h | 4 +
.../WebCore/platform/network/cf/CertificateInfo.h | 4 +-
.../platform/network/cocoa/CredentialCocoa.h | 2 +-
.../platform/network/cocoa/CredentialCocoa.mm | 4 +-
.../platform/network/cocoa/WebCoreNSURLSession.h | 5 +
.../platform/network/cocoa/WebCoreNSURLSession.mm | 8 ++
.../network/soup/AuthenticationChallenge.h | 1 +
.../platform/network/soup/ResourceHandleSoup.cpp | 17 +++
.../network/soup/SocketStreamHandleImplSoup.cpp | 17 +++
Source/WebCore/platform/posix/FileSystemPOSIX.cpp | 1 +
Source/WebCore/platform/spi/cf/CFNetworkSPI.h | 1 +
.../WebCore/platform/spi/cocoa/NEFilterSourceSPI.h | 2 +-
Source/WebCore/platform/spi/cocoa/QuartzCoreSPI.h | 3 +
Source/WebCore/platform/spi/mac/DataDetectorsSPI.h | 2 +
Source/WebCore/platform/text/mac/TextBoundaries.mm | 3 +
Source/WebCore/rendering/RenderThemeMac.mm | 58 ++++-----
Source/cmake/OptionsMac.cmake | 4 +-
Tools/CMakeLists.txt | 2 +-
Tools/Scripts/webkitdirs.pm | 3 +-
Tools/WebKitTestRunner/CMakeLists.txt | 2 +-
130 files changed, 664 insertions(+), 254 deletions(-)
create mode 100644 Source/WebCore/platform/graphics/mac/UTIUtilities.h
diff --git a/Source/JavaScriptCore/API/JSContext.mm b/Source/JavaScriptCore/API/JSContext.mm
index 5b100c75e..38516f799 100644
--- a/Source/JavaScriptCore/API/JSContext.mm
+++ b/Source/JavaScriptCore/API/JSContext.mm
@@ -40,6 +40,8 @@
#if JSC_OBJC_API_ENABLED
+#include <objc/objc-arc.h>
+
@implementation JSContext {
JSVirtualMachine *m_virtualMachine;
JSGlobalContextRef m_context;
diff --git a/Source/JavaScriptCore/API/JSValueRef.cpp b/Source/JavaScriptCore/API/JSValueRef.cpp
index 64ac6c324..712d25c30 100644
--- a/Source/JavaScriptCore/API/JSValueRef.cpp
+++ b/Source/JavaScriptCore/API/JSValueRef.cpp
@@ -44,7 +44,7 @@
#include <wtf/text/StringHash.h>
#include <wtf/text/WTFString.h>
-#if PLATFORM(MAC)
+#if OS(DARWIN)
#include <mach-o/dyld.h>
#endif
@@ -54,7 +54,7 @@
using namespace JSC;
-#if PLATFORM(MAC)
+#if OS(DARWIN)
static bool evernoteHackNeeded()
{
static const int32_t webkitLastVersionWithEvernoteHack = 35133959;
@@ -442,7 +442,7 @@ void JSValueProtect(JSContextRef ctx, JSValueRef value)
void JSValueUnprotect(JSContextRef ctx, JSValueRef value)
{
-#if PLATFORM(MAC)
+#if OS(DARWIN)
if ((!value || !ctx) && evernoteHackNeeded())
return;
#endif
diff --git a/Source/JavaScriptCore/API/JSWrapperMap.mm b/Source/JavaScriptCore/API/JSWrapperMap.mm
index 8cce3692e..f3bf7840d 100644
--- a/Source/JavaScriptCore/API/JSWrapperMap.mm
+++ b/Source/JavaScriptCore/API/JSWrapperMap.mm
@@ -42,7 +42,11 @@
#import <wtf/spi/cocoa/NSMapTableSPI.h>
#import <wtf/spi/darwin/dyldSPI.h>
+#if OS(DARWIN)
#include <mach-o/dyld.h>
+#endif
+
+#undef toupper
#if PLATFORM(APPLETV)
#else
@@ -664,7 +668,7 @@ bool supportsInitMethodConstructors()
#if PLATFORM(APPLETV)
// There are no old clients on Apple TV, so there's no need for backwards compatibility.
return true;
-#else
+#elif OS(DARWIN)
// First check to see the version of JavaScriptCore we directly linked against.
static int32_t versionOfLinkTimeJavaScriptCore = 0;
if (!versionOfLinkTimeJavaScriptCore)
@@ -680,6 +684,8 @@ bool supportsInitMethodConstructors()
programSDKVersion = dyld_get_program_sdk_version();
return programSDKVersion >= firstSDKVersionWithInitConstructorSupport;
+#else
+ return true;
#endif
}
diff --git a/Source/JavaScriptCore/API/ObjcRuntimeExtras.h b/Source/JavaScriptCore/API/ObjcRuntimeExtras.h
index fa44ff6f7..dccf90d9b 100644
--- a/Source/JavaScriptCore/API/ObjcRuntimeExtras.h
+++ b/Source/JavaScriptCore/API/ObjcRuntimeExtras.h
@@ -236,11 +236,21 @@ typename DelegateType::ResultType parseObjCType(const char*& position)
}
}
+#if PLATFORM(GNUSTEP)
+#define _protocol_getMethodTypeEncoding(x, y, z, w) (protocol_getMethodDescription(x, y, z, w).types)
+#define _Block_has_signature(x) (block_getType_np(x) != NULL)
+#define _Block_signature(x) block_getType_np(x)
+#endif
+
extern "C" {
// Forward declare some Objective-C runtime internal methods that are not API.
+#if !PLATFORM(GNUSTEP)
const char *_protocol_getMethodTypeEncoding(Protocol *, SEL, BOOL isRequiredMethod, BOOL isInstanceMethod);
+#endif
id objc_initWeak(id *, id);
void objc_destroyWeak(id *);
+#if !PLATFORM(GNUSTEP)
bool _Block_has_signature(void *);
const char * _Block_signature(void *);
+#endif
}
diff --git a/Source/JavaScriptCore/API/tests/Regress141275.mm b/Source/JavaScriptCore/API/tests/Regress141275.mm
index 18e186a65..c142e07eb 100644
--- a/Source/JavaScriptCore/API/tests/Regress141275.mm
+++ b/Source/JavaScriptCore/API/tests/Regress141275.mm
@@ -29,6 +29,7 @@
#import <Foundation/Foundation.h>
#import <objc/objc.h>
#import <objc/runtime.h>
+#import <dispatch/dispatch.h>
#if JSC_OBJC_API_ENABLED
diff --git a/Source/JavaScriptCore/API/tests/testapi.mm b/Source/JavaScriptCore/API/tests/testapi.mm
index e98d6cf5d..bccee3f39 100644
--- a/Source/JavaScriptCore/API/tests/testapi.mm
+++ b/Source/JavaScriptCore/API/tests/testapi.mm
@@ -24,6 +24,7 @@
*/
#import <JavaScriptCore/JavaScriptCore.h>
+#import <wtf/Platform.h>
#import "CurrentThisInsideBlockGetterTest.h"
#import "DateTests.h"
@@ -37,8 +38,14 @@
extern "C" void JSSynchronousGarbageCollectForDebugging(JSContextRef);
extern "C" void JSSynchronousEdenCollectForDebugging(JSContextRef);
+#if PLATFORM(GNUSTEP)
+#import <Block.h>
+#define _Block_has_signature(x) (block_getType_np((__bridge void *)x) != NULL)
+#define _Block_signature(x) block_getType_np((__bridge void *)x)
+#else
extern "C" bool _Block_has_signature(id);
extern "C" const char * _Block_signature(id);
+#endif
extern int failed;
extern "C" void testObjectiveCAPI(void);
@@ -1469,7 +1476,7 @@ static void testObjectiveCAPIMain()
checkResult(@"Ran code in five concurrent VMs that GC'd", ok);
}
- currentThisInsideBlockGetterTest();
+ //currentThisInsideBlockGetterTest();
runDateTests();
runJSExportTests();
runRegress141275();
diff --git a/Source/JavaScriptCore/PlatformMac.cmake b/Source/JavaScriptCore/PlatformMac.cmake
index e528b800a..08df416f1 100644
--- a/Source/JavaScriptCore/PlatformMac.cmake
+++ b/Source/JavaScriptCore/PlatformMac.cmake
@@ -31,7 +31,7 @@ list(APPEND JavaScriptCore_INCLUDE_DIRECTORIES
${JAVASCRIPTCORE_DIR}/inspector/remote/cocoa
)
-set(CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS} "-compatibility_version 1 -current_version ${WEBKIT_MAC_VERSION}")
+#set(CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS}"-compatibility_version 1 -current_version ${WEBKIT_MAC_VERSION}")
# FIXME: Make including these files consistent in the source so these forwarding headers are not needed.
if (NOT EXISTS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorBackendDispatchers.h)
diff --git a/Source/JavaScriptCore/inspector/EventLoop.cpp b/Source/JavaScriptCore/inspector/EventLoop.cpp
index 7af75c114..179ed9900 100644
--- a/Source/JavaScriptCore/inspector/EventLoop.cpp
+++ b/Source/JavaScriptCore/inspector/EventLoop.cpp
@@ -32,6 +32,10 @@
#include <glib.h>
#endif
+#if USE(CF)
+#include <CoreFoundation/CoreFoundation.h>
+#endif
+
namespace Inspector {
#if USE(CF) && !OS(WINDOWS)
diff --git a/Source/JavaScriptCore/runtime/Options.cpp b/Source/JavaScriptCore/runtime/Options.cpp
index 430eacf82..a891bde04 100644
--- a/Source/JavaScriptCore/runtime/Options.cpp
+++ b/Source/JavaScriptCore/runtime/Options.cpp
@@ -46,7 +46,7 @@
#include <wtf/text/StringBuilder.h>
#include <wtf/threads/Signals.h>
-#if PLATFORM(COCOA)
+#if OS(DARWIN)
#include <crt_externs.h>
#endif
@@ -523,7 +523,7 @@ void Options::initialize()
// Allow environment vars to override options if applicable.
// The evn var should be the name of the option prefixed with
// "JSC_".
-#if PLATFORM(COCOA)
+#if OS(DARWIN)
bool hasBadOptions = false;
for (char** envp = *_NSGetEnviron(); *envp; envp++) {
const char* env = *envp;
@@ -536,12 +536,12 @@ void Options::initialize()
}
if (hasBadOptions && Options::validateOptions())
CRASH();
-#else // PLATFORM(COCOA)
+#else // OS(DARWIN)
#define FOR_EACH_OPTION(type_, name_, defaultValue_, availability_, description_) \
overrideOptionWithHeuristic(name_(), name_##ID, "JSC_" #name_, Availability::availability_);
JSC_OPTIONS(FOR_EACH_OPTION)
#undef FOR_EACH_OPTION
-#endif // PLATFORM(COCOA)
+#endif // OS(DARWIN)
#define FOR_EACH_OPTION(aliasedName_, unaliasedName_, equivalence_) \
overrideAliasedOptionWithHeuristic("JSC_" #aliasedName_);
diff --git a/Source/JavaScriptCore/shell/CMakeLists.txt b/Source/JavaScriptCore/shell/CMakeLists.txt
index bc37dd317..e978b8d6a 100644
--- a/Source/JavaScriptCore/shell/CMakeLists.txt
+++ b/Source/JavaScriptCore/shell/CMakeLists.txt
@@ -71,8 +71,8 @@ if (NOT WIN32)
add_executable(testmasm ${TESTMASM_SOURCES})
target_link_libraries(testmasm ${JSC_LIBRARIES})
- add_executable(testb3 ${TESTB3_SOURCES})
- target_link_libraries(testb3 ${JSC_LIBRARIES})
+ #add_executable(testb3 ${TESTB3_SOURCES})
+ #target_link_libraries(testb3 ${JSC_LIBRARIES})
add_executable(testair ${TESTAIR_SOURCES})
target_link_libraries(testair ${JSC_LIBRARIES})
diff --git a/Source/JavaScriptCore/shell/PlatformMac.cmake b/Source/JavaScriptCore/shell/PlatformMac.cmake
index 7c0fea252..21c4e1701 100644
--- a/Source/JavaScriptCore/shell/PlatformMac.cmake
+++ b/Source/JavaScriptCore/shell/PlatformMac.cmake
@@ -1,5 +1,5 @@
set(TESTAPI_OBJC_SOURCES
- ../API/tests/CurrentThisInsideBlockGetterTest.mm
+ #../API/tests/CurrentThisInsideBlockGetterTest.mm CFBridgingRetain
../API/tests/DateTests.mm
../API/tests/JSExportTests.mm
../API/tests/Regress141275.mm
diff --git a/Source/WTF/wtf/Assertions.cpp b/Source/WTF/wtf/Assertions.cpp
index 86ae54506..4071a4e43 100644
--- a/Source/WTF/wtf/Assertions.cpp
+++ b/Source/WTF/wtf/Assertions.cpp
@@ -55,7 +55,7 @@
#if USE(CF)
#include <CoreFoundation/CFString.h>
-#if PLATFORM(COCOA)
+#if PLATFORM(COCOA) && !PLATFORM(GNUSTEP)
#define USE_APPLE_SYSTEM_LOG 1
#include <asl.h>
#endif
diff --git a/Source/WTF/wtf/MD5.cpp b/Source/WTF/wtf/MD5.cpp
index 55080f215..41ade9396 100644
--- a/Source/WTF/wtf/MD5.cpp
+++ b/Source/WTF/wtf/MD5.cpp
@@ -59,7 +59,7 @@
namespace WTF {
-#if PLATFORM(COCOA)
+#if PLATFORM(COCOA) && !PLATFORM(GNUSTEP)
MD5::MD5()
{
diff --git a/Source/WTF/wtf/MD5.h b/Source/WTF/wtf/MD5.h
index ff1dbbb93..a01a0a959 100644
--- a/Source/WTF/wtf/MD5.h
+++ b/Source/WTF/wtf/MD5.h
@@ -34,7 +34,7 @@
#include <array>
#include <wtf/Vector.h>
-#if PLATFORM(COCOA)
+#if PLATFORM(COCOA) && !PLATFORM(GNUSTEP)
#include <CommonCrypto/CommonDigest.h>
#endif
@@ -60,7 +60,7 @@ public:
WTF_EXPORT_PRIVATE void checksum(Digest&);
private:
-#if PLATFORM(COCOA)
+#if PLATFORM(COCOA) && !PLATFORM(GNUSTEP)
CC_MD5_CTX m_context;
#else
uint32_t m_buf[4];
diff --git a/Source/WTF/wtf/MainThread.h b/Source/WTF/wtf/MainThread.h
index 14b34673a..4596ebbbb 100644
--- a/Source/WTF/wtf/MainThread.h
+++ b/Source/WTF/wtf/MainThread.h
@@ -84,7 +84,7 @@ void initializeMainThreadPlatform();
void scheduleDispatchFunctionsOnMainThread();
void dispatchFunctionsFromMainThread();
-#if OS(DARWIN) && !USE(GLIB)
+#if PLATFORM(COCOA) && !USE(GLIB)
#if !USE(WEB_THREAD)
// This version of initializeMainThread sets up the main thread as corresponding
// to the process's main thread, and not necessarily the thread that calls this
diff --git a/Source/WTF/wtf/OSObjectPtr.h b/Source/WTF/wtf/OSObjectPtr.h
index ed7eceb92..3b33246d5 100644
--- a/Source/WTF/wtf/OSObjectPtr.h
+++ b/Source/WTF/wtf/OSObjectPtr.h
@@ -30,6 +30,20 @@
#include <wtf/Assertions.h>
#include <wtf/StdLibExtras.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+#ifndef __OBJC__
+void *os_retain(void *object);
+void os_release(void *object);
+#else
+#define os_retain(object) [object release]
+#define os_release(object) [object release]
+#endif
+#ifdef __cplusplus
+}
+#endif
+
namespace WTF {
template<typename T> class OSObjectPtr;
diff --git a/Source/WTF/wtf/ObjcRuntimeExtras.h b/Source/WTF/wtf/ObjcRuntimeExtras.h
index 89b9f4b9c..55e4301a2 100644
--- a/Source/WTF/wtf/ObjcRuntimeExtras.h
+++ b/Source/WTF/wtf/ObjcRuntimeExtras.h
@@ -29,6 +29,9 @@
// but it should be ObjC with an uppercase C.
#include <objc/message.h>
+#if PLATFORM(GNUSTEP)
+#include <objc/runtime.h>
+#endif
#ifdef __cplusplus
diff --git a/Source/WTF/wtf/Platform.h b/Source/WTF/wtf/Platform.h
index 802f52579..566d986d2 100644
--- a/Source/WTF/wtf/Platform.h
+++ b/Source/WTF/wtf/Platform.h
@@ -28,6 +28,10 @@
#ifndef WTF_Platform_h
#define WTF_Platform_h
+// FIXME: TEMP
+#define __MAC_OS_X_VERSION_MIN_REQUIRED 0
+#define __MAC_OS_X_VERSION_MAX_ALLOWED 0
+
/* Include compiler specific macros */
#include <wtf/Compiler.h>
@@ -466,6 +470,9 @@
/* PLATFORM(WIN) */
#if defined(BUILDING_GTK__)
#define WTF_PLATFORM_GTK 1
+#elif defined(BUILDING_GNUSTEP__)
+#define WTF_PLATFORM_GNUSTEP 1
+#define WTF_PLATFORM_MAC 1
#elif defined(BUILDING_WPE__)
#define WTF_PLATFORM_WPE 1
#elif defined(BUILDING_JSCONLY__)
@@ -492,6 +499,11 @@
#endif
#endif
+/* PLATFORM(GNUSTEP) */
+#if PLATFORM(GNUSTEP)
+#include <GNUstepBase/GSVersionMacros.h>
+#endif
+
/* PLATFORM(APPLETV) */
#if defined(TARGET_OS_TV) && TARGET_OS_TV
#define WTF_PLATFORM_APPLETV 1
@@ -517,11 +529,14 @@
#define USE_GLIB 1
#define USE_FREETYPE 1
#define USE_HARFBUZZ 1
-#define USE_SOUP 1
#define USE_WEBP 1
#define USE_FILE_LOCK 1
#endif
+#if PLATFORM(GTK) || PLATFORM(WPE) || PLATFORM(GNUSTEP)
+#define USE_SOUP 1
+#endif
+
#if PLATFORM(GTK)
#define GLIB_VERSION_MIN_REQUIRED GLIB_VERSION_2_36
#endif
@@ -544,13 +559,13 @@
#define USE_CF 1
#define USE_FOUNDATION 1
#define USE_NETWORK_CFDATA_ARRAY_CALLBACK 1
-#define ENABLE_USER_MESSAGE_HANDLERS 1
+#define ENABLE_USER_MESSAGE_HANDLERS 0 // ENABLE_!
#define HAVE_OUT_OF_PROCESS_LAYER_HOSTING 1
#define HAVE_DTRACE 0
#define USE_FILE_LOCK 1
#if !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
-#define ENABLE_DATA_DETECTION 1
+#define ENABLE_DATA_DETECTION 0 // ENABLE_!
#define HAVE_AVKIT 1
#define HAVE_PARENTAL_CONTROLS 1
#endif
@@ -559,7 +574,7 @@
#if PLATFORM(MAC)
-#if __MAC_OS_X_VERSION_MIN_REQUIRED < 101200
+#if __MAC_OS_X_VERSION_MIN_REQUIRED < 101200 && !PLATFORM(GNUSTEP)
#define USE_QTKIT 1
#else
#define USE_QTKIT 0
@@ -1053,7 +1068,7 @@
#define ENABLE_BINDING_INTEGRITY 1
#endif
-#if PLATFORM(COCOA)
+#if PLATFORM(COCOA) && !PLATFORM(GNUSTEP)
#define USE_AVFOUNDATION 1
#endif
@@ -1080,33 +1095,33 @@
#endif
#endif
-#if PLATFORM(IOS) || PLATFORM(MAC)
+#if PLATFORM(COCOA) && !PLATFORM(GNUSTEP)
#define USE_COREMEDIA 1
#define HAVE_AVFOUNDATION_VIDEO_OUTPUT 1
#endif
-#if PLATFORM(IOS) || PLATFORM(MAC) || (OS(WINDOWS) && USE(CG))
+#if (PLATFORM(COCOA) && !PLATFORM(GNUSTEP)) || (OS(WINDOWS) && USE(CG))
#define HAVE_AVFOUNDATION_MEDIA_SELECTION_GROUP 1
#endif
-#if PLATFORM(IOS) || PLATFORM(MAC) || (OS(WINDOWS) && USE(CG))
+#if (PLATFORM(COCOA) && !PLATFORM(GNUSTEP)) || (OS(WINDOWS) && USE(CG))
#define HAVE_AVFOUNDATION_LEGIBLE_OUTPUT_SUPPORT 1
#define HAVE_MEDIA_ACCESSIBILITY_FRAMEWORK 1
#endif
-#if PLATFORM(IOS) || PLATFORM(MAC)
+#if PLATFORM(COCOA) && !PLATFORM(GNUSTEP)
#define HAVE_AVFOUNDATION_LOADER_DELEGATE 1
#endif
-#if PLATFORM(MAC) || (PLATFORM(IOS) && ENABLE(WEB_RTC))
+#if (PLATFORM(MAC) || (PLATFORM(IOS) && ENABLE(WEB_RTC))) && !PLATFORM(GNUSTEP)
#define USE_VIDEOTOOLBOX 1
#endif
-#if PLATFORM(COCOA) || PLATFORM(GTK) || PLATFORM(WPE)
+#if (PLATFORM(COCOA) || PLATFORM(GTK) || PLATFORM(WPE)) && !PLATFORM(GNUSTEP)
#define USE_REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR 1
#endif
-#if PLATFORM(MAC)
+#if PLATFORM(MAC) && !PLATFORM(GNUSTEP)
#define USE_COREAUDIO 1
#endif
@@ -1115,7 +1130,7 @@
#endif
#ifndef HAVE_QOS_CLASSES
-#if PLATFORM(COCOA)
+#if PLATFORM(COCOA) && !PLATFORM(GNUSTEP)
#define HAVE_QOS_CLASSES 1
#endif
#endif
@@ -1153,16 +1168,16 @@
#define HAVE_TIMINGDATAOPTIONS 1
#endif
-#if PLATFORM(COCOA)
+#if PLATFORM(COCOA) && !PLATFORM(GNUSTEP)
#define USE_AUDIO_SESSION 1
#endif
-#if PLATFORM(COCOA) && !PLATFORM(IOS_SIMULATOR)
+#if PLATFORM(COCOA) && !PLATFORM(IOS_SIMULATOR) && !PLATFORM(GNUSTEP)
#define USE_IOSURFACE 1
#endif
#if PLATFORM(COCOA)
-#define ENABLE_RESOURCE_USAGE 1
+#define ENABLE_RESOURCE_USAGE 0 // ENABLE_!
#endif
#if PLATFORM(GTK) || PLATFORM(WPE)
@@ -1190,6 +1205,7 @@
#define HAVE_NS_ACTIVITY 1
#endif
+/* GSTODO: Review this */
#if (OS(DARWIN) && USE(CG)) || (USE(FREETYPE) && !PLATFORM(GTK)) || (PLATFORM(WIN) && (USE(CG) || USE(CAIRO)))
#undef ENABLE_OPENTYPE_MATH
#define ENABLE_OPENTYPE_MATH 1
@@ -1201,7 +1217,7 @@
#define TARGET_OS_IPHONE 0
#endif
-#if PLATFORM(COCOA)
+#if PLATFORM(COCOA) && !PLATFORM(GNUSTEP)
#define USE_MEDIATOOLBOX 1
#endif
@@ -1213,7 +1229,7 @@
#endif
#endif
-#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200) || PLATFORM(IOS)
+#if ((PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200) || PLATFORM(IOS)) && !PLATFORM(GNUSTEP)
#define HAVE_SEC_TRUST_SERIALIZATION 1
#endif
@@ -1241,7 +1257,7 @@
#endif
#endif
-#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
+#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200 && !PLATFORM(GNUSTEP)
#define USE_MEDIAREMOTE 1
#endif
diff --git a/Source/WTF/wtf/PlatformMac.cmake b/Source/WTF/wtf/PlatformMac.cmake
index b4b1daf33..df8777ac3 100644
--- a/Source/WTF/wtf/PlatformMac.cmake
+++ b/Source/WTF/wtf/PlatformMac.cmake
@@ -3,6 +3,11 @@ find_library(COREFOUNDATION_LIBRARY CoreFoundation)
find_library(READLINE_LIBRARY Readline)
list(APPEND WTF_LIBRARIES
${COREFOUNDATION_LIBRARY}
+ gnustep-base
+ dispatch
+ objc
+ objcxx
+ pthread
${COCOA_LIBRARY}
${READLINE_LIBRARY}
)
@@ -19,9 +24,6 @@ list(APPEND WTF_SOURCES
cf/RunLoopCF.cpp
- cocoa/CPUTimeCocoa.mm
- cocoa/MemoryFootprintCocoa.cpp
- cocoa/MemoryPressureHandlerCocoa.mm
cocoa/WorkQueueCocoa.cpp
mac/DeprecatedSymbolsUsedBySafari.mm
@@ -37,28 +39,46 @@ list(APPEND WTF_SOURCES
text/mac/StringViewObjC.mm
)
+if (WTF_LINUX)
+ list(APPEND WTF_SOURCES
+ linux/MemoryFootprintLinux.cpp
+ linux/MemoryPressureHandlerLinux.cpp
+ unix/CPUTimeUnix.cpp
+ )
+else (WTF_LINUX)
+ list(APPEND WTF_SOURCES
+ cocoa/MemoryFootprintCocoa.mm
+ cocoa/MemoryPressureHandlerCocoa.mm
+ cocoa/CPUTimeCocoa.mm
+ )
+endif(WTF_LINUX)
+
+
list(APPEND WTF_INCLUDE_DIRECTORIES
"${WTF_DIR}/icu"
"${WTF_DIR}/wtf/spi/darwin"
${DERIVED_SOURCES_WTF_DIR}
)
-file(COPY mac/MachExceptions.defs DESTINATION ${DERIVED_SOURCES_WTF_DIR})
+if (WTF_LINUX)
+else(WTF_LINUX)
+ file(COPY mac/MachExceptions.defs DESTINATION ${DERIVED_SOURCES_WTF_DIR})
-add_custom_command(
- OUTPUT
- ${DERIVED_SOURCES_WTF_DIR}/MachExceptionsServer.h
- ${DERIVED_SOURCES_WTF_DIR}/mach_exc.h
+ add_custom_command(
+ OUTPUT
+ ${DERIVED_SOURCES_WTF_DIR}/MachExceptionsServer.h
+ ${DERIVED_SOURCES_WTF_DIR}/mach_exc.h
+ ${DERIVED_SOURCES_WTF_DIR}/mach_excServer.c
+ ${DERIVED_SOURCES_WTF_DIR}/mach_excUser.c
+ MAIN_DEPENDENCY mac/MachExceptions.defs
+ WORKING_DIRECTORY ${DERIVED_SOURCES_WTF_DIR}
+ COMMAND mig -sheader MachExceptionsServer.h MachExceptions.defs
+ VERBATIM)
+ list(APPEND WTF_SOURCES
${DERIVED_SOURCES_WTF_DIR}/mach_excServer.c
${DERIVED_SOURCES_WTF_DIR}/mach_excUser.c
- MAIN_DEPENDENCY mac/MachExceptions.defs
- WORKING_DIRECTORY ${DERIVED_SOURCES_WTF_DIR}
- COMMAND mig -sheader MachExceptionsServer.h MachExceptions.defs
- VERBATIM)
-list(APPEND WTF_SOURCES
- ${DERIVED_SOURCES_WTF_DIR}/mach_excServer.c
- ${DERIVED_SOURCES_WTF_DIR}/mach_excUser.c
-)
+ )
+endif(WTF_LINUX)
WEBKIT_CREATE_FORWARDING_HEADERS(WebKitLegacy DIRECTORIES ${WebKitLegacy_FORWARDING_HEADERS_DIRECTORIES} FILES ${WebKitLegacy_FORWARDING_HEADERS_FILES})
WEBKIT_CREATE_FORWARDING_HEADERS(WebKit DIRECTORIES ${FORWARDING_HEADERS_DIR}/WebKitLegacy)
diff --git a/Source/WTF/wtf/PlatformUserPreferredLanguagesMac.mm b/Source/WTF/wtf/PlatformUserPreferredLanguagesMac.mm
index 3ae71aefc..746afd36b 100644
--- a/Source/WTF/wtf/PlatformUserPreferredLanguagesMac.mm
+++ b/Source/WTF/wtf/PlatformUserPreferredLanguagesMac.mm
@@ -29,6 +29,7 @@
#import "BlockObjCExceptions.h"
#import <mutex>
#import <unicode/uloc.h>
+#import <dispatch/dispatch.h>
#import <wtf/Assertions.h>
#import <wtf/Lock.h>
#import <wtf/NeverDestroyed.h>
@@ -88,6 +89,7 @@ static String httpStyleLanguageCode(NSString *language)
// 1. There is no reason why CFBundle localization names would be at all related to language names as used on the Web.
// 2. Script Manager codes cannot represent all languages that are now supported by the platform, so the conversion is lossy.
// 3. This should probably match what is sent by the network layer as Accept-Language, but currently, that's implemented separately.
+#if !PLATFORM(GNUSTEP)
CFBundleGetLocalizationInfoForLocalization((CFStringRef)language, &languageCode, &regionCode, &scriptCode, &stringEncoding);
RetainPtr<CFStringRef> preferredLanguageCode = adoptCF(CFBundleCopyLocalizationForLocalizationInfo(languageCode, regionCode, scriptCode, stringEncoding));
if (preferredLanguageCode)
@@ -99,6 +101,7 @@ static String httpStyleLanguageCode(NSString *language)
[mutableLanguageCode.get() replaceCharactersInRange:NSMakeRange(2, 1) withString:@"-"];
return mutableLanguageCode.get();
}
+#endif
return language;
}
@@ -118,6 +121,9 @@ Vector<String> platformUserPreferredLanguages()
Vector<String>& userPreferredLanguages = preferredLanguages();
if (userPreferredLanguages.isEmpty()) {
+#if PLATFORM(GNUSTEP)
+ userPreferredLanguages.append("en");
+#else
RetainPtr<CFArrayRef> languages = adoptCF(CFLocaleCopyPreferredLanguages());
CFIndex languageCount = CFArrayGetCount(languages.get());
if (!languageCount)
@@ -126,6 +132,7 @@ Vector<String> platformUserPreferredLanguages()
for (CFIndex i = 0; i < languageCount; i++)
userPreferredLanguages.append(httpStyleLanguageCode((NSString *)CFArrayGetValueAtIndex(languages.get(), i)));
}
+#endif
}
Vector<String> userPreferredLanguagesCopy;
diff --git a/Source/WTF/wtf/RetainPtr.h b/Source/WTF/wtf/RetainPtr.h
index c55eec31c..9ebd1a674 100644
--- a/Source/WTF/wtf/RetainPtr.h
+++ b/Source/WTF/wtf/RetainPtr.h
@@ -167,7 +167,11 @@ template<typename T> inline typename RetainPtr<T>::PtrType RetainPtr<T>::leakRef
#ifdef __OBJC__
template<typename T> inline auto RetainPtr<T>::autorelease() -> PtrType
{
+#if PLATFORM(GNUSTEP)
+ return (__bridge PtrType)leakRef();
+#else
return (__bridge PtrType)CFBridgingRelease(leakRef());
+#endif
}
#endif
diff --git a/Source/WTF/wtf/SHA1.cpp b/Source/WTF/wtf/SHA1.cpp
index 2f84a1e95..bf89490ce 100644
--- a/Source/WTF/wtf/SHA1.cpp
+++ b/Source/WTF/wtf/SHA1.cpp
@@ -39,7 +39,7 @@
namespace WTF {
-#if PLATFORM(COCOA)
+#if PLATFORM(COCOA) && !PLATFORM(GNUSTEP)
SHA1::SHA1()
{
diff --git a/Source/WTF/wtf/SHA1.h b/Source/WTF/wtf/SHA1.h
index 009b484ad..2094cf6f0 100644
--- a/Source/WTF/wtf/SHA1.h
+++ b/Source/WTF/wtf/SHA1.h
@@ -35,7 +35,7 @@
#include <wtf/Vector.h>
#include <wtf/text/CString.h>
-#if PLATFORM(COCOA)
+#if PLATFORM(COCOA) && !PLATFORM(GNUSTEP)
#include <CommonCrypto/CommonDigest.h>
#endif
@@ -71,7 +71,7 @@ public:
WTF_EXPORT_PRIVATE CString computeHexDigest();
private:
-#if PLATFORM(COCOA)
+#if PLATFORM(COCOA) && !PLATFORM(GNUSTEP)
CC_SHA1_CTX m_context;
#else
void finalize();
diff --git a/Source/WTF/wtf/SchedulePairMac.mm b/Source/WTF/wtf/SchedulePairMac.mm
index 24d5577cd..5047c8b68 100644
--- a/Source/WTF/wtf/SchedulePairMac.mm
+++ b/Source/WTF/wtf/SchedulePairMac.mm
@@ -29,13 +29,13 @@
#include "config.h"
#include "SchedulePair.h"
-#if !USE(CFURLCONNECTION)
+#if !USE(CFURLCONNECTION) || !PLATFORM(GNUSTEP)
namespace WTF {
SchedulePair::SchedulePair(NSRunLoop* runLoop, CFStringRef mode)
: m_nsRunLoop(runLoop)
- , m_runLoop([runLoop getCFRunLoop])
+ , m_runLoop(NULL/*[runLoop getCFRunLoop]*/)
{
if (mode)
m_mode = adoptCF(CFStringCreateCopy(0, mode));
diff --git a/Source/WTF/wtf/glib/GRefPtr.cpp b/Source/WTF/wtf/glib/GRefPtr.cpp
index c522095af..1e380fbf6 100644
--- a/Source/WTF/wtf/glib/GRefPtr.cpp
+++ b/Source/WTF/wtf/glib/GRefPtr.cpp
@@ -19,7 +19,7 @@
#include "config.h"
#include "GRefPtr.h"
-#if USE(GLIB)
+#if USE(GLIB) || PLATFORM(GNUSTEP)
#include <glib-object.h>
#include <glib.h>
diff --git a/Source/WTF/wtf/glib/GRefPtr.h b/Source/WTF/wtf/glib/GRefPtr.h
index 731305bda..758e95790 100644
--- a/Source/WTF/wtf/glib/GRefPtr.h
+++ b/Source/WTF/wtf/glib/GRefPtr.h
@@ -23,8 +23,10 @@
#ifndef WTF_GRefPtr_h
#define WTF_GRefPtr_h
-#if USE(GLIB)
+#if USE(GLIB) || PLATFORM(GNUSTEP)
+#include <glib.h>
+#include <glib-object.h>
#include <wtf/HashTraits.h>
#include <algorithm>
diff --git a/Source/WTF/wtf/glib/GUniquePtr.h b/Source/WTF/wtf/glib/GUniquePtr.h
index e1cff8dde..27482da0d 100644
--- a/Source/WTF/wtf/glib/GUniquePtr.h
+++ b/Source/WTF/wtf/glib/GUniquePtr.h
@@ -21,9 +21,10 @@
#ifndef GUniquePtr_h
#define GUniquePtr_h
-#if USE(GLIB)
+//#if USE(GLIB)
#include <gio/gio.h>
+#include <glib.h>
#include <wtf/Noncopyable.h>
namespace WTF {
@@ -122,7 +123,7 @@ private:
using WTF::GUniquePtr;
using WTF::GUniqueOutPtr;
-#endif // USE(GLIB)
+//#endif // USE(GLIB)
#endif // GUniquePtr_h
diff --git a/Source/WTF/wtf/mac/AppKitCompatibilityDeclarations.h b/Source/WTF/wtf/mac/AppKitCompatibilityDeclarations.h
index bbeb39134..c80c3bd9d 100644
--- a/Source/WTF/wtf/mac/AppKitCompatibilityDeclarations.h
+++ b/Source/WTF/wtf/mac/AppKitCompatibilityDeclarations.h
@@ -26,7 +26,7 @@
#ifndef AppKitCompatibilityDeclarations_h
#define AppKitCompatibilityDeclarations_h
-#import <Availability.h>
+//#import <Availability.h>
#if __MAC_OS_X_VERSION_MAX_ALLOWED < 101200
diff --git a/Source/WTF/wtf/mac/MainThreadMac.mm b/Source/WTF/wtf/mac/MainThreadMac.mm
index 272e3f5f9..2f6909c85 100644
--- a/Source/WTF/wtf/mac/MainThreadMac.mm
+++ b/Source/WTF/wtf/mac/MainThreadMac.mm
@@ -46,6 +46,17 @@
- (void)call;
@end
+#if OS(LINUX)
+#include <unistd.h>
+#include <sys/syscall.h>
+#include <sys/types.h>
+
+static inline int pthread_main_np()
+{
+ return syscall(SYS_gettid) == getpid() ? 1 : 0;
+}
+#endif
+
@implementation JSWTFMainThreadCaller
- (void)call
diff --git a/Source/WTF/wtf/spi/cf/CFBundleSPI.h b/Source/WTF/wtf/spi/cf/CFBundleSPI.h
index c089e175b..ce6fda718 100644
--- a/Source/WTF/wtf/spi/cf/CFBundleSPI.h
+++ b/Source/WTF/wtf/spi/cf/CFBundleSPI.h
@@ -30,13 +30,15 @@
#if USE(APPLE_INTERNAL_SDK)
#import <CoreFoundation/CFPriv.h>
-#else
+#elif OS(DARWIN)
#include <wtf/spi/darwin/XPCSPI.h>
#endif
WTF_EXTERN_C_BEGIN
+#if OS(DARWIN)
void _CFBundleSetupXPCBootstrap(xpc_object_t bootstrap);
+#endif
CFBundleRef _CFBundleCreateUnique(CFAllocatorRef, CFURLRef bundleURL);
Boolean CFBundleGetLocalizationInfoForLocalization(CFStringRef localizationName, SInt32 *languageCode, SInt32 *regionCode, SInt32 *scriptCode, CFStringEncoding *stringEncoding);
diff --git a/Source/WTF/wtf/spi/cocoa/SecuritySPI.h b/Source/WTF/wtf/spi/cocoa/SecuritySPI.h
index 375b9e215..10c64af32 100644
--- a/Source/WTF/wtf/spi/cocoa/SecuritySPI.h
+++ b/Source/WTF/wtf/spi/cocoa/SecuritySPI.h
@@ -70,7 +70,7 @@ CFTypeRef SecTaskCopyValueForEntitlement(SecTaskRef, CFStringRef entitlement, CF
CFStringRef SecTaskCopySigningIdentifier(SecTaskRef, CFErrorRef *);
#endif
-#if PLATFORM(MAC)
+#if PLATFORM(MAC) && !PLATFORM(GNUSTEP)
#include <Security/SecAsn1Types.h>
extern const SecAsn1Template kSecAsn1AlgorithmIDTemplate[];
extern const SecAsn1Template kSecAsn1SubjectPublicKeyInfoTemplate[];
diff --git a/Source/WTF/wtf/text/mac/TextBreakIteratorInternalICUMac.mm b/Source/WTF/wtf/text/mac/TextBreakIteratorInternalICUMac.mm
index 5fd654af1..70b3ff726 100644
--- a/Source/WTF/wtf/text/mac/TextBreakIteratorInternalICUMac.mm
+++ b/Source/WTF/wtf/text/mac/TextBreakIteratorInternalICUMac.mm
@@ -53,21 +53,29 @@ static const int maxLocaleStringLength = 32;
static inline RetainPtr<CFStringRef> textBreakLocalePreference()
{
+#if PLATFORM(GNUSTEP)
+ return static_cast<CFStringRef>(CFSTR("en_US_POSIX"));
+#else
RetainPtr<CFPropertyListRef> locale = adoptCF(CFPreferencesCopyValue(CFSTR("AppleTextBreakLocale"),
kCFPreferencesAnyApplication, kCFPreferencesCurrentUser, kCFPreferencesAnyHost));
if (!locale || CFGetTypeID(locale.get()) != CFStringGetTypeID())
return nullptr;
return static_cast<CFStringRef>(locale.get());
+#endif
}
static RetainPtr<CFStringRef> topLanguagePreference()
{
+#if PLATFORM(GNUSTEP)
+ return nullptr;
+#else
RetainPtr<CFArrayRef> languagesArray = adoptCF(CFLocaleCopyPreferredLanguages());
if (!languagesArray)
return nullptr;
if (!CFArrayGetCount(languagesArray.get()))
return nullptr;
return static_cast<CFStringRef>(CFArrayGetValueAtIndex(languagesArray.get(), 0));
+#endif
}
static void getLocale(CFStringRef locale, char localeStringBuffer[maxLocaleStringLength])
diff --git a/Source/WebCore/PAL/pal/PlatformMac.cmake b/Source/WebCore/PAL/pal/PlatformMac.cmake
index 42878a606..7323b5d0a 100644
--- a/Source/WebCore/PAL/pal/PlatformMac.cmake
+++ b/Source/WebCore/PAL/pal/PlatformMac.cmake
@@ -1,5 +1,6 @@
list(APPEND PAL_SOURCES
- crypto/commoncrypto/CryptoDigestCommonCrypto.cpp
+ #crypto/commoncrypto/CryptoDigestCommonCrypto.cpp
+ crypto/gcrypt/CryptoDigestGCrypt.cpp
system/mac/SoundMac.mm
diff --git a/Source/WebCore/PlatformMac.cmake b/Source/WebCore/PlatformMac.cmake
index 12d7325c2..dd4955848 100644
--- a/Source/WebCore/PlatformMac.cmake
+++ b/Source/WebCore/PlatformMac.cmake
@@ -114,9 +114,10 @@ list(APPEND WebCore_INCLUDE_DIRECTORIES
"${WEBCORE_DIR}/platform/mac"
"${WEBCORE_DIR}/platform/mediastream/mac"
"${WEBCORE_DIR}/platform/network/cocoa"
- "${WEBCORE_DIR}/platform/network/cf"
- "${WEBCORE_DIR}/platform/network/ios"
- "${WEBCORE_DIR}/platform/network/mac"
+ #"${WEBCORE_DIR}/platform/network/cf"
+ #"${WEBCORE_DIR}/platform/network/ios"
+ #"${WEBCORE_DIR}/platform/network/mac"
+ "${WEBCORE_DIR}/platform/network/soup"
"${WEBCORE_DIR}/platform/text/cf"
"${WEBCORE_DIR}/platform/text/mac"
"${WEBCORE_DIR}/platform/spi/cf"
@@ -241,10 +242,12 @@ list(APPEND WebCore_SOURCES
page/CaptionUserPreferencesMediaAF.cpp
page/PageDebuggable.cpp
- page/cocoa/MemoryReleaseCocoa.mm
- page/cocoa/PerformanceLoggingCocoa.mm
- page/cocoa/ResourceUsageOverlayCocoa.mm
- page/cocoa/ResourceUsageThreadCocoa.mm
+ #page/cocoa/MemoryReleaseCocoa.mm
+ # page/cocoa/PerformanceLoggingCocoa.mm
+ #page/cocoa/ResourceUsageOverlayCocoa.mm
+ #page/cocoa/ResourceUsageThreadCocoa.mm
+ page/linux/ResourceUsageThreadLinux.cpp
+ page/linux/ResourceUsageOverlayLinux.cpp
page/cocoa/SettingsCocoa.mm
page/cocoa/UserAgent.mm
@@ -308,7 +311,7 @@ list(APPEND WebCore_SOURCES
platform/cocoa/KeyEventCocoa.mm
platform/cocoa/LocalizedStringsCocoa.mm
platform/cocoa/MIMETypeRegistryCocoa.mm
- platform/cocoa/MachSendRight.cpp
+ #platform/cocoa/MachSendRight.cpp
platform/cocoa/NetworkExtensionContentFilter.mm
platform/cocoa/ParentalControlsContentFilter.mm
platform/cocoa/RuntimeApplicationChecksCocoa.mm
@@ -316,7 +319,7 @@ list(APPEND WebCore_SOURCES
platform/cocoa/ScrollSnapAnimatorState.mm
platform/cocoa/SearchPopupMenuCocoa.mm
platform/cocoa/SharedBufferCocoa.mm
- platform/cocoa/SleepDisablerCocoa.cpp
+ #platform/cocoa/SleepDisablerCocoa.cpp
platform/cocoa/SystemVersion.mm
platform/cocoa/TelephoneNumberDetectorCocoa.cpp
platform/cocoa/ThemeCocoa.mm
@@ -493,10 +496,10 @@ list(APPEND WebCore_SOURCES
platform/mac/PlatformScreenMac.mm
platform/mac/PlatformSpeechSynthesizerMac.mm
platform/mac/PluginBlacklist.mm
- platform/mac/PowerObserverMac.cpp
+ #platform/mac/PowerObserverMac.cpp
platform/mac/PublicSuffixMac.mm
platform/mac/RemoteCommandListenerMac.mm
- platform/mac/SSLKeyGeneratorMac.mm
+ platform/glib/SSLKeyGeneratorGLib.cpp
platform/mac/ScrollAnimatorMac.mm
platform/mac/ScrollViewMac.mm
platform/mac/ScrollbarThemeMac.mm
@@ -525,51 +528,76 @@ list(APPEND WebCore_SOURCES
platform/mediastream/mac/MockRealtimeVideoSourceMac.mm
- platform/network/cf/AuthenticationCF.cpp
- platform/network/cf/CookieJarCFNet.cpp
- platform/network/cf/CookieStorageCFNet.cpp
- platform/network/cf/CredentialStorageCFNet.cpp
- platform/network/cf/DNSCFNet.cpp
- platform/network/cf/FormDataStreamCFNet.cpp
- platform/network/cf/LoaderRunLoopCF.cpp
- platform/network/cf/NetworkStorageSessionCFNet.cpp
- platform/network/cf/ProxyServerCFNet.cpp
- platform/network/cf/ResourceErrorCF.cpp
- platform/network/cf/ResourceRequestCFNet.cpp
- platform/network/cf/ResourceResponseCFNet.cpp
- platform/network/cf/SocketStreamHandleImplCFNet.cpp
- platform/network/cf/SynchronousLoaderClientCFNet.cpp
- platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp
-
- platform/network/cocoa/CookieCocoa.mm
- platform/network/cocoa/CookieStorageObserver.mm
- platform/network/cocoa/CredentialCocoa.mm
- platform/network/cocoa/NetworkLoadMetrics.mm
- platform/network/cocoa/NetworkStorageSessionCocoa.mm
- platform/network/cocoa/ProtectionSpaceCocoa.mm
- platform/network/cocoa/ResourceRequestCocoa.mm
- platform/network/cocoa/ResourceResponseCocoa.mm
- platform/network/cocoa/WebCoreNSURLSession.mm
-
- platform/network/mac/AuthenticationMac.mm
- platform/network/mac/BlobDataFileReferenceMac.mm
- platform/network/mac/CertificateInfoMac.mm
- platform/network/mac/CookieJarMac.mm
- platform/network/mac/CookieStorageMac.mm
- platform/network/mac/CredentialStorageMac.mm
- platform/network/mac/FormDataStreamMac.mm
- platform/network/mac/NetworkStateNotifierMac.cpp
- platform/network/mac/ResourceErrorMac.mm
- platform/network/mac/ResourceHandleMac.mm
- platform/network/mac/SynchronousLoaderClient.mm
- platform/network/mac/UTIUtilities.mm
- platform/network/mac/WebCoreResourceHandleAsDelegate.mm
- platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm
- platform/network/mac/WebCoreURLResponse.mm
+ #platform/network/cf/AuthenticationCF.cpp
+ #platform/network/cf/CookieJarCFNet.cpp
+ #platform/network/cf/CookieStorageCFNet.cpp
+ #platform/network/cf/CredentialStorageCFNet.cpp
+ #platform/network/cf/DNSCFNet.cpp
+ #platform/network/cf/FormDataStreamCFNet.cpp
+ #platform/network/cf/LoaderRunLoopCF.cpp
+ #platform/network/cf/NetworkStorageSessionCFNet.cpp
+ #platform/network/cf/ProxyServerCFNet.cpp
+ #platform/network/cf/ResourceErrorCF.cpp
+ #platform/network/cf/ResourceRequestCFNet.cpp
+ #platform/network/cf/ResourceResponseCFNet.cpp
+ #platform/network/cf/SocketStreamHandleImplCFNet.cpp
+ #platform/network/cf/SynchronousLoaderClientCFNet.cpp
+ #platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp
+
+ #platform/network/cocoa/CookieCocoa.mm
+ #platform/network/cocoa/CookieStorageObserver.mm
+ #platform/network/cocoa/CredentialCocoa.mm
+ #platform/network/cocoa/NetworkLoadMetrics.mm
+ #platform/network/cocoa/NetworkStorageSessionCocoa.mm
+ #platform/network/cocoa/ProtectionSpaceCocoa.mm
+ #platform/network/cocoa/ResourceRequestCocoa.mm
+ #platform/network/cocoa/ResourceResponseCocoa.mm
+ #platform/network/cocoa/WebCoreNSURLSession.mm
+
+ #platform/network/mac/AuthenticationMac.mm
+ #platform/network/mac/BlobDataFileReferenceMac.mm
+ #platform/network/mac/CertificateInfoMac.mm
+ #platform/network/soup/CertificateInfo.cpp
+ #platform/network/mac/CookieJarMac.mm
+ #platform/network/mac/CookieStorageMac.mm
+ #platform/network/mac/CredentialStorageMac.mm
+ #platform/network/mac/FormDataStreamMac.mm
+ #platform/network/mac/NetworkStateNotifierMac.cpp
+ #platform/network/mac/ResourceErrorMac.mm
+ #platform/network/mac/ResourceHandleMac.mm
+ #platform/network/mac/SynchronousLoaderClient.mm
+ #platform/network/mac/UTIUtilities.mm
+ #platform/network/mac/WebCoreResourceHandleAsDelegate.mm
+ #platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm
+ #platform/network/mac/WebCoreURLResponse.mm
+
+ platform/network/soup/AuthenticationChallengeSoup.cpp
+ platform/network/soup/CertificateInfo.cpp
+ platform/network/soup/CookieJarSoup.cpp
+ platform/network/soup/CookieStorageSoup.cpp
+ platform/network/soup/CredentialStorageSoup.cpp
+ platform/network/soup/DNSSoup.cpp
+ platform/network/soup/GRefPtrSoup.cpp
+ platform/network/soup/NetworkStorageSessionSoup.cpp
+ platform/network/soup/ProxyServerSoup.cpp
+ platform/network/soup/ResourceErrorSoup.cpp
+ platform/network/soup/ResourceHandleSoup.cpp
+ platform/network/soup/ResourceRequestSoup.cpp
+ platform/network/soup/ResourceResponseSoup.cpp
+ platform/network/soup/SocketStreamHandleImplSoup.cpp
+ platform/network/soup/SoupNetworkSession.cpp
+ platform/network/soup/SynchronousLoaderClientSoup.cpp
+ platform/network/soup/WebKitSoupRequestGeneric.cpp
+
+ platform/soup/PublicSuffixSoup.cpp
+ platform/soup/SharedBufferSoup.cpp
+ platform/soup/URLSoup.cpp
+
+ platform/text/Hyphenation.cpp
platform/posix/FileSystemPOSIX.cpp
- platform/text/cf/HyphenationCF.cpp
+ #platform/text/cf/HyphenationCF.cpp
platform/text/mac/LocaleMac.mm
platform/text/mac/TextBoundaries.mm
diff --git a/Source/WebCore/accessibility/mac/AXObjectCacheMac.mm b/Source/WebCore/accessibility/mac/AXObjectCacheMac.mm
index 2379751b8..bf8ca9396 100644
--- a/Source/WebCore/accessibility/mac/AXObjectCacheMac.mm
+++ b/Source/WebCore/accessibility/mac/AXObjectCacheMac.mm
@@ -33,6 +33,7 @@
#import "RenderObject.h"
#import "WebAccessibilityObjectWrapperMac.h"
#import "WebCoreSystemInterface.h"
+#import <HIServices/Accessibility.h>
#if USE(APPLE_INTERNAL_SDK)
#include <HIServices/AccessibilityPriv.h>
diff --git a/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm b/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
index eec17d8d9..f402a10b8 100644
--- a/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
+++ b/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
@@ -83,6 +83,13 @@
#import <wtf/text/StringBuilder.h>
#endif
+#if OS(LINUX)
+#include <bsd/string.h>
+#endif
+
+#import <ApplicationServices/ApplicationServices.h>
+#include <dispatch/dispatch.h>
+
using namespace WebCore;
using namespace HTMLNames;
@@ -3493,7 +3500,9 @@ static NSString* roleValueToNSString(AccessibilityRole value)
}
}
+#if ENABLE(CONTEXT_MENUS)
page->contextMenuController().showContextMenuAt(page->mainFrame(), rect.center());
+#endif
}
- (void)accessibilityScrollToVisible
diff --git a/Source/WebCore/crypto/keys/CryptoKeyEC.h b/Source/WebCore/crypto/keys/CryptoKeyEC.h
index 4c7d0298e..1d4d2e088 100644
--- a/Source/WebCore/crypto/keys/CryptoKeyEC.h
+++ b/Source/WebCore/crypto/keys/CryptoKeyEC.h
@@ -31,7 +31,7 @@
#if ENABLE(SUBTLE_CRYPTO)
-#if OS(DARWIN) && !PLATFORM(GTK)
+#if PLATFORM(COCOA) && !PLATFORM(GTK)
typedef struct _CCECCryptor *CCECCryptorRef;
typedef CCECCryptorRef PlatformECKey;
#endif
diff --git a/Source/WebCore/crypto/keys/CryptoKeyRSA.h b/Source/WebCore/crypto/keys/CryptoKeyRSA.h
index 41bce859e..e156140c8 100644
--- a/Source/WebCore/crypto/keys/CryptoKeyRSA.h
+++ b/Source/WebCore/crypto/keys/CryptoKeyRSA.h
@@ -31,7 +31,7 @@
#if ENABLE(SUBTLE_CRYPTO)
-#if OS(DARWIN) && !PLATFORM(GTK)
+#if PLATFORM(COCOA) && !PLATFORM(GTK)
typedef struct _CCRSACryptor *CCRSACryptorRef;
typedef CCRSACryptorRef PlatformRSAKey;
#endif
diff --git a/Source/WebCore/css/StyleResolver.cpp b/Source/WebCore/css/StyleResolver.cpp
index 6eabcb156..0cc90e94a 100644
--- a/Source/WebCore/css/StyleResolver.cpp
+++ b/Source/WebCore/css/StyleResolver.cpp
@@ -782,9 +782,11 @@ static bool hasEffectiveDisplayNoneForDisplayContents(const Element& element)
// FIXME: <g>, <use> and <tspan> have special (?) behavior for display:contents in the current draft spec.
if (is<SVGElement>(element))
return true;
+#if ENABLE(MATHML)
// Not sure MathML code can handle it.
if (is<MathMLElement>(element))
return true;
+#endif
if (!is<HTMLElement>(element))
return false;
return tagNames.get().contains(element.localName());
diff --git a/Source/WebCore/dom/DataTransferMac.mm b/Source/WebCore/dom/DataTransferMac.mm
index 94711a06d..f7d0e7e12 100644
--- a/Source/WebCore/dom/DataTransferMac.mm
+++ b/Source/WebCore/dom/DataTransferMac.mm
@@ -30,6 +30,8 @@
#import "Element.h"
#import "DragImage.h"
+#if ENABLE(DRAG_SUPPORT)
+
namespace WebCore {
// FIXME: Need to refactor and figure out how to handle the flipping in a more sensible way so we can
@@ -58,3 +60,5 @@ DragImageRef DataTransfer::createDragImage(IntPoint& location) const
}
}
+
+#endif
diff --git a/Source/WebCore/editing/mac/FrameSelectionMac.mm b/Source/WebCore/editing/mac/FrameSelectionMac.mm
index 69eb299df..b05dff299 100644
--- a/Source/WebCore/editing/mac/FrameSelectionMac.mm
+++ b/Source/WebCore/editing/mac/FrameSelectionMac.mm
@@ -30,6 +30,8 @@
#import "Frame.h"
#import "RenderView.h"
+#import <HIServices/UniversalAccess.h>
+
namespace WebCore {
#if !PLATFORM(IOS)
diff --git a/Source/WebCore/fileapi/FileCocoa.mm b/Source/WebCore/fileapi/FileCocoa.mm
index 0d5a697f6..0f003a945 100644
--- a/Source/WebCore/fileapi/FileCocoa.mm
+++ b/Source/WebCore/fileapi/FileCocoa.mm
@@ -32,6 +32,8 @@
#if PLATFORM(IOS)
#import <MobileCoreServices/MobileCoreServices.h>
+#elif PLATFORM(MAC)
+#import <ApplicationServices/ApplicationServices.h>
#endif
namespace WebCore {
diff --git a/Source/WebCore/html/HTMLMediaElement.cpp b/Source/WebCore/html/HTMLMediaElement.cpp
index 9d3989431..971a72468 100644
--- a/Source/WebCore/html/HTMLMediaElement.cpp
+++ b/Source/WebCore/html/HTMLMediaElement.cpp
@@ -5949,7 +5949,7 @@ void HTMLMediaElement::privateBrowsingStateDidChange()
MediaControls* HTMLMediaElement::mediaControls() const
{
-#if ENABLE(MEDIA_CONTROLS_SCRIPT)
+#if ENABLE(MEDIA_CONTROLS_SCRIPT) || PLATFORM(GNUSTEP)
return nullptr;
#else
ShadowRoot* root = userAgentShadowRoot();
@@ -5962,7 +5962,7 @@ MediaControls* HTMLMediaElement::mediaControls() const
bool HTMLMediaElement::hasMediaControls() const
{
-#if ENABLE(MEDIA_CONTROLS_SCRIPT)
+#if ENABLE(MEDIA_CONTROLS_SCRIPT) || PLATFORM(GNUSTEP)
return false;
#else
@@ -5978,7 +5978,7 @@ bool HTMLMediaElement::hasMediaControls() const
bool HTMLMediaElement::createMediaControls()
{
-#if ENABLE(MEDIA_CONTROLS_SCRIPT)
+#if ENABLE(MEDIA_CONTROLS_SCRIPT) || PLATFORM(GNUSTEP)
ensureMediaControlsShadowRoot();
return false;
#else
diff --git a/Source/WebCore/inspector/InspectorNetworkAgent.cpp b/Source/WebCore/inspector/InspectorNetworkAgent.cpp
index f3e3acfcf..f2c52aba0 100644
--- a/Source/WebCore/inspector/InspectorNetworkAgent.cpp
+++ b/Source/WebCore/inspector/InspectorNetworkAgent.cpp
@@ -658,8 +658,6 @@ void InspectorNetworkAgent::didReceiveWebSocketFrameError(unsigned long identifi
m_frontendDispatcher->webSocketFrameError(IdentifiersFactory::requestId(identifier), timestamp(), errorMessage);
}
-#endif // ENABLE(WEB_SOCKETS)
-
void InspectorNetworkAgent::enable(ErrorString&)
{
enable();
@@ -706,6 +704,8 @@ void InspectorNetworkAgent::disable(ErrorString&)
m_pageAgent->page().setResourceCachingDisabledOverride(false);
}
+#endif // ENABLE(WEB_SOCKETS)
+
void InspectorNetworkAgent::setExtraHTTPHeaders(ErrorString&, const InspectorObject& headers)
{
for (auto& entry : headers) {
diff --git a/Source/WebCore/page/MemoryRelease.cpp b/Source/WebCore/page/MemoryRelease.cpp
index 1089db046..f060a061c 100644
--- a/Source/WebCore/page/MemoryRelease.cpp
+++ b/Source/WebCore/page/MemoryRelease.cpp
@@ -188,7 +188,7 @@ void logMemoryStatisticsAtTimeOfDeath()
#endif
}
-#if !PLATFORM(COCOA)
+#if !PLATFORM(COCOA) || PLATFORM(GNUSTEP)
void platformReleaseMemory(Critical) { }
void jettisonExpensiveObjectsOnTopLevelNavigation() { }
void registerMemoryReleaseNotifyCallbacks() { }
diff --git a/Source/WebCore/page/PerformanceLogging.cpp b/Source/WebCore/page/PerformanceLogging.cpp
index 24f039603..d0274d221 100644
--- a/Source/WebCore/page/PerformanceLogging.cpp
+++ b/Source/WebCore/page/PerformanceLogging.cpp
@@ -102,7 +102,7 @@ void PerformanceLogging::didReachPointOfInterest(PointOfInterest poi)
#endif
}
-#if !PLATFORM(COCOA)
+#if !PLATFORM(COCOA) || PLATFORM(GNUSTEP)
void PerformanceLogging::getPlatformMemoryUsageStatistics(HashMap<const char*, size_t>&) { }
std::optional<uint64_t> PerformanceLogging::physicalFootprint() { return std::nullopt; }
#endif
diff --git a/Source/WebCore/page/Settings.cpp b/Source/WebCore/page/Settings.cpp
index 668f2c10b..bba20047f 100644
--- a/Source/WebCore/page/Settings.cpp
+++ b/Source/WebCore/page/Settings.cpp
@@ -583,7 +583,7 @@ void Settings::setQTKitEnabled(bool enabled)
return;
gQTKitEnabled = enabled;
- HTMLMediaElement::resetMediaEngines();
+ //HTMLMediaElement::resetMediaEngines();
}
#endif
diff --git a/Source/WebCore/page/cocoa/SettingsCocoa.mm b/Source/WebCore/page/cocoa/SettingsCocoa.mm
index ca14e3198..e8a207ccf 100644
--- a/Source/WebCore/page/cocoa/SettingsCocoa.mm
+++ b/Source/WebCore/page/cocoa/SettingsCocoa.mm
@@ -27,6 +27,7 @@
#include "Settings.h"
#include <wtf/NeverDestroyed.h>
+#import <CoreText/CoreText.h>
#if PLATFORM(IOS)
#include "Device.h"
diff --git a/Source/WebCore/page/scrolling/ScrollingMomentumCalculator.cpp b/Source/WebCore/page/scrolling/ScrollingMomentumCalculator.cpp
index 7640d55d9..c95df52f4 100644
--- a/Source/WebCore/page/scrolling/ScrollingMomentumCalculator.cpp
+++ b/Source/WebCore/page/scrolling/ScrollingMomentumCalculator.cpp
@@ -29,6 +29,8 @@
#include "FloatPoint.h"
#include "FloatSize.h"
+#if ENABLE(CSS_SCROLL_SNAP)
+
namespace WebCore {
static const Seconds scrollSnapAnimationDuration = 1_s;
@@ -233,3 +235,5 @@ float BasicScrollingMomentumCalculator::animationProgressAfterElapsedTime(Second
}
}; // namespace WebCore
+
+#endif
diff --git a/Source/WebCore/page/scrolling/mac/ScrollingMomentumCalculatorMac.h b/Source/WebCore/page/scrolling/mac/ScrollingMomentumCalculatorMac.h
index 89f336b6e..7a895c85f 100644
--- a/Source/WebCore/page/scrolling/mac/ScrollingMomentumCalculatorMac.h
+++ b/Source/WebCore/page/scrolling/mac/ScrollingMomentumCalculatorMac.h
@@ -25,6 +25,8 @@
#pragma once
+#if ENABLE(CSS_SCROLL_SNAP)
+
#include "ScrollingMomentumCalculator.h"
#include <wtf/RetainPtr.h>
@@ -50,3 +52,5 @@ private:
};
} // namespace WebCore
+
+#endif
diff --git a/Source/WebCore/page/scrolling/mac/ScrollingMomentumCalculatorMac.mm b/Source/WebCore/page/scrolling/mac/ScrollingMomentumCalculatorMac.mm
index 66b2e9f9e..054949e67 100644
--- a/Source/WebCore/page/scrolling/mac/ScrollingMomentumCalculatorMac.mm
+++ b/Source/WebCore/page/scrolling/mac/ScrollingMomentumCalculatorMac.mm
@@ -26,6 +26,8 @@
#include "config.h"
#include "ScrollingMomentumCalculatorMac.h"
+#if ENABLE(CSS_SCROLL_SNAP)
+
#if PLATFORM(MAC)
#include "NSScrollingMomentumCalculatorSPI.h"
@@ -106,3 +108,5 @@ _NSScrollingMomentumCalculator *ScrollingMomentumCalculatorMac::ensurePlatformMo
} // namespace WebCore
#endif // PLATFORM(MAC)
+
+#endif
diff --git a/Source/WebCore/platform/Logging.cpp b/Source/WebCore/platform/Logging.cpp
index 88843995c..d921680e0 100644
--- a/Source/WebCore/platform/Logging.cpp
+++ b/Source/WebCore/platform/Logging.cpp
@@ -31,7 +31,7 @@
#include <wtf/text/CString.h>
#include <wtf/text/WTFString.h>
-#if PLATFORM(COCOA)
+#if OS(DARWIN)
#include <notify.h>
#include <wtf/BlockPtr.h>
#endif
@@ -82,7 +82,7 @@ void initializeLogChannelsIfNecessary()
#ifndef NDEBUG
void registerNotifyCallback(const String& notifyID, WTF::Function<void()>&& callback)
{
-#if PLATFORM(COCOA)
+#if OS(DARWIN)
int token;
notify_register_dispatch(notifyID.utf8().data(), &token, dispatch_get_main_queue(), BlockPtr<void (int)>::fromCallable([callback = WTFMove(callback)] (int) {
callback();
diff --git a/Source/WebCore/platform/PlatformScreen.h b/Source/WebCore/platform/PlatformScreen.h
index e28ff1995..3ef4b2fa1 100644
--- a/Source/WebCore/platform/PlatformScreen.h
+++ b/Source/WebCore/platform/PlatformScreen.h
@@ -28,13 +28,14 @@
#if PLATFORM(MAC)
OBJC_CLASS NSScreen;
OBJC_CLASS NSWindow;
-#ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
+/*#ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
typedef struct CGRect NSRect;
typedef struct CGPoint NSPoint;
#else
typedef struct _NSRect NSRect;
typedef struct _NSPoint NSPoint;
-#endif
+#endif*/
+#include <CoreGraphics/CGGeometry.h>
#endif
#if PLATFORM(IOS)
diff --git a/Source/WebCore/platform/SleepDisabler.cpp b/Source/WebCore/platform/SleepDisabler.cpp
index b243e77d9..ed51b16c0 100644
--- a/Source/WebCore/platform/SleepDisabler.cpp
+++ b/Source/WebCore/platform/SleepDisabler.cpp
@@ -28,7 +28,7 @@
namespace WebCore {
-#if !PLATFORM(COCOA)
+#if !PLATFORM(COCOA) || PLATFORM(GNUSTEP)
std::unique_ptr<SleepDisabler> SleepDisabler::create(const char* reason, Type type)
{
return std::unique_ptr<SleepDisabler>(new SleepDisabler(reason, type));
diff --git a/Source/WebCore/platform/audio/mac/AudioHardwareListenerMac.cpp b/Source/WebCore/platform/audio/mac/AudioHardwareListenerMac.cpp
index 0b44f5921..cd76fa97e 100644
--- a/Source/WebCore/platform/audio/mac/AudioHardwareListenerMac.cpp
+++ b/Source/WebCore/platform/audio/mac/AudioHardwareListenerMac.cpp
@@ -24,10 +24,10 @@
*/
#include "config.h"
-#include "AudioHardwareListenerMac.h"
-#if PLATFORM(MAC)
+#if PLATFORM(MAC) && ENABLE(WEB_AUDIO)
+#include "AudioHardwareListenerMac.h"
#include <algorithm>
enum {
diff --git a/Source/WebCore/platform/audio/mac/CAAudioStreamDescription.cpp b/Source/WebCore/platform/audio/mac/CAAudioStreamDescription.cpp
index 86bbcb93f..6800047c6 100644
--- a/Source/WebCore/platform/audio/mac/CAAudioStreamDescription.cpp
+++ b/Source/WebCore/platform/audio/mac/CAAudioStreamDescription.cpp
@@ -24,6 +24,9 @@
*/
#include "config.h"
+
+#if ENABLE(WEB_AUDIO)
+
#include "CAAudioStreamDescription.h"
namespace WebCore {
@@ -157,3 +160,5 @@ bool operator==(const AudioStreamBasicDescription& a, const AudioStreamBasicDesc
}
}
+
+#endif
diff --git a/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm b/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm
index b3c877681..a7b02ba48 100644
--- a/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm
+++ b/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm
@@ -112,8 +112,10 @@ void MediaSessionManagerMac::clientCharacteristicsChanged(PlatformMediaSession&)
PlatformMediaSession* MediaSessionManagerMac::nowPlayingEligibleSession()
{
+#if ENABLE(VIDEO)
if (auto element = HTMLMediaElement::bestMediaElementForShowingPlaybackControlsManager(MediaElementSession::PlaybackControlsPurpose::NowPlaying))
return &element->mediaSession();
+#endif
return nullptr;
}
diff --git a/Source/WebCore/platform/cf/MainThreadSharedTimerCF.cpp b/Source/WebCore/platform/cf/MainThreadSharedTimerCF.cpp
index f9e4bf800..8d70455b0 100644
--- a/Source/WebCore/platform/cf/MainThreadSharedTimerCF.cpp
+++ b/Source/WebCore/platform/cf/MainThreadSharedTimerCF.cpp
@@ -29,7 +29,7 @@
#include <wtf/AutodrainedPool.h>
#if PLATFORM(MAC)
-#import "PowerObserverMac.h"
+//#import "PowerObserverMac.h"
#elif PLATFORM(IOS)
#import "WebCoreThreadInternal.h"
#import "WebCoreThreadRun.h"
@@ -54,7 +54,7 @@ static void applicationDidBecomeActive(CFNotificationCenterRef, void*, CFStringR
static void setupPowerObserver()
{
-#if PLATFORM(MAC)
+#if PLATFORM(MAC) && !PLATFORM(GNUSTEP)
static PowerObserver* powerObserver;
if (!powerObserver)
powerObserver = std::make_unique<PowerObserver>(restartSharedTimer).release();
diff --git a/Source/WebCore/platform/cocoa/ContentFilterUnblockHandlerCocoa.mm b/Source/WebCore/platform/cocoa/ContentFilterUnblockHandlerCocoa.mm
index 4e891f970..cfe143593 100644
--- a/Source/WebCore/platform/cocoa/ContentFilterUnblockHandlerCocoa.mm
+++ b/Source/WebCore/platform/cocoa/ContentFilterUnblockHandlerCocoa.mm
@@ -32,6 +32,7 @@
#import "Logging.h"
#import "ResourceRequest.h"
#import <wtf/BlockObjCExceptions.h>
+#include <dispatch/dispatch.h>
#if !LOG_DISABLED
#import <wtf/text/CString.h>
diff --git a/Source/WebCore/platform/cocoa/CoreVideoSoftLink.cpp b/Source/WebCore/platform/cocoa/CoreVideoSoftLink.cpp
index 7a3691dfa..9d49eeae7 100644
--- a/Source/WebCore/platform/cocoa/CoreVideoSoftLink.cpp
+++ b/Source/WebCore/platform/cocoa/CoreVideoSoftLink.cpp
@@ -25,6 +25,8 @@
#include "config.h"
+#if ENABLE(VIDEO)
+
#include <CoreVideo/CoreVideo.h>
#include <wtf/SoftLinking.h>
@@ -69,3 +71,5 @@ SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreVideo, CVOpenGLTextureGetTarget, GLen
SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreVideo, CVOpenGLTextureGetName, GLuint, (CVOpenGLTextureRef image), (image))
SOFT_LINK_CONSTANT_FOR_SOURCE(WebCore, CoreVideo, kCVPixelBufferIOSurfaceOpenGLFBOCompatibilityKey, CFStringRef)
#endif
+
+#endif
diff --git a/Source/WebCore/platform/cocoa/CoreVideoSoftLink.h b/Source/WebCore/platform/cocoa/CoreVideoSoftLink.h
index a9dd2b19e..b45621086 100644
--- a/Source/WebCore/platform/cocoa/CoreVideoSoftLink.h
+++ b/Source/WebCore/platform/cocoa/CoreVideoSoftLink.h
@@ -26,6 +26,8 @@
#ifndef CoreVideoSoftLink_h
#define CoreVideoSoftLink_h
+#if ENABLE(VIDEO)
+
#include <CoreVideo/CoreVideo.h>
#include <wtf/SoftLinking.h>
@@ -109,4 +111,6 @@ SOFT_LINK_CONSTANT_FOR_HEADER(WebCore, CoreVideo, kCVPixelBufferIOSurfaceOpenGLF
#define kCVPixelBufferIOSurfaceOpenGLFBOCompatibilityKey get_CoreVideo_kCVPixelBufferIOSurfaceOpenGLFBOCompatibilityKey()
#endif
+#endif
+
#endif // CoreVideoSoftLink_h
diff --git a/Source/WebCore/platform/cocoa/FileMonitorCocoa.mm b/Source/WebCore/platform/cocoa/FileMonitorCocoa.mm
index 395df7771..5c1cb8666 100644
--- a/Source/WebCore/platform/cocoa/FileMonitorCocoa.mm
+++ b/Source/WebCore/platform/cocoa/FileMonitorCocoa.mm
@@ -30,6 +30,8 @@
#import "Logging.h"
#import <wtf/BlockPtr.h>
+#if OS(DARWIN)
+
namespace WebCore {
constexpr unsigned monitorMask = DISPATCH_VNODE_DELETE | DISPATCH_VNODE_WRITE | DISPATCH_VNODE_RENAME | DISPATCH_VNODE_REVOKE;
@@ -88,3 +90,5 @@ FileMonitor::~FileMonitor()
}
} // namespace WebCore
+
+#endif
diff --git a/Source/WebCore/platform/cocoa/FileSystemCocoa.mm b/Source/WebCore/platform/cocoa/FileSystemCocoa.mm
index 51e2259fc..c9de52702 100644
--- a/Source/WebCore/platform/cocoa/FileSystemCocoa.mm
+++ b/Source/WebCore/platform/cocoa/FileSystemCocoa.mm
@@ -56,7 +56,7 @@ String openTemporaryFile(const String& prefix, PlatformFileHandle& platformFileH
platformFileHandle = invalidPlatformFileHandle;
Vector<char> temporaryFilePath(PATH_MAX);
- if (!confstr(_CS_DARWIN_USER_TEMP_DIR, temporaryFilePath.data(), temporaryFilePath.size()))
+ //if (!confstr(_CS_DARWIN_USER_TEMP_DIR, temporaryFilePath.data(), temporaryFilePath.size())) GNUSTEP FIX
return String();
// Shrink the vector.
diff --git a/Source/WebCore/platform/cocoa/MachSendRight.h b/Source/WebCore/platform/cocoa/MachSendRight.h
index cded9dcb0..088fc5adc 100644
--- a/Source/WebCore/platform/cocoa/MachSendRight.h
+++ b/Source/WebCore/platform/cocoa/MachSendRight.h
@@ -26,6 +26,8 @@
#ifndef MachSendRight_h
#define MachSendRight_h
+#if 0
+
#include <mach/mach_port.h>
namespace WebCore {
@@ -56,4 +58,6 @@ private:
}
+#endif
+
#endif // MachSendRight_h
diff --git a/Source/WebCore/platform/cocoa/NetworkExtensionContentFilter.h b/Source/WebCore/platform/cocoa/NetworkExtensionContentFilter.h
index 983b7035b..f66e32adf 100644
--- a/Source/WebCore/platform/cocoa/NetworkExtensionContentFilter.h
+++ b/Source/WebCore/platform/cocoa/NetworkExtensionContentFilter.h
@@ -27,12 +27,15 @@
#define NetworkExtensionContentFilter_h
#include "PlatformContentFilter.h"
+#if !PLATFORM(GNUSTEP)
#include <objc/NSObjCRuntime.h>
+#endif
#include <wtf/Compiler.h>
#include <wtf/OSObjectPtr.h>
#include <wtf/RetainPtr.h>
+#include <dispatch/dispatch.h>
-enum NEFilterSourceStatus : NSInteger;
+enum NEFilterSourceStatus : int;
OBJC_CLASS NEFilterSource;
OBJC_CLASS NSData;
diff --git a/Source/WebCore/platform/cocoa/VideoToolboxSoftLink.cpp b/Source/WebCore/platform/cocoa/VideoToolboxSoftLink.cpp
index 614cd0e5b..0ca1b3cca 100644
--- a/Source/WebCore/platform/cocoa/VideoToolboxSoftLink.cpp
+++ b/Source/WebCore/platform/cocoa/VideoToolboxSoftLink.cpp
@@ -25,6 +25,8 @@
#include "config.h"
+#if ENABLE(VIDEO)
+
#include <VideoToolbox/VideoToolbox.h>
#include <wtf/SoftLinking.h>
@@ -41,3 +43,5 @@ SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, VideoToolbox, VTDecompressionSessionDecod
SOFT_LINK_FUNCTION_MAY_FAIL_FOR_SOURCE(WebCore, VideoToolbox, VTIsHardwareDecodeSupported, Boolean, (CMVideoCodecType codecType), (codecType))
SOFT_LINK_CONSTANT_FOR_SOURCE(WebCore, VideoToolbox, kVTVideoDecoderSpecification_EnableHardwareAcceleratedVideoDecoder, CFStringRef)
#define kVTVideoDecoderSpecification_EnableHardwareAcceleratedVideoDecoder get_VideoToolbox_kVTVideoDecoderSpecification_EnableHardwareAcceleratedVideoDecoder()
+
+#endif
diff --git a/Source/WebCore/platform/cocoa/WebCoreNSErrorExtras.mm b/Source/WebCore/platform/cocoa/WebCoreNSErrorExtras.mm
index 52399d64a..ad2ca074f 100644
--- a/Source/WebCore/platform/cocoa/WebCoreNSErrorExtras.mm
+++ b/Source/WebCore/platform/cocoa/WebCoreNSErrorExtras.mm
@@ -26,7 +26,7 @@
#import "config.h"
#import "WebCoreNSErrorExtras.h"
-#import <AVFoundation/AVError.h>
+//#import <AVFoundation/AVError.h>
namespace WebCore {
@@ -34,7 +34,7 @@ long mediaKeyErrorSystemCode(NSError *error)
{
NSInteger code = [error code];
- if (code == AVErrorUnknown) {
+ if (code == -11800) {
NSError* underlyingError = [error.userInfo valueForKey:NSUnderlyingErrorKey];
if (underlyingError && [underlyingError isKindOfClass:[NSError class]])
return [underlyingError code];
diff --git a/Source/WebCore/platform/graphics/ComplexTextController.h b/Source/WebCore/platform/graphics/ComplexTextController.h
index b2c151f99..4ed68e1fb 100644
--- a/Source/WebCore/platform/graphics/ComplexTextController.h
+++ b/Source/WebCore/platform/graphics/ComplexTextController.h
@@ -34,8 +34,13 @@
typedef unsigned short CGGlyph;
+#if !PLATFORM(GNUSTEP)
typedef const struct __CTRun * CTRunRef;
typedef const struct __CTLine * CTLineRef;
+#else
+typedef struct CTRun *CTRunRef;
+typedef struct CTLine *CTLineRef;
+#endif
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/FloatPoint.h b/Source/WebCore/platform/graphics/FloatPoint.h
index 6ed4d21a2..99db7e9ac 100644
--- a/Source/WebCore/platform/graphics/FloatPoint.h
+++ b/Source/WebCore/platform/graphics/FloatPoint.h
@@ -34,7 +34,8 @@
#import <Foundation/NSGeometry.h>
#endif
-#if USE(CG)
+#include <CoreGraphics/CGGeometry.h>
+/*#if USE(CG)
typedef struct CGPoint CGPoint;
#endif
@@ -44,7 +45,7 @@ typedef struct CGPoint NSPoint;
#else
typedef struct _NSPoint NSPoint;
#endif
-#endif // PLATFORM(MAC)
+#endif // PLATFORM(MAC)*/
#if PLATFORM(WIN)
struct D2D_POINT_2F;
diff --git a/Source/WebCore/platform/graphics/FloatRect.h b/Source/WebCore/platform/graphics/FloatRect.h
index 7e5558d63..c6a90f21e 100644
--- a/Source/WebCore/platform/graphics/FloatRect.h
+++ b/Source/WebCore/platform/graphics/FloatRect.h
@@ -28,7 +28,8 @@
#include "FloatPoint.h"
-#if USE(CG)
+#include <CoreGraphics/CGGeometry.h>
+/*#if USE(CG)
typedef struct CGRect CGRect;
#endif
@@ -38,7 +39,7 @@ typedef struct CGRect NSRect;
#else
typedef struct _NSRect NSRect;
#endif
-#endif // PLATFORM(MAC)
+#endif // PLATFORM(MAC)*/
#if USE(CAIRO)
typedef struct _cairo_rectangle cairo_rectangle_t;
diff --git a/Source/WebCore/platform/graphics/FloatSize.h b/Source/WebCore/platform/graphics/FloatSize.h
index 51e52acb4..1582ef442 100644
--- a/Source/WebCore/platform/graphics/FloatSize.h
+++ b/Source/WebCore/platform/graphics/FloatSize.h
@@ -34,7 +34,8 @@
#include <CoreGraphics/CoreGraphics.h>
#endif
-#if USE(CG)
+#include <CoreGraphics/CGGeometry.h>
+/*#if USE(CG)
typedef struct CGSize CGSize;
#endif
@@ -44,7 +45,7 @@ typedef struct CGSize NSSize;
#else
typedef struct _NSSize NSSize;
#endif
-#endif // PLATFORM(MAC)
+#endif // PLATFORM(MAC)*/
#if PLATFORM(WIN)
struct D2D_SIZE_F;
diff --git a/Source/WebCore/platform/graphics/FontPlatformData.h b/Source/WebCore/platform/graphics/FontPlatformData.h
index 45db14748..28fb283aa 100644
--- a/Source/WebCore/platform/graphics/FontPlatformData.h
+++ b/Source/WebCore/platform/graphics/FontPlatformData.h
@@ -48,7 +48,9 @@
OBJC_CLASS NSFont;
#endif
-#if PLATFORM(COCOA)
+#if PLATFORM(GNUSTEP)
+typedef struct OPFont* CTFontRef;
+#elif PLATFORM(COCOA)
typedef const struct __CTFont* CTFontRef;
#endif
diff --git a/Source/WebCore/platform/graphics/IntPoint.h b/Source/WebCore/platform/graphics/IntPoint.h
index 1a8d79b1a..c4a797a92 100644
--- a/Source/WebCore/platform/graphics/IntPoint.h
+++ b/Source/WebCore/platform/graphics/IntPoint.h
@@ -32,7 +32,8 @@
#import <Foundation/NSGeometry.h>
#endif
-#if USE(CG)
+#include <CoreGraphics/CGGeometry.h>
+/*#if USE(CG)
typedef struct CGPoint CGPoint;
#endif
@@ -45,7 +46,7 @@ typedef struct CGPoint NSPoint;
typedef struct _NSPoint NSPoint;
#endif
#endif
-#endif // !PLATFORM(IOS)
+#endif // !PLATFORM(IOS)*/
#if PLATFORM(WIN)
typedef struct tagPOINT POINT;
diff --git a/Source/WebCore/platform/graphics/IntRect.h b/Source/WebCore/platform/graphics/IntRect.h
index e262bfb6b..a8a3f3cc4 100644
--- a/Source/WebCore/platform/graphics/IntRect.h
+++ b/Source/WebCore/platform/graphics/IntRect.h
@@ -28,7 +28,8 @@
#include "IntPoint.h"
#include "LayoutUnit.h"
-#if USE(CG)
+#include <CoreGraphics/CGGeometry.h>
+/*#if USE(CG)
typedef struct CGRect CGRect;
#endif
@@ -44,7 +45,7 @@ typedef struct _NSRect NSRect;
#ifndef NSRect
#define NSRect CGRect
#endif
-#endif
+#endif*/
#if PLATFORM(WIN)
typedef struct tagRECT RECT;
diff --git a/Source/WebCore/platform/graphics/IntSize.h b/Source/WebCore/platform/graphics/IntSize.h
index 5dcdfd1a1..ad09f15d1 100644
--- a/Source/WebCore/platform/graphics/IntSize.h
+++ b/Source/WebCore/platform/graphics/IntSize.h
@@ -32,7 +32,8 @@
#import <Foundation/NSGeometry.h>
#endif
-#if USE(CG)
+#include <CoreGraphics/CGGeometry.h>
+/*#if USE(CG)
typedef struct CGSize CGSize;
#endif
@@ -48,7 +49,7 @@ typedef struct _NSSize NSSize;
#ifndef NSSize
#define NSSize CGSize
#endif
-#endif
+#endif*/
#if PLATFORM(WIN)
typedef struct tagSIZE SIZE;
diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm b/Source/WebCore/platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm
index 0f895ae43..84baa296c 100644
--- a/Source/WebCore/platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm
+++ b/Source/WebCore/platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm
@@ -34,6 +34,8 @@
#import "CoreMediaSoftLink.h"
#import "CoreVideoSoftLink.h"
+#if ENABLE(VIDEO)
+
namespace WebCore {
static inline void releaseUint8Vector(void *array, const void*)
@@ -297,3 +299,6 @@ RefPtr<JSC::Uint8ClampedArray> MediaSampleAVFObjC::getRGBAImageData() const
}
}
+
+#endif
+
diff --git a/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h b/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
index f7fbd233f..073926ff9 100644
--- a/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
+++ b/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
@@ -32,6 +32,7 @@
#include <wtf/HashMap.h>
#include <wtf/RetainPtr.h>
#include <wtf/text/StringHash.h>
+#include <ImageIO/ImageIO.h>
// Enable this to add a light red wash over the visible portion of Tiled Layers, as computed
// by flushCompositingState().
diff --git a/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm b/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm
index 5c9b42ed1..61a7044b9 100644
--- a/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm
+++ b/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm
@@ -46,8 +46,8 @@
#import "WebLayer.h"
#import "WebSystemBackdropLayer.h"
#import "WebTiledBackingLayer.h"
-#import <AVFoundation/AVPlayer.h>
-#import <AVFoundation/AVPlayerLayer.h>
+//#import <AVFoundation/AVPlayer.h>
+//#import <AVFoundation/AVPlayerLayer.h>
#import <QuartzCore/QuartzCore.h>
#import <objc/runtime.h>
#import <wtf/BlockObjCExceptions.h>
@@ -63,9 +63,9 @@
#import "ThemeMac.h"
#endif
-SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation)
+//SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation)
-SOFT_LINK_CLASS_OPTIONAL(AVFoundation, AVPlayerLayer)
+//SOFT_LINK_CLASS_OPTIONAL(AVFoundation, AVPlayerLayer)
using namespace WebCore;
@@ -192,8 +192,8 @@ static NSString *toCAFilterType(PlatformCALayer::FilterType type)
PlatformCALayer::LayerType PlatformCALayerCocoa::layerTypeForPlatformLayer(PlatformLayer* layer)
{
- if ([layer isKindOfClass:getAVPlayerLayerClass()] || [layer isKindOfClass:objc_getClass("WebVideoContainerLayer")])
- return LayerTypeAVPlayerLayer;
+ /*if ([layer isKindOfClass:getAVPlayerLayerClass()] || [layer isKindOfClass:objc_getClass("WebVideoContainerLayer")])
+ return LayerTypeAVPlayerLayer;*/
if ([layer isKindOfClass:[WebGLLayer class]])
return LayerTypeContentsProvidedLayer;
@@ -251,9 +251,9 @@ PlatformCALayerCocoa::PlatformCALayerCocoa(LayerType layerType, PlatformCALayerC
case LayerTypePageTiledBackingLayer:
layerClass = [WebTiledBackingLayer class];
break;
- case LayerTypeAVPlayerLayer:
+ /*case LayerTypeAVPlayerLayer:
layerClass = getAVPlayerLayerClass();
- break;
+ break;*/
case LayerTypeContentsProvidedLayer:
// We don't create PlatformCALayerCocoas wrapped around WebGLLayers or WebGPULayers.
ASSERT_NOT_REACHED();
@@ -349,7 +349,7 @@ Ref<PlatformCALayer> PlatformCALayerCocoa::clone(PlatformCALayerClient* owner) c
newLayer->copyFiltersFrom(*this);
newLayer->updateCustomAppearance(customAppearance());
- if (type == LayerTypeAVPlayerLayer) {
+ /*if (type == LayerTypeAVPlayerLayer) {
ASSERT([newLayer->platformLayer() isKindOfClass:getAVPlayerLayerClass()]);
AVPlayerLayer *destinationPlayerLayer = static_cast<PlatformCALayerCocoa&>(newLayer.get()).avPlayerLayer();
@@ -359,7 +359,7 @@ Ref<PlatformCALayer> PlatformCALayerCocoa::clone(PlatformCALayerClient* owner) c
dispatch_async(dispatch_get_main_queue(), ^{
[destinationPlayerLayer setPlayer:[sourcePlayerLayer player]];
});
- }
+ }*/
if (type == LayerTypeShapeLayer)
newLayer->setShapeRoundedRect(shapeRoundedRect());
@@ -1224,7 +1224,7 @@ unsigned PlatformCALayerCocoa::backingStoreBytesPerPixel() const
return 4;
}
-AVPlayerLayer *PlatformCALayerCocoa::avPlayerLayer() const
+/*AVPlayerLayer *PlatformCALayerCocoa::avPlayerLayer() const
{
if (layerType() != LayerTypeAVPlayerLayer)
return nil;
@@ -1240,4 +1240,4 @@ AVPlayerLayer *PlatformCALayerCocoa::avPlayerLayer() const
ASSERT_NOT_REACHED();
return nil;
-}
+}*/
diff --git a/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp b/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp
index c7dd81460..09df52b96 100644
--- a/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp
+++ b/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp
@@ -50,6 +50,10 @@
#include "WebCoreSystemInterface.h"
#endif
+#if PLATFORM(MAC)
+#include <CoreServices/CoreServices.h>
+#endif
+
#if USE(IOSURFACE_CANVAS_BACKING_STORE)
#include "IOSurface.h"
#include "IOSurfaceSPI.h"
diff --git a/Source/WebCore/platform/graphics/cg/ImageBufferDataCG.h b/Source/WebCore/platform/graphics/cg/ImageBufferDataCG.h
index c0b6392e9..0ad4cfee7 100644
--- a/Source/WebCore/platform/graphics/cg/ImageBufferDataCG.h
+++ b/Source/WebCore/platform/graphics/cg/ImageBufferDataCG.h
@@ -31,7 +31,7 @@
#include <wtf/RetainPtr.h>
#include <wtf/Vector.h>
-#if PLATFORM(COCOA) && USE(CA) && !PLATFORM(IOS_SIMULATOR)
+#if PLATFORM(COCOA) && USE(CA) && !PLATFORM(IOS_SIMULATOR) && !PLATFORM(GNUSTEP)
#define USE_IOSURFACE_CANVAS_BACKING_STORE 1
#endif
diff --git a/Source/WebCore/platform/graphics/cg/PDFDocumentImage.h b/Source/WebCore/platform/graphics/cg/PDFDocumentImage.h
index b1c95288d..bf2d61d2e 100644
--- a/Source/WebCore/platform/graphics/cg/PDFDocumentImage.h
+++ b/Source/WebCore/platform/graphics/cg/PDFDocumentImage.h
@@ -34,8 +34,10 @@
#if USE(CG)
-#if PLATFORM(MAC)
+#if PLATFORM(MAC) && !PLATFORM(GNUSTEP)
#define USE_PDFKIT_FOR_PDFDOCUMENTIMAGE 1
+#else
+#define USE_PDFKIT_FOR_PDFDOCUMENTIMAGE 0
#endif
typedef struct CGPDFDocument *CGPDFDocumentRef;
diff --git a/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp b/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp
index 9f0f31244..2a4493850 100644
--- a/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp
+++ b/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp
@@ -29,6 +29,7 @@
#include "CoreTextSPI.h"
#include "Font.h"
+#include <CoreFoundation/CoreFoundation.h>
#include <CoreText/SFNTLayoutTypes.h>
#include <wtf/HashSet.h>
@@ -707,25 +708,25 @@ static float stretchFromCoreTextTraits(CFDictionaryRef traits)
static void invalidateFontCache();
-static void fontCacheRegisteredFontsChangedNotificationCallback(CFNotificationCenterRef, void* observer, CFStringRef, const void *, CFDictionaryRef)
+/*static void fontCacheRegisteredFontsChangedNotificationCallback(CFNotificationCenterRef, void* observer, CFStringRef, const void *, CFDictionaryRef)
{
ASSERT_UNUSED(observer, observer == &FontCache::singleton());
invalidateFontCache();
-}
+}*/
void FontCache::platformInit()
{
- CFNotificationCenterAddObserver(CFNotificationCenterGetLocalCenter(), this, &fontCacheRegisteredFontsChangedNotificationCallback, kCTFontManagerRegisteredFontsChangedNotification, nullptr, CFNotificationSuspensionBehaviorDeliverImmediately);
+ //CFNotificationCenterAddObserver(CFNotificationCenterGetLocalCenter(), this, &fontCacheRegisteredFontsChangedNotificationCallback, kCTFontManagerRegisteredFontsChangedNotification, nullptr, CFNotificationSuspensionBehaviorDeliverImmediately);
-#if PLATFORM(MAC)
+/*#if PLATFORM(MAC)
CFNotificationCenterRef center = CFNotificationCenterGetLocalCenter();
const CFStringRef notificationName = kCFLocaleCurrentLocaleDidChangeNotification;
#else
CFNotificationCenterRef center = CFNotificationCenterGetDarwinNotifyCenter();
const CFStringRef notificationName = CFSTR("com.apple.language.changed");
#endif
- CFNotificationCenterAddObserver(center, this, &fontCacheRegisteredFontsChangedNotificationCallback, notificationName, nullptr, CFNotificationSuspensionBehaviorDeliverImmediately);
+ CFNotificationCenterAddObserver(center, this, &fontCacheRegisteredFontsChangedNotificationCallback, notificationName, nullptr, CFNotificationSuspensionBehaviorDeliverImmediately);*/
}
Vector<String> FontCache::systemFontFamilies()
@@ -743,7 +744,7 @@ Vector<String> FontCache::systemFontFamilies()
HashSet<String> visited;
for (CFIndex i = 0; i < numMatches; ++i) {
- auto fontDescriptor = static_cast<CTFontDescriptorRef>(CFArrayGetValueAtIndex(matchedDescriptors.get(), i));
+ auto fontDescriptor = (CTFontDescriptorRef)(CFArrayGetValueAtIndex(matchedDescriptors.get(), i));
if (auto familyName = adoptCF(static_cast<CFStringRef>(CTFontDescriptorCopyAttribute(fontDescriptor, kCTFontFamilyNameAttribute))))
visited.add(familyName.get());
}
@@ -896,7 +897,7 @@ public:
Vector<InstalledFont> result;
result.reserveInitialCapacity(count);
for (CFIndex i = 0; i < count; ++i) {
- InstalledFont installedFont(static_cast<CTFontDescriptorRef>(CFArrayGetValueAtIndex(matches.get(), i)));
+ InstalledFont installedFont((CTFontDescriptorRef)(CFArrayGetValueAtIndex(matches.get(), i)));
result.uncheckedAppend(WTFMove(installedFont));
}
return InstalledFontFamily(WTFMove(result));
@@ -919,7 +920,7 @@ public:
CFTypeRef values[] = { kCFBooleanTrue, postScriptNameString.get() };
auto attributes = adoptCF(CFDictionaryCreate(kCFAllocatorDefault, keys, values, WTF_ARRAY_LENGTH(keys), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
auto fontDescriptorToMatch = adoptCF(CTFontDescriptorCreateWithAttributes(attributes.get()));
- auto match = adoptCF(static_cast<CTFontDescriptorRef>(CTFontDescriptorCreateMatchingFontDescriptor(fontDescriptorToMatch.get(), nullptr)));
+ auto match = adoptCF((CTFontDescriptorRef)(CTFontDescriptorCreateMatchingFontDescriptor(fontDescriptorToMatch.get(), nullptr)));
return InstalledFont(match.get());
}).iterator->value;
}
diff --git a/Source/WebCore/platform/graphics/cocoa/FontCocoa.mm b/Source/WebCore/platform/graphics/cocoa/FontCocoa.mm
index 7a1f0f39d..3c87dcde6 100644
--- a/Source/WebCore/platform/graphics/cocoa/FontCocoa.mm
+++ b/Source/WebCore/platform/graphics/cocoa/FontCocoa.mm
@@ -679,10 +679,10 @@ bool Font::canRenderCombiningCharacterSequence(const UChar* characters, size_t l
CFIndex runCount = CFArrayGetCount(runArray);
for (CFIndex r = 0; r < runCount; r++) {
- CTRunRef ctRun = static_cast<CTRunRef>(CFArrayGetValueAtIndex(runArray, r));
+ CTRunRef ctRun = (CTRunRef)(CFArrayGetValueAtIndex(runArray, r));
ASSERT(CFGetTypeID(ctRun) == CTRunGetTypeID());
CFDictionaryRef runAttributes = CTRunGetAttributes(ctRun);
- CTFontRef runFont = static_cast<CTFontRef>(CFDictionaryGetValue(runAttributes, kCTFontAttributeName));
+ CTFontRef runFont = (CTFontRef)(CFDictionaryGetValue(runAttributes, kCTFontAttributeName));
if (!CFEqual(fontEqualityObject.get(), FontPlatformData::objectForEqualityCheck(runFont).get()))
return false;
}
diff --git a/Source/WebCore/platform/graphics/cocoa/FontFamilySpecificationCoreText.h b/Source/WebCore/platform/graphics/cocoa/FontFamilySpecificationCoreText.h
index 3294d8788..cbefb9864 100644
--- a/Source/WebCore/platform/graphics/cocoa/FontFamilySpecificationCoreText.h
+++ b/Source/WebCore/platform/graphics/cocoa/FontFamilySpecificationCoreText.h
@@ -27,7 +27,11 @@
#include <wtf/RetainPtr.h>
+#if !PLATFORM(GNUSTEP)
typedef const struct __CTFontDescriptor* CTFontDescriptorRef;
+#else
+typedef struct OPFontDescriptor *CTFontDescriptorRef;
+#endif
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/cocoa/GPUDeviceMetal.mm b/Source/WebCore/platform/graphics/cocoa/GPUDeviceMetal.mm
index 4d02098c2..b1526c7fb 100644
--- a/Source/WebCore/platform/graphics/cocoa/GPUDeviceMetal.mm
+++ b/Source/WebCore/platform/graphics/cocoa/GPUDeviceMetal.mm
@@ -29,12 +29,12 @@
#import "Logging.h"
#import "WebGPULayer.h"
+#if ENABLE(WEBGPU)
+
#import <Metal/Metal.h>
#import <runtime/ArrayBuffer.h>
#import <wtf/BlockObjCExceptions.h>
-#if ENABLE(WEBGPU)
-
namespace WebCore {
GPUDevice::GPUDevice()
diff --git a/Source/WebCore/platform/graphics/cocoa/WebActionDisablingCALayerDelegate.mm b/Source/WebCore/platform/graphics/cocoa/WebActionDisablingCALayerDelegate.mm
index 373a9ea4c..d63a7776a 100644
--- a/Source/WebCore/platform/graphics/cocoa/WebActionDisablingCALayerDelegate.mm
+++ b/Source/WebCore/platform/graphics/cocoa/WebActionDisablingCALayerDelegate.mm
@@ -27,6 +27,7 @@
#import "WebActionDisablingCALayerDelegate.h"
#import <QuartzCore/QuartzCore.h>
+#include <dispatch/dispatch.h>
@implementation WebActionDisablingCALayerDelegate
diff --git a/Source/WebCore/platform/graphics/cv/PixelBufferConformerCV.cpp b/Source/WebCore/platform/graphics/cv/PixelBufferConformerCV.cpp
index 6a4c43144..991fb4c88 100644
--- a/Source/WebCore/platform/graphics/cv/PixelBufferConformerCV.cpp
+++ b/Source/WebCore/platform/graphics/cv/PixelBufferConformerCV.cpp
@@ -24,6 +24,9 @@
*/
#include "config.h"
+
+#if ENABLE(VIDEO)
+
#include "PixelBufferConformerCV.h"
#include "GraphicsContextCG.h"
@@ -118,3 +121,5 @@ RetainPtr<CGImageRef> PixelBufferConformerCV::createImageFromPixelBuffer(CVPixel
}
}
+
+#endif
diff --git a/Source/WebCore/platform/graphics/cv/TextureCacheCV.mm b/Source/WebCore/platform/graphics/cv/TextureCacheCV.mm
index fe7919ce2..b3b94f59f 100644
--- a/Source/WebCore/platform/graphics/cv/TextureCacheCV.mm
+++ b/Source/WebCore/platform/graphics/cv/TextureCacheCV.mm
@@ -24,6 +24,9 @@
*/
#include "config.h"
+
+#if ENABLE(VIDEO)
+
#include "TextureCacheCV.h"
#include "GraphicsContext3D.h"
@@ -90,3 +93,5 @@ RetainPtr<TextureCacheCV::TextureType> TextureCacheCV::textureFromImage(CVImageB
}
}
+
+#endif
diff --git a/Source/WebCore/platform/graphics/cv/VideoTextureCopierCV.cpp b/Source/WebCore/platform/graphics/cv/VideoTextureCopierCV.cpp
index 9bc37b3e6..23701b56c 100644
--- a/Source/WebCore/platform/graphics/cv/VideoTextureCopierCV.cpp
+++ b/Source/WebCore/platform/graphics/cv/VideoTextureCopierCV.cpp
@@ -26,6 +26,8 @@
#include "config.h"
#include "VideoTextureCopierCV.h"
+#if ENABLE(VIDEO)
+
#include "Logging.h"
#include <wtf/NeverDestroyed.h>
@@ -210,3 +212,5 @@ bool VideoTextureCopierCV::copyVideoTextureToPlatformTexture(TextureType inputTe
}
+
+#endif
diff --git a/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm b/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm
index 636daa18f..1a9d42b96 100644
--- a/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm
+++ b/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm
@@ -239,13 +239,13 @@ void ComplexTextController::collectComplexTextRunsForCharacters(const UChar* cp,
CFIndex runCount = CFArrayGetCount(runArray);
for (CFIndex r = 0; r < runCount; r++) {
- CTRunRef ctRun = static_cast<CTRunRef>(CFArrayGetValueAtIndex(runArray, m_run.ltr() ? r : runCount - 1 - r));
+ CTRunRef ctRun = (CTRunRef)(CFArrayGetValueAtIndex(runArray, m_run.ltr() ? r : runCount - 1 - r));
ASSERT(CFGetTypeID(ctRun) == CTRunGetTypeID());
CFRange runRange = CTRunGetStringRange(ctRun);
const Font* runFont = font;
if (isSystemFallback) {
CFDictionaryRef runAttributes = CTRunGetAttributes(ctRun);
- CTFontRef runCTFont = static_cast<CTFontRef>(CFDictionaryGetValue(runAttributes, kCTFontAttributeName));
+ CTFontRef runCTFont = (CTFontRef)(CFDictionaryGetValue(runAttributes, kCTFontAttributeName));
ASSERT(runCTFont && CFGetTypeID(runCTFont) == CTFontGetTypeID());
RetainPtr<CFTypeRef> runFontEqualityObject = FontPlatformData::objectForEqualityCheck(runCTFont);
if (!safeCFEqual(runFontEqualityObject.get(), font->platformData().objectForEqualityCheck().get())) {
diff --git a/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.h b/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.h
index 838c414a0..f46a44235 100644
--- a/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.h
+++ b/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.h
@@ -28,7 +28,12 @@
#include <wtf/RetainPtr.h>
typedef struct CGFont* CGFontRef;
+
+#if !PLATFORM(GNUSTEP)
typedef const struct __CTFontDescriptor* CTFontDescriptorRef;
+#else
+typedef struct OPFontDescriptor *CTFontDescriptorRef;
+#endif
namespace WebCore {
diff --git a/Source/WebCore/platform/graphics/mac/ImageMac.mm b/Source/WebCore/platform/graphics/mac/ImageMac.mm
index e1cfe3fbd..12467de64 100644
--- a/Source/WebCore/platform/graphics/mac/ImageMac.mm
+++ b/Source/WebCore/platform/graphics/mac/ImageMac.mm
@@ -35,6 +35,8 @@
#import <CoreGraphics/CoreGraphics.h>
#import <ImageIO/ImageIO.h>
#import <MobileCoreServices/MobileCoreServices.h>
+#elif PLATFORM(MAC)
+#import <ApplicationServices/ApplicationServices.h>
#endif
@interface WebCoreBundleFinder : NSObject
diff --git a/Source/WebCore/platform/graphics/mac/UTIUtilities.h b/Source/WebCore/platform/graphics/mac/UTIUtilities.h
new file mode 100644
index 000000000..e15f69b71
--- /dev/null
+++ b/Source/WebCore/platform/graphics/mac/UTIUtilities.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2012 Apple 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:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS 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 APPLE OR ITS 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.
+ */
+
+#ifndef UTIUtilities_h
+#define UTIUtilities_h
+
+#import <wtf/RetainPtr.h>
+
+namespace WebCore {
+RetainPtr<CFStringRef> mimeTypeFromUTITree(CFStringRef uti);
+RetainPtr<CFStringRef> UTIFromMIMEType(CFStringRef mime);
+bool isDeclaredUTI(CFStringRef UTI);
+}
+
+#endif // UTIUtilities_h
diff --git a/Source/WebCore/platform/mac/BlacklistUpdater.mm b/Source/WebCore/platform/mac/BlacklistUpdater.mm
index 940f82965..a36221212 100644
--- a/Source/WebCore/platform/mac/BlacklistUpdater.mm
+++ b/Source/WebCore/platform/mac/BlacklistUpdater.mm
@@ -75,7 +75,11 @@ void BlacklistUpdater::reloadIfNecessary()
if (stat([blacklistPath fileSystemRepresentation], &statBuf) == -1)
return;
+#if OS(LINUX)
+ if (statBuf.st_mtime == blacklistUpdateTime)
+#else
if (statBuf.st_mtimespec.tv_sec == blacklistUpdateTime)
+#endif
return;
NSDictionary *propertyList = readBlacklistData();
if (!propertyList)
@@ -94,7 +98,11 @@ void BlacklistUpdater::reloadIfNecessary()
s_pluginBlacklist = PluginBlacklist::create(propertyList).release();
s_webGLBlacklist = WebGLBlacklist::create(propertyList).release();
+#if OS(LINUX)
+ blacklistUpdateTime = statBuf.st_mtime;
+#else
blacklistUpdateTime = statBuf.st_mtimespec.tv_sec;
+#endif
}
void BlacklistUpdater::initializeQueue()
diff --git a/Source/WebCore/platform/mac/DragDataMac.mm b/Source/WebCore/platform/mac/DragDataMac.mm
index 8e56b5fa9..ecae77c2e 100644
--- a/Source/WebCore/platform/mac/DragDataMac.mm
+++ b/Source/WebCore/platform/mac/DragDataMac.mm
@@ -37,6 +37,8 @@
#if PLATFORM(IOS)
#import <MobileCoreServices/MobileCoreServices.h>
+#elif PLATFORM(MAC)
+#import <CoreServices/CoreServices.h>
#endif
namespace WebCore {
diff --git a/Source/WebCore/platform/mac/FileSystemMac.mm b/Source/WebCore/platform/mac/FileSystemMac.mm
index 58dcea88b..4ade55f33 100644
--- a/Source/WebCore/platform/mac/FileSystemMac.mm
+++ b/Source/WebCore/platform/mac/FileSystemMac.mm
@@ -31,6 +31,7 @@
#import "WebCoreNSURLExtras.h"
#import "WebCoreSystemInterface.h"
#import <wtf/text/WTFString.h>
+#include <dispatch/dispatch.h>
namespace WebCore {
@@ -70,7 +71,7 @@ bool canExcludeFromBackup()
bool excludeFromBackup(const String& path)
{
// It is critical to pass FALSE for excludeByPath because excluding by path requires root privileges.
- CSBackupSetItemExcluded(pathAsURL(path).get(), TRUE, FALSE);
+ //CSBackupSetItemExcluded(pathAsURL(path).get(), TRUE, FALSE);
return true;
}
diff --git a/Source/WebCore/platform/mac/PasteboardMac.mm b/Source/WebCore/platform/mac/PasteboardMac.mm
index 18dfabc87..0a6008b43 100644
--- a/Source/WebCore/platform/mac/PasteboardMac.mm
+++ b/Source/WebCore/platform/mac/PasteboardMac.mm
@@ -55,6 +55,7 @@
#import <wtf/StdLibExtras.h>
#import <wtf/text/StringBuilder.h>
#import <wtf/unicode/CharacterNames.h>
+#import <CoreServices/CoreServices.h>
namespace WebCore {
diff --git a/Source/WebCore/platform/mac/PasteboardWriter.mm b/Source/WebCore/platform/mac/PasteboardWriter.mm
index 82637f8cd..5df1fc010 100644
--- a/Source/WebCore/platform/mac/PasteboardWriter.mm
+++ b/Source/WebCore/platform/mac/PasteboardWriter.mm
@@ -28,6 +28,7 @@
#if PLATFORM(MAC)
+#import <CoreServices/CoreServices.h>
#import "NSPasteboardSPI.h"
#import "PasteboardWriterData.h"
#import "SharedBuffer.h"
diff --git a/Source/WebCore/platform/mac/PlatformEventFactoryMac.mm b/Source/WebCore/platform/mac/PlatformEventFactoryMac.mm
index 6ba76f4af..109c633a9 100644
--- a/Source/WebCore/platform/mac/PlatformEventFactoryMac.mm
+++ b/Source/WebCore/platform/mac/PlatformEventFactoryMac.mm
@@ -34,8 +34,9 @@
#import "WebCoreSystemInterface.h"
#import "WindowsKeyboardCodes.h"
#import <HIToolbox/Events.h>
-#import <mach/mach_time.h>
+//#import <mach/mach_time.h>
#import <wtf/ASCIICType.h>
+#include <dispatch/dispatch.h>
namespace WebCore {
@@ -588,10 +589,10 @@ static void updateSystemStartupTimeIntervalSince1970()
{
// CFAbsoluteTimeGetCurrent() provides the absolute time in seconds since 2001.
// mach_absolute_time() provides a relative system time since startup minus the time the computer was suspended.
- mach_timebase_info_data_t timebase_info;
+ /*mach_timebase_info_data_t timebase_info;
mach_timebase_info(&timebase_info);
double elapsedTimeSinceStartup = static_cast<double>(mach_absolute_time()) * timebase_info.numer / timebase_info.denom / 1e9;
- systemStartupTime = kCFAbsoluteTimeIntervalSince1970 + CFAbsoluteTimeGetCurrent() - elapsedTimeSinceStartup;
+ systemStartupTime = kCFAbsoluteTimeIntervalSince1970 + CFAbsoluteTimeGetCurrent() - elapsedTimeSinceStartup;*/
}
static CFTimeInterval cachedStartupTimeIntervalSince1970()
diff --git a/Source/WebCore/platform/mac/PlatformPasteboardMac.mm b/Source/WebCore/platform/mac/PlatformPasteboardMac.mm
index 16a248c7b..4e24c8873 100644
--- a/Source/WebCore/platform/mac/PlatformPasteboardMac.mm
+++ b/Source/WebCore/platform/mac/PlatformPasteboardMac.mm
@@ -28,6 +28,7 @@
#import "URL.h"
#import "PlatformPasteboard.h"
#import "SharedBuffer.h"
+#import <CoreServices/CoreServices.h>
namespace WebCore {
diff --git a/Source/WebCore/platform/mac/ScrollbarThemeMac.mm b/Source/WebCore/platform/mac/ScrollbarThemeMac.mm
index 118256211..fa5de6972 100644
--- a/Source/WebCore/platform/mac/ScrollbarThemeMac.mm
+++ b/Source/WebCore/platform/mac/ScrollbarThemeMac.mm
@@ -37,6 +37,7 @@
#include "ScrollView.h"
#include "WebCoreSystemInterface.h"
#include <Carbon/Carbon.h>
+#include <QuartzCore/CALayer.h>
#include <wtf/BlockObjCExceptions.h>
#include <wtf/HashMap.h>
#include <wtf/NeverDestroyed.h>
@@ -485,7 +486,8 @@ bool ScrollbarThemeMac::shouldDragDocumentInsteadOfThumb(Scrollbar&, const Platf
int ScrollbarThemeMac::scrollbarPartToHIPressedState(ScrollbarPart part)
{
- switch (part) {
+ return 0;
+ /*switch (part) {
case BackButtonStartPart:
return kThemeTopOutsideArrowPressed;
case BackButtonEndPart:
@@ -498,7 +500,7 @@ int ScrollbarThemeMac::scrollbarPartToHIPressedState(ScrollbarPart part)
return kThemeThumbPressed;
default:
return 0;
- }
+ }*/
}
void ScrollbarThemeMac::updateEnabledState(Scrollbar& scrollbar)
diff --git a/Source/WebCore/platform/mac/ThemeMac.mm b/Source/WebCore/platform/mac/ThemeMac.mm
index d8c00330d..cf30b4ae2 100644
--- a/Source/WebCore/platform/mac/ThemeMac.mm
+++ b/Source/WebCore/platform/mac/ThemeMac.mm
@@ -157,7 +157,7 @@ static LengthSize sizeFromFont(const FontCascade& font, const LengthSize& zoomed
return sizeFromNSControlSize(controlSizeForFont(font), zoomedSize, zoomFactor, sizes);
}
-static ControlSize controlSizeFromPixelSize(const std::array<IntSize, 3>& sizes, const IntSize& minZoomedSize, float zoomFactor)
+static NSControlSize controlSizeFromPixelSize(const std::array<IntSize, 3>& sizes, const IntSize& minZoomedSize, float zoomFactor)
{
if (minZoomedSize.width() >= static_cast<int>(sizes[NSControlSizeRegular].width() * zoomFactor)
&& minZoomedSize.height() >= static_cast<int>(sizes[NSControlSizeRegular].height() * zoomFactor))
@@ -170,7 +170,7 @@ static ControlSize controlSizeFromPixelSize(const std::array<IntSize, 3>& sizes,
static void setControlSize(NSCell* cell, const std::array<IntSize, 3>& sizes, const IntSize& minZoomedSize, float zoomFactor)
{
- ControlSize size = controlSizeFromPixelSize(sizes, minZoomedSize, zoomFactor);
+ NSControlSize size = controlSizeFromPixelSize(sizes, minZoomedSize, zoomFactor);
if (size != [cell controlSize]) // Only update if we have to, since AppKit does work even if the size is the same.
[cell setControlSize:(NSControlSize)size];
}
@@ -215,7 +215,8 @@ static void updateStates(NSCell* cell, const ControlStates& controlStates, bool
static ThemeDrawState convertControlStatesToThemeDrawState(ThemeButtonKind kind, const ControlStates& controlStates)
{
- ControlStates::States states = controlStates.states();
+ return 0;
+ /*ControlStates::States states = controlStates.states();
if (!(states & ControlStates::EnabledState))
return kThemeStateUnavailableInactive;
@@ -226,7 +227,7 @@ static ThemeDrawState convertControlStatesToThemeDrawState(ThemeButtonKind kind,
return states & ControlStates::SpinUpState ? kThemeStatePressedUp : kThemeStatePressedDown;
return kThemeStatePressed;
}
- return kThemeStateActive;
+ return kThemeStateActive;*/
}
static FloatRect inflateRect(const FloatRect& zoomedRect, const IntSize& zoomedSize, const int* margins, float zoomFactor)
@@ -570,17 +571,17 @@ static void paintStepper(ControlStates& states, GraphicsContext& context, const
// We don't use NSStepperCell because there are no ways to draw an
// NSStepperCell with the up button highlighted.
- HIThemeButtonDrawInfo drawInfo;
- drawInfo.version = 0;
- drawInfo.state = convertControlStatesToThemeDrawState(kThemeIncDecButton, states);
- drawInfo.adornment = kThemeAdornmentDefault;
- ControlSize controlSize = controlSizeFromPixelSize(stepperSizes(), IntSize(zoomedRect.size()), zoomFactor);
- if (controlSize == NSControlSizeSmall)
- drawInfo.kind = kThemeIncDecButtonSmall;
- else if (controlSize == NSControlSizeMini)
- drawInfo.kind = kThemeIncDecButtonMini;
- else
- drawInfo.kind = kThemeIncDecButton;
+ //HIThemeButtonDrawInfo drawInfo;
+ //drawInfo.version = 0;
+ //drawInfo.state = convertControlStatesToThemeDrawState(kThemeIncDecButton, states);
+ //drawInfo.adornment = kThemeAdornmentDefault;
+ //ControlSize controlSize = controlSizeFromPixelSize(stepperSizes(), IntSize(zoomedRect.size()), zoomFactor);
+ //if (controlSize == NSControlSizeSmall)
+ // drawInfo.kind = kThemeIncDecButtonSmall;
+ //else if (controlSize == NSControlSizeMini)
+ // drawInfo.kind = kThemeIncDecButtonMini;
+ //else
+ // drawInfo.kind = kThemeIncDecButton;
IntRect rect(zoomedRect);
GraphicsContextStateSaver stateSaver(context);
@@ -593,7 +594,7 @@ static void paintStepper(ControlStates& states, GraphicsContext& context, const
}
CGRect bounds(rect);
CGRect backgroundBounds;
- HIThemeGetButtonBackgroundBounds(&bounds, &drawInfo, &backgroundBounds);
+ //HIThemeGetButtonBackgroundBounds(&bounds, &drawInfo, &backgroundBounds);
// Center the stepper rectangle in the specified area.
backgroundBounds.origin.x = bounds.origin.x + (bounds.size.width - backgroundBounds.size.width) / 2;
if (backgroundBounds.size.height < bounds.size.height) {
@@ -602,7 +603,7 @@ static void paintStepper(ControlStates& states, GraphicsContext& context, const
}
LocalCurrentGraphicsContext localContext(context);
- HIThemeDrawButton(&backgroundBounds, &drawInfo, localContext.cgContext(), kHIThemeOrientationNormal, 0);
+ //HIThemeDrawButton(&backgroundBounds, &drawInfo, localContext.cgContext(), kHIThemeOrientationNormal, 0);
}
// This will ensure that we always return a valid NSView, even if ScrollView doesn't have an associated document NSView.
@@ -803,7 +804,7 @@ void ThemeMac::inflateControlPaintRect(ControlPart part, const ControlStates& st
}
case InnerSpinButtonPart: {
static const int stepperMargin[4] = { 0, 0, 0, 0 };
- ControlSize controlSize = controlSizeFromPixelSize(stepperSizes(), zoomRectSize, zoomFactor);
+ NSControlSize controlSize = controlSizeFromPixelSize(stepperSizes(), zoomRectSize, zoomFactor);
IntSize zoomedSize = stepperSizes()[controlSize];
zoomedSize.setHeight(zoomedSize.height() * zoomFactor);
zoomedSize.setWidth(zoomedSize.width() * zoomFactor);
diff --git a/Source/WebCore/platform/mac/ThreadCheck.mm b/Source/WebCore/platform/mac/ThreadCheck.mm
index ec0b9996f..f8519fa21 100644
--- a/Source/WebCore/platform/mac/ThreadCheck.mm
+++ b/Source/WebCore/platform/mac/ThreadCheck.mm
@@ -31,6 +31,17 @@
#import <wtf/StdLibExtras.h>
#include <wtf/text/StringHash.h>
+#if OS(LINUX)
+#include <unistd.h>
+#include <sys/syscall.h>
+#include <sys/types.h>
+
+static inline int pthread_main_np()
+{
+ return syscall(SYS_gettid) == getpid() ? 1 : 0;
+}
+#endif
+
namespace WebCore {
static bool didReadThreadViolationBehaviorFromUserDefaults = false;
diff --git a/Source/WebCore/platform/mac/WebCoreFullScreenWarningView.mm b/Source/WebCore/platform/mac/WebCoreFullScreenWarningView.mm
index 3494b88ac..7343a2ddf 100644
--- a/Source/WebCore/platform/mac/WebCoreFullScreenWarningView.mm
+++ b/Source/WebCore/platform/mac/WebCoreFullScreenWarningView.mm
@@ -45,6 +45,8 @@ static const CGFloat WarningViewShadowAlpha = 1;
static const NSSize WarningViewShadowOffset = {0, -2};
static const CGFloat WarningViewShadowRadius = 5;
+#if ENABLE(FULLSCREEN_API)
+
@implementation WebCoreFullScreenWarningView
- (id)initWithTitle:(NSString*)title
@@ -107,3 +109,5 @@ static const CGFloat WarningViewShadowRadius = 5;
@end
#endif // !PLATFORM(IOS)
+
+#endif
diff --git a/Source/WebCore/platform/mac/WebCoreSystemInterface.h b/Source/WebCore/platform/mac/WebCoreSystemInterface.h
index 5adf12e3f..1f82e4bf7 100644
--- a/Source/WebCore/platform/mac/WebCoreSystemInterface.h
+++ b/Source/WebCore/platform/mac/WebCoreSystemInterface.h
@@ -27,13 +27,14 @@
#define WebCoreSystemInterface_h
#include <objc/objc.h>
+#include <CoreGraphics/CGGeometry.h>
typedef const struct __CFString * CFStringRef;
typedef const struct __CFNumber * CFNumberRef;
typedef const struct __CFDictionary * CFDictionaryRef;
-typedef struct CGPoint CGPoint;
-typedef struct CGSize CGSize;
-typedef struct CGRect CGRect;
+//typedef struct CGPoint CGPoint;
+//typedef struct CGSize CGSize;
+//typedef struct CGRect CGRect;
typedef struct CGAffineTransform CGAffineTransform;
typedef struct CGContext *CGContextRef;
typedef struct CGImage *CGImageRef;
@@ -47,10 +48,17 @@ typedef struct __CFRunLoop * CFRunLoopRef;
typedef struct __CFHTTPMessage *CFHTTPMessageRef;
typedef struct _CFURLResponse *CFURLResponseRef;
typedef const struct _CFURLRequest *CFURLRequestRef;
+#if !PLATFORM(GNUSTEP)
typedef const struct __CTFont * CTFontRef;
typedef const struct __CTLine * CTLineRef;
typedef const struct __CTRun * CTRunRef;
typedef const struct __CTTypesetter * CTTypesetterRef;
+#else
+typedef struct OPFont * CTFontRef;
+typedef struct CTLine * CTLineRef;
+typedef struct CTRun * CTRunRef;
+typedef struct CTTypesetter * CTTypesetterRef;
+#endif
typedef const struct __AXUIElement *AXUIElementRef;
#if !PLATFORM(IOS)
typedef struct _NSRange NSRange;
@@ -63,7 +71,7 @@ typedef struct __IOSurface *IOSurfaceRef;
#endif // !PLATFORM(IOS_SIMULATOR)
#endif
-#if !PLATFORM(IOS)
+/*#if !PLATFORM(IOS)
#ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
typedef struct CGPoint NSPoint;
typedef struct CGRect NSRect;
@@ -71,7 +79,7 @@ typedef struct CGRect NSRect;
typedef struct _NSPoint NSPoint;
typedef struct _NSRect NSRect;
#endif
-#endif // !PLATFORM(IOS)
+#endif // !PLATFORM(IOS)*/
#if PLATFORM(IOS)
#include <CoreGraphics/CoreGraphics.h>
diff --git a/Source/WebCore/platform/mac/WebGLBlacklist.mm b/Source/WebCore/platform/mac/WebGLBlacklist.mm
index 6724bcfad..f95e91310 100644
--- a/Source/WebCore/platform/mac/WebGLBlacklist.mm
+++ b/Source/WebCore/platform/mac/WebGLBlacklist.mm
@@ -26,7 +26,7 @@
#import "config.h"
#import "WebGLBlacklist.h"
-#if PLATFORM(MAC)
+#if PLATFORM(MAC) && ENABLE(WEBGL)
#import "BlacklistUpdater.h"
#import "CFUtilitiesSPI.h"
diff --git a/Source/WebCore/platform/network/NetworkStorageSession.h b/Source/WebCore/platform/network/NetworkStorageSession.h
index dfca3240a..fae2e201c 100644
--- a/Source/WebCore/platform/network/NetworkStorageSession.h
+++ b/Source/WebCore/platform/network/NetworkStorageSession.h
@@ -77,7 +77,7 @@ public:
NSHTTPCookieStorage *nsCookieStorage() const;
#endif
-#if PLATFORM(COCOA) || USE(CFURLCONNECTION)
+#if (PLATFORM(COCOA) || USE(CFURLCONNECTION)) && !PLATFORM(GNUSTEP)
WEBCORE_EXPORT static void ensureSession(SessionID, const String& identifierBase, RetainPtr<CFHTTPCookieStorageRef>&&);
NetworkStorageSession(SessionID, RetainPtr<CFURLStorageSessionRef>&&, RetainPtr<CFHTTPCookieStorageRef>&&);
@@ -120,7 +120,7 @@ private:
static HashMap<SessionID, std::unique_ptr<NetworkStorageSession>>& globalSessionMap();
SessionID m_sessionID;
-#if PLATFORM(COCOA) || USE(CFURLCONNECTION)
+#if (PLATFORM(COCOA) || USE(CFURLCONNECTION)) && !PLATFORM(GNUSTEP)
RetainPtr<CFURLStorageSessionRef> m_platformSession;
RetainPtr<CFHTTPCookieStorageRef> m_platformCookieStorage;
#elif USE(SOUP)
diff --git a/Source/WebCore/platform/network/ResourceHandleInternal.h b/Source/WebCore/platform/network/ResourceHandleInternal.h
index 5f34de8c4..61ea52d32 100644
--- a/Source/WebCore/platform/network/ResourceHandleInternal.h
+++ b/Source/WebCore/platform/network/ResourceHandleInternal.h
@@ -210,6 +210,10 @@ public:
#endif
#if PLATFORM(COCOA)
+#ifndef nil
+#define nil 0
+#endif
+
// We need to keep a reference to the original challenge to be able to cancel it.
// It is almost identical to m_currentWebChallenge.nsURLAuthenticationChallenge(), but has a different sender.
NSURLAuthenticationChallenge *m_currentMacChallenge { nil };
diff --git a/Source/WebCore/platform/network/cf/CertificateInfo.h b/Source/WebCore/platform/network/cf/CertificateInfo.h
index 3619015d3..929f3b86a 100644
--- a/Source/WebCore/platform/network/cf/CertificateInfo.h
+++ b/Source/WebCore/platform/network/cf/CertificateInfo.h
@@ -29,7 +29,7 @@
#include "PlatformExportMacros.h"
#include <wtf/RetainPtr.h>
-#if PLATFORM(COCOA)
+#if PLATFORM(COCOA) && HAVE(SEC_TRUST_SERIALIZATION)
#include <Security/SecTrust.h>
#endif
@@ -68,7 +68,7 @@ public:
bool isEmpty() const { return type() == Type::None; }
-#if PLATFORM(COCOA)
+#if PLATFORM(COCOA) && HAVE(SEC_TRUST_SERIALIZATION)
static RetainPtr<CFArrayRef> certificateChainFromSecTrust(SecTrustRef);
#endif
diff --git a/Source/WebCore/platform/network/cocoa/CredentialCocoa.h b/Source/WebCore/platform/network/cocoa/CredentialCocoa.h
index a69fc25af..a03634ad1 100644
--- a/Source/WebCore/platform/network/cocoa/CredentialCocoa.h
+++ b/Source/WebCore/platform/network/cocoa/CredentialCocoa.h
@@ -26,7 +26,7 @@
#pragma once
#include "CredentialBase.h"
-#include <Security/SecBase.h>
+//#include <Security/SecBase.h>
#include <wtf/RetainPtr.h>
#if USE(CFURLCONNECTION)
diff --git a/Source/WebCore/platform/network/cocoa/CredentialCocoa.mm b/Source/WebCore/platform/network/cocoa/CredentialCocoa.mm
index 9b735ba77..f6c76062e 100644
--- a/Source/WebCore/platform/network/cocoa/CredentialCocoa.mm
+++ b/Source/WebCore/platform/network/cocoa/CredentialCocoa.mm
@@ -75,8 +75,8 @@ Credential::Credential(const Credential& original, CredentialPersistence persist
if (NSString *user = originalNSURLCredential.user)
m_nsCredential = adoptNS([[NSURLCredential alloc] initWithUser:user password:originalNSURLCredential.password persistence:toNSURLCredentialPersistence(persistence)]);
- else if (SecIdentityRef identity = originalNSURLCredential.identity)
- m_nsCredential = adoptNS([[NSURLCredential alloc] initWithIdentity:identity certificates:originalNSURLCredential.certificates persistence:toNSURLCredentialPersistence(persistence)]);
+ /*else if (SecIdentityRef identity = originalNSURLCredential.identity)
+ m_nsCredential = adoptNS([[NSURLCredential alloc] initWithIdentity:identity certificates:originalNSURLCredential.certificates persistence:toNSURLCredentialPersistence(persistence)]);*/
else {
// It is not possible to set the persistence of server trust credentials.
ASSERT_NOT_REACHED();
diff --git a/Source/WebCore/platform/network/cocoa/WebCoreNSURLSession.h b/Source/WebCore/platform/network/cocoa/WebCoreNSURLSession.h
index 9873bc342..cfe0f0378 100644
--- a/Source/WebCore/platform/network/cocoa/WebCoreNSURLSession.h
+++ b/Source/WebCore/platform/network/cocoa/WebCoreNSURLSession.h
@@ -26,6 +26,7 @@
#ifndef WebCoreNSURLSession_h
#define WebCoreNSURLSession_h
+#include <dispatch/dispatch.h>
#import <Foundation/NSURLSession.h>
#import <wtf/HashSet.h>
#import <wtf/Lock.h>
@@ -104,6 +105,8 @@ WEBCORE_EXPORT @interface WebCoreNSURLSession : NSObject {
- (NSURLSessionDownloadTask *)downloadTaskWithResumeData:(NSData *)resumeData completionHandler:(void (^)(NSURL * location, NSURLResponse * response, NSError * error))completionHandler;
@end
+#if ENABLE(VIDEO)
+
@interface WebCoreNSURLSessionDataTask : NSObject {
WebCoreNSURLSession *_session;
RefPtr<WebCore::PlatformMediaResource> _resource;
@@ -138,6 +141,8 @@ WEBCORE_EXPORT @interface WebCoreNSURLSession : NSObject {
- (void)resume;
@end
+#endif
+
NS_ASSUME_NONNULL_END
#endif
diff --git a/Source/WebCore/platform/network/cocoa/WebCoreNSURLSession.mm b/Source/WebCore/platform/network/cocoa/WebCoreNSURLSession.mm
index 41cb090d5..ea7dfad53 100644
--- a/Source/WebCore/platform/network/cocoa/WebCoreNSURLSession.mm
+++ b/Source/WebCore/platform/network/cocoa/WebCoreNSURLSession.mm
@@ -341,6 +341,8 @@ NS_ASSUME_NONNULL_END
namespace WebCore {
+#if ENABLE(VIDEO)
+
class WebCoreNSURLSessionDataTaskClient : public PlatformMediaResourceClient {
public:
WebCoreNSURLSessionDataTaskClient(WebCoreNSURLSessionDataTask *task)
@@ -403,6 +405,10 @@ void WebCoreNSURLSessionDataTaskClient::loadFinished(PlatformMediaResource& reso
}
+#endif
+
+#if ENABLE(VIDEO)
+
#pragma mark - WebCoreNSURLSessionDataTask
@implementation WebCoreNSURLSessionDataTask
@@ -657,3 +663,5 @@ void WebCoreNSURLSessionDataTaskClient::loadFinished(PlatformMediaResource& reso
[self _resource:resource loadFinishedWithError:nil];
}
@end
+
+#endif
diff --git a/Source/WebCore/platform/network/soup/AuthenticationChallenge.h b/Source/WebCore/platform/network/soup/AuthenticationChallenge.h
index c6d4bd1dd..94ce7a838 100644
--- a/Source/WebCore/platform/network/soup/AuthenticationChallenge.h
+++ b/Source/WebCore/platform/network/soup/AuthenticationChallenge.h
@@ -27,6 +27,7 @@
#include "AuthenticationChallengeBase.h"
#include "AuthenticationClient.h"
+#include <wtf/glib/GRefPtr.h>
typedef struct _SoupAuth SoupAuth;
typedef struct _SoupMessage SoupMessage;
diff --git a/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp b/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp
index bfb173be1..6127c1b67 100644
--- a/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp
+++ b/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp
@@ -61,6 +61,23 @@
#include <wtf/glib/RunLoopSourcePriority.h>
#include <wtf/text/CString.h>
+enum RunLoopSourcePriority {
+ RunLoopDispatcher = 100,
+ RunLoopTimer = 0,
+ JavascriptTimer = 200,
+ MainThreadDispatcherTimer = 100,
+ MemoryPressureHandlerTimer = -100,
+ MainThreadSharedTimer = 100,
+ ReleaseUnusedResourcesTimer = 200,
+ CompositingThreadUpdateTimer = 110,
+ LayerFlushTimer = -100,
+ DisplayRefreshMonitorTimer = -100,
+ NonAcceleratedDrawingTimer = 100,
+ AsyncIONetwork = 100,
+ DiskCacheRead = 100,
+ DiskCacheWrite = 200,
+};
+
namespace WebCore {
static const size_t gDefaultReadBufferSize = 8192;
diff --git a/Source/WebCore/platform/network/soup/SocketStreamHandleImplSoup.cpp b/Source/WebCore/platform/network/soup/SocketStreamHandleImplSoup.cpp
index e8594e943..ed2c9a4ee 100644
--- a/Source/WebCore/platform/network/soup/SocketStreamHandleImplSoup.cpp
+++ b/Source/WebCore/platform/network/soup/SocketStreamHandleImplSoup.cpp
@@ -46,6 +46,23 @@
#include <wtf/glib/RunLoopSourcePriority.h>
#include <wtf/text/CString.h>
+enum RunLoopSourcePriority {
+ RunLoopDispatcher = 100,
+ RunLoopTimer = 0,
+ JavascriptTimer = 200,
+ MainThreadDispatcherTimer = 100,
+ MemoryPressureHandlerTimer = -100,
+ MainThreadSharedTimer = 100,
+ ReleaseUnusedResourcesTimer = 200,
+ CompositingThreadUpdateTimer = 110,
+ LayerFlushTimer = -100,
+ DisplayRefreshMonitorTimer = -100,
+ NonAcceleratedDrawingTimer = 100,
+ AsyncIONetwork = 100,
+ DiskCacheRead = 100,
+ DiskCacheWrite = 200,
+};
+
#define READ_BUFFER_SIZE 1024
namespace WebCore {
diff --git a/Source/WebCore/platform/posix/FileSystemPOSIX.cpp b/Source/WebCore/platform/posix/FileSystemPOSIX.cpp
index dff9b8598..79f68f484 100644
--- a/Source/WebCore/platform/posix/FileSystemPOSIX.cpp
+++ b/Source/WebCore/platform/posix/FileSystemPOSIX.cpp
@@ -38,6 +38,7 @@
#include <stdio.h>
#include <sys/stat.h>
#include <sys/types.h>
+#include <sys/file.h>
#include <unistd.h>
#include <wtf/text/CString.h>
#include <wtf/text/WTFString.h>
diff --git a/Source/WebCore/platform/spi/cf/CFNetworkSPI.h b/Source/WebCore/platform/spi/cf/CFNetworkSPI.h
index 5738474c5..2b33617fe 100644
--- a/Source/WebCore/platform/spi/cf/CFNetworkSPI.h
+++ b/Source/WebCore/platform/spi/cf/CFNetworkSPI.h
@@ -29,6 +29,7 @@
#include "CFNetworkConnectionCacheSPI.h"
#include <CFNetwork/CFNetwork.h>
+#include <dispatch/dispatch.h>
#if PLATFORM(WIN) || USE(APPLE_INTERNAL_SDK)
diff --git a/Source/WebCore/platform/spi/cocoa/NEFilterSourceSPI.h b/Source/WebCore/platform/spi/cocoa/NEFilterSourceSPI.h
index f8bd9f014..8b3b2c2c4 100644
--- a/Source/WebCore/platform/spi/cocoa/NEFilterSourceSPI.h
+++ b/Source/WebCore/platform/spi/cocoa/NEFilterSourceSPI.h
@@ -29,7 +29,7 @@
#else
-typedef NS_ENUM(NSInteger, NEFilterSourceStatus) {
+typedef NS_ENUM(int, NEFilterSourceStatus) {
NEFilterSourceStatusPass = 1,
NEFilterSourceStatusBlock = 2,
NEFilterSourceStatusNeedsMoreData = 3,
diff --git a/Source/WebCore/platform/spi/cocoa/QuartzCoreSPI.h b/Source/WebCore/platform/spi/cocoa/QuartzCoreSPI.h
index f2329686f..fe7b6653e 100644
--- a/Source/WebCore/platform/spi/cocoa/QuartzCoreSPI.h
+++ b/Source/WebCore/platform/spi/cocoa/QuartzCoreSPI.h
@@ -24,7 +24,10 @@
*/
#import <QuartzCore/QuartzCore.h>
+
+#if USE(IOSURFACE)
#import <WebCore/IOSurfaceSPI.h>
+#endif
#if USE(APPLE_INTERNAL_SDK)
diff --git a/Source/WebCore/platform/spi/mac/DataDetectorsSPI.h b/Source/WebCore/platform/spi/mac/DataDetectorsSPI.h
index 32bfcbf08..4675f2b57 100644
--- a/Source/WebCore/platform/spi/mac/DataDetectorsSPI.h
+++ b/Source/WebCore/platform/spi/mac/DataDetectorsSPI.h
@@ -34,6 +34,8 @@
#if PLATFORM(MAC)
+#import <CoreGraphics/CoreGraphics.h>
+
#if USE(APPLE_INTERNAL_SDK)
// Can't include DDAction.h because as of this writing it is a private header that includes a non-private header with an "" include.
diff --git a/Source/WebCore/platform/text/mac/TextBoundaries.mm b/Source/WebCore/platform/text/mac/TextBoundaries.mm
index 5c39d6319..43b2252bd 100644
--- a/Source/WebCore/platform/text/mac/TextBoundaries.mm
+++ b/Source/WebCore/platform/text/mac/TextBoundaries.mm
@@ -26,7 +26,10 @@
#import "config.h"
#import "TextBoundaries.h"
+#if !USE(APPKIT)
#import <CoreFoundation/CFStringTokenizer.h>
+#endif
+
#import <Foundation/Foundation.h>
#import <unicode/ubrk.h>
#import <unicode/uchar.h>
diff --git a/Source/WebCore/rendering/RenderThemeMac.mm b/Source/WebCore/rendering/RenderThemeMac.mm
index d634165c8..3c36f385e 100644
--- a/Source/WebCore/rendering/RenderThemeMac.mm
+++ b/Source/WebCore/rendering/RenderThemeMac.mm
@@ -451,7 +451,7 @@ static RGBA32 convertNSColorToColor(NSColor *color)
static RGBA32 menuBackgroundColor()
{
- NSBitmapImageRep *offscreenRep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:nil
+ /*NSBitmapImageRep *offscreenRep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:nil
pixelsWide:1
pixelsHigh:1
bitsPerSample:8
@@ -474,7 +474,9 @@ static RGBA32 menuBackgroundColor()
[offscreenRep release];
- return makeRGB(pixel[0], pixel[1], pixel[2]);
+ return makeRGB(pixel[0], pixel[1], pixel[2]);*/
+ // GNUSTEP: FIXME
+ return makeRGB(0, 0, 0);
}
void RenderThemeMac::platformColorsDidChange()
@@ -1130,31 +1132,31 @@ bool RenderThemeMac::paintProgressBar(const RenderObject& renderObject, const Pa
NSControlSize controlSize = controlSizeForFont(renderObject.style());
const auto& renderProgress = downcast<RenderProgress>(renderObject);
- HIThemeTrackDrawInfo trackInfo;
- trackInfo.version = 0;
- if (controlSize == NSControlSizeRegular)
- trackInfo.kind = renderProgress.position() < 0 ? kThemeLargeIndeterminateBar : kThemeLargeProgressBar;
- else
- trackInfo.kind = renderProgress.position() < 0 ? kThemeMediumIndeterminateBar : kThemeMediumProgressBar;
-
- float deviceScaleFactor = renderObject.document().deviceScaleFactor();
- trackInfo.bounds = IntRect(IntPoint(), inflatedRect.size());
- trackInfo.min = 0;
- trackInfo.max = std::numeric_limits<SInt32>::max();
- trackInfo.value = lround(renderProgress.position() * nextafter(trackInfo.max, 0));
- trackInfo.trackInfo.progress.phase = lround(renderProgress.animationProgress() * nextafter(progressAnimationNumFrames, 0) * deviceScaleFactor);
- trackInfo.attributes = kThemeTrackHorizontal;
- trackInfo.enableState = isActive(renderObject) ? kThemeTrackActive : kThemeTrackInactive;
- trackInfo.reserved = 0;
- trackInfo.filler1 = 0;
-
- std::unique_ptr<ImageBuffer> imageBuffer = ImageBuffer::createCompatibleBuffer(inflatedRect.size(), deviceScaleFactor, ColorSpaceSRGB, paintInfo.context());
- if (!imageBuffer)
- return true;
-
- ContextContainer cgContextContainer(imageBuffer->context());
- CGContextRef cgContext = cgContextContainer.context();
- HIThemeDrawTrack(&trackInfo, 0, cgContext, kHIThemeOrientationNormal);
+ //HIThemeTrackDrawInfo trackInfo;
+ //trackInfo.version = 0;
+ //if (controlSize == NSControlSizeRegular)
+ // trackInfo.kind = renderProgress.position() < 0 ? kThemeLargeIndeterminateBar : kThemeLargeProgressBar;
+ //else
+ // trackInfo.kind = renderProgress.position() < 0 ? kThemeMediumIndeterminateBar : kThemeMediumProgressBar;
+
+ //float deviceScaleFactor = renderObject.document().deviceScaleFactor();
+ //trackInfo.bounds = IntRect(IntPoint(), inflatedRect.size());
+ //trackInfo.min = 0;
+ //trackInfo.max = std::numeric_limits<SInt32>::max();
+ //trackInfo.value = lround(renderProgress.position() * nextafter(trackInfo.max, 0));
+ //trackInfo.trackInfo.progress.phase = lround(renderProgress.animationProgress() * nextafter(progressAnimationNumFrames, 0) * deviceScaleFactor);
+ //trackInfo.attributes = kThemeTrackHorizontal;
+ //trackInfo.enableState = isActive(renderObject) ? kThemeTrackActive : kThemeTrackInactive;
+ //trackInfo.reserved = 0;
+ //trackInfo.filler1 = 0;
+
+ //std::unique_ptr<ImageBuffer> imageBuffer = ImageBuffer::createCompatibleBuffer(inflatedRect.size(), deviceScaleFactor, ColorSpaceSRGB, paintInfo.context());
+ //if (!imageBuffer)
+ // return true;
+
+ //ContextContainer cgContextContainer(imageBuffer->context());
+ //CGContextRef cgContext = cgContextContainer.context();
+ //HIThemeDrawTrack(&trackInfo, 0, cgContext, kHIThemeOrientationNormal);
GraphicsContextStateSaver stateSaver(paintInfo.context());
@@ -1163,7 +1165,7 @@ bool RenderThemeMac::paintProgressBar(const RenderObject& renderObject, const Pa
paintInfo.context().scale(FloatSize(-1, 1));
}
- paintInfo.context().drawConsumingImageBuffer(WTFMove(imageBuffer), inflatedRect.location());
+ //paintInfo.context().drawConsumingImageBuffer(WTFMove(imageBuffer), inflatedRect.location());
return false;
}
diff --git a/Source/cmake/OptionsMac.cmake b/Source/cmake/OptionsMac.cmake
index 091152417..a750e9786 100644
--- a/Source/cmake/OptionsMac.cmake
+++ b/Source/cmake/OptionsMac.cmake
@@ -111,11 +111,11 @@ WEBKIT_OPTION_END()
set(ENABLE_GRAPHICS_CONTEXT_3D ON)
set(ENABLE_WEBKIT_LEGACY ON)
-set(ENABLE_WEBKIT ON)
+#set(ENABLE_WEBKIT ON)
set(WebCore_LIBRARY_TYPE SHARED)
set(WebCoreTestSupport_LIBRARY_TYPE SHARED)
set(WebKit_LIBRARY_TYPE SHARED)
add_definitions(-DU_DISABLE_RENAMING=1 -DU_SHOW_CPLUSPLUS_API=0)
-set(ICU_LIBRARIES libicucore.dylib)
+set(ICU_LIBRARIES icucore)
diff --git a/Tools/CMakeLists.txt b/Tools/CMakeLists.txt
index a0d91f705..94906cfc1 100644
--- a/Tools/CMakeLists.txt
+++ b/Tools/CMakeLists.txt
@@ -17,7 +17,7 @@ if ("${PORT}" STREQUAL "GTK")
endif ()
elseif ("${PORT}" STREQUAL "Mac")
add_subdirectory(DumpRenderTree)
- add_subdirectory(WebKitTestRunner)
+ # add_subdirectory(WebKitTestRunner)
add_subdirectory(MiniBrowser/mac)
elseif ("${PORT}" STREQUAL "JSCOnly")
if (ENABLE_API_TESTS)
diff --git a/Tools/Scripts/webkitdirs.pm b/Tools/Scripts/webkitdirs.pm
index a4987a183..0c5941eef 100755
--- a/Tools/Scripts/webkitdirs.pm
+++ b/Tools/Scripts/webkitdirs.pm
@@ -1213,7 +1213,8 @@ sub isWindowsXP()
sub isDarwin()
{
- return ($^O eq "darwin") || 0;
+ #return ($^O eq "darwin") || 0;
+ return 1;
}
sub isWindows()
diff --git a/Tools/WebKitTestRunner/CMakeLists.txt b/Tools/WebKitTestRunner/CMakeLists.txt
index fb7d52339..32f31c2db 100644
--- a/Tools/WebKitTestRunner/CMakeLists.txt
+++ b/Tools/WebKitTestRunner/CMakeLists.txt
@@ -118,4 +118,4 @@ add_dependencies(WebKitTestRunner WebKitTestRunnerBindings)
if (NOT APPLE)
add_dependencies(WebKit2 ${ForwardingHeadersForWebKitTestRunner_NAME})
-endif ()
\ No newline at end of file
+endif ()
--
2.13.3
From 7043c288f3243a36a4fdb08ab33043ec320d3dcc Mon Sep 17 00:00:00 2001
From: Daniel Ferreira <dtf@stanford.edu>
Date: Sat, 19 Aug 2017 21:16:08 +0000
Subject: [PATCH 2/3] Second patch round
---
Source/WTF/wtf/FeatureDefines.h | 32 +++---
Source/WTF/wtf/Platform.h | 2 +-
Source/WTF/wtf/PlatformMac.cmake | 3 +
Source/WTF/wtf/text/cf/TextBreakIteratorCF.h | 15 +--
Source/WebCore/PAL/pal/PlatformMac.cmake | 3 +-
Source/WebCore/PlatformMac.cmake | 44 +++++---
Source/WebCore/editing/cocoa/EditorCocoa.mm | 10 ++
Source/WebCore/editing/cocoa/HTMLConverter.mm | 2 +-
Source/WebCore/editing/mac/DictionaryLookup.mm | 2 +-
Source/WebCore/editing/mac/EditorMac.mm | 8 ++
Source/WebCore/html/HTMLPlugInElement.cpp | 2 +-
Source/WebCore/inspector/InspectorController.cpp | 2 +
Source/WebCore/inspector/InspectorNetworkAgent.cpp | 6 +-
Source/WebCore/loader/ResourceLoader.cpp | 2 +-
Source/WebCore/loader/ResourceLoader.h | 4 +-
Source/WebCore/loader/SubresourceLoader.h | 4 +-
.../loader/archive/cf/LegacyWebArchiveMac.mm | 8 +-
.../WebCore/loader/cocoa/DiskCacheMonitorCocoa.mm | 7 +-
.../WebCore/loader/cocoa/SubresourceLoaderCocoa.mm | 8 +-
Source/WebCore/loader/mac/DocumentLoaderMac.cpp | 2 +-
Source/WebCore/page/DOMWindow.cpp | 4 +-
Source/WebCore/page/MemoryRelease.cpp | 2 +-
Source/WebCore/page/Page.cpp | 6 +-
Source/WebCore/page/mac/EventHandlerMac.mm | 4 +-
Source/WebCore/page/mac/PageMac.mm | 4 +-
Source/WebCore/page/mac/TextIndicatorWindow.mm | 8 +-
.../WebCore/page/mac/WheelEventDeltaFilterMac.mm | 6 +-
Source/WebCore/platform/DragImage.cpp | 3 +
Source/WebCore/platform/ScrollableArea.cpp | 4 +-
.../platform/audio/mac/MediaSessionManagerMac.mm | 5 +
Source/WebCore/platform/cocoa/FileSystemCocoa.mm | 4 +-
.../platform/cocoa/MIMETypeRegistryCocoa.mm | 9 +-
.../cocoa/NetworkExtensionContentFilter.mm | 8 +-
.../cocoa/ParentalControlsContentFilter.mm | 2 +-
.../graphics/ca/cocoa/PlatformCALayerCocoa.mm | 2 +
.../WebCore/platform/graphics/cg/UTIRegistry.cpp | 7 +-
.../WebCore/platform/gtk/LocalizedStringsGtk.cpp | 2 +
Source/WebCore/platform/mac/BlacklistUpdater.mm | 6 ++
Source/WebCore/platform/mac/PlatformScreenMac.mm | 5 +-
Source/WebCore/platform/mac/PluginBlacklist.mm | 5 +-
Source/WebCore/platform/mac/ScrollbarThemeMac.mm | 53 ++++-----
Source/WebCore/platform/mac/ThemeMac.mm | 2 +-
.../mac/WebCoreFullScreenPlaceholderView.mm | 9 +-
.../WebCore/platform/mac/WebCoreNSStringExtras.mm | 5 +-
Source/WebCore/platform/mac/WidgetMac.mm | 2 +
Source/WebCore/platform/network/Cookie.cpp | 2 +-
Source/WebCore/platform/network/Credential.h | 2 +-
.../platform/network/NetworkStateNotifier.cpp | 2 +-
.../platform/network/NetworkStorageSession.h | 2 +-
.../platform/network/ProtectionSpaceBase.cpp | 3 +-
.../platform/network/ResourceHandleClient.cpp | 2 +-
.../platform/network/ResourceHandleClient.h | 4 +-
.../platform/network/cocoa/ResourceRequestCocoa.mm | 14 +--
.../network/cocoa/ResourceResponseCocoa.mm | 10 +-
.../platform/network/mac/ResourceErrorMac.mm | 2 +-
.../platform/network/soup/ResourceErrorSoup.cpp | 6 +-
Source/WebCore/platform/spi/cg/CoreGraphicsSPI.h | 4 +-
Source/WebCore/platform/spi/cocoa/CoreTextSPI.h | 2 +-
Source/WebCore/platform/spi/cocoa/QuartzCoreSPI.h | 4 +-
Source/WebCore/rendering/RenderTheme.h | 2 +-
Source/WebCore/rendering/RenderThemeIOS.h | 2 +-
Source/WebCore/rendering/RenderThemeIOS.mm | 4 +-
Source/WebCore/rendering/RenderThemeMac.h | 2 +-
Source/WebCore/rendering/RenderThemeMac.mm | 4 +-
Source/WebCore/testing/Internals.cpp | 2 +-
Source/WebKitLegacy/PlatformMac.cmake | 120 ++++++++++-----------
.../cf/WebCoreSupport/WebInspectorClientCF.cpp | 4 +-
Source/WebKitLegacy/mac/DOM/DOM.mm | 10 ++
Source/WebKitLegacy/mac/DOM/DOMPrivate.h | 4 +-
Source/WebKitLegacy/mac/Misc/WebCache.mm | 11 ++
Source/WebKitLegacy/mac/Misc/WebDownload.mm | 4 +-
Source/WebKitLegacy/mac/Misc/WebIconDatabase.h | 2 +-
Source/WebKitLegacy/mac/Misc/WebIconDatabase.mm | 1 +
.../WebKitLegacy/mac/Misc/WebKitNSStringExtras.mm | 2 +-
.../WebKitLegacy/mac/Misc/WebKitVersionChecks.mm | 10 ++
.../WebApplicationCacheQuotaManager.mm | 8 +-
.../mac/WebCoreSupport/WebContextMenuClient.mm | 2 +-
.../mac/WebCoreSupport/WebEditorClient.mm | 2 +-
.../mac/WebCoreSupport/WebFrameLoaderClient.mm | 4 +
.../mac/WebCoreSupport/WebInspectorClient.mm | 2 +-
Source/WebKitLegacy/mac/WebView/WebArchive.mm | 4 +
Source/WebKitLegacy/mac/WebView/WebDataSource.mm | 12 +++
Source/WebKitLegacy/mac/WebView/WebFrame.mm | 19 ++++
Source/WebKitLegacy/mac/WebView/WebFramePrivate.h | 1 +
Source/WebKitLegacy/mac/WebView/WebFrameView.mm | 5 +-
.../mac/WebView/WebHTMLRepresentation.mm | 2 +
Source/WebKitLegacy/mac/WebView/WebHTMLView.mm | 74 +++++++++----
.../mac/WebView/WebImmediateActionController.h | 4 +-
.../mac/WebView/WebImmediateActionController.mm | 46 ++++----
Source/WebKitLegacy/mac/WebView/WebPDFView.h | 2 +-
Source/WebKitLegacy/mac/WebView/WebPreferences.mm | 29 +++--
.../mac/WebView/WebPreferencesPrivate.h | 6 +-
Source/WebKitLegacy/mac/WebView/WebView.mm | 46 +++++---
Source/WebKitLegacy/mac/WebView/WebViewPrivate.h | 1 +
Tools/CMakeLists.txt | 2 +-
Tools/DumpRenderTree/mac/FrameLoadDelegate.mm | 1 +
Tools/DumpRenderTree/mac/UIScriptControllerMac.mm | 1 +
WebKitLibraries/WebKitSystemInterface.h | 8 +-
98 files changed, 545 insertions(+), 312 deletions(-)
diff --git a/Source/WTF/wtf/FeatureDefines.h b/Source/WTF/wtf/FeatureDefines.h
index d389a1fa1..da9ca0265 100644
--- a/Source/WTF/wtf/FeatureDefines.h
+++ b/Source/WTF/wtf/FeatureDefines.h
@@ -174,31 +174,31 @@ the public iOS SDK. We will also need to update the FeatureDefines.xcconfig file
#if PLATFORM(MAC)
#if !defined(ENABLE_CONTENT_EXTENSIONS)
-#define ENABLE_CONTENT_EXTENSIONS 1
+#define ENABLE_CONTENT_EXTENSIONS 0
#endif
#if !defined(ENABLE_DASHBOARD_SUPPORT)
-#define ENABLE_DASHBOARD_SUPPORT 1
+#define ENABLE_DASHBOARD_SUPPORT 0
#endif
#if !defined(ENABLE_FULLSCREEN_API)
-#define ENABLE_FULLSCREEN_API 1
+#define ENABLE_FULLSCREEN_API 0
#endif
#if !defined(ENABLE_REMOTE_INSPECTOR)
-#define ENABLE_REMOTE_INSPECTOR 1
+#define ENABLE_REMOTE_INSPECTOR 0
#endif
#if !defined(ENABLE_INSPECTOR_ALTERNATE_DISPATCHERS)
-#define ENABLE_INSPECTOR_ALTERNATE_DISPATCHERS 1
+#define ENABLE_INSPECTOR_ALTERNATE_DISPATCHERS 0
#endif
#if !defined(ENABLE_SMOOTH_SCROLLING)
-#define ENABLE_SMOOTH_SCROLLING 1
+#define ENABLE_SMOOTH_SCROLLING 0
#endif
#if !defined(ENABLE_ASYNC_SCROLLING)
-#define ENABLE_ASYNC_SCROLLING 1
+#define ENABLE_ASYNC_SCROLLING 0
#endif
#if ENABLE(VIDEO)
@@ -216,31 +216,31 @@ the public iOS SDK. We will also need to update the FeatureDefines.xcconfig file
#endif
#if !defined(ENABLE_WEB_ARCHIVE)
-#define ENABLE_WEB_ARCHIVE 1
+#define ENABLE_WEB_ARCHIVE 0
#endif
#if !defined(ENABLE_WEB_AUDIO)
-#define ENABLE_WEB_AUDIO 1
+#define ENABLE_WEB_AUDIO 0
#endif
#if !defined(ENABLE_CURSOR_VISIBILITY)
-#define ENABLE_CURSOR_VISIBILITY 1
+#define ENABLE_CURSOR_VISIBILITY 0
#endif
#if !defined(ENABLE_INPUT_TYPE_COLOR)
-#define ENABLE_INPUT_TYPE_COLOR 1
+#define ENABLE_INPUT_TYPE_COLOR 0
#endif
#if !defined(ENABLE_INPUT_TYPE_COLOR_POPOVER)
-#define ENABLE_INPUT_TYPE_COLOR_POPOVER 1
+#define ENABLE_INPUT_TYPE_COLOR_POPOVER 0
#endif
#if !defined(ENABLE_PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC)
-#define ENABLE_PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC 1
+#define ENABLE_PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC 0
#endif
#if !defined(ENABLE_MAC_GESTURE_EVENTS) && USE(APPLE_INTERNAL_SDK)
-#define ENABLE_MAC_GESTURE_EVENTS 1
+#define ENABLE_MAC_GESTURE_EVENTS 0
#endif
#endif /* PLATFORM(MAC) */
@@ -252,11 +252,11 @@ the public iOS SDK. We will also need to update the FeatureDefines.xcconfig file
#endif
#if !defined(ENABLE_LEGACY_ENCRYPTED_MEDIA)
-#define ENABLE_LEGACY_ENCRYPTED_MEDIA 1
+#define ENABLE_LEGACY_ENCRYPTED_MEDIA 0
#endif
#if !defined(ENABLE_FILE_REPLACEMENT)
-#define ENABLE_FILE_REPLACEMENT 1
+#define ENABLE_FILE_REPLACEMENT 0
#endif
#if !defined(ENABLE_KEYBOARD_KEY_ATTRIBUTE)
diff --git a/Source/WTF/wtf/Platform.h b/Source/WTF/wtf/Platform.h
index 566d986d2..73b19c284 100644
--- a/Source/WTF/wtf/Platform.h
+++ b/Source/WTF/wtf/Platform.h
@@ -1017,7 +1017,7 @@
#endif
#if PLATFORM(COCOA)
-#define USE_PROTECTION_SPACE_AUTH_CALLBACK 1
+#define USE_PROTECTION_SPACE_AUTH_CALLBACK 0
#endif
#if PLATFORM(COCOA) && HAVE(ACCESSIBILITY)
diff --git a/Source/WTF/wtf/PlatformMac.cmake b/Source/WTF/wtf/PlatformMac.cmake
index df8777ac3..6538f96b4 100644
--- a/Source/WTF/wtf/PlatformMac.cmake
+++ b/Source/WTF/wtf/PlatformMac.cmake
@@ -37,12 +37,15 @@ list(APPEND WTF_SOURCES
text/mac/StringImplMac.mm
text/mac/StringMac.mm
text/mac/StringViewObjC.mm
+
+ glib/GRefPtr.cpp
)
if (WTF_LINUX)
list(APPEND WTF_SOURCES
linux/MemoryFootprintLinux.cpp
linux/MemoryPressureHandlerLinux.cpp
+ linux/CurrentProcessMemoryStatus.cpp
unix/CPUTimeUnix.cpp
)
else (WTF_LINUX)
diff --git a/Source/WTF/wtf/text/cf/TextBreakIteratorCF.h b/Source/WTF/wtf/text/cf/TextBreakIteratorCF.h
index 27e50bce5..1c0888092 100644
--- a/Source/WTF/wtf/text/cf/TextBreakIteratorCF.h
+++ b/Source/WTF/wtf/text/cf/TextBreakIteratorCF.h
@@ -63,24 +63,27 @@ public:
auto length = static_cast<unsigned long>(CFStringGetLength(m_string.get()));
if (location > length)
return length;
- auto range = CFStringGetRangeOfCharacterClusterAtIndex(m_string.get(), location - 1, m_type);
- return range.location;
+ //auto range = CFStringGetRangeOfCharacterClusterAtIndex(m_string.get(), location - 1, m_type);
+ //return range.location;
+ return {};
}
std::optional<unsigned> following(unsigned location) const
{
if (location >= static_cast<unsigned long>(CFStringGetLength(m_string.get())))
return { };
- auto range = CFStringGetRangeOfCharacterClusterAtIndex(m_string.get(), location, m_type);
- return range.location + range.length;
+ //auto range = CFStringGetRangeOfCharacterClusterAtIndex(m_string.get(), location, m_type);
+ //return range.location + range.length;
+ return {};
}
bool isBoundary(unsigned location) const
{
if (location == static_cast<unsigned long>(CFStringGetLength(m_string.get())))
return true;
- auto range = CFStringGetRangeOfCharacterClusterAtIndex(m_string.get(), location, m_type);
- return static_cast<unsigned long>(range.location) == location;
+ //auto range = CFStringGetRangeOfCharacterClusterAtIndex(m_string.get(), location, m_type);
+ //return static_cast<unsigned long>(range.location) == location;
+ return false;
}
private:
diff --git a/Source/WebCore/PAL/pal/PlatformMac.cmake b/Source/WebCore/PAL/pal/PlatformMac.cmake
index 7323b5d0a..0eb3ca2d8 100644
--- a/Source/WebCore/PAL/pal/PlatformMac.cmake
+++ b/Source/WebCore/PAL/pal/PlatformMac.cmake
@@ -4,5 +4,6 @@ list(APPEND PAL_SOURCES
system/mac/SoundMac.mm
- text/mac/KillRingMac.mm
+ #text/mac/KillRingMac.mm
+ text/KillRingNone.cpp
)
diff --git a/Source/WebCore/PlatformMac.cmake b/Source/WebCore/PlatformMac.cmake
index dd4955848..497e489a3 100644
--- a/Source/WebCore/PlatformMac.cmake
+++ b/Source/WebCore/PlatformMac.cmake
@@ -45,9 +45,17 @@ list(APPEND WebCore_LIBRARIES
${SECURITY_LIBRARY}
${SQLITE3_LIBRARY}
${SYSTEMCONFIGURATION_LIBRARY}
- ${WEBKITSYSTEMINTERFACE_LIBRARY}
+ #${WEBKITSYSTEMINTERFACE_LIBRARY}
${XML2_LIBRARY}
${ZLIB_LIBRARIES}
+ opal
+ QuartzCore
+ soup-2.4
+ glib-2.0
+ gio-2.0
+ gobject-2.0
+ gcrypt
+ bsd
)
add_definitions(-iframework ${APPLICATIONSERVICES_LIBRARY}/Versions/Current/Frameworks)
@@ -113,6 +121,7 @@ list(APPEND WebCore_INCLUDE_DIRECTORIES
"${WEBCORE_DIR}/platform/graphics/mac"
"${WEBCORE_DIR}/platform/mac"
"${WEBCORE_DIR}/platform/mediastream/mac"
+ "${WEBCORE_DIR}/platform/network"
"${WEBCORE_DIR}/platform/network/cocoa"
#"${WEBCORE_DIR}/platform/network/cf"
#"${WEBCORE_DIR}/platform/network/ios"
@@ -225,25 +234,28 @@ list(APPEND WebCore_SOURCES
history/mac/HistoryItemMac.mm
- loader/ResourceLoadInfo.cpp
+ #loader/ResourceLoadInfo.cpp
- loader/archive/cf/LegacyWebArchive.cpp
- loader/archive/cf/LegacyWebArchiveMac.mm
+ #loader/archive/cf/LegacyWebArchive.cpp
+ #loader/archive/cf/LegacyWebArchiveMac.mm
- loader/cocoa/DiskCacheMonitorCocoa.mm
- loader/cocoa/SubresourceLoaderCocoa.mm
+ #loader/cocoa/DiskCacheMonitorCocoa.mm
+ #loader/cocoa/SubresourceLoaderCocoa.mm
- loader/cf/ResourceLoaderCFNet.cpp
+ #loader/cf/ResourceLoaderCFNet.cpp