Diff
Modified: trunk/Source/WebCore/ChangeLog (222843 => 222844)
--- trunk/Source/WebCore/ChangeLog 2017-10-04 13:51:19 UTC (rev 222843)
+++ trunk/Source/WebCore/ChangeLog 2017-10-04 14:07:19 UTC (rev 222844)
@@ -1,3 +1,20 @@
+2017-10-04 Michael Catanzaro <[email protected]>
+
+ [GTK] GtkUtilities.h should not be included in libs not linked to GTK
+ https://bugs.webkit.org/show_bug.cgi?id=177860
+
+ Reviewed by Carlos Garcia Campos.
+
+ * platform/FreeType.cmake:
+ * platform/gtk/GtkUtilities.cpp:
+ (WebCore::topLevelPath): Deleted.
+ (WebCore::webkitBuildDirectory): Deleted.
+ * platform/gtk/GtkUtilities.h:
+ (WebCore::wallTimeForEvent):
+ * platform/text/hyphen/HyphenationLibHyphen.cpp:
+ (WebCore::topLevelPath):
+ (WebCore::webkitBuildDirectory):
+
2017-10-04 Carlos Garcia Campos <[email protected]>
[Harfbuzz] Implement ComplexTextController on top of HarfBuzz
Modified: trunk/Source/WebCore/platform/FreeType.cmake (222843 => 222844)
--- trunk/Source/WebCore/platform/FreeType.cmake 2017-10-04 13:51:19 UTC (rev 222843)
+++ trunk/Source/WebCore/platform/FreeType.cmake 2017-10-04 14:07:19 UTC (rev 222844)
@@ -7,7 +7,6 @@
)
list(APPEND WebCore_SOURCES
- platform/graphics/freetype/FontCacheFreeType.cpp
platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp
platform/graphics/freetype/FontPlatformDataFreeType.cpp
platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp
@@ -17,6 +16,16 @@
platform/graphics/harfbuzz/HarfBuzzFace.cpp
)
+if (PORT STREQUAL "GTK")
+ list(APPEND WebCorePlatformGTK_SOURCES
+ platform/graphics/freetype/FontCacheFreeType.cpp
+)
+else ()
+ list(APPEND WebCore_SOURCES
+ platform/graphics/freetype/FontCacheFreeType.cpp
+)
+endif ()
+
if (USE_CAIRO)
list(APPEND WebCore_SOURCES
platform/graphics/cairo/FontCairoHarfbuzzNG.cpp
Modified: trunk/Source/WebCore/platform/gtk/GtkUtilities.cpp (222843 => 222844)
--- trunk/Source/WebCore/platform/gtk/GtkUtilities.cpp 2017-10-04 13:51:19 UTC (rev 222843)
+++ trunk/Source/WebCore/platform/gtk/GtkUtilities.cpp 2017-10-04 14:07:19 UTC (rev 222844)
@@ -21,7 +21,6 @@
#include "IntPoint.h"
#include <gtk/gtk.h>
-#include <wtf/glib/GLibUtilities.h>
#include <wtf/glib/GUniquePtr.h>
namespace WebCore {
@@ -78,30 +77,4 @@
return String::fromUTF8(fontString.get());
}
-#if ENABLE(DEVELOPER_MODE)
-static CString topLevelPath()
-{
- if (const char* topLevelDirectory = g_getenv("WEBKIT_TOP_LEVEL"))
- return topLevelDirectory;
-
- // If the environment variable wasn't provided then assume we were built into
- // WebKitBuild/Debug or WebKitBuild/Release. Obviously this will fail if the build
- // directory is non-standard, but we can't do much more about this.
- GUniquePtr<char> parentPath(g_path_get_dirname(getCurrentExecutablePath().data()));
- GUniquePtr<char> layoutTestsPath(g_build_filename(parentPath.get(), "..", "..", "..", nullptr));
- GUniquePtr<char> absoluteTopLevelPath(realpath(layoutTestsPath.get(), 0));
- return absoluteTopLevelPath.get();
-}
-
-CString webkitBuildDirectory()
-{
- const char* webkitOutputDir = g_getenv("WEBKIT_OUTPUTDIR");
- if (webkitOutputDir)
- return webkitOutputDir;
-
- GUniquePtr<char> outputDir(g_build_filename(topLevelPath().data(), "WebKitBuild", nullptr));
- return outputDir.get();
-}
-#endif
-
} // namespace WebCore
Modified: trunk/Source/WebCore/platform/gtk/GtkUtilities.h (222843 => 222844)
--- trunk/Source/WebCore/platform/gtk/GtkUtilities.h 2017-10-04 13:51:19 UTC (rev 222843)
+++ trunk/Source/WebCore/platform/gtk/GtkUtilities.h 2017-10-04 14:07:19 UTC (rev 222844)
@@ -19,6 +19,7 @@
#ifndef GtkUtilities_h
#define GtkUtilities_h
+#include <gtk/gtk.h>
#include <wtf/MonotonicTime.h>
#include <wtf/WallTime.h>
#include <wtf/text/CString.h>
@@ -34,10 +35,7 @@
template<typename GdkEventType>
WallTime wallTimeForEvent(const GdkEventType* event)
{
- // FIXME: 0 is GDK_CURRENT_TIME. We should stop including this header from
- // HyphenationLibHyphen.cpp so that we can include gtk/gtk.h here and use
- // GDK_CURRENT_TIME.
- if (event->time == 0)
+ if (event->time == GDK_CURRENT_TIME)
return WallTime::now();
return MonotonicTime::fromRawSeconds(event->time / 1000.).approximateWallTime();
}
@@ -47,10 +45,6 @@
String defaultGtkSystemFont();
-#if ENABLE(DEVELOPER_MODE)
-CString webkitBuildDirectory();
-#endif
-
} // namespace WebCore
#endif // GtkUtilities_h
Modified: trunk/Source/WebCore/platform/text/hyphen/HyphenationLibHyphen.cpp (222843 => 222844)
--- trunk/Source/WebCore/platform/text/hyphen/HyphenationLibHyphen.cpp 2017-10-04 13:51:19 UTC (rev 222843)
+++ trunk/Source/WebCore/platform/text/hyphen/HyphenationLibHyphen.cpp 2017-10-04 14:07:19 UTC (rev 222844)
@@ -36,15 +36,12 @@
#include <wtf/HashMap.h>
#include <wtf/NeverDestroyed.h>
#include <wtf/TinyLRUCache.h>
+#include <wtf/glib/GLibUtilities.h>
+#include <wtf/glib/GUniquePtr.h>
#include <wtf/text/AtomicStringHash.h>
#include <wtf/text/CString.h>
#include <wtf/text/StringView.h>
-#if PLATFORM(GTK)
-#include "GtkUtilities.h"
-#include <wtf/glib/GUniquePtr.h>
-#endif
-
namespace WebCore {
static const char* const gDictionaryDirectories[] = {
@@ -88,6 +85,30 @@
}
#if ENABLE(DEVELOPER_MODE)
+static CString topLevelPath()
+{
+ if (const char* topLevelDirectory = g_getenv("WEBKIT_TOP_LEVEL"))
+ return topLevelDirectory;
+
+ // If the environment variable wasn't provided then assume we were built into
+ // WebKitBuild/Debug or WebKitBuild/Release. Obviously this will fail if the build
+ // directory is non-standard, but we can't do much more about this.
+ GUniquePtr<char> parentPath(g_path_get_dirname(getCurrentExecutablePath().data()));
+ GUniquePtr<char> layoutTestsPath(g_build_filename(parentPath.get(), "..", "..", "..", nullptr));
+ GUniquePtr<char> absoluteTopLevelPath(realpath(layoutTestsPath.get(), 0));
+ return absoluteTopLevelPath.get();
+}
+
+static CString webkitBuildDirectory()
+{
+ const char* webkitOutputDir = g_getenv("WEBKIT_OUTPUTDIR");
+ if (webkitOutputDir)
+ return webkitOutputDir;
+
+ GUniquePtr<char> outputDir(g_build_filename(topLevelPath().data(), "WebKitBuild", nullptr));
+ return outputDir.get();
+}
+
static void scanTestDictionariesDirectoryIfNecessary(HashMap<AtomicString, Vector<String>>& availableLocales)
{
// It's unfortunate that we need to look for the dictionaries this way, but