Bug 1575420 - Replace MOZ_WIDGET_TOOLKIT value of "gtk3" with "gtk". r=froydnj
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 21 Aug 2019 12:25:42 +0000
changeset 489301 51bf6a97396d96ddb82fa91c2cf9bd9f5bc9ae06
parent 489300 3148126492b506f3bf55475aa381fbd77ac7b8f9
child 489302 d66eea07487a361163fd0a49e4b965e2ec729219
push id36468
push useraciure@mozilla.com
push dateThu, 22 Aug 2019 04:04:03 +0000
treeherdermozilla-central@efe4a620841c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1575420
milestone70.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1575420 - Replace MOZ_WIDGET_TOOLKIT value of "gtk3" with "gtk". r=froydnj Differential Revision: https://phabricator.services.mozilla.com/D42765
accessible/aom/moz.build
accessible/atk/moz.build
accessible/base/moz.build
accessible/generic/moz.build
accessible/html/moz.build
accessible/ipc/moz.build
accessible/ipc/other/moz.build
accessible/moz.build
accessible/xpcom/moz.build
accessible/xul/moz.build
browser/base/content/browser-tabsintitlebar.js
browser/base/content/test/contextMenu/browser.ini
browser/base/content/test/plugins/browser-rs-blocklist.ini
browser/base/content/test/plugins/browser.ini
browser/base/moz.build
browser/branding/branding-common.mozbuild
browser/components/build/components.conf
browser/components/preferences/in-content/moz.build
browser/components/preferences/moz.build
browser/components/shell/moz.build
browser/installer/Makefile.in
browser/installer/package-manifest.in
browser/themes/moz.build
chrome/moz.build
config/recurse.mk
dom/geolocation/moz.build
dom/ipc/tests/mochitest.ini
dom/moz.build
dom/plugins/ipc/moz.build
dom/plugins/test/mochitest/mochitest.ini
dom/plugins/test/moz.build
dom/plugins/test/testplugin/testplugin.mozbuild
dom/system/moz.build
dom/xbl/builtin/moz.build
gfx/2d/moz.build
gfx/cairo/cairo/src/moz.build
gfx/gl/moz.build
gfx/harfbuzz/src/moz.build
gfx/skia/generate_mozbuild.py
gfx/skia/moz.build
gfx/src/moz.build
gfx/thebes/moz.build
gfx/webrender_bindings/moz.build
image/decoders/icon/moz.build
image/decoders/moz.build
intl/locale/moz.build
intl/lwbrk/moz.build
ipc/chromium/moz.build
layout/base/tests/mochitest.ini
layout/generic/moz.build
layout/generic/test/mochitest.ini
layout/reftests/bidi/reftest.list
layout/reftests/scrolling/reftest.list
layout/reftests/xul/reftest.list
layout/tools/reftest/manifest.jsm
netwerk/build/moz.build
netwerk/protocol/moz.build
old-configure.in
python/mozbuild/mozbuild/test/test_mozinfo.py
security/manager/ssl/moz.build
security/sandbox/linux/broker/moz.build
testing/mozbase/manifestparser/tests/test_testmanifest.py
testing/tools/screenshot/moz.build
toolkit/components/remote/moz.build
toolkit/crashreporter/client/moz.build
toolkit/library/moz.build
toolkit/locales/moz.build
toolkit/modules/moz.build
toolkit/moz.build
toolkit/moz.configure
toolkit/mozapps/installer/upload-files.mk
toolkit/mozapps/update/updater/moz.build
toolkit/mozapps/update/updater/updater-common.build
toolkit/themes/moz.build
toolkit/toolkit.mozbuild
toolkit/xre/moz.build
uriloader/exthandler/moz.build
widget/gtk/moz.build
widget/headless/moz.build
widget/headless/tests/xpcshell.ini
widget/moz.build
widget/tests/chrome.ini
xpcom/base/moz.build
xpcom/components/moz.build
xpcom/glue/standalone/moz.build
--- a/accessible/aom/moz.build
+++ b/accessible/aom/moz.build
@@ -12,17 +12,17 @@ UNIFIED_SOURCES += [
     'AccessibleNode.cpp',
 ]
 
 LOCAL_INCLUDES += [
     '/accessible/base',
     '/accessible/generic',
 ]
 
-if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
     LOCAL_INCLUDES += [
         '/accessible/atk',
     ]
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
     LOCAL_INCLUDES += [
         '/accessible/windows/ia2',
         '/accessible/windows/msaa',
     ]
--- a/accessible/atk/moz.build
+++ b/accessible/atk/moz.build
@@ -41,17 +41,17 @@ LOCAL_INCLUDES += [
     '/accessible/ipc/other',
     '/accessible/xpcom',
     '/accessible/xul',
     '/other-licenses/atk-1.0',
 ]
 
 FINAL_LIBRARY = 'xul'
 
-if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
     CFLAGS += CONFIG['TK_CFLAGS']
     CXXFLAGS += CONFIG['TK_CFLAGS']
 
 if CONFIG['MOZ_ENABLE_DBUS']:
     CXXFLAGS += CONFIG['MOZ_DBUS_CFLAGS']
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
--- a/accessible/base/moz.build
+++ b/accessible/base/moz.build
@@ -85,17 +85,17 @@ LOCAL_INCLUDES += [
     '/ipc/chromium/src',
     '/layout/generic',
     '/layout/style',
     '/layout/svg',
     '/layout/xul',
     '/layout/xul/tree/',
 ]
 
-if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
     LOCAL_INCLUDES += [
         '/accessible/atk',
     ]
     CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
     LOCAL_INCLUDES += [
         '/accessible/windows/ia2',
         '/accessible/windows/msaa',
--- a/accessible/generic/moz.build
+++ b/accessible/generic/moz.build
@@ -42,17 +42,17 @@ if CONFIG['OS_ARCH'] == 'WINNT':
     LOCAL_INCLUDES += [
         '/accessible/ipc/win',
     ]
 else:
     LOCAL_INCLUDES += [
         '/accessible/ipc/other',
     ]
 
-if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
     LOCAL_INCLUDES += [
         '/accessible/atk',
     ]
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
     LOCAL_INCLUDES += [
         '/accessible/windows/ia2',
         '/accessible/windows/msaa',
     ]
--- a/accessible/html/moz.build
+++ b/accessible/html/moz.build
@@ -20,17 +20,17 @@ LOCAL_INCLUDES += [
     '/accessible/generic',
     '/accessible/xpcom',
     '/layout/forms',
     '/layout/generic',
     '/layout/tables',
     '/layout/xul',
 ]
 
-if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
     LOCAL_INCLUDES += [
         '/accessible/atk',
     ]
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
     LOCAL_INCLUDES += [
         '/accessible/windows/ia2',
         '/accessible/windows/msaa',
     ]
--- a/accessible/ipc/moz.build
+++ b/accessible/ipc/moz.build
@@ -11,17 +11,17 @@ if CONFIG['OS_ARCH'] == 'WINNT':
         '/accessible/windows/ia2',
         '/accessible/windows/msaa',
     ]
 else:
     DIRS += ['other']
     LOCAL_INCLUDES += [
         '/accessible/ipc/other',
     ]
-    if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
+    if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
         LOCAL_INCLUDES += [
             '/accessible/atk',
         ]
     elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
         LOCAL_INCLUDES += [
             '/accessible/mac',
         ]
     elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
--- a/accessible/ipc/other/moz.build
+++ b/accessible/ipc/other/moz.build
@@ -20,17 +20,17 @@ if CONFIG['ACCESSIBILITY']:
     ]
 
     LOCAL_INCLUDES += [
         '../../base',
         '../../generic',
         '../../xpcom',
     ]
 
-    if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
+    if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
         LOCAL_INCLUDES += [
             '/accessible/atk',
         ]
     elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
         LOCAL_INCLUDES += [
             '/accessible/mac',
         ]
     elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
--- a/accessible/moz.build
+++ b/accessible/moz.build
@@ -1,17 +1,17 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 toolkit = CONFIG['MOZ_WIDGET_TOOLKIT']
 
-if 'gtk' in toolkit:
+if toolkit == 'gtk':
     DIRS += ['atk']
 elif toolkit == 'windows':
     DIRS += ['windows']
 elif toolkit == 'cocoa':
     DIRS += ['mac']
 elif toolkit == 'android':
     DIRS += ['android']
 else:
--- a/accessible/xpcom/moz.build
+++ b/accessible/xpcom/moz.build
@@ -30,17 +30,17 @@ EXPORTS += [
     'xpcAccessibilityService.h',
 ]
 
 LOCAL_INCLUDES += [
     '/accessible/base',
     '/accessible/generic',
 ]
 
-if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
     LOCAL_INCLUDES += [
         '/accessible/atk',
     ]
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
     LOCAL_INCLUDES += [
         '/accessible/windows/msaa',
     ]
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
--- a/accessible/xul/moz.build
+++ b/accessible/xul/moz.build
@@ -24,17 +24,17 @@ LOCAL_INCLUDES += [
     '/accessible/xpcom',
     '/dom/base',
     '/dom/xul',
     '/layout/generic',
     '/layout/xul',
     '/layout/xul/tree',
 ]
 
-if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
     LOCAL_INCLUDES += [
         '/accessible/atk',
     ]
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
     LOCAL_INCLUDES += [
         '/accessible/windows/ia2',
         '/accessible/windows/msaa',
     ]
--- a/browser/base/content/browser-tabsintitlebar.js
+++ b/browser/base/content/browser-tabsintitlebar.js
@@ -31,17 +31,17 @@ var TabsInTitlebar;
 
     get systemSupported() {
       let isSupported = false;
       switch (AppConstants.MOZ_WIDGET_TOOLKIT) {
         case "windows":
         case "cocoa":
           isSupported = true;
           break;
-        case "gtk3":
+        case "gtk":
           isSupported = window.matchMedia("(-moz-gtk-csd-available)").matches;
           break;
       }
       delete this.systemSupported;
       return (this.systemSupported = isSupported);
     },
 
     get enabled() {
--- a/browser/base/content/test/contextMenu/browser.ini
+++ b/browser/base/content/test/contextMenu/browser.ini
@@ -18,11 +18,11 @@ skip-if = true # Bug 1424433, disable du
 support-files =
   test_contextmenu_iframe.html
 [browser_utilityOverlay.js]
 skip-if = os == "linux" || os == "mac" #Bug 1444631
 [browser_utilityOverlayPrincipal.js]
 [browser_contextmenu_childprocess.js]
 [browser_contextmenu.js]
 tags = fullscreen clipboard
-skip-if = toolkit == "gtk3" || verify || (os == "win" && processor == "aarch64") # disabled on Linux due to bug 513558, aarch64 due to 1531590
+skip-if = toolkit == "gtk" || verify || (os == "win" && processor == "aarch64") # disabled on Linux due to bug 513558, aarch64 due to 1531590
 [browser_contextmenu_input.js]
-skip-if = toolkit == "gtk3" || (os == "win" && processor == "aarch64") # disabled on Linux due to bug 513558, aarch64 due to 1533161
+skip-if = toolkit == "gtk" || (os == "win" && processor == "aarch64") # disabled on Linux due to bug 513558, aarch64 due to 1533161
--- a/browser/base/content/test/plugins/browser-rs-blocklist.ini
+++ b/browser/base/content/test/plugins/browser-rs-blocklist.ini
@@ -34,17 +34,17 @@ support-files =
   plugin_two_types.html
   plugin_unknown.html
   plugin_zoom.html
 
 [browser_bug743421.js]
 [browser_bug812562.js]
 [browser_clearplugindata.js]
 [browser_CTP_context_menu.js]
-skip-if = fission || toolkit == "gtk3"   # fails intermittently on Linux (bug 909342)
+skip-if = fission || toolkit == "gtk"   # fails intermittently on Linux (bug 909342)
 [browser_CTP_crashreporting.js]
 skip-if = !crashreporter || verify || os == 'win' # bug 1442837
 [browser_CTP_drag_drop.js]
 [browser_CTP_hide_overlay.js]
 [browser_CTP_iframe.js]
 skip-if = os == 'win' && !debug # Bug 1519868
 [browser_CTP_nonplugins.js]
 skip-if = verify
--- a/browser/base/content/test/plugins/browser.ini
+++ b/browser/base/content/test/plugins/browser.ini
@@ -52,17 +52,17 @@ fail-if = fission
 [browser_bug787619.js]
 [browser_bug797677.js]
 [browser_bug812562.js]
 tags = blocklist
 [browser_bug818118.js]
 [browser_clearplugindata.js]
 tags = blocklist
 [browser_CTP_context_menu.js]
-skip-if = fission || toolkit == "gtk3"   # fails intermittently on Linux (bug 909342)
+skip-if = fission || toolkit == "gtk"   # fails intermittently on Linux (bug 909342)
 tags = blocklist
 [browser_CTP_crashreporting.js]
 skip-if = !crashreporter || verify || os == 'win' # bug 1442837
 tags = blocklist
 [browser_CTP_drag_drop.js]
 tags = blocklist
 [browser_CTP_favorfallback.js]
 [browser_CTP_hide_overlay.js]
--- a/browser/base/moz.build
+++ b/browser/base/moz.build
@@ -59,15 +59,15 @@ BROWSER_CHROME_MANIFESTS += [
     'content/test/webrtc/browser.ini',
 ]
 
 DEFINES['MOZ_APP_VERSION'] = CONFIG['MOZ_APP_VERSION']
 DEFINES['MOZ_APP_VERSION_DISPLAY'] = CONFIG['MOZ_APP_VERSION_DISPLAY']
 
 DEFINES['APP_LICENSE_BLOCK'] = '%s/content/overrides/app-license.html' % SRCDIR
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'gtk3', 'cocoa'):
+if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'gtk', 'cocoa'):
     DEFINES['CONTEXT_COPY_IMAGE_CONTENTS'] = 1
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'gtk3'):
+if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'gtk'):
     DEFINES['MENUBAR_CAN_AUTOHIDE'] = 1
 
 JAR_MANIFESTS += ['jar.mn']
--- a/browser/branding/branding-common.mozbuild
+++ b/browser/branding/branding-common.mozbuild
@@ -18,16 +18,16 @@ def FirefoxBranding():
     if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
         FINAL_TARGET_FILES['..'] += [
             'firefox.VisualElementsManifest.xml',
         ]
         FINAL_TARGET_FILES.VisualElements += [
             'VisualElements_150.png',
             'VisualElements_70.png',
         ]
-    elif 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
+    elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
         FINAL_TARGET_FILES.chrome.icons.default += [
             'default128.png',
             'default16.png',
             'default32.png',
             'default48.png',
             'default64.png',
         ]
--- a/browser/components/build/components.conf
+++ b/browser/components/build/components.conf
@@ -16,17 +16,17 @@ Classes = [
 
 TOOLKIT = buildconfig.substs['MOZ_WIDGET_TOOLKIT']
 
 shell_service_contracts = [
     '@mozilla.org/browser/shell-service;1',
     '@mozilla.org/toolkit/shell-service;1',
 ]
 
-if TOOLKIT == 'gtk3':
+if TOOLKIT == 'gtk':
     Classes += [
         {
             'cid': '{63c7b9f4-0cc8-43f8-b666-0a661655cb73}',
             'contract_ids': shell_service_contracts,
             'type': 'nsGNOMEShellService',
             'headers': ['/browser/components/shell/nsGNOMEShellService.h'],
             'init_method': 'Init',
         },
--- a/browser/components/preferences/in-content/moz.build
+++ b/browser/components/preferences/in-content/moz.build
@@ -2,12 +2,12 @@
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 for var in ('MOZ_APP_NAME', 'MOZ_MACBUNDLE_NAME'):
     DEFINES[var] = CONFIG[var]
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'gtk3', 'cocoa'):
+if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'gtk', 'cocoa'):
     DEFINES['HAVE_SHELL_SERVICE'] = 1
 
 JAR_MANIFESTS += ['jar.mn']
--- a/browser/components/preferences/moz.build
+++ b/browser/components/preferences/moz.build
@@ -11,15 +11,15 @@ DIRS += [
 BROWSER_CHROME_MANIFESTS += [
     'in-content/tests/browser.ini',
     'in-content/tests/siteData/browser.ini'
 ]
 
 for var in ('MOZ_APP_NAME', 'MOZ_MACBUNDLE_NAME'):
     DEFINES[var] = CONFIG[var]
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'gtk3', 'cocoa'):
+if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'gtk', 'cocoa'):
     DEFINES['HAVE_SHELL_SERVICE'] = 1
 
 JAR_MANIFESTS += ['jar.mn']
 
 with Files('**'):
     BUG_COMPONENT = ('Firefox', 'Preferences')
--- a/browser/components/shell/moz.build
+++ b/browser/components/shell/moz.build
@@ -21,17 +21,17 @@ XPIDL_SOURCES += [
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
     XPIDL_SOURCES += [
         'nsIMacShellService.idl',
     ]
 
     SOURCES += [
         'nsMacShellService.cpp',
     ]
-elif 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
+elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
     XPIDL_SOURCES += [
         'nsIGNOMEShellService.idl',
     ]
 
     SOURCES += [
         'nsGNOMEShellService.cpp',
     ]
 elif CONFIG['OS_ARCH'] == 'WINNT':
--- a/browser/installer/Makefile.in
+++ b/browser/installer/Makefile.in
@@ -28,21 +28,18 @@ DEFINES += -DMOZ_APP_NAME=$(MOZ_APP_NAME
 
 ifdef MOZ_DEBUG
 DEFINES += -DMOZ_DEBUG=1
 endif
 ifdef MOZ_LAYOUT_DEBUGGER
 DEFINES += -DMOZ_LAYOUT_DEBUGGER=1
 endif
 
-ifneq (,$(filter gtk%,$(MOZ_WIDGET_TOOLKIT)))
+ifeq ($(MOZ_WIDGET_TOOLKIT),gtk)
 DEFINES += -DMOZ_GTK=1
-ifeq ($(MOZ_WIDGET_TOOLKIT),gtk3)
-DEFINES += -DMOZ_GTK3=1
-endif
 endif
 
 ifdef MOZ_SYSTEM_NSPR
 DEFINES += -DMOZ_SYSTEM_NSPR=1
 endif
 
 ifdef MOZ_SYSTEM_NSS
 DEFINES += -DMOZ_SYSTEM_NSS=1
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -93,17 +93,17 @@
 @BINPATH@/@MSVC_C_RUNTIME_DLL@
 @BINPATH@/@MSVC_CXX_RUNTIME_DLL@
 #endif
 #if MOZ_PACKAGE_WIN_UCRT_DLLS
 @BINPATH@/api-ms-win-*.dll
 @BINPATH@/ucrtbase.dll
 #endif
 #endif
-#ifdef MOZ_GTK3
+#ifdef MOZ_GTK
 @BINPATH@/@DLL_PREFIX@mozgtk@DLL_SUFFIX@
 @BINPATH@/gtk2/@DLL_PREFIX@mozgtk@DLL_SUFFIX@
 #ifdef MOZ_WAYLAND
 @BINPATH@/@DLL_PREFIX@mozwayland@DLL_SUFFIX@
 #endif
 #endif
 
 ; We don't have a complete view of which dlls to expect when doing an artifact
--- a/browser/themes/moz.build
+++ b/browser/themes/moz.build
@@ -6,17 +6,17 @@
 
 with Files("**"):
     BUG_COMPONENT = ("Firefox", "Theme")
 
 toolkit = CONFIG['MOZ_WIDGET_TOOLKIT']
 
 if toolkit == 'cocoa':
     DIRS += ['osx']
-elif toolkit == 'gtk3':
+elif toolkit == 'gtk':
     DIRS += ['linux']
 else:
     DIRS += ['windows']
 
 DIRS += [
     'addons/dark',
     'addons/light',
 ]
--- a/chrome/moz.build
+++ b/chrome/moz.build
@@ -35,13 +35,13 @@ FINAL_LIBRARY = 'xul'
 LOCAL_INCLUDES += [
     '!/xpcom',
     '/dom/base',
     '/netwerk/base',
     '/netwerk/protocol/res',
     '/xpcom/components'
 ]
 
-if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
     CXXFLAGS += CONFIG['TK_CFLAGS']
 
 with Files("**"):
     BUG_COMPONENT = ("Toolkit", "Startup and Profile System")
--- a/config/recurse.mk
+++ b/config/recurse.mk
@@ -183,15 +183,15 @@ dom/bindings/export: layout/style/export
 
 ifdef ENABLE_CLANG_PLUGIN
 $(filter-out config/host build/unix/stdc++compat/% build/clang-plugin/%,$(compile_targets)): build/clang-plugin/host build/clang-plugin/tests/target-objects
 build/clang-plugin/tests/target-objects: build/clang-plugin/host
 endif
 
 # Interdependencies that moz.build world don't know about yet for compilation.
 # Note some others are hardcoded or "guessed" in recursivemake.py and emitter.py
-ifeq ($(MOZ_WIDGET_TOOLKIT),gtk3)
+ifeq ($(MOZ_WIDGET_TOOLKIT),gtk)
 toolkit/library/target: widget/gtk/mozgtk/gtk3/target
 endif
 endif
 # Most things are built during compile (target/host), but some things happen during export
 # Those need to depend on config/export for system wrappers.
 $(addprefix build/unix/stdc++compat/,target host) build/clang-plugin/host: config/export
--- a/dom/geolocation/moz.build
+++ b/dom/geolocation/moz.build
@@ -41,14 +41,14 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'andr
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
     LOCAL_INCLUDES += [
         '/dom/system/mac',
     ]
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
     LOCAL_INCLUDES += [
         '/dom/system/windows',
     ]
-elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
+elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
     if CONFIG['MOZ_GPSD']:
         LOCAL_INCLUDES += [
             '/dom/system/linux',
         ]
         DEFINES['MOZ_GPSD'] = True
--- a/dom/ipc/tests/mochitest.ini
+++ b/dom/ipc/tests/mochitest.ini
@@ -10,17 +10,17 @@ skip-if = e10s
 skip-if = e10s
 [test_bug1086684.html]
 # This test is only supposed to run in the main process
 skip-if = e10s || toolkit == 'android'
 [test_cpow_cookies.html]
 [test_child_docshell.html]
 skip-if = toolkit == 'cocoa' # cocoa: disabled due to hangs, see changeset 6852e7c47edf
 [test_CrashService_crash.html]
-skip-if = !(crashreporter && !e10s && (toolkit == 'gtk3' || toolkit == 'cocoa' || toolkit == 'windows'))
+skip-if = !(crashreporter && !e10s && (toolkit == 'gtk' || toolkit == 'cocoa' || toolkit == 'windows'))
 [test_temporaryfile_stream.html]
 skip-if = !e10s || toolkit == 'android' || (os == "win" && processor == "aarch64") # Bug 1525959, aarch64 due to 1531150
 support-files =
   blob_verify.sjs
   !/dom/canvas/test/captureStream_common.js
 [test_Preallocated.html]
 skip-if = !e10s || toolkit == 'android' # Bug 1525959
 [test_force_oop_iframe.html]
--- a/dom/moz.build
+++ b/dom/moz.build
@@ -114,12 +114,12 @@ if CONFIG['OS_ARCH'] == 'WINNT':
 
 DIRS += ['presentation']
 
 TEST_DIRS += [
     'tests',
     'imptests',
 ]
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk3', 'cocoa', 'windows'):
+if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk', 'cocoa', 'windows'):
     TEST_DIRS += ['plugins/test']
 
 SPHINX_TREES['dom'] = 'docs'
--- a/dom/plugins/ipc/moz.build
+++ b/dom/plugins/ipc/moz.build
@@ -135,17 +135,17 @@ if CONFIG['MOZ_SANDBOX'] and CONFIG['OS_
     LOCAL_INCLUDES += [
         '/security/sandbox/chromium',
         '/security/sandbox/chromium-shim',
         '/security/sandbox/win/src/sandboxpermissions',
     ]
 
 DEFINES['FORCE_PR_LOG'] = True
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gtk3':
+if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gtk':
     CXXFLAGS += CONFIG['TK_CFLAGS']
 else:
     # Force build against gtk+2 for struct offsets and such.
     CXXFLAGS += CONFIG['MOZ_GTK2_CFLAGS']
 
 CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
 
 if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
--- a/dom/plugins/test/mochitest/mochitest.ini
+++ b/dom/plugins/test/mochitest/mochitest.ini
@@ -66,19 +66,19 @@ reason = Plugins are not supported on Wi
 skip-if = verify || (processor == 'aarch64' && os == 'win') # aarch64 due to 1541241
 [test_cocoa_focus.html]
 skip-if = toolkit != "cocoa" || e10s # Bug 1194534
 support-files = cocoa_focus.html
 [test_cocoa_window_focus.html]
 skip-if = toolkit != "cocoa" # Bug 1194534
 support-files = cocoa_window_focus.html
 [test_copyText.html]
-skip-if = toolkit != "gtk3"
+skip-if = toolkit != "gtk"
 [test_crash_nested_loop.html]
-skip-if = toolkit != "gtk3"
+skip-if = toolkit != "gtk"
 [test_crashing.html]
 skip-if = !crashreporter
 [test_crashing2.html]
 skip-if = (!crashreporter) || true # Bug 566049
 [test_CrashService_crash.html]
 skip-if = !crashreporter || e10s
 [test_CrashService_hang.html]
 skip-if = !crashreporter || e10s
@@ -144,11 +144,11 @@ skip-if = e10s # Bug 1090576
 skip-if = toolkit == "cocoa"
 [test_windowed_invalidate.html]
 skip-if = os != "win" || webrender # win/webrender bug 1296400
 [test_windowless_flash.html]
 skip-if = !(os == "win" && processor == "x86_64") || verify
 [test_windowless_ime.html]
 skip-if = os != "win" || (os == "win" && processor == "aarch64") # aarch64 due to 1536350
 [test_x11_error_crash.html]
-skip-if = !crashreporter || e10s || toolkit != "gtk3"
+skip-if = !crashreporter || e10s || toolkit != "gtk"
 [test_zero_opacity.html]
 skip-if = os == "win" && webrender # win/webrender bug 1296400
--- a/dom/plugins/test/moz.build
+++ b/dom/plugins/test/moz.build
@@ -3,13 +3,13 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 DIRS += ['testplugin']
 
 XPCSHELL_TESTS_MANIFESTS += ['unit/xpcshell.ini']
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk3', 'cocoa', 'windows'):
+if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk', 'cocoa', 'windows'):
     MOCHITEST_MANIFESTS += ['mochitest/mochitest.ini']
     MOCHITEST_CHROME_MANIFESTS += ['mochitest/chrome.ini']
     BROWSER_CHROME_MANIFESTS += ['mochitest/browser.ini']
 
--- a/dom/plugins/test/testplugin/testplugin.mozbuild
+++ b/dom/plugins/test/testplugin/testplugin.mozbuild
@@ -13,17 +13,17 @@ UNIFIED_SOURCES += [
     '%s/nptest_name.cpp' % relative_path,
 ]
 
 toolkit = CONFIG['MOZ_WIDGET_TOOLKIT']
 if toolkit == 'cocoa':
     UNIFIED_SOURCES += [
         'nptest_macosx.mm'
     ]
-elif toolkit == 'gtk3':
+elif toolkit == 'gtk':
     UNIFIED_SOURCES += [
         'nptest_gtk2.cpp',
     ]
 elif toolkit == 'windows':
     UNIFIED_SOURCES += [
         'nptest_windows.cpp',
     ]
     OS_LIBS += [
@@ -42,17 +42,17 @@ NO_PGO = True
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
     RCFILE  = 'nptest.rc'
     RESFILE = 'nptest.res'
     DEFFILE = 'nptest.def'
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa' and CONFIG['TARGET_CPU'] == 'x86_64':
     OS_LIBS += ['-framework Carbon']
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
     CXXFLAGS += CONFIG['MOZ_GTK2_CFLAGS']
     CFLAGS += CONFIG['MOZ_GTK2_CFLAGS']
     OS_LIBS += CONFIG['MOZ_GTK2_LIBS']
     OS_LIBS += CONFIG['XLDFLAGS']
     OS_LIBS += CONFIG['XLIBS']
     OS_LIBS += CONFIG['XEXT_LIBS']
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
--- a/dom/system/moz.build
+++ b/dom/system/moz.build
@@ -44,17 +44,17 @@ with Files("tests/*1197901*"):
 toolkit = CONFIG['MOZ_WIDGET_TOOLKIT']
 
 if toolkit == 'windows':
     DIRS += ['windows']
 elif toolkit == 'cocoa':
     DIRS += ['mac']
 elif toolkit == 'android':
     DIRS += ['android']
-elif toolkit == 'gtk3':
+elif toolkit == 'gtk':
     DIRS += ['linux']
 
 if toolkit != 'cocoa':
     EXPORTS += [
         'nsOSPermissionRequest.h',
     ]
 
 XPIDL_SOURCES += [
--- a/dom/xbl/builtin/moz.build
+++ b/dom/xbl/builtin/moz.build
@@ -5,17 +5,17 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 if CONFIG['OS_ARCH'] == 'WINNT':
     DIRS += ['win']
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
     DIRS += ['mac']
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
     DIRS += ['android']
-elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
+elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
     DIRS += ['unix']
 else:
     DIRS += ['emacs']
 
 EXPORTS.mozilla += ['ShortcutKeys.h']
 
 SOURCES += ['ShortcutKeys.cpp']
 
--- a/gfx/2d/moz.build
+++ b/gfx/2d/moz.build
@@ -97,26 +97,26 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wi
     ]
     DEFINES['WIN32'] = True
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'windows':
     SOURCES += [
         'JobScheduler_posix.cpp',
     ]
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gtk3'):
+if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gtk'):
     EXPORTS.mozilla.gfx += [
         'UnscaledFontFreeType.h',
     ]
     SOURCES += [
         'NativeFontResourceFreeType.cpp',
         'UnscaledFontFreeType.cpp',
     ]
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
     SOURCES += [
         'ScaledFontFontconfig.cpp',
     ]
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
     SOURCES += [
         'ScaledFontFreeType.cpp',
     ]
@@ -235,22 +235,22 @@ if CONFIG['CPU_ARCH'] == 'aarch64' or CO
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
 
 for var in ('USE_CAIRO', 'MOZ2D_HAS_MOZ_CAIRO'):
     DEFINES[var] = True
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gtk3'):
+if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gtk'):
     DEFINES['MOZ_ENABLE_FREETYPE'] = True
 
 CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gtk3'):
+if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gtk'):
     CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS']
 
 LOCAL_INCLUDES += CONFIG['SKIA_INCLUDES']
 
 if CONFIG['MOZ_ENABLE_SKIA']:
     LOCAL_INCLUDES += [
         '/gfx/skia/skia/include/private',
         '/gfx/skia/skia/src/core',
--- a/gfx/cairo/cairo/src/moz.build
+++ b/gfx/cairo/cairo/src/moz.build
@@ -65,17 +65,17 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] in {'c
     ]
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'beos':
     EXPORTS.cairo += [
         'cairo-beos.h',
     ]
     SOURCES += [
         'cairo-beos-surface.cpp',
     ]
-elif 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
+elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
     EXPORTS.cairo += [
         'cairo-ps.h',
     ]
     SOURCES += [
         'cairo-ps-surface.c',
     ]
 
 if CONFIG['MOZ_X11']:
--- a/gfx/gl/moz.build
+++ b/gfx/gl/moz.build
@@ -7,17 +7,17 @@
 gl_provider = 'Null'
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
     gl_provider = 'WGL'
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
     gl_provider = 'CGL'
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'uikit':
     gl_provider = 'EAGL'
-elif 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
+elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
     if CONFIG['MOZ_EGL_XRENDER_COMPOSITE']:
         gl_provider = 'EGL'
     else:
         gl_provider = 'GLX'
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
     gl_provider = 'EGL'
 
 if CONFIG['MOZ_GL_PROVIDER']:
--- a/gfx/harfbuzz/src/moz.build
+++ b/gfx/harfbuzz/src/moz.build
@@ -78,17 +78,17 @@ UNIFIED_SOURCES += [
     'hb-static.cc',
     'hb-subset-cff-common.cc',
     'hb-subset-cff1.cc',
     'hb-subset-cff2.cc',
     'hb-unicode.cc',
     'hb-warning.cc',
 ]
 
-if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
     EXPORTS.harfbuzz += [
         'hb-glib.h',
     ]
     UNIFIED_SOURCES += [
         'hb-glib.cc',
     ]
     CXXFLAGS += CONFIG['GLIB_CFLAGS']
 
--- a/gfx/skia/generate_mozbuild.py
+++ b/gfx/skia/generate_mozbuild.py
@@ -112,21 +112,21 @@ if CONFIG['CC_TYPE'] == 'gcc':
 if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
     CXXFLAGS += [
         '-Wno-implicit-fallthrough',
         '-Wno-inconsistent-missing-override',
         '-Wno-macro-redefined',
         '-Wno-unused-private-field',
     ]
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk3', 'android'):
+if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk', 'android'):
     CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
     CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS']
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
     CXXFLAGS += CONFIG['MOZ_PANGO_CFLAGS']
 
 if CONFIG['MOZ_ENABLE_SKIA_PDF_SFNTLY']:
     LOCAL_INCLUDES += CONFIG['SFNTLY_INCLUDES']
 """
 
 import json
 
@@ -396,17 +396,17 @@ def write_mozbuild(sources):
   write_sources(f, sources['pdf'], 4)
 
   f.write("if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':\n")
   write_sources(f, sources['android'], 4)
 
   f.write("if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('cocoa', 'uikit'):\n")
   write_sources(f, sources['mac'], 4)
 
-  f.write("if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':\n")
+  f.write("if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':\n")
   write_sources(f, sources['linux'], 4)
 
   f.write("if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':\n")
   write_list(f, "SOURCES", sources['win'], 4)
 
   f.write("if CONFIG['INTEL_ARCHITECTURE']:\n")
   write_sources(f, sources['intel'], 4)
   write_cflags(f, sources['intel'], opt_whitelist, 'skia_opt_flags', 4)
--- a/gfx/skia/moz.build
+++ b/gfx/skia/moz.build
@@ -362,17 +362,17 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('coc
         'skia/src/ports/SkDebug_stdio.cpp',
         'skia/src/ports/SkOSFile_posix.cpp',
         'skia/src/ports/SkOSLibrary_posix.cpp',
         'skia/src/ports/SkTLS_pthread.cpp',
     ]
     SOURCES += [
         'skia/src/ports/SkFontHost_mac.cpp',
     ]
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
     UNIFIED_SOURCES += [
         'skia/src/ports/SkDebug_stdio.cpp',
         'skia/src/ports/SkOSFile_posix.cpp',
         'skia/src/ports/SkOSLibrary_posix.cpp',
         'skia/src/ports/SkTLS_pthread.cpp',
     ]
     SOURCES += [
         'skia/src/ports/SkFontHost_cairo.cpp',
@@ -488,17 +488,17 @@ if CONFIG['CC_TYPE'] == 'gcc':
 if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
     CXXFLAGS += [
         '-Wno-implicit-fallthrough',
         '-Wno-inconsistent-missing-override',
         '-Wno-macro-redefined',
         '-Wno-unused-private-field',
     ]
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk3', 'android'):
+if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk', 'android'):
     CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
     CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS']
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
     CXXFLAGS += CONFIG['MOZ_PANGO_CFLAGS']
 
 if CONFIG['MOZ_ENABLE_SKIA_PDF_SFNTLY']:
     LOCAL_INCLUDES += CONFIG['SFNTLY_INCLUDES']
--- a/gfx/src/moz.build
+++ b/gfx/src/moz.build
@@ -87,10 +87,10 @@ LOCAL_INCLUDES += [
     '/dom/ipc',  # for ContentChild.h
 ]
 
 FINAL_LIBRARY = 'xul'
 
 CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
 CXXFLAGS += CONFIG['TK_CFLAGS']
 
-if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
     CXXFLAGS += CONFIG['MOZ_PANGO_CFLAGS']
--- a/gfx/thebes/moz.build
+++ b/gfx/thebes/moz.build
@@ -104,17 +104,17 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'co
     SOURCES += [
         'gfxCoreTextShaper.cpp',
         'gfxMacFont.cpp',
         'gfxPlatformMac.cpp',
         'gfxQuartzNativeDrawing.cpp',
         'gfxQuartzSurface.cpp',
         'PrintTargetCG.mm',
     ]
-elif 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
+elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
     EXPORTS += [
         'gfxFT2FontBase.h',
         'gfxGdkNativeRenderer.h',
         'gfxPlatformGtk.h',
     ]
     EXPORTS.mozilla.gfx += [
         'PrintTargetPDF.h',
         'PrintTargetPS.h',
@@ -255,33 +255,33 @@ include('/ipc/chromium/chromium-config.m
 
 FINAL_LIBRARY = 'xul'
 
 LOCAL_INCLUDES += [
     '/dom/base',
     '/dom/xml',
 ]
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gtk3'):
+if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gtk'):
     DEFINES['MOZ_ENABLE_FREETYPE'] = True
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
     for var in ('MOZ_ENABLE_D3D10_LAYER',):
         if CONFIG[var]:
             DEFINES[var] = True
 
 CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
 CXXFLAGS += CONFIG['TK_CFLAGS']
 CFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
 CFLAGS += CONFIG['TK_CFLAGS']
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android'):
     CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS']
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
     CXXFLAGS += CONFIG['MOZ_PANGO_CFLAGS']
 
 if CONFIG['MOZ_WAYLAND']:
     CXXFLAGS += CONFIG['MOZ_WAYLAND_CFLAGS']
 
 LOCAL_INCLUDES += CONFIG['SKIA_INCLUDES']
 
 DEFINES['GRAPHITE2_STATIC'] = True
--- a/gfx/webrender_bindings/moz.build
+++ b/gfx/webrender_bindings/moz.build
@@ -73,17 +73,17 @@ if CONFIG['MOZ_ENABLE_D3D10_LAYER']:
 if CONFIG['MOZ_WAYLAND']:
     EXPORTS.mozilla.webrender += [
         'RenderCompositorEGL.h',
     ]
     SOURCES += [
         'RenderCompositorEGL.cpp',
     ]
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gtk3'):
+if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gtk'):
     CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
     CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS']
 
 if CONFIG['COMPILE_ENVIRONMENT']:
     GENERATED_FILES += [
         'webrender_ffi_generated.h',
     ]
 
--- a/image/decoders/icon/moz.build
+++ b/image/decoders/icon/moz.build
@@ -18,17 +18,17 @@ FINAL_LIBRARY = 'xul'
 include('/ipc/chromium/chromium-config.mozbuild')
 
 EXPORTS += [
   'nsIconURI.h',
 ]
 
 platform = None
 
-if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
     platform = 'gtk'
 
 if CONFIG['OS_ARCH'] == 'WINNT':
     platform = 'win'
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
     platform = 'mac'
 
--- a/image/decoders/moz.build
+++ b/image/decoders/moz.build
@@ -3,17 +3,17 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 toolkit = CONFIG['MOZ_WIDGET_TOOLKIT']
 
 # The Icon Channel stuff really shouldn't live in decoders/icon, but we'll
 # fix that another time.
-if 'gtk' in toolkit:
+if toolkit == 'gtk':
     DIRS += ['icon/gtk', 'icon']
 
 if CONFIG['OS_ARCH'] == 'WINNT':
     DIRS += ['icon/win', 'icon']
 
 if toolkit == 'cocoa':
     DIRS += ['icon/mac', 'icon']
 elif toolkit == 'android':
--- a/intl/locale/moz.build
+++ b/intl/locale/moz.build
@@ -7,17 +7,17 @@
 XPCSHELL_TESTS_MANIFESTS += ['tests/unit/xpcshell.ini']
 
 toolkit = CONFIG['MOZ_WIDGET_TOOLKIT']
 
 if toolkit == 'windows':
     DIRS += ['windows']
 elif toolkit == 'cocoa':
     DIRS += ['mac']
-elif 'gtk' in toolkit:
+elif toolkit == 'gtk':
     DIRS += ['gtk']
 elif toolkit == 'android':
     DIRS += ['android']
 
 XPIDL_SOURCES += [
     'mozILocaleService.idl',
     'mozIOSPreferences.idl',
     'nsICollation.idl',
--- a/intl/lwbrk/moz.build
+++ b/intl/lwbrk/moz.build
@@ -11,17 +11,17 @@ EXPORTS.mozilla.intl += [
     'WordBreaker.h',
 ]
 
 UNIFIED_SOURCES += [
     'LineBreaker.cpp',
     'WordBreaker.cpp',
 ]
 
-if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
     SOURCES += [
         'nsPangoBreaker.cpp',
     ]
     CXXFLAGS += CONFIG['MOZ_PANGO_CFLAGS']
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
     SOURCES += [
         'nsUniscribeBreaker.cpp',
     ]
--- a/ipc/chromium/moz.build
+++ b/ipc/chromium/moz.build
@@ -100,17 +100,17 @@ if os_linux:
     if CONFIG['OS_TARGET'] == 'Android':
         UNIFIED_SOURCES += [
             'src/base/message_pump_android.cc',
         ]
         DEFINES['ANDROID'] = True
         DEFINES['_POSIX_MONOTONIC_CLOCK'] = 0
 
 if os_bsd or os_linux:
-    if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
+    if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
         SOURCES += [
             'src/base/message_pump_glib.cc',
         ]
 
 if os_solaris:
     SOURCES += [
         'src/base/process_util_linux.cc',
         'src/base/time_posix.cc',
--- a/layout/base/tests/mochitest.ini
+++ b/layout/base/tests/mochitest.ini
@@ -125,17 +125,17 @@ support-files = bug1078327_inner.html
 skip-if = toolkit == 'android' # We don't support pointer event on android
 support-files = bug1080360_inner.html
 [test_bug1080361.html]
 skip-if = toolkit == 'android' # We don't support pointer event on android
 support-files = bug1080361_inner.html
 [test_bug1093686.html]
 support-files = bug1093686_inner.html
 [test_bug1120705.html]
-skip-if = toolkit == 'android' || os == 'mac' || toolkit == 'gtk3' # android does not have clickable scrollbars, mac does not have scrollbar down and up buttons, gtk may or may not have scrollbar buttons depending on theme
+skip-if = toolkit == 'android' || os == 'mac' || toolkit == 'gtk' # android does not have clickable scrollbars, mac does not have scrollbar down and up buttons, gtk may or may not have scrollbar buttons depending on theme
 [test_bug1153130.html]
 skip-if = toolkit == 'android' # We don't support pointer event on android
 support-files = bug1153130_inner.html
 [test_bug1162990.html]
 skip-if = toolkit == 'android' # We don't support pointer event on android
 support-files =
   bug1162990_inner_1.html
   bug1162990_inner_2.html
--- a/layout/generic/moz.build
+++ b/layout/generic/moz.build
@@ -258,13 +258,13 @@ CONTENT_ACCESSIBLE_FILES.html = [
     'folder.png',
 ]
 
 MOCHITEST_MANIFESTS += ['test/mochitest.ini']
 MOCHITEST_CHROME_MANIFESTS += ['test/chrome.ini']
 
 CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
 
-if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
     CXXFLAGS += CONFIG['TK_CFLAGS']
 
 if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
     CXXFLAGS += ['-Wno-error=shadow']
--- a/layout/generic/test/mochitest.ini
+++ b/layout/generic/test/mochitest.ini
@@ -112,17 +112,17 @@ skip-if = os=='win'
 [test_invalidate_during_plugin_paint.html]
 skip-if = toolkit == 'android' || headless # Headless:Bug 1405871
 [test_intrinsic_size_on_loading.html]
 [test_movement_by_characters.html]
 [test_movement_by_words.html]
 # Disable the caret movement by word test on Linux because the shortcut keys
 # are defined in system level.  So, it depends on the environment.
 # Disable on Windows for too many intermittent failures (bug 916143).
-skip-if = (toolkit == "gtk3") || (os == "win")
+skip-if = (toolkit == "gtk") || (os == "win")
 [test_overflow_event.html]
 [test_page_scroll_with_fixed_pos.html]
 support-files = page_scroll_with_fixed_pos_window.html
 [test_plugin_clipping.xhtml]
 skip-if = e10s
 [test_plugin_clipping2.xhtml]
 skip-if = e10s
 [test_plugin_clipping_transformed.xhtml]
--- a/layout/reftests/bidi/reftest.list
+++ b/layout/reftests/bidi/reftest.list
@@ -138,17 +138,17 @@ random-if(/^Windows\x20NT\x206\.1/.test(
 == 746987-4.html 746987-4-ref.html
 == 779003-1.html 779003-1-ref.html
 == 779003-1-dynamic.html 779003-1-ref.html
 == 817406-1.html 817406-1-ref.html
 == 817406-2.html 817406-2-ref.html
 == 817406-3.html 817406-1-ref.html
 == 817406-4.html 817406-4-ref.html
 == 847242-1.html 847242-1-ref.html
-pref(layout.css.xul-tree-pseudos.content.enabled,true) fuzzy-if(xulRuntime.widgetToolkit=="gtk3",0-1,0-11) == chrome://reftest/content/bidi/869833-1.xul chrome://reftest/content/bidi/869833-1-ref.xul
+pref(layout.css.xul-tree-pseudos.content.enabled,true) fuzzy-if(xulRuntime.widgetToolkit=="gtk",0-1,0-11) == chrome://reftest/content/bidi/869833-1.xul chrome://reftest/content/bidi/869833-1-ref.xul
 == 922530-1.html 922530-1-ref.html
 random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == 922550-1.html 922550-1-ref.html # Bug 1392106
 == 989994-1.html 989994-1-ref.html
 == 1067268-1.html 1067268-1-ref.html
 == 1069941-inline-bidi-border-1.html 1069941-inline-bidi-border-1-ref.html
 == 1069941-inline-bidi-margin-1.html 1069941-inline-bidi-margin-1-ref.html
 != chrome://reftest/content/bidi/1155359-1.xul chrome://reftest/content/bidi/1155359-1-ref.xul
 == 1157726-1.html 1157726-1-ref.html
--- a/layout/reftests/scrolling/reftest.list
+++ b/layout/reftests/scrolling/reftest.list
@@ -1,10 +1,10 @@
 HTTP == deferred-anchor.xhtml#d deferred-anchor-ref.xhtml#d
-fuzzy-if(xulRuntime.widgetToolkit=="gtk3",0-1,0-23) == deferred-anchor2.xhtml deferred-anchor-ref.xhtml#d # bug 1182632
+fuzzy-if(xulRuntime.widgetToolkit=="gtk",0-1,0-23) == deferred-anchor2.xhtml deferred-anchor-ref.xhtml#d # bug 1182632
 HTTP == fixed-1.html fixed-1.html?ref
 fuzzy-if(skiaContent,0-1,0-32200) HTTP == fixed-table-1.html fixed-table-1.html?ref
 HTTP == fixed-opacity-1.html fixed-opacity-1.html?ref
 HTTP == fixed-opacity-2.html fixed-opacity-2.html?ref
 random-if(gtkWidget) fuzzy-if(Android,0-3,0-60) HTTP == fixed-text-1.html fixed-text-1.html?ref
 HTTP == fixed-text-2.html fixed-text-2.html?ref
 random-if(Android) fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu),0-1,0-12) fuzzy-if(webrender&&winWidget,0-1,0-31) == iframe-border-radius.html iframe-border-radius-ref.html # bug 760269
 random-if(Android) HTTP == image-1.html image-1.html?ref
--- a/layout/reftests/xul/reftest.list
+++ b/layout/reftests/xul/reftest.list
@@ -2,17 +2,17 @@
 
 == chrome://reftest/content/xul/menuitem-key.xul chrome://reftest/content/xul/menuitem-key-ref.xul
 # these random-if(Android) are due to differences between Android Native & Xul, see bug 732569
 random-if(Android) == chrome://reftest/content/xul/menulist-shrinkwrap-1.xul chrome://reftest/content/xul/menulist-shrinkwrap-1-ref.xul
 random-if(Android) == chrome://reftest/content/xul/menulist-shrinkwrap-2.xul chrome://reftest/content/xul/menulist-shrinkwrap-2-ref.xul
 == chrome://reftest/content/xul/textbox-overflow-1.xul chrome://reftest/content/xul/textbox-overflow-1-ref.xul # for bug 749658
 # accesskeys are not normally displayed on Mac, so set a pref to enable them
 pref(ui.key.menuAccessKey,18) == chrome://reftest/content/xul/accesskey.xul chrome://reftest/content/xul/accesskey-ref.xul
-pref(layout.css.xul-tree-pseudos.content.enabled,true) fuzzy-if(xulRuntime.widgetToolkit=="gtk3",0-1,0-11) == chrome://reftest/content/xul/tree-row-outline-1.xul chrome://reftest/content/xul/tree-row-outline-1-ref.xul # win8: bug 1254832
+pref(layout.css.xul-tree-pseudos.content.enabled,true) fuzzy-if(xulRuntime.widgetToolkit=="gtk",0-1,0-11) == chrome://reftest/content/xul/tree-row-outline-1.xul chrome://reftest/content/xul/tree-row-outline-1-ref.xul # win8: bug 1254832
 skip-if(!cocoaWidget) fails-if(webrender&&cocoaWidget) == chrome://reftest/content/xul/mac-tab-toolbar.xul chrome://reftest/content/xul/mac-tab-toolbar-ref.xul
 pref(layout.css.xul-tree-pseudos.content.enabled,true) != chrome://reftest/content/xul/tree-row-outline-1.xul chrome://reftest/content/xul/tree-row-outline-1-notref.xul
 == chrome://reftest/content/xul/text-crop.xul chrome://reftest/content/xul/text-crop-ref.xul
 random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == chrome://reftest/content/xul/text-small-caps-1.xul chrome://reftest/content/xul/text-small-caps-1-ref.xul
 fuzzy-if(skiaContent,0-1,0-60) fuzzy-if(cocoaWidget&&browserIsRemote&&!skiaContent,0-1,0-31) fuzzy-if(winWidget&&browserIsRemote&&layersGPUAccelerated,0-1,0-50) fuzzy-if(webrender,0-1,350-1050) == chrome://reftest/content/xul/inactive-fixed-bg-bug1205630.xul inactive-fixed-bg-bug1205630-ref.html
 fuzzy-if(skiaContent,0-1,0-60) fuzzy-if(cocoaWidget&&browserIsRemote&&!skiaContent,0-1,0-31) fuzzy-if(winWidget&&browserIsRemote&&layersGPUAccelerated,0-1,0-50) fuzzy-if(webrender,0-1,450-1100) == chrome://reftest/content/xul/inactive-fixed-bg-bug1272525.xul inactive-fixed-bg-bug1272525-ref.html
 
 # Tests for XUL <image> with 'object-fit' & 'object-position':
--- a/layout/tools/reftest/manifest.jsm
+++ b/layout/tools/reftest/manifest.jsm
@@ -461,28 +461,28 @@ function BuildConditionSandbox(aURL) {
     sandbox.retainedDisplayList =
       prefs.getBoolPref("layout.display-list.retain");
 
     sandbox.usesOverlayScrollbars = g.windowUtils.usesOverlayScrollbars;
 
     // Shortcuts for widget toolkits.
     sandbox.Android = xr.OS == "Android";
     sandbox.cocoaWidget = xr.widgetToolkit == "cocoa";
-    sandbox.gtkWidget = xr.widgetToolkit == "gtk3";
+    sandbox.gtkWidget = xr.widgetToolkit == "gtk";
     sandbox.qtWidget = xr.widgetToolkit == "qt";
     sandbox.winWidget = xr.widgetToolkit == "windows";
 
     sandbox.is64Bit = xr.is64Bit;
 
     // GeckoView is currently uniquely identified by "android + e10s" but
     // we might want to make this condition more precise in the future.
     sandbox.geckoview = (sandbox.Android && g.browserIsRemote);
 
     // Scrollbars that are semi-transparent. See bug 1169666.
-    sandbox.transparentScrollbars = xr.widgetToolkit == "gtk3";
+    sandbox.transparentScrollbars = xr.widgetToolkit == "gtk";
 
     if (sandbox.Android) {
         var sysInfo = Cc["@mozilla.org/system-info;1"].getService(Ci.nsIPropertyBag2);
 
         // This is currently used to distinguish Android 4.0.3 (SDK version 15)
         // and later from Android 2.x
         sandbox.AndroidVersion = sysInfo.getPropertyAsInt32("version");
     }
--- a/netwerk/build/moz.build
+++ b/netwerk/build/moz.build
@@ -34,17 +34,17 @@ LOCAL_INCLUDES += [
     '/netwerk/protocol/res',
     '/netwerk/protocol/viewsource',
     '/netwerk/protocol/websocket',
     '/netwerk/socket',
     '/netwerk/streamconv',
     '/netwerk/streamconv/converters',
 ]
 
-if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
     LOCAL_INCLUDES += [
         '/netwerk/protocol/gio',
     ]
 
 
 LOCAL_INCLUDES += [
     '!/netwerk/dns',
     '/modules/brotli/dec',
--- a/netwerk/protocol/moz.build
+++ b/netwerk/protocol/moz.build
@@ -1,10 +1,10 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 DIRS += ['about', 'data', 'file', 'ftp']
-if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
     DIRS += ['gio']
 DIRS += ['http', 'res', 'viewsource', 'websocket' ]
--- a/old-configure.in
+++ b/old-configure.in
@@ -1780,17 +1780,17 @@ dnl there are a lot of tests on MOZ_ENAB
 dnl to keep that way than testing against MOZ_WIDGET_TOOLKIT
 case "$MOZ_WIDGET_TOOLKIT" in
 gtk*)
     MOZ_ENABLE_GTK=1
     ;;
 esac
 
 if test "$COMPILE_ENVIRONMENT"; then
-  if test "$MOZ_WIDGET_TOOLKIT" = gtk3; then
+  if test "$MOZ_WIDGET_TOOLKIT" = gtk; then
     PKG_CHECK_MODULES(MOZ_GTK3, gtk+-3.0 >= $GTK3_VERSION gtk+-unix-print-3.0 glib-2.0 gobject-2.0 gio-unix-2.0 $GDK_PACKAGES)
     MOZ_GTK3_CFLAGS="-I${_topsrcdir}/widget/gtk/compat-gtk3 $MOZ_GTK3_CFLAGS"
     TK_CFLAGS=$MOZ_GTK3_CFLAGS
     TK_LIBS=$MOZ_GTK3_LIBS
     dnl GDK_VERSION_MIN_REQUIRED is not set here as GDK3 deprecated warnings
     dnl are suppressed by widget/gtk/compat-gtk3/gdk/gdkversionmacros.h.
     AC_DEFINE_UNQUOTED(GDK_VERSION_MAX_ALLOWED,$GDK_VERSION_MAX_ALLOWED)
     GLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_32
--- a/python/mozbuild/mozbuild/test/test_mozinfo.py
+++ b/python/mozbuild/mozbuild/test/test_mozinfo.py
@@ -55,31 +55,31 @@ class TestBuildDict(unittest.TestCase, B
         self.assertEqual('x86', d['processor'])
         self.assertEqual('windows', d['toolkit'])
         self.assertEqual(32, d['bits'])
 
     def test_linux(self):
         d = build_dict(self._config(dict(
             OS_TARGET='Linux',
             TARGET_CPU='i386',
-            MOZ_WIDGET_TOOLKIT='gtk3',
+            MOZ_WIDGET_TOOLKIT='gtk',
         )))
         self.assertEqual('linux', d['os'])
         self.assertEqual('x86', d['processor'])
-        self.assertEqual('gtk3', d['toolkit'])
+        self.assertEqual('gtk', d['toolkit'])
         self.assertEqual(32, d['bits'])
 
         d = build_dict(self._config(dict(
             OS_TARGET='Linux',
             TARGET_CPU='x86_64',
-            MOZ_WIDGET_TOOLKIT='gtk3',
+            MOZ_WIDGET_TOOLKIT='gtk',
         )))
         self.assertEqual('linux', d['os'])
         self.assertEqual('x86_64', d['processor'])
-        self.assertEqual('gtk3', d['toolkit'])
+        self.assertEqual('gtk', d['toolkit'])
         self.assertEqual(64, d['bits'])
 
     def test_mac(self):
         d = build_dict(self._config(dict(
             OS_TARGET='Darwin',
             TARGET_CPU='i386',
             MOZ_WIDGET_TOOLKIT='cocoa',
         )))
@@ -129,24 +129,24 @@ class TestBuildDict(unittest.TestCase, B
 
     def test_arm(self):
         """
         Test that all arm CPU architectures => arm.
         """
         d = build_dict(self._config(dict(
             OS_TARGET='Linux',
             TARGET_CPU='arm',
-            MOZ_WIDGET_TOOLKIT='gtk3',
+            MOZ_WIDGET_TOOLKIT='gtk',
         )))
         self.assertEqual('arm', d['processor'])
 
         d = build_dict(self._config(dict(
             OS_TARGET='Linux',
             TARGET_CPU='armv7',
-            MOZ_WIDGET_TOOLKIT='gtk3',
+            MOZ_WIDGET_TOOLKIT='gtk',
         )))
         self.assertEqual('arm', d['processor'])
 
     def test_unknown(self):
         """
         Test that unknown values pass through okay.
         """
         d = build_dict(self._config(dict(
@@ -162,43 +162,43 @@ class TestBuildDict(unittest.TestCase, B
 
     def test_debug(self):
         """
         Test that debug values are properly detected.
         """
         d = build_dict(self._config(dict(
             OS_TARGET='Linux',
             TARGET_CPU='i386',
-            MOZ_WIDGET_TOOLKIT='gtk3',
+            MOZ_WIDGET_TOOLKIT='gtk',
         )))
         self.assertEqual(False, d['debug'])
 
         d = build_dict(self._config(dict(
             OS_TARGET='Linux',
             TARGET_CPU='i386',
-            MOZ_WIDGET_TOOLKIT='gtk3',
+            MOZ_WIDGET_TOOLKIT='gtk',
             MOZ_DEBUG='1',
         )))
         self.assertEqual(True, d['debug'])
 
     def test_crashreporter(self):
         """
         Test that crashreporter values are properly detected.
         """
         d = build_dict(self._config(dict(
             OS_TARGET='Linux',
             TARGET_CPU='i386',
-            MOZ_WIDGET_TOOLKIT='gtk3',
+            MOZ_WIDGET_TOOLKIT='gtk',
         )))
         self.assertEqual(False, d['crashreporter'])
 
         d = build_dict(self._config(dict(
             OS_TARGET='Linux',
             TARGET_CPU='i386',
-            MOZ_WIDGET_TOOLKIT='gtk3',
+            MOZ_WIDGET_TOOLKIT='gtk',
             MOZ_CRASHREPORTER='1',
         )))
         self.assertEqual(True, d['crashreporter'])
 
 
 class TestWriteMozinfo(unittest.TestCase, Base):
     """
     Test the write_mozinfo function.
--- a/security/manager/ssl/moz.build
+++ b/security/manager/ssl/moz.build
@@ -133,17 +133,17 @@ UNIFIED_SOURCES += [
     'PublicKeyPinningService.cpp',
     'RootCertificateTelemetryUtils.cpp',
     'SecretDecoderRing.cpp',
     'SharedSSLState.cpp',
     'SSLServerCertVerification.cpp',
     'TransportSecurityInfo.cpp',
 ]
 
-if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
     UNIFIED_SOURCES += [
         'LibSecret.cpp',
     ]
     CFLAGS += CONFIG['GLIB_CFLAGS']
     CXXFLAGS += CONFIG['GLIB_CFLAGS']
 
 if CONFIG['OS_ARCH'] == 'Darwin':
     UNIFIED_SOURCES += [
--- a/security/sandbox/linux/broker/moz.build
+++ b/security/sandbox/linux/broker/moz.build
@@ -25,13 +25,13 @@ LOCAL_INCLUDES += [
 include('/ipc/chromium/chromium-config.mozbuild')
 
 # Need this for safe_sprintf.h used by SandboxLogging.h,
 # but it has to be after ipc/chromium/src.
 LOCAL_INCLUDES += [
     '/security/sandbox/chromium',
 ]
 
-if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
     CXXFLAGS += CONFIG['GLIB_CFLAGS']
     CXXFLAGS += CONFIG['TK_CFLAGS']
 
 FINAL_LIBRARY = 'xul'
--- a/testing/mozbase/manifestparser/tests/test_testmanifest.py
+++ b/testing/mozbase/manifestparser/tests/test_testmanifest.py
@@ -29,17 +29,17 @@ class TestTestManifest(unittest.TestCase
                                                                    exists=False)],
                          ['fleem', 'linuxtest'])
 
         # Look for existing tests.  There is only one:
         self.assertEqual([i['name'] for i in manifest.active_tests()],
                          ['fleem'])
 
         # You should be able to expect failures:
-        last = manifest.active_tests(exists=False, toolkit='gtk3')[-1]
+        last = manifest.active_tests(exists=False, toolkit='gtk')[-1]
         self.assertEqual(last['name'], 'linuxtest')
         self.assertEqual(last['expected'], 'pass')
         last = manifest.active_tests(exists=False, toolkit='cocoa')[-1]
         self.assertEqual(last['expected'], 'fail')
 
     def test_missing_paths(self):
         """
         Test paths that don't exist raise an exception in strict mode.
--- a/testing/tools/screenshot/moz.build
+++ b/testing/tools/screenshot/moz.build
@@ -1,15 +1,15 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT'] and CONFIG['MOZ_X11']:
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk' and CONFIG['MOZ_X11']:
     Program('screentopng')
     SOURCES += [
         'gdk-screenshot.cpp',
     ]
     CXXFLAGS += CONFIG['TK_CFLAGS']
     LDFLAGS += CONFIG['XLDFLAGS']
     OS_LIBS += CONFIG['TK_LIBS']
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
--- a/toolkit/components/remote/moz.build
+++ b/toolkit/components/remote/moz.build
@@ -6,17 +6,17 @@
 
 with Files('**'):
     BUG_COMPONENT = ('Toolkit', 'Startup and Profile System')
 
 SOURCES += [
     'nsRemoteService.cpp',
 ]
 
-if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
     SOURCES += [
         'nsGTKRemoteServer.cpp',
         'nsUnixRemoteServer.cpp',
         'nsXRemoteClient.cpp',
         'nsXRemoteServer.cpp',
         'RemoteUtils.cpp',
     ]
     if CONFIG['MOZ_ENABLE_DBUS']:
--- a/toolkit/crashreporter/client/moz.build
+++ b/toolkit/crashreporter/client/moz.build
@@ -66,17 +66,17 @@ elif CONFIG['OS_ARCH'] == 'SunOS':
     SOURCES += [
         'crashreporter_linux.cpp',
         'crashreporter_unix.cpp',
     ]
     USE_LIBS += [
         'breakpad_solaris_common_s',
     ]
 
-if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
     UNIFIED_SOURCES += [
         'crashreporter_gtk_common.cpp',
         'crashreporter_linux.cpp',
         'crashreporter_unix_common.cpp'
     ]
     USE_LIBS += [
         'breakpad_linux_common_s',
     ]
--- a/toolkit/library/moz.build
+++ b/toolkit/library/moz.build
@@ -154,32 +154,32 @@ USE_LIBS += [
     'zlib',
 ]
 
 if CONFIG['USE_ICU']:
     USE_LIBS += [
         'icu',
     ]
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
     USE_LIBS += [
         'mozgtk_stub',
     ]
 
 if CONFIG['MOZ_WAYLAND']:
     USE_LIBS += [
         'mozwayland',
     ]
 
 if CONFIG['MOZ_JPROF']:
     USE_LIBS += [
         'jprof',
     ]
 
-if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT'] or \
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk' or \
         CONFIG['MOZ_TREE_FREETYPE']:
     USE_LIBS += [
         'freetype',
     ]
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
     CXXFLAGS += CONFIG['TK_CFLAGS']
 
@@ -277,22 +277,19 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('coc
 if CONFIG['OS_ARCH'] == 'OpenBSD':
     OS_LIBS += [
         'sndio',
     ]
 
 if CONFIG['MOZ_ENABLE_DBUS']:
     OS_LIBS += CONFIG['MOZ_DBUS_GLIB_LIBS']
 
-if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
-    if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
-        OS_LIBS += [l for l in CONFIG['TK_LIBS']
-            if l not in ('-lgtk-3', '-lgdk-3')]
-    else:
-        OS_LIBS += CONFIG['TK_LIBS']
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
+    OS_LIBS += [l for l in CONFIG['TK_LIBS']
+        if l not in ('-lgtk-3', '-lgdk-3')]
     OS_LIBS += CONFIG['XLDFLAGS']
     OS_LIBS += CONFIG['XLIBS']
     OS_LIBS += CONFIG['XEXT_LIBS']
     OS_LIBS += CONFIG['MOZ_PANGO_LIBS']
     OS_LIBS += CONFIG['XT_LIBS']
     OS_LIBS += [
         'gthread-2.0',
     ]
--- a/toolkit/locales/moz.build
+++ b/toolkit/locales/moz.build
@@ -5,17 +5,17 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 with Files('**'):
     BUG_COMPONENT = ('Firefox Build System', 'General')
 
 if CONFIG['MOZ_BUILD_APP'] == 'mobile/android':
   DEFINES['MOZ_FENNEC'] = True
 
-if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
   DEFINES['MOZ_GTK'] = True
 
 JAR_MANIFESTS += ['jar.mn']
 
 GENERATED_FILES = [
     'multilocale.txt',
 ]
 multilocale = GENERATED_FILES['multilocale.txt']
--- a/toolkit/modules/moz.build
+++ b/toolkit/modules/moz.build
@@ -241,20 +241,20 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'coco
 EXTRA_JS_MODULES.third_party.jsesc += ['third_party/jsesc/jsesc.js']
 EXTRA_JS_MODULES.sessionstore += [
     'sessionstore/PrivacyFilter.jsm',
     'sessionstore/PrivacyLevel.jsm',
     'sessionstore/SessionHistory.jsm',
     'sessionstore/Utils.jsm',
 ]
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'gtk3'):
+if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'gtk'):
     DEFINES['MENUBAR_CAN_AUTOHIDE'] = 1
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'gtk3', 'cocoa'):
+if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'gtk', 'cocoa'):
     DEFINES['HAVE_SHELL_SERVICE'] = 1
 
 EXTRA_PP_JS_MODULES += [
     'AppConstants.jsm',
 ]
 
 if 'Android' != CONFIG['OS_TARGET']:
     EXTRA_JS_MODULES += [
--- a/toolkit/moz.build
+++ b/toolkit/moz.build
@@ -39,17 +39,17 @@ if CONFIG['MOZ_MAINTENANCE_SERVICE']:
     DIRS += [
         'components/maintenanceservice'
     ]
 
 DIRS += ['xre']
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'android':
     DIRS += ['mozapps/handling']
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
     DIRS += ['system/unixproxy']
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
     DIRS += ['system/osxproxy']
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
     DIRS += ['system/windowsproxy',
             'system/windowsDHCPClient']
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
     DIRS += ['system/androidproxy']
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -225,37 +225,35 @@ option('--enable-default-toolkit', nargs
        help='Select default toolkit')
 
 @depends_if('--enable-default-toolkit')
 def full_toolkit(value):
     return value[0]
 
 @depends(full_toolkit)
 def toolkit(toolkit):
-    if toolkit == 'cairo-gtk3-wayland':
-        widget_toolkit = 'gtk3'
+    if toolkit.startswith('cairo-gtk3'):
+        widget_toolkit = 'gtk'
     else:
         widget_toolkit = toolkit.replace('cairo-', '')
     return widget_toolkit
 
 set_config('MOZ_WIDGET_TOOLKIT', toolkit)
 add_old_configure_assignment('MOZ_WIDGET_TOOLKIT', toolkit)
 
 @depends(toolkit)
 def toolkit_define(toolkit):
-    if toolkit == 'gtk3':
-        toolkit = 'gtk'
     if toolkit != 'windows':
         return 'MOZ_WIDGET_%s' % toolkit.upper()
 
 set_define(toolkit_define, True)
 
 @depends(toolkit)
 def toolkit_gtk(toolkit):
-    return toolkit == 'gtk3'
+    return toolkit == 'gtk'
 
 set_config('MOZ_X11', True, when=toolkit_gtk)
 set_define('MOZ_X11', True, when=toolkit_gtk)
 add_old_configure_assignment('MOZ_X11', True, when=toolkit_gtk)
 
 # Wayland support
 # ==============================================================
 wayland_headers = pkg_check_modules(
@@ -309,17 +307,17 @@ def gl_provider_define(provider):
 
 set_define(gl_provider_define, True)
 
 
 # PDF printing
 # ==============================================================
 @depends(toolkit)
 def pdf_printing(toolkit):
-    if toolkit in ('windows', 'gtk3', 'android'):
+    if toolkit in ('windows', 'gtk', 'android'):
         return True
 
 @depends(pdf_printing)
 def pdf_surface_feature(pdf_printing):
     if pdf_printing:
         return '#define CAIRO_HAS_PDF_SURFACE 1'
     else:
         # CONFIGURE_SUBST_FILES need explicit empty values.
@@ -331,32 +329,32 @@ set_config('PDF_SURFACE_FEATURE', pdf_su
 
 # Event loop instrumentation
 # ==============================================================
 option(env='MOZ_INSTRUMENT_EVENT_LOOP',
        help='Force-enable event loop instrumentation')
 
 @depends('MOZ_INSTRUMENT_EVENT_LOOP', toolkit)
 def instrument_event_loop(value, toolkit):
-    if value or (toolkit in ('windows', 'gtk3', 'cocoa', 'android') and
+    if value or (toolkit in ('windows', 'gtk', 'cocoa', 'android') and
                  value.origin == 'default'):
         return True
 
 set_config('MOZ_INSTRUMENT_EVENT_LOOP', instrument_event_loop)
 set_define('MOZ_INSTRUMENT_EVENT_LOOP', instrument_event_loop)
 
 
 # Fontconfig Freetype
 # ==============================================================
 option(env='USE_FC_FREETYPE',
        help='Force-enable the use of fontconfig freetype')
 
 @depends('USE_FC_FREETYPE', toolkit)
 def fc_freetype(value, toolkit):
-    if value or (toolkit == 'gtk3' and
+    if value or (toolkit == 'gtk' and
                  value.origin == 'default'):
         return True
 
 add_old_configure_assignment('USE_FC_FREETYPE', fc_freetype)
 
 # Pango
 # ==============================================================
 pkg_check_modules('MOZ_PANGO',
@@ -756,17 +754,17 @@ def printing(value):
 set_config('NS_PRINTING', printing)
 set_define('NS_PRINTING', printing)
 set_define('NS_PRINT_PREVIEW', printing)
 
 # Speech-dispatcher support
 # ==============================================================
 @depends(toolkit)
 def no_speechd_on_non_gtk(toolkit):
-    if toolkit != 'gtk3':
+    if toolkit != 'gtk':
         return False
 
 imply_option('--enable-synth-speechd', no_speechd_on_non_gtk,
              reason='--enable-default-toolkit')
 
 option('--disable-synth-speechd', help='Disable speech-dispatcher support')
 
 set_config('MOZ_SYNTH_SPEECHD',
@@ -1746,17 +1744,17 @@ with only_when(compile_environment & tar
                when=d3d_compiler_dll.path)
     set_config('MOZ_D3DCOMPILER_VISTA_DLL_PATH', d3d_compiler_dll.path)
 
 # Remoting protocol support
 # ==============================================================
 
 @depends(toolkit)
 def has_remote(toolkit):
-    if 'gtk' in toolkit or toolkit == 'windows':
+    if toolkit in ('gtk', 'windows'):
         return True
 
 set_config('MOZ_HAS_REMOTE', has_remote)
 set_define('MOZ_HAS_REMOTE', has_remote)
 
 
 # new XULStore implementation
 # ==============================================================
--- a/toolkit/mozapps/installer/upload-files.mk
+++ b/toolkit/mozapps/installer/upload-files.mk
@@ -7,17 +7,17 @@ ifndef MOZ_PKG_FORMAT
         MOZ_PKG_FORMAT  = DMG
     else
         ifeq (WINNT,$(OS_ARCH))
             MOZ_PKG_FORMAT  = ZIP
         else
             ifeq (SunOS,$(OS_ARCH))
                 MOZ_PKG_FORMAT  = BZ2
             else
-                ifeq (gtk3,$(MOZ_WIDGET_TOOLKIT))
+                ifeq (gtk,$(MOZ_WIDGET_TOOLKIT))
                     MOZ_PKG_FORMAT  = BZ2
                 else
                     ifeq (android,$(MOZ_WIDGET_TOOLKIT))
                         MOZ_PKG_FORMAT = APK
                     else
                         MOZ_PKG_FORMAT = TGZ
                     endif
                 endif
--- a/toolkit/mozapps/update/updater/moz.build
+++ b/toolkit/mozapps/update/updater/moz.build
@@ -60,10 +60,10 @@ elif CONFIG['MOZ_UPDATE_CHANNEL'] in ('n
 else:
     primary_cert.inputs += ['dep1.der']
     secondary_cert.inputs += ['dep2.der']
 
 dep1_cert.inputs += ['dep1.der']
 dep2_cert.inputs += ['dep2.der']
 xpcshell_cert.inputs += ['xpcshellCertificate.der']
 
-if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
     FINAL_TARGET_FILES.icons += ['updater.png']
--- a/toolkit/mozapps/update/updater/updater-common.build
+++ b/toolkit/mozapps/update/updater/updater-common.build
@@ -42,17 +42,17 @@ if CONFIG['OS_ARCH'] == 'WINNT':
 
 USE_LIBS += [
     'bspatch',
     'mar',
     'updatecommon',
     'xz-embedded',
 ]
 
-if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
     have_progressui = 1
     srcs += [
         'progressui_gtk.cpp',
     ]
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
     have_progressui = 1
     srcs += [
@@ -95,14 +95,14 @@ DELAYLOAD_DLLS += [
     'wsock32.dll',
 ]
 
 if CONFIG['CC_TYPE'] == 'clang-cl':
     WIN32_EXE_LDFLAGS += ['-ENTRY:wmainCRTStartup']
 elif CONFIG['OS_ARCH'] == 'WINNT':
     WIN32_EXE_LDFLAGS += ['-municode']
 
-if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
     CXXFLAGS += CONFIG['TK_CFLAGS']
     OS_LIBS += CONFIG['TK_LIBS']
 
 if CONFIG['CC_TYPE'] == 'gcc':
     CXXFLAGS += ['-Wno-format-truncation']
--- a/toolkit/themes/moz.build
+++ b/toolkit/themes/moz.build
@@ -15,17 +15,17 @@
 #                         non-mac (toolkit/themes/shared/non-mac)
 # mobile                  native UIs that do not use XUL for UI
 
 toolkit = CONFIG['MOZ_WIDGET_TOOLKIT']
 app = CONFIG['MOZ_BUILD_APP']
 
 if toolkit == 'cocoa':
     DIRS += ['osx']
-elif toolkit == 'gtk3':
+elif toolkit == 'gtk':
     DIRS += ['linux']
 elif app == 'mobile/android':
     DIRS += ['mobile']
 else:
     DIRS += ['windows']
 
 with Files('**'):
     BUG_COMPONENT = ('Toolkit', 'Themes')
--- a/toolkit/toolkit.mozbuild
+++ b/toolkit/toolkit.mozbuild
@@ -151,17 +151,17 @@ DIRS += [
     '/devtools',
     '/toolkit/library',
     '/services',
     '/startupcache',
     '/js/ductwork/debugger',
     '/other-licenses/snappy',
 ]
 
-if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
     DIRS += [
         '/toolkit/system/gnome',
     ]
 
 if CONFIG['ENABLE_REMOTE_AGENT']:
     DIRS += ['/remote']
 
 if CONFIG['ENABLE_MARIONETTE']:
--- a/toolkit/xre/moz.build
+++ b/toolkit/xre/moz.build
@@ -82,31 +82,31 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'co
     LOCAL_INCLUDES += [
         '../components/printingui',
     ]
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'uikit':
     UNIFIED_SOURCES += [
         'nsNativeAppSupportDefault.cpp',
         'UIKitDirProvider.mm',
     ]
-elif 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
+elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
     UNIFIED_SOURCES += [
         'nsNativeAppSupportUnix.cpp',
     ]
 else:
     UNIFIED_SOURCES += [
         'nsNativeAppSupportDefault.cpp',
     ]
 
 if CONFIG['MOZ_HAS_REMOTE']:
     LOCAL_INCLUDES += [
         '../components/remote',
     ]
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
     UNIFIED_SOURCES += [
         'nsGDKErrorHandler.cpp',
     ]
 
 if CONFIG['MOZ_X11']:
     EXPORTS += ['nsX11ErrorHandler.h']
     UNIFIED_SOURCES += [
         'nsX11ErrorHandler.cpp',
@@ -240,17 +240,17 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'coco
         '/widget/cocoa',
         '/xpcom/base',
     ]
 
 CXXFLAGS += CONFIG['TK_CFLAGS']
 CXXFLAGS += CONFIG['MOZ_DBUS_CFLAGS']
 CXXFLAGS += CONFIG['MOZ_DBUS_GLIB_CFLAGS']
 
-if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
     CXXFLAGS += CONFIG['MOZ_PANGO_CFLAGS']
 
 DEFINES['TOPOBJDIR'] = TOPOBJDIR
 FINAL_TARGET_PP_FILES += [
     'platform.ini'
 ]
 
 if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
--- a/uriloader/exthandler/moz.build
+++ b/uriloader/exthandler/moz.build
@@ -81,17 +81,17 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'ui
 else:
     # These files can't be built in unified mode because they redefine LOG.
     SOURCES += [
         osdir + '/nsOSHelperAppService.cpp',
     ]
     if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
         CXXFLAGS += ['-Wno-error=shadow']
 
-if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
     UNIFIED_SOURCES += [
         'unix/nsGNOMERegistry.cpp',
         'unix/nsMIMEInfoUnix.cpp',
     ]
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
     UNIFIED_SOURCES += [
         'android/nsAndroidHandlerApp.cpp',
         'android/nsExternalURLHandlerService.cpp',
@@ -139,11 +139,11 @@ LOCAL_INCLUDES += [
     '/netwerk/base',
     '/netwerk/protocol/http',
 ]
 
 if CONFIG['MOZ_ENABLE_DBUS']:
     CXXFLAGS += CONFIG['TK_CFLAGS']
     CXXFLAGS += CONFIG['MOZ_DBUS_CFLAGS']
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
     CXXFLAGS += CONFIG['TK_CFLAGS']
     CXXFLAGS += CONFIG['MOZ_DBUS_GLIB_CFLAGS']
--- a/widget/gtk/moz.build
+++ b/widget/gtk/moz.build
@@ -8,17 +8,17 @@ with Files("**"):
     BUG_COMPONENT = ("Core", "Widget: Gtk")
 
 with Files("*CompositorWidget*"):
     BUG_COMPONENT = ("Core", "Graphics")
 
 with Files("*WindowSurface*"):
     BUG_COMPONENT = ("Core", "Graphics")
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
     DIRS += ['mozgtk']
 
 if CONFIG['MOZ_WAYLAND']:
     DIRS += ['wayland', 'mozwayland']
 
 EXPORTS += [
     'mozcontainer.h',
     'nsGTKToolkit.h',
@@ -148,17 +148,17 @@ CFLAGS += CONFIG['MOZ_STARTUP_NOTIFICATI
 
 # When building with GTK3, the widget code always needs to use
 # system Cairo headers, regardless of whether we are also linked
 # against and using in-tree Cairo. By not using in-tree Cairo
 # headers, we avoid picking up our renamed symbols, and instead
 # use only system Cairo symbols that GTK3 uses. This allows that
 # any Cairo objects created can be freely passed back and forth
 # between the widget code and GTK3.
-if not (CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3' and CONFIG['MOZ_TREE_CAIRO']):
+if not (CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk' and CONFIG['MOZ_TREE_CAIRO']):
     CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
 
 CXXFLAGS += CONFIG['MOZ_STARTUP_NOTIFICATION_CFLAGS']
 
 CFLAGS += CONFIG['TK_CFLAGS']
 CXXFLAGS += CONFIG['TK_CFLAGS']
 
 if CONFIG['MOZ_WAYLAND']:
--- a/widget/headless/moz.build
+++ b/widget/headless/moz.build
@@ -10,18 +10,16 @@ with Files("**"):
 DIRS += ['tests']
 
 LOCAL_INCLUDES += [
     '/widget',
     '/widget/headless',
 ]
 
 widget_dir = CONFIG['MOZ_WIDGET_TOOLKIT']
-if widget_dir == 'gtk3':
-    widget_dir = 'gtk'
 
 LOCAL_INCLUDES += [
     '/widget/%s' % widget_dir,
 ]
 
 UNIFIED_SOURCES += [
     'HeadlessClipboard.cpp',
     'HeadlessClipboardData.cpp',
--- a/widget/headless/tests/xpcshell.ini
+++ b/widget/headless/tests/xpcshell.ini
@@ -1,9 +1,9 @@
 [DEFAULT]
-skip-if = toolkit != "gtk3" && toolkit != "windows"
+skip-if = toolkit != "gtk" && toolkit != "windows"
 headless = true
 
 [test_headless_clipboard.js]
 [test_headless.js]
 support-files =
   headless.html
   headless_button.html
--- a/widget/moz.build
+++ b/widget/moz.build
@@ -78,17 +78,17 @@ TEST_DIRS += ['tests']
 DIRS += ['headless']
 
 # Don't build the DSO under the 'build' directory as windows does.
 #
 # The DSOs get built in the toolkit dir itself.  Do this so that
 # multiple implementations of widget can be built on the same
 # source tree.
 #
-if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
     DIRS += ['gtk']
 
     if CONFIG['MOZ_X11']:
         DIRS += ['gtkxtbin']
 
     XPIDL_SOURCES += [
         'nsIGtkTaskbarProgress.idl',
         'nsITaskbarProgress.idl',
@@ -265,27 +265,27 @@ if toolkit == 'windows':
         'PluginWidgetProxy.cpp',
     ]
 
 if toolkit in ('cocoa', 'windows'):
     UNIFIED_SOURCES += [
         'nsBaseClipboard.cpp',
     ]
 
-if toolkit in {'gtk3', 'cocoa', 'windows',
+if toolkit in {'gtk', 'cocoa', 'windows',
                'android', 'uikit'}:
     UNIFIED_SOURCES += [
         'nsBaseFilePicker.cpp',
     ]
 
-if toolkit in ('gtk3', 'windows', 'cocoa', 'android'):
+if toolkit in ('gtk', 'windows', 'cocoa', 'android'):
     UNIFIED_SOURCES += [
         'nsNativeTheme.cpp',
     ]
-if toolkit == 'gtk3':
+if toolkit == 'gtk':
     XPIDL_SOURCES += [
         'nsIApplicationChooser.idl',
     ]
 
 DEFINES['MOZ_CROSS_PROCESS_IME'] = True
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
@@ -304,35 +304,31 @@ LOCAL_INCLUDES += [
 ]
 
 if toolkit == 'windows':
     IPDL_SOURCES = [
         'headless/HeadlessWidgetTypes.ipdlh',
         'windows/PCompositorWidget.ipdl',
         'windows/PlatformWidgetTypes.ipdlh',
     ]
-elif 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT'] and CONFIG['MOZ_X11']:
+elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk' and CONFIG['MOZ_X11']:
     IPDL_SOURCES = [
         'gtk/PCompositorWidget.ipdl',
         'gtk/PlatformWidgetTypes.ipdlh',
         'headless/HeadlessWidgetTypes.ipdlh',
     ]
 else:
     IPDL_SOURCES = [
         'headless/HeadlessWidgetTypes.ipdlh',
         'PCompositorWidget.ipdl',
         'PlatformWidgetTypes.ipdlh',
     ]
 
-widget_dir = toolkit
-if widget_dir == 'gtk3':
-    widget_dir = 'gtk'
-
 LOCAL_INCLUDES += [
-    '/widget/%s' % widget_dir,
+    '/widget/%s' % toolkit,
 ]
 FINAL_LIBRARY = 'xul'
 
 if CONFIG['MOZ_ENABLE_D3D10_LAYER']:
     DEFINES['MOZ_ENABLE_D3D10_LAYER'] = True
 
 CXXFLAGS += CONFIG['TK_CFLAGS']
 if CONFIG['MOZ_WAYLAND']:
--- a/widget/tests/chrome.ini
+++ b/widget/tests/chrome.ini
@@ -87,17 +87,17 @@ support-files = file_secure_input.html
 skip-if = toolkit != "cocoa"
 [test_native_key_bindings_mac.html]
 skip-if = toolkit != "cocoa" || verify
 [test_system_status_bar.xul]
 skip-if = toolkit != "cocoa"
 
 [test_system_font_changes.xul]
 support-files = system_font_changes.xul
-run-if = toolkit == 'gtk3' # Currently the test works on only gtk3
+run-if = toolkit == 'gtk' # Currently the test works on only gtk3
 
 # Windows
 # taskbar_previews.xul
 # window_state_windows.xul
 [test_chrome_context_menus_win.xul]
 skip-if = toolkit != "windows"
 support-files = chrome_context_menus_win.xul
 [test_plugin_input_event.html]
--- a/xpcom/base/moz.build
+++ b/xpcom/base/moz.build
@@ -241,10 +241,10 @@ FINAL_LIBRARY = 'xul'
 LOCAL_INCLUDES += [
     '../build',
     '/dom/base',
     '/mfbt',
     '/netwerk/base',
     '/xpcom/ds',
 ]
 
-if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
     CXXFLAGS += CONFIG['TK_CFLAGS']
--- a/xpcom/components/moz.build
+++ b/xpcom/components/moz.build
@@ -68,15 +68,15 @@ LOCAL_INCLUDES += [
     '../build',
     '../ds',
     '/chrome',
     '/js/xpconnect/loader',
     '/layout/build',
     '/modules/libjar',
 ]
 
-if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
     CXXFLAGS += CONFIG['TK_CFLAGS']
 
 if CONFIG['MOZ_LAYOUT_DEBUGGER']:
     DEFINES['MOZ_LAYOUT_DEBUGGER'] = True
 
 include('/ipc/chromium/chromium-config.mozbuild')
--- a/xpcom/glue/standalone/moz.build
+++ b/xpcom/glue/standalone/moz.build
@@ -27,10 +27,10 @@ LOCAL_INCLUDES += [
     '../../threads',
 ]
 
 # Don't use STL wrappers here (i.e. wrapped <new>); they require mozalloc
 DisableStlWrapping()
 
 DIST_INSTALL = True
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
     CXXFLAGS += CONFIG['GLIB_CFLAGS']