Bug 1325503 - Remove Windows {XP, Server 2003, Vista} support from widget/. r=jimm.
authorNicholas Nethercote <nnethercote@mozilla.com>
Fri, 23 Dec 2016 13:13:31 +1100
changeset 328892 0673be23886e7eadfa5d815394357db365b86f70
parent 328891 5001b49ef3f6083e770fb23749a629a0c9b0d825
child 328893 7139c89482fb880253548fb2157a5ff37ae12f33
push id31191
push usercbook@mozilla.com
push dateWed, 11 Jan 2017 15:24:19 +0000
treeherdermozilla-central@63ad56438630 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm
bugs1325503
milestone53.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 1325503 - Remove Windows {XP, Server 2003, Vista} support from widget/. r=jimm. I did my best to remove as much stuff as possible in this patch. The starting point was to remove all the IsVistaOrLater() and IsWin7OrLater() calls, but I also grepped for various strings and found some other removable stuff that way. I may have still missed some things. Notable things done by this patch. - It removes numerous blocklist entries. - It removes CanComputeVirtualKeyCodeFromScanCode(), because it's always true now. - It removes ShowXP{Folder,File}Picker(), even though these were available as fallbacks on Vista+. The "when platform is built without the longhorn SDK" condition in the comment above nsFilePicker::ShowXPFolderPicker() sounds like it won't ever happen any more. - It removes the config.trim_on_minimize preference. This requires adding a bool sHaveInitializedPrefs variable; previously the lack of pref initialization was indicated by the tri-state sTrimOnMinimize variable having the value 2. Notable things *not* done by this patch. - ClearThemeRegion() still exists. The comment suggests that it is XP/Vista only, but the code suggests otherwise. jimm thinks the comment is wrong. - The comment in WinWakeLockListener::Callback() suggests that the StartTimer() call is no longer needed to block the screen saver. I'm uncertain about this and so I think it's best left to a follow-up.
layout/style/nsMediaFeatures.cpp
widget/GfxInfoBase.cpp
widget/LookAndFeel.h
widget/windows/GfxInfo.cpp
widget/windows/KeyboardLayout.cpp
widget/windows/KeyboardLayout.h
widget/windows/TSFTextStore.cpp
widget/windows/WinMouseScrollHandler.cpp
widget/windows/WinTaskbar.cpp
widget/windows/WinUtils.cpp
widget/windows/nsDataObj.cpp
widget/windows/nsFilePicker.cpp
widget/windows/nsFilePicker.h
widget/windows/nsLookAndFeel.cpp
widget/windows/nsNativeThemeWin.cpp
widget/windows/nsNativeThemeWin.h
widget/windows/nsUXThemeConstants.h
widget/windows/nsUXThemeData.cpp
widget/windows/nsWindow.cpp
widget/windows/nsWindow.h
--- a/layout/style/nsMediaFeatures.cpp
+++ b/layout/style/nsMediaFeatures.cpp
@@ -66,18 +66,16 @@ const WindowsThemeName themeStrings[] = 
 
 struct OperatingSystemVersionInfo {
   LookAndFeel::OperatingSystemVersion id;
   const wchar_t* name;
 };
 
 // Os version identities used in the -moz-os-version media query.
 const OperatingSystemVersionInfo osVersionStrings[] = {
-  { LookAndFeel::eOperatingSystemVersion_WindowsXP,     L"windows-xp" },
-  { LookAndFeel::eOperatingSystemVersion_WindowsVista,  L"windows-vista" },
   { LookAndFeel::eOperatingSystemVersion_Windows7,      L"windows-win7" },
   { LookAndFeel::eOperatingSystemVersion_Windows8,      L"windows-win8" },
   { LookAndFeel::eOperatingSystemVersion_Windows10,     L"windows-win10" }
 };
 #endif
 
 // A helper for four features below
 static nsSize
--- a/widget/GfxInfoBase.cpp
+++ b/widget/GfxInfoBase.cpp
@@ -245,23 +245,17 @@ RemovePrefForDriverVersion()
 {
   Preferences::ClearUser(SUGGESTED_VERSION_PREF);
 }
 
 
 static OperatingSystem
 BlacklistOSToOperatingSystem(const nsAString& os)
 {
-  if (os.EqualsLiteral("WINNT 5.1"))
-    return OperatingSystem::WindowsXP;
-  else if (os.EqualsLiteral("WINNT 5.2"))
-    return OperatingSystem::WindowsServer2003;
-  else if (os.EqualsLiteral("WINNT 6.0"))
-    return OperatingSystem::WindowsVista;
-  else if (os.EqualsLiteral("WINNT 6.1"))
+  if (os.EqualsLiteral("WINNT 6.1"))
     return OperatingSystem::Windows7;
   else if (os.EqualsLiteral("WINNT 6.2"))
     return OperatingSystem::Windows8;
   else if (os.EqualsLiteral("WINNT 6.3"))
     return OperatingSystem::Windows8_1;
   else if (os.EqualsLiteral("WINNT 10.0"))
     return OperatingSystem::Windows10;
   else if (os.EqualsLiteral("Linux"))
--- a/widget/LookAndFeel.h
+++ b/widget/LookAndFeel.h
@@ -413,16 +413,17 @@ public:
     eWindowsTheme_Zune,
     eWindowsTheme_AeroLite
   };
 
   /**
    * Operating system versions.
    */
   enum OperatingSystemVersion {
+    // XXX: The XP and Vista values can now be removed (see bug 1330146).
     eOperatingSystemVersion_WindowsXP = 0,
     eOperatingSystemVersion_WindowsVista,
     eOperatingSystemVersion_Windows7,
     eOperatingSystemVersion_Windows8,
     eOperatingSystemVersion_Windows10,
     eOperatingSystemVersion_Unknown
   };
 
--- a/widget/windows/GfxInfo.cpp
+++ b/widget/windows/GfxInfo.cpp
@@ -236,19 +236,16 @@ ParseIDFromDeviceID(const nsAString &key
   nsresult err;
   return id.ToInteger(&err, 16);
 }
 
 // OS version in 16.16 major/minor form
 // based on http://msdn.microsoft.com/en-us/library/ms724834(VS.85).aspx
 enum {
   kWindowsUnknown = 0,
-  kWindowsXP = 0x50001,
-  kWindowsServer2003 = 0x50002,
-  kWindowsVista = 0x60000,
   kWindows7 = 0x60001,
   kWindows8 = 0x60002,
   kWindows8_1 = 0x60003,
   kWindows10 = 0xA0000
 };
 
 static int32_t
 WindowsOSVersion()
@@ -864,22 +861,16 @@ GfxInfo::AddCrashReportAnnotations()
 
 #endif
 }
 
 static OperatingSystem
 WindowsVersionToOperatingSystem(int32_t aWindowsVersion)
 {
   switch(aWindowsVersion) {
-    case kWindowsXP:
-      return OperatingSystem::WindowsXP;
-    case kWindowsServer2003:
-      return OperatingSystem::WindowsServer2003;
-    case kWindowsVista:
-      return OperatingSystem::WindowsVista;
     case kWindows7:
       return OperatingSystem::Windows7;
     case kWindows8:
       return OperatingSystem::Windows8;
     case kWindows8_1:
       return OperatingSystem::Windows8_1;
     case kWindows10:
       return OperatingSystem::Windows10;
@@ -898,58 +889,37 @@ GfxInfo::GetGfxDriverInfo()
      * should be inserted -before- more generalized restriction. As the first
      * match for feature/OS/device found in the list will be used for the final
      * blacklisting call.
      */
 
     /*
      * NVIDIA entries
      */
-    APPEND_TO_DRIVER_BLOCKLIST(OperatingSystem::WindowsXP,
-      (nsAString&) GfxDriverInfo::GetDeviceVendor(VendorNVIDIA), GfxDriverInfo::allDevices,
-      GfxDriverInfo::allFeatures, nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION,
-      DRIVER_LESS_THAN_OR_EQUAL, V(6,14,11,8745), "FEATURE_FAILURE_NV_XP", "nVidia driver > 187.45" );
-
     /*
      * The last 5 digit of the NVIDIA driver version maps to the version that
      * NVIDIA uses. The minor version (15, 16, 17) corresponds roughtly to the
      * OS (Vista, Win7, Win7) but they show up in smaller numbers across all
      * OS versions (perhaps due to OS upgrades). So we want to support
      * October 2009+ drivers across all these minor versions.
      *
      * 187.45 (late October 2009) and earlier contain a bug which can cause us
      * to crash on shutdown.
      */
-    APPEND_TO_DRIVER_BLOCKLIST(OperatingSystem::WindowsVista,
-      (nsAString&) GfxDriverInfo::GetDeviceVendor(VendorNVIDIA), GfxDriverInfo::allDevices,
-      GfxDriverInfo::allFeatures, nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION,
-      DRIVER_LESS_THAN_OR_EQUAL, V(8,15,11,8745),
-      "FEATURE_FAILURE_NV_VISTA_15", "nVidia driver > 187.45" );
     APPEND_TO_DRIVER_BLOCKLIST(OperatingSystem::Windows7,
       (nsAString&) GfxDriverInfo::GetDeviceVendor(VendorNVIDIA), GfxDriverInfo::allDevices,
       GfxDriverInfo::allFeatures, nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION,
       DRIVER_LESS_THAN_OR_EQUAL, V(8,15,11,8745),
       "FEATURE_FAILURE_NV_W7_15", "nVidia driver > 187.45" );
-    APPEND_TO_DRIVER_BLOCKLIST_RANGE(OperatingSystem::WindowsVista,
-      (nsAString&) GfxDriverInfo::GetDeviceVendor(VendorNVIDIA), GfxDriverInfo::allDevices,
-      GfxDriverInfo::allFeatures, nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION,
-      DRIVER_BETWEEN_INCLUSIVE_START, V(8,16,10,0000), V(8,16,11,8745),
-      "FEATURE_FAILURE_NV_VISTA_16", "nVidia driver > 187.45" );
     APPEND_TO_DRIVER_BLOCKLIST_RANGE(OperatingSystem::Windows7,
       (nsAString&) GfxDriverInfo::GetDeviceVendor(VendorNVIDIA), GfxDriverInfo::allDevices,
       GfxDriverInfo::allFeatures, nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION,
       DRIVER_BETWEEN_INCLUSIVE_START, V(8,16,10,0000), V(8,16,11,8745),
       "FEATURE_FAILURE_NV_W7_16", "nVidia driver > 187.45" );
     // Telemetry doesn't show any driver in this range so it might not even be required.
-    APPEND_TO_DRIVER_BLOCKLIST_RANGE(OperatingSystem::WindowsVista,
-      (nsAString&) GfxDriverInfo::GetDeviceVendor(VendorNVIDIA), GfxDriverInfo::allDevices,
-      GfxDriverInfo::allFeatures, nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION,
-      DRIVER_BETWEEN_INCLUSIVE_START, V(8,17,10,0000), V(8,17,11,8745),
-      "FEATURE_FAILURE_NV_VISTA_17", "nVidia driver > 187.45" );
-    // Telemetry doesn't show any driver in this range so it might not even be required.
     APPEND_TO_DRIVER_BLOCKLIST_RANGE(OperatingSystem::Windows7,
       (nsAString&) GfxDriverInfo::GetDeviceVendor(VendorNVIDIA), GfxDriverInfo::allDevices,
       GfxDriverInfo::allFeatures, nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION,
       DRIVER_BETWEEN_INCLUSIVE_START, V(8,17,10,0000), V(8,17,11,8745),
       "FEATURE_FAILURE_NV_W7_17", "nVidia driver > 187.45" );
 
     /*
      * AMD/ATI entries. 8.56.1.15 is the driver that shipped with Windows 7 RTM
@@ -1037,64 +1007,32 @@ GfxInfo::GetGfxDriverInfo()
         DRIVER_LESS_THAN, driverVer, ruleId )
 
     #define IMPLEMENT_INTEL_DRIVER_BLOCKLIST_D2D(winVer, devFamily, driverVer, ruleId)                                          \
       APPEND_TO_DRIVER_BLOCKLIST2( winVer,                                                                                      \
         (nsAString&) GfxDriverInfo::GetDeviceVendor(VendorIntel), (GfxDeviceFamily*) GfxDriverInfo::GetDeviceFamily(devFamily), \
         nsIGfxInfo::FEATURE_DIRECT2D, nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION,                                               \
         DRIVER_BUILD_ID_LESS_THAN, driverVer, ruleId )
 
-    IMPLEMENT_INTEL_DRIVER_BLOCKLIST_D2D(OperatingSystem::WindowsVista, IntelGMA500,   1006, "FEATURE_FAILURE_594877_1");
-    IMPLEMENT_INTEL_DRIVER_BLOCKLIST_D2D(OperatingSystem::WindowsVista, IntelGMA900,   GfxDriverInfo::allDriverVersions, "FEATURE_FAILURE_594877_2");
-    IMPLEMENT_INTEL_DRIVER_BLOCKLIST_D2D(OperatingSystem::WindowsVista, IntelGMA950,   1504, "FEATURE_FAILURE_594877_3");
-    IMPLEMENT_INTEL_DRIVER_BLOCKLIST_D2D(OperatingSystem::WindowsVista, IntelGMA3150,  2124, "FEATURE_FAILURE_594877_4");
-    IMPLEMENT_INTEL_DRIVER_BLOCKLIST_D2D(OperatingSystem::WindowsVista, IntelGMAX3000, 1666, "FEATURE_FAILURE_594877_5");
-    IMPLEMENT_INTEL_DRIVER_BLOCKLIST_D2D(OperatingSystem::WindowsVista, IntelHDGraphicsToSandyBridge, 2202, "FEATURE_FAILURE_594877_6");
-
     IMPLEMENT_INTEL_DRIVER_BLOCKLIST_D2D(OperatingSystem::Windows7, IntelGMA500,   2026, "FEATURE_FAILURE_594877_7");
     IMPLEMENT_INTEL_DRIVER_BLOCKLIST_D2D(OperatingSystem::Windows7, IntelGMA900,   GfxDriverInfo::allDriverVersions, "FEATURE_FAILURE_594877_8");
     IMPLEMENT_INTEL_DRIVER_BLOCKLIST_D2D(OperatingSystem::Windows7, IntelGMA950,   1930, "FEATURE_FAILURE_594877_9");
     IMPLEMENT_INTEL_DRIVER_BLOCKLIST_D2D(OperatingSystem::Windows7, IntelGMA3150,  2117, "FEATURE_FAILURE_594877_10");
     IMPLEMENT_INTEL_DRIVER_BLOCKLIST_D2D(OperatingSystem::Windows7, IntelGMAX3000, 1930, "FEATURE_FAILURE_594877_11");
     IMPLEMENT_INTEL_DRIVER_BLOCKLIST_D2D(OperatingSystem::Windows7, IntelHDGraphicsToSandyBridge, 2202, "FEATURE_FAILURE_594877_12");
 
     /* Disable Direct2D on Intel GMAX4500 devices because of rendering corruption discovered
      * in bug 1180379. These seems to affect even the most recent drivers. We're black listing
      * all of the devices to be safe even though we've only confirmed the issue on the G45
      */
     APPEND_TO_DRIVER_BLOCKLIST2(OperatingSystem::Windows,
         (nsAString&) GfxDriverInfo::GetDeviceVendor(VendorIntel), (GfxDeviceFamily*) GfxDriverInfo::GetDeviceFamily(IntelGMAX4500HD),
       nsIGfxInfo::FEATURE_DIRECT2D, nsIGfxInfo::FEATURE_BLOCKED_DEVICE,
       DRIVER_LESS_THAN, GfxDriverInfo::allDriverVersions, "FEATURE_FAILURE_1180379");
 
-    IMPLEMENT_INTEL_DRIVER_BLOCKLIST(OperatingSystem::WindowsXP, IntelGMA500,   V(3,0,20,3200), "FEATURE_FAILURE_INTEL_1");
-    IMPLEMENT_INTEL_DRIVER_BLOCKLIST(OperatingSystem::WindowsXP, IntelGMA900,   V(6,14,10,4764), "FEATURE_FAILURE_INTEL_2");
-    IMPLEMENT_INTEL_DRIVER_BLOCKLIST(OperatingSystem::WindowsXP, IntelGMA950,   V(6,14,10,4926), "FEATURE_FAILURE_INTEL_3");
-    IMPLEMENT_INTEL_DRIVER_BLOCKLIST(OperatingSystem::WindowsXP, IntelGMA3150,  V(6,14,10,5134), "FEATURE_FAILURE_INTEL_4");
-    IMPLEMENT_INTEL_DRIVER_BLOCKLIST(OperatingSystem::WindowsXP, IntelGMAX3000, V(6,14,10,5218), "FEATURE_FAILURE_INTEL_5");
-    IMPLEMENT_INTEL_DRIVER_BLOCKLIST(OperatingSystem::WindowsXP, IntelGMAX4500HD, V(6,14,10,4969), "FEATURE_FAILURE_INTEL_6");
-    IMPLEMENT_INTEL_DRIVER_BLOCKLIST(OperatingSystem::WindowsXP, IntelHDGraphicsToSandyBridge, V(6,14,10,4969), "FEATURE_FAILURE_INTEL_7");
-
-    // StrechRect seems to suffer from precision issues which leads to artifacting
-    // during content drawing starting with at least version 6.14.10.5082
-    // and going until 6.14.10.5218. See bug 919454 and bug 949275 for more info.
-    APPEND_TO_DRIVER_BLOCKLIST_RANGE(OperatingSystem::WindowsXP,
-      const_cast<nsAString&>(GfxDriverInfo::GetDeviceVendor(VendorIntel)),
-      const_cast<GfxDeviceFamily*>(GfxDriverInfo::GetDeviceFamily(IntelGMAX4500HD)),
-      GfxDriverInfo::allFeatures, nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION,
-      DRIVER_BETWEEN_EXCLUSIVE, V(6,14,10,5076), V(6,14,10,5218), "FEATURE_FAILURE_INTEL_8", "6.14.10.5218");
-
-    IMPLEMENT_INTEL_DRIVER_BLOCKLIST(OperatingSystem::WindowsVista, IntelGMA500,   V(3,0,20,3200), "FEATURE_FAILURE_INTEL_9");
-    IMPLEMENT_INTEL_DRIVER_BLOCKLIST(OperatingSystem::WindowsVista, IntelGMA900,   GfxDriverInfo::allDriverVersions, "FEATURE_FAILURE_INTEL_10");
-    IMPLEMENT_INTEL_DRIVER_BLOCKLIST(OperatingSystem::WindowsVista, IntelGMA950,   V(7,14,10,1504), "FEATURE_FAILURE_INTEL_11");
-    IMPLEMENT_INTEL_DRIVER_BLOCKLIST(OperatingSystem::WindowsVista, IntelGMA3150,  V(7,14,10,1910), "FEATURE_FAILURE_INTEL_12");
-    IMPLEMENT_INTEL_DRIVER_BLOCKLIST(OperatingSystem::WindowsVista, IntelGMAX3000, V(7,15,10,1666), "FEATURE_FAILURE_INTEL_13");
-    IMPLEMENT_INTEL_DRIVER_BLOCKLIST(OperatingSystem::WindowsVista, IntelGMAX4500HD, V(7,15,10,1666), "FEATURE_FAILURE_INTEL_14");
-    IMPLEMENT_INTEL_DRIVER_BLOCKLIST(OperatingSystem::WindowsVista, IntelHDGraphicsToSandyBridge, V(7,15,10,1666), "FEATURE_FAILURE_INTEL_15");
-
     IMPLEMENT_INTEL_DRIVER_BLOCKLIST(OperatingSystem::Windows7, IntelGMA500,   V(5,0,0,2026), "FEATURE_FAILURE_INTEL_16");
     IMPLEMENT_INTEL_DRIVER_BLOCKLIST(OperatingSystem::Windows7, IntelGMA900,   GfxDriverInfo::allDriverVersions, "FEATURE_FAILURE_INTEL_17");
     IMPLEMENT_INTEL_DRIVER_BLOCKLIST(OperatingSystem::Windows7, IntelGMA950,   V(8,15,10,1930), "FEATURE_FAILURE_INTEL_18");
     IMPLEMENT_INTEL_DRIVER_BLOCKLIST(OperatingSystem::Windows7, IntelGMA3150,  V(8,14,10,1972), "FEATURE_FAILURE_INTEL_19");
     IMPLEMENT_INTEL_DRIVER_BLOCKLIST(OperatingSystem::Windows7, IntelGMAX3000, V(7,15,10,1666), "FEATURE_FAILURE_INTEL_20");
     IMPLEMENT_INTEL_DRIVER_BLOCKLIST(OperatingSystem::Windows7, IntelGMAX4500HD, V(7,15,10,1666), "FEATURE_FAILURE_INTEL_21");
     IMPLEMENT_INTEL_DRIVER_BLOCKLIST(OperatingSystem::Windows7, IntelHDGraphicsToSandyBridge, V(7,15,10,1666), "FEATURE_FAILURE_INTEL_22");
 
@@ -1327,33 +1265,16 @@ GfxInfo::GetFeatureStatusImpl(int32_t aF
 
     uint64_t driverVersion;
     if (!ParseDriverVersion(adapterDriverVersionString, &driverVersion)) {
       aFailureId = "FEATURE_FAILURE_PARSE_DRIVER";
       *aStatus = FEATURE_BLOCKED_DRIVER_VERSION;
       return NS_OK;
     }
 
-    // special-case the WinXP test slaves: they have out-of-date drivers, but we still want to
-    // whitelist them, actually we do know that this combination of device and driver version
-    // works well.
-    if (mWindowsVersion == kWindowsXP &&
-        adapterVendorID.Equals(GfxDriverInfo::GetDeviceVendor(VendorNVIDIA), nsCaseInsensitiveStringComparator()) &&
-        adapterDeviceID.LowerCaseEqualsLiteral("0x0861") && // GeForce 9400
-        driverVersion == V(6,14,11,7756))
-    {
-      *aStatus = FEATURE_STATUS_OK;
-      return NS_OK;
-    }
-
-    // Windows Server 2003 should be just like Windows XP for present purpose, but still has a different version number.
-    // OTOH Windows Server 2008 R1 and R2 already have the same version numbers as Vista and Seven respectively
-    if (os == OperatingSystem::WindowsServer2003)
-      os = OperatingSystem::WindowsXP;
-
     if (mHasDriverVersionMismatch) {
       *aStatus = nsIGfxInfo::FEATURE_BLOCKED_MISMATCHED_VERSION;
       return NS_OK;
     }
   }
 
   return GfxInfoBase::GetFeatureStatusImpl(aFeature, aStatus, aSuggestedDriverVersion, aDriverInfo, aFailureId, &os);
 }
--- a/widget/windows/KeyboardLayout.cpp
+++ b/widget/windows/KeyboardLayout.cpp
@@ -1353,44 +1353,16 @@ NativeKey::InitWithKeyChar()
       // mOriginalVirtualKeyCode to mVirtualKeyCode.  Note that don't compute
       // it from MapVirtualKeyEx() because the scan code might be wrong if
       // the message is sent/posted by other application.  Then, we will compute
       // unexpected keycode from the scan code.
       if (!isLeftRightDistinguishedKey) {
         break;
       }
 
-      if (!CanComputeVirtualKeyCodeFromScanCode()) {
-        // The right control key and the right alt key are extended keys.
-        // Therefore, we never get VK_RCONTRL and VK_RMENU for the result of
-        // MapVirtualKeyEx() on WinXP or WinServer2003.
-        //
-        // If VK_SHIFT, VK_CONTROL or VK_MENU key message is caused by well
-        // known scan code, we should decide it as Right key.  Otherwise,
-        // decide it as Left key.
-        switch (mOriginalVirtualKeyCode) {
-          case VK_CONTROL:
-            mVirtualKeyCode =
-              mIsExtended && mScanCode == 0x1D ? VK_RCONTROL : VK_LCONTROL;
-            break;
-          case VK_MENU:
-            mVirtualKeyCode =
-              mIsExtended && mScanCode == 0x38 ? VK_RMENU : VK_LMENU;
-            break;
-          case VK_SHIFT:
-            // Neither left shift nor right shift is an extended key,
-            // let's use VK_LSHIFT for unknown mapping.
-            mVirtualKeyCode = VK_LSHIFT;
-            break;
-          default:
-            MOZ_CRASH("Unsupported mOriginalVirtualKeyCode");
-        }
-        break;
-      }
-
       NS_ASSERTION(!mVirtualKeyCode,
                    "mVirtualKeyCode has been computed already");
 
       // Otherwise, compute the virtual keycode with MapVirtualKeyEx().
       mVirtualKeyCode = ComputeVirtualKeyCodeFromScanCodeEx();
 
       // Following code shouldn't be used now because we compute scancode value
       // if we detect that the sender doesn't set proper scancode.
@@ -1437,21 +1409,16 @@ NativeKey::InitWithKeyChar()
         mLastInstance->mReceivedMsg = mMsg;
         return;
       }
 
       // NOTE: If other applications like a11y tools sends WM_*CHAR without
       //       scancode, we cannot compute virtual keycode.  I.e., with such
       //       applications, we cannot generate proper KeyboardEvent.code value.
 
-      // We cannot compute the virtual key code from WM_CHAR message on WinXP
-      // if it's caused by an extended key.
-      if (!CanComputeVirtualKeyCodeFromScanCode()) {
-        break;
-      }
       mVirtualKeyCode = mOriginalVirtualKeyCode =
         ComputeVirtualKeyCodeFromScanCodeEx();
       NS_ASSERTION(mVirtualKeyCode, "Failed to compute virtual keycode");
       break;
     default:
       MOZ_CRASH("Unsupported message");
   }
 
@@ -1859,59 +1826,40 @@ NativeKey::GetKeyLocation() const
     case VK_MENU:
       NS_WARNING("Failed to decide the key location?");
 
     default:
       return nsIDOMKeyEvent::DOM_KEY_LOCATION_STANDARD;
   }
 }
 
-bool
-NativeKey::CanComputeVirtualKeyCodeFromScanCode() const
-{
-  // Vista or later supports ScanCodeEx.
-  if (IsVistaOrLater()) {
-    return true;
-  }
-  // Otherwise, MapVirtualKeyEx() can compute virtual keycode only with
-  // non-extended key.
-  return !mIsExtended;
-}
-
 uint8_t
 NativeKey::ComputeVirtualKeyCodeFromScanCode() const
 {
   return static_cast<uint8_t>(
            ::MapVirtualKeyEx(mScanCode, MAPVK_VSC_TO_VK, mKeyboardLayout));
 }
 
 uint8_t
 NativeKey::ComputeVirtualKeyCodeFromScanCodeEx() const
 {
   // MapVirtualKeyEx() has been improved for supporting extended keys since
   // Vista.  When we call it for mapping a scancode of an extended key and
   // a virtual keycode, we need to add 0xE000 to the scancode.
-  // On the other hand, neither WinXP nor WinServer2003 doesn't support 0xE000.
-  // Therefore, we have no way to get virtual keycode from scan code of
-  // extended keys.
-  if (NS_WARN_IF(!CanComputeVirtualKeyCodeFromScanCode())) {
-    return 0;
-  }
   return static_cast<uint8_t>(
            ::MapVirtualKeyEx(GetScanCodeWithExtendedFlag(), MAPVK_VSC_TO_VK_EX,
                              mKeyboardLayout));
 }
 
 uint16_t
 NativeKey::ComputeScanCodeExFromVirtualKeyCode(UINT aVirtualKeyCode) const
 {
   return static_cast<uint16_t>(
            ::MapVirtualKeyEx(aVirtualKeyCode,
-                             IsVistaOrLater() ? MAPVK_VK_TO_VSC_EX :
-                                                MAPVK_VK_TO_VSC,
+                             MAPVK_VK_TO_VSC_EX,
                              mKeyboardLayout));
 }
 
 char16_t
 NativeKey::ComputeUnicharFromScanCode() const
 {
   return static_cast<char16_t>(
            ::MapVirtualKeyEx(ComputeVirtualKeyCodeFromScanCode(),
@@ -4001,34 +3949,28 @@ KeyboardLayout::LoadLayout(HKL aLayout)
       }
     }
   }
 
   ::SetKeyboardState(originalKbdState);
 
   if (MOZ_LOG_TEST(sKeyboardLayoutLogger, LogLevel::Verbose)) {
     static const UINT kExtendedScanCode[] = { 0x0000, 0xE000 };
-    static const UINT kMapType =
-      IsVistaOrLater() ? MAPVK_VSC_TO_VK_EX : MAPVK_VSC_TO_VK;
+    static const UINT kMapType = MAPVK_VSC_TO_VK_EX;
     MOZ_LOG(sKeyboardLayoutLogger, LogLevel::Verbose,
       ("Logging virtual keycode values for scancode (0x%p)...",
        mKeyboardLayout));
     for (uint32_t i = 0; i < ArrayLength(kExtendedScanCode); i++) {
       for (uint32_t j = 1; j <= 0xFF; j++) {
         UINT scanCode = kExtendedScanCode[i] + j;
         UINT virtualKeyCode =
           ::MapVirtualKeyEx(scanCode, kMapType, mKeyboardLayout);
         MOZ_LOG(sKeyboardLayoutLogger, LogLevel::Verbose,
           ("0x%04X, %s", scanCode, kVirtualKeyName[virtualKeyCode]));
       }
-      // XP and Server 2003 don't support 0xE0 prefix of the scancode.
-      // Therefore, we don't need to continue on them.
-      if (!IsVistaOrLater()) {
-        break;
-      }
     }
   }
 }
 
 inline int32_t
 KeyboardLayout::GetKeyIndex(uint8_t aVirtualKey)
 {
 // Currently these 68 (NS_NUM_OF_KEYS) virtual keys are assumed
--- a/widget/windows/KeyboardLayout.h
+++ b/widget/windows/KeyboardLayout.h
@@ -545,21 +545,16 @@ private:
    * Otherwise, returns false.
    *
    * WARNING: Even if this returns true, aCharMsg may be WM_NULL or its
    *          hwnd may be different window.
    */
   bool GetFollowingCharMessage(MSG& aCharMsg);
 
   /**
-   * Whether the key event can compute virtual keycode from the scancode value.
-   */
-  bool CanComputeVirtualKeyCodeFromScanCode() const;
-
-  /**
    * Wraps MapVirtualKeyEx() with MAPVK_VSC_TO_VK.
    */
   uint8_t ComputeVirtualKeyCodeFromScanCode() const;
 
   /**
    * Wraps MapVirtualKeyEx() with MAPVK_VSC_TO_VK_EX.
    */
   uint8_t ComputeVirtualKeyCodeFromScanCodeEx() const;
--- a/widget/windows/TSFTextStore.cpp
+++ b/widget/windows/TSFTextStore.cpp
@@ -5644,18 +5644,17 @@ TSFTextStore::Initialize()
     ("TSFTextStore::Initialize() is called..."));
 
   if (sThreadMgr) {
     MOZ_LOG(sTextStoreLog, LogLevel::Error,
       ("  TSFTextStore::Initialize() FAILED due to already initialized"));
     return;
   }
 
-  bool enableTsf =
-    IsVistaOrLater() && Preferences::GetBool(kPrefNameEnableTSF, false);
+  bool enableTsf = Preferences::GetBool(kPrefNameEnableTSF, false);
   MOZ_LOG(sTextStoreLog, LogLevel::Info,
     ("  TSFTextStore::Initialize(), TSF is %s",
      enableTsf ? "enabled" : "disabled"));
   if (!enableTsf) {
     return;
   }
 
   // XXX MSDN documents that ITfInputProcessorProfiles is available only on
--- a/widget/windows/WinMouseScrollHandler.cpp
+++ b/widget/windows/WinMouseScrollHandler.cpp
@@ -987,20 +987,17 @@ MouseScrollHandler::SystemSettings::Init
     MOZ_LOG(gMouseScrollLog, LogLevel::Info,
       ("MouseScroll::SystemSettings::InitScrollChars(): mScrollChars is "
        "overridden by the pref: %d",
        mScrollChars));
   } else if (!::SystemParametersInfo(SPI_GETWHEELSCROLLCHARS, 0,
                                      &mScrollChars, 0)) {
     MOZ_LOG(gMouseScrollLog, LogLevel::Info,
       ("MouseScroll::SystemSettings::InitScrollChars(): ::SystemParametersInfo("
-       "SPI_GETWHEELSCROLLCHARS) failed, %s",
-       IsVistaOrLater() ?
-         "this is unexpected on Vista or later" :
-         "but on XP or earlier, this is not a problem"));
+       "SPI_GETWHEELSCROLLCHARS) failed, this is unexpected on Vista or later"));
     // XXX Should we use DefaultScrollChars()?
     mScrollChars = 1;
   }
 
   if (mScrollChars > WHEEL_DELTA) {
     MOZ_LOG(gMouseScrollLog, LogLevel::Info,
       ("MouseScroll::SystemSettings::InitScrollChars(): the result of "
        "::SystemParametersInfo(SPI_GETWHEELSCROLLCHARS) is too large: %d",
@@ -1076,17 +1073,17 @@ MouseScrollHandler::SystemSettings::Trus
 
   // XXX We're not sure about other touchpad drivers...
 }
 
 bool
 MouseScrollHandler::SystemSettings::IsOverridingSystemScrollSpeedAllowed()
 {
   return mScrollLines == DefaultScrollLines() &&
-         (!IsVistaOrLater() || mScrollChars == DefaultScrollChars());
+         mScrollChars == DefaultScrollChars();
 }
 
 /******************************************************************************
  *
  * UserPrefs
  *
  ******************************************************************************/
 
--- a/widget/windows/WinTaskbar.cpp
+++ b/widget/windows/WinTaskbar.cpp
@@ -334,19 +334,16 @@ WinTaskbar::GetDefaultGroupId(nsAString 
     return NS_ERROR_UNEXPECTED;
 
   return NS_OK;
 }
 
 // (static) Called from AppShell
 bool
 WinTaskbar::RegisterAppUserModelID() {
-  if (!IsWin7OrLater())
-    return false;
-
   SetCurrentProcessExplicitAppUserModelIDPtr funcAppUserModelID = nullptr;
   bool retVal = false;
 
   nsAutoString uid;
   if (!GetAppUserModelID(uid))
     return false;
 
   HMODULE hDLL = ::LoadLibraryW(kShellLibraryName);
@@ -367,17 +364,17 @@ WinTaskbar::RegisterAppUserModelID() {
 
   return retVal;
 }
 
 NS_IMETHODIMP
 WinTaskbar::GetAvailable(bool *aAvailable) {
   // ITaskbarList4::HrInit() may fail with shell extensions like blackbox
   // installed. Initialize early to return available=false in those cases.
-  *aAvailable = IsWin7OrLater() && Initialize();
+  *aAvailable = Initialize();
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 WinTaskbar::CreateTaskbarTabPreview(nsIDocShell *shell, nsITaskbarPreviewController *controller, nsITaskbarTabPreview **_retval) {
   if (!Initialize())
     return NS_ERROR_NOT_AVAILABLE;
--- a/widget/windows/WinUtils.cpp
+++ b/widget/windows/WinUtils.cpp
@@ -457,17 +457,17 @@ typedef NTSTATUS (NTAPI* NtTestAlertPtr)
 static NtTestAlertPtr sNtTestAlert = nullptr;
 #endif
 
 
 /* static */
 void
 WinUtils::Initialize()
 {
-  if (!sDwmDll && IsVistaOrLater()) {
+  if (!sDwmDll) {
     sDwmDll = ::LoadLibraryW(kDwmLibraryName);
 
     if (sDwmDll) {
       dwmExtendFrameIntoClientAreaPtr = (DwmExtendFrameIntoClientAreaProc)::GetProcAddress(sDwmDll, "DwmExtendFrameIntoClientArea");
       dwmIsCompositionEnabledPtr = (DwmIsCompositionEnabledProc)::GetProcAddress(sDwmDll, "DwmIsCompositionEnabled");
       dwmSetIconicThumbnailPtr = (DwmSetIconicThumbnailProc)::GetProcAddress(sDwmDll, "DwmSetIconicThumbnail");
       dwmSetIconicLivePreviewBitmapPtr = (DwmSetIconicLivePreviewBitmapProc)::GetProcAddress(sDwmDll, "DwmSetIconicLivePreviewBitmap");
       dwmGetWindowAttributePtr = (DwmGetWindowAttributeProc)::GetProcAddress(sDwmDll, "DwmGetWindowAttribute");
@@ -623,26 +623,24 @@ typedef HRESULT
 (WINAPI *GETPROCESSDPIAWARENESSPROC)(HANDLE, PROCESS_DPI_AWARENESS*);
 
 GETDPIFORMONITORPROC sGetDpiForMonitor;
 GETPROCESSDPIAWARENESSPROC sGetProcessDpiAwareness;
 
 static bool
 SlowIsPerMonitorDPIAware()
 {
-  if (IsVistaOrLater()) {
-    // Intentionally leak the handle.
-    HMODULE shcore =
-      LoadLibraryEx(L"shcore", NULL, LOAD_LIBRARY_SEARCH_SYSTEM32);
-    if (shcore) {
-      sGetDpiForMonitor =
-        (GETDPIFORMONITORPROC) GetProcAddress(shcore, "GetDpiForMonitor");
-      sGetProcessDpiAwareness =
-        (GETPROCESSDPIAWARENESSPROC) GetProcAddress(shcore, "GetProcessDpiAwareness");
-    }
+  // Intentionally leak the handle.
+  HMODULE shcore =
+    LoadLibraryEx(L"shcore", NULL, LOAD_LIBRARY_SEARCH_SYSTEM32);
+  if (shcore) {
+    sGetDpiForMonitor =
+      (GETDPIFORMONITORPROC) GetProcAddress(shcore, "GetDpiForMonitor");
+    sGetProcessDpiAwareness =
+      (GETPROCESSDPIAWARENESSPROC) GetProcAddress(shcore, "GetProcessDpiAwareness");
   }
   PROCESS_DPI_AWARENESS dpiAwareness;
   return sGetDpiForMonitor && sGetProcessDpiAwareness &&
       SUCCEEDED(sGetProcessDpiAwareness(GetCurrentProcess(), &dpiAwareness)) &&
       dpiAwareness == PROCESS_PER_MONITOR_DPI_AWARE;
 }
 
 /* static */ bool
@@ -755,17 +753,17 @@ WinUtils::GetMessage(LPMSG aMsg, HWND aW
   return ::GetMessageW(aMsg, aWnd, aFirstMessage, aLastMessage);
 }
 
 #if defined(ACCESSIBILITY)
 static DWORD
 GetWaitFlags()
 {
   DWORD result = MWMO_INPUTAVAILABLE;
-  if (IsVistaOrLater() && XRE_IsContentProcess()) {
+  if (XRE_IsContentProcess()) {
     result |= MWMO_ALERTABLE;
   }
   return result;
 }
 #endif
 
 /* static */
 void
@@ -1874,17 +1872,17 @@ WinUtils::IsTouchDeviceSupportPresent()
   return (touchCapabilities & NID_READY) &&
          (touchCapabilities & (NID_EXTERNAL_TOUCH | NID_INTEGRATED_TOUCH));
 }
 
 /* static */
 uint32_t
 WinUtils::GetMaxTouchPoints()
 {
-  if (IsWin7OrLater() && IsTouchDeviceSupportPresent()) {
+  if (IsTouchDeviceSupportPresent()) {
     return GetSystemMetrics(SM_MAXIMUMTOUCHES);
   }
   return 0;
 }
 
 #pragma pack(push, 1)
 typedef struct REPARSE_DATA_BUFFER {
   ULONG  ReparseTag;
@@ -1912,21 +1910,16 @@ typedef struct REPARSE_DATA_BUFFER {
   };
 } REPARSE_DATA_BUFFER, *PREPARSE_DATA_BUFFER;
 #pragma pack(pop)
 
 /* static */
 bool
 WinUtils::ResolveMovedUsersFolder(std::wstring& aPath)
 {
-  // Users folder was introduced with Vista.
-  if (!IsVistaOrLater()) {
-    return true;
-  }
-
   wchar_t* usersPath;
   if (FAILED(WinUtils::SHGetKnownFolderPath(FOLDERID_UserProfiles, 0, nullptr,
                                             &usersPath))) {
     return false;
   }
 
   // Ensure usersPath gets freed properly.
   UniquePtr<wchar_t, CoTaskMemFreePolicy> autoFreePath(usersPath);
@@ -2073,31 +2066,29 @@ WinUtils::GetAppInitDLLs(nsAString& aOut
   HKEY hkey = NULL;
   if (RegOpenKeyExW(HKEY_LOCAL_MACHINE,
         L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Windows",
         0, KEY_QUERY_VALUE, &hkey)) {
     return false;
   }
   nsAutoRegKey key(hkey);
   LONG status;
-  if (IsVistaOrLater()) {
-    const wchar_t kLoadAppInitDLLs[] = L"LoadAppInit_DLLs";
-    DWORD loadAppInitDLLs = 0;
-    DWORD loadAppInitDLLsLen = sizeof(loadAppInitDLLs);
-    status = RegQueryValueExW(hkey, kLoadAppInitDLLs, nullptr,
-                              nullptr, (LPBYTE)&loadAppInitDLLs,
-                              &loadAppInitDLLsLen);
-    if (status != ERROR_SUCCESS) {
-      return false;
-    }
-    if (!loadAppInitDLLs) {
-      // If loadAppInitDLLs is zero then AppInit_DLLs is disabled.
-      // In this case we'll return true along with an empty output string.
-      return true;
-    }
+  const wchar_t kLoadAppInitDLLs[] = L"LoadAppInit_DLLs";
+  DWORD loadAppInitDLLs = 0;
+  DWORD loadAppInitDLLsLen = sizeof(loadAppInitDLLs);
+  status = RegQueryValueExW(hkey, kLoadAppInitDLLs, nullptr,
+                            nullptr, (LPBYTE)&loadAppInitDLLs,
+                            &loadAppInitDLLsLen);
+  if (status != ERROR_SUCCESS) {
+    return false;
+  }
+  if (!loadAppInitDLLs) {
+    // If loadAppInitDLLs is zero then AppInit_DLLs is disabled.
+    // In this case we'll return true along with an empty output string.
+    return true;
   }
   DWORD numBytes = 0;
   const wchar_t kAppInitDLLs[] = L"AppInit_DLLs";
   // Query for required buffer size
   status = RegQueryValueExW(hkey, kAppInitDLLs, nullptr, nullptr, nullptr,
                             &numBytes);
   if (status != ERROR_SUCCESS) {
     return false;
--- a/widget/windows/nsDataObj.cpp
+++ b/widget/windows/nsDataObj.cpp
@@ -1142,18 +1142,17 @@ nsDataObj :: GetFileContentsInternetShor
   rv = aUri->GetAsciiSpec(asciiUrl);
   if (NS_FAILED(rv)) {
     return E_FAIL;
   }
 
   const char *shortcutFormatStr;
   int totalLen;
   nsCString path;
-  if (!Preferences::GetBool(kShellIconPref, true) ||
-      !IsVistaOrLater()) {
+  if (!Preferences::GetBool(kShellIconPref, true)) {
     shortcutFormatStr = "[InternetShortcut]\r\nURL=%s\r\n";
     const int formatLen = strlen(shortcutFormatStr) - 2;  // don't include %s
     totalLen = formatLen + asciiUrl.Length();  // don't include null character
   } else {
     nsCOMPtr<nsIFile> icoFile;
 
     nsAutoString aUriHash;
 
--- a/widget/windows/nsFilePicker.cpp
+++ b/widget/windows/nsFilePicker.cpp
@@ -23,17 +23,16 @@
 #include "nsEnumeratorUtils.h"
 #include "nsCRT.h"
 #include "nsString.h"
 #include "nsToolkit.h"
 #include "WinUtils.h"
 #include "nsPIDOMWindow.h"
 #include "GeckoProfiler.h"
 
-using mozilla::IsVistaOrLater;
 using mozilla::IsWin8OrLater;
 using mozilla::MakeUnique;
 using mozilla::mscom::EnsureMTA;
 using mozilla::UniquePtr;
 using namespace mozilla::widget;
 
 char16_t *nsFilePicker::mLastUsedUnicodeDirectory;
 char nsFilePicker::mLastUsedDirectory[MAX_PATH+1] = { 0 };
@@ -214,201 +213,16 @@ STDMETHODIMP nsFilePicker::QueryInterfac
   if (nullptr != *ppvResult) {
     ((LPUNKNOWN)*ppvResult)->AddRef();
     return S_OK;
   }
 
   return E_NOINTERFACE;
 }
 
-/*
- * XP picker callbacks
- */
-
-// Show - Display the file dialog
-int CALLBACK
-BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData)
-{
-  if (uMsg == BFFM_INITIALIZED)
-  {
-    char16_t * filePath = (char16_t *) lpData;
-    if (filePath)
-      ::SendMessageW(hwnd, BFFM_SETSELECTIONW,
-                     TRUE /* true because lpData is a path string */,
-                     lpData);
-  }
-  return 0;
-}
-
-static void
-EnsureWindowVisible(HWND hwnd) 
-{
-  // Obtain the monitor which has the largest area of intersection 
-  // with the window, or nullptr if there is no intersection.
-  HMONITOR monitor = MonitorFromWindow(hwnd, MONITOR_DEFAULTTONULL);
-  if (!monitor) {
-    // The window is not visible, we should reposition it to the same place as its parent
-    HWND parentHwnd = GetParent(hwnd);
-    RECT parentRect;
-    GetWindowRect(parentHwnd, &parentRect);
-    SetWindowPos(hwnd, nullptr, parentRect.left, parentRect.top, 0, 0,
-                 SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOZORDER);
-  }
-}
-
-// Callback hook which will ensure that the window is visible. Currently
-// only in use on os <= XP.
-UINT_PTR CALLBACK
-nsFilePicker::FilePickerHook(HWND hwnd,
-                             UINT msg,
-                             WPARAM wParam,
-                             LPARAM lParam) 
-{
-  switch(msg) {
-    case WM_NOTIFY:
-      {
-        LPOFNOTIFYW lpofn = (LPOFNOTIFYW) lParam;
-        if (!lpofn || !lpofn->lpOFN) {
-          return 0;
-        }
-        
-        if (CDN_INITDONE == lpofn->hdr.code) {
-          // The Window will be automatically moved to the last position after
-          // CDN_INITDONE.  We post a message to ensure the window will be visible
-          // so it will be done after the automatic last position window move.
-          PostMessage(hwnd, MOZ_WM_ENSUREVISIBLE, 0, 0);
-        }
-      }
-      break;
-    case MOZ_WM_ENSUREVISIBLE:
-      EnsureWindowVisible(GetParent(hwnd));
-      break;
-    case WM_INITDIALOG:
-      {
-        OPENFILENAMEW* pofn = reinterpret_cast<OPENFILENAMEW*>(lParam);
-        SetProp(hwnd, kDialogPtrProp, (HANDLE)pofn->lCustData);
-        nsFilePicker* picker = reinterpret_cast<nsFilePicker*>(pofn->lCustData);
-        if (picker) {
-          picker->SetDialogHandle(hwnd);
-          SetTimer(hwnd, kDialogTimerID, kDialogTimerTimeout, nullptr);
-        }
-      }
-      break;
-    case WM_TIMER:
-      {
-        // Check to see if our parent has been torn down, if so, we close too.
-        if (wParam == kDialogTimerID) {
-          nsFilePicker* picker = 
-            reinterpret_cast<nsFilePicker*>(GetProp(hwnd, kDialogPtrProp));
-          if (picker && picker->ClosePickerIfNeeded(true)) {
-            KillTimer(hwnd, kDialogTimerID);
-          }
-        }
-      }
-      break;
-  }
-  return 0;
-}
-
-
-// Callback hook which will dynamically allocate a buffer large enough
-// for the file picker dialog.  Currently only in use on  os <= XP.
-UINT_PTR CALLBACK
-nsFilePicker::MultiFilePickerHook(HWND hwnd,
-                                  UINT msg,
-                                  WPARAM wParam,
-                                  LPARAM lParam)
-{
-  switch (msg) {
-    case WM_INITDIALOG:
-      {
-        // Finds the child drop down of a File Picker dialog and sets the 
-        // maximum amount of text it can hold when typed in manually.
-        // A wParam of 0 mean 0x7FFFFFFE characters.
-        HWND comboBox = FindWindowEx(GetParent(hwnd), nullptr, 
-                                     L"ComboBoxEx32", nullptr );
-        if(comboBox)
-          SendMessage(comboBox, CB_LIMITTEXT, 0, 0);
-        // Store our nsFilePicker ptr for future use
-        OPENFILENAMEW* pofn = reinterpret_cast<OPENFILENAMEW*>(lParam);
-        SetProp(hwnd, kDialogPtrProp, (HANDLE)pofn->lCustData);
-        nsFilePicker* picker =
-          reinterpret_cast<nsFilePicker*>(pofn->lCustData);
-        if (picker) {
-          picker->SetDialogHandle(hwnd);
-          SetTimer(hwnd, kDialogTimerID, kDialogTimerTimeout, nullptr);
-        }
-      }
-      break;
-    case WM_NOTIFY:
-      {
-        LPOFNOTIFYW lpofn = (LPOFNOTIFYW) lParam;
-        if (!lpofn || !lpofn->lpOFN) {
-          return 0;
-        }
-        // CDN_SELCHANGE is sent when the selection in the list box of the file
-        // selection dialog changes
-        if (lpofn->hdr.code == CDN_SELCHANGE) {
-          HWND parentHWND = GetParent(hwnd);
-
-          // Get the required size for the selected files buffer
-          UINT newBufLength = 0; 
-          int requiredBufLength = CommDlg_OpenSave_GetSpecW(parentHWND, 
-                                                            nullptr, 0);
-          if(requiredBufLength >= 0)
-            newBufLength += requiredBufLength;
-          else
-            newBufLength += MAX_PATH;
-
-          // If the user selects multiple files, the buffer contains the 
-          // current directory followed by the file names of the selected 
-          // files. So make room for the directory path.  If the user
-          // selects a single file, it is no harm to add extra space.
-          requiredBufLength = CommDlg_OpenSave_GetFolderPathW(parentHWND, 
-                                                              nullptr, 0);
-          if(requiredBufLength >= 0)
-            newBufLength += requiredBufLength;
-          else
-            newBufLength += MAX_PATH;
-
-          // Check if lpstrFile and nMaxFile are large enough
-          if (newBufLength > lpofn->lpOFN->nMaxFile) {
-            if (lpofn->lpOFN->lpstrFile)
-              delete[] lpofn->lpOFN->lpstrFile;
-
-            // We allocate FILE_BUFFER_SIZE more bytes than is needed so that
-            // if the user selects a file and holds down shift and down to 
-            // select  additional items, we will not continuously reallocate
-            newBufLength += FILE_BUFFER_SIZE;
-
-            wchar_t* filesBuffer = new wchar_t[newBufLength];
-            ZeroMemory(filesBuffer, newBufLength * sizeof(wchar_t));
-
-            lpofn->lpOFN->lpstrFile = filesBuffer;
-            lpofn->lpOFN->nMaxFile  = newBufLength;
-          }
-        }
-      }
-      break;
-    case WM_TIMER:
-      {
-        // Check to see if our parent has been torn down, if so, we close too.
-        if (wParam == kDialogTimerID) {
-          nsFilePicker* picker =
-            reinterpret_cast<nsFilePicker*>(GetProp(hwnd, kDialogPtrProp));
-          if (picker && picker->ClosePickerIfNeeded(true)) {
-            KillTimer(hwnd, kDialogTimerID);
-          }
-        }
-      }
-      break;
-  }
-
-  return FilePickerHook(hwnd, msg, wParam, lParam);
-}
 
 /*
  * Vista+ callbacks
  */
 
 HRESULT
 nsFilePicker::OnFileOk(IFileDialog *pfd)
 {
@@ -471,137 +285,81 @@ nsFilePicker::OnOverwrite(IFileDialog *p
   return S_OK;
 }
 
 /*
  * Close on parent close logic
  */
 
 bool
-nsFilePicker::ClosePickerIfNeeded(bool aIsXPDialog)
+nsFilePicker::ClosePickerIfNeeded()
 {
   if (!mParentWidget || !mDlgWnd)
     return false;
 
   nsWindow *win = static_cast<nsWindow *>(mParentWidget.get());
-  // Note, the xp callbacks hand us an inner window, so we have to step up
-  // one to get the actual dialog.
-  HWND dlgWnd;
-  if (aIsXPDialog)
-    dlgWnd = GetParent(mDlgWnd);
-  else
-    dlgWnd = mDlgWnd;
-  if (IsWindow(dlgWnd) && IsWindowVisible(dlgWnd) && win->DestroyCalled()) {
+  if (IsWindow(mDlgWnd) && IsWindowVisible(mDlgWnd) && win->DestroyCalled()) {
     wchar_t className[64];
     // Make sure we have the right window
-    if (GetClassNameW(dlgWnd, className, mozilla::ArrayLength(className)) &&
+    if (GetClassNameW(mDlgWnd, className, mozilla::ArrayLength(className)) &&
         !wcscmp(className, L"#32770") &&
-        DestroyWindow(dlgWnd)) {
+        DestroyWindow(mDlgWnd)) {
       mDlgWnd = nullptr;
       return true;
     }
   }
   return false;
 }
 
 void
 nsFilePicker::PickerCallbackTimerFunc(nsITimer *aTimer, void *aCtx)
 {
   nsFilePicker* picker = (nsFilePicker*)aCtx;
-  if (picker->ClosePickerIfNeeded(false)) {
+  if (picker->ClosePickerIfNeeded()) {
     aTimer->Cancel();
   }
 }
 
 void
 nsFilePicker::SetDialogHandle(HWND aWnd)
 {
   if (!aWnd || mDlgWnd)
     return;
   mDlgWnd = aWnd;
 }
 
 /*
  * Folder picker invocation
  */
 
-// Open the older XP style folder picker dialog. We end up in this call
-// on XP systems or when platform is built without the longhorn SDK.
-bool
-nsFilePicker::ShowXPFolderPicker(const nsString& aInitialDir)
-{
-  bool result = false;
-
-  auto dirBuffer = MakeUnique<wchar_t[]>(FILE_BUFFER_SIZE);
-  wcsncpy(dirBuffer.get(), aInitialDir.get(), FILE_BUFFER_SIZE);
-  dirBuffer[FILE_BUFFER_SIZE-1] = '\0';
-
-  AutoDestroyTmpWindow adtw((HWND)(mParentWidget.get() ?
-    mParentWidget->GetNativeData(NS_NATIVE_TMP_WINDOW) : nullptr));
-
-  BROWSEINFOW browserInfo = {0};
-  browserInfo.pidlRoot       = nullptr;
-  browserInfo.pszDisplayName = dirBuffer.get();
-  browserInfo.lpszTitle      = mTitle.get();
-  browserInfo.ulFlags        = BIF_USENEWUI | BIF_RETURNONLYFSDIRS;
-  browserInfo.hwndOwner      = adtw.get(); 
-  browserInfo.iImage         = 0;
-  browserInfo.lParam         = reinterpret_cast<LPARAM>(this);
-
-  if (!aInitialDir.IsEmpty()) {
-    // the dialog is modal so that |initialDir.get()| will be valid in 
-    // BrowserCallbackProc. Thus, we don't need to clone it.
-    browserInfo.lParam = (LPARAM) aInitialDir.get();
-    browserInfo.lpfn   = &BrowseCallbackProc;
-  } else {
-    browserInfo.lParam = 0;
-    browserInfo.lpfn   = nullptr;
-  }
-
-  LPITEMIDLIST list = ::SHBrowseForFolderW(&browserInfo);
-  if (list) {
-    result = ::SHGetPathFromIDListW(list, dirBuffer.get());
-    if (result)
-      mUnicodeFile.Assign(static_cast<const wchar_t*>(dirBuffer.get()));
-    // free PIDL
-    CoTaskMemFree(list);
-  }
-
-  return result;
-}
-
 /*
- * Show a folder picker post Windows XP
- * 
+ * Show a folder picker.
+ *
  * @param aInitialDir   The initial directory, the last used directory will be
  *                      used if left blank.
- * @param aWasInitError Out parameter will hold true if there was an error
- *                      before the folder picker is shown.
  * @return true if a file was selected successfully.
 */
 bool
-nsFilePicker::ShowFolderPicker(const nsString& aInitialDir, bool &aWasInitError)
+nsFilePicker::ShowFolderPicker(const nsString& aInitialDir)
 {
   if (!IsWin8OrLater()) {
     // Some Windows 7 users are experiencing a race condition when some dlls
     // that are loaded by the file picker cause a crash while attempting to shut
     // down the COM multithreaded apartment. By instantiating EnsureMTA, we hold
     // an additional reference to the MTA that should prevent this race, since
     // the MTA will remain alive until shutdown.
     EnsureMTA ensureMTA;
   }
 
   RefPtr<IFileOpenDialog> dialog;
   if (FAILED(CoCreateInstance(CLSID_FileOpenDialog, nullptr, CLSCTX_INPROC,
                               IID_IFileOpenDialog,
                               getter_AddRefs(dialog)))) {
-    aWasInitError = true;
     return false;
   }
-  aWasInitError = false;
 
   // hook up event callbacks
   dialog->Advise(this, &mFDECookie);
 
   // options
   FILEOPENDIALOGOPTIONS fos = FOS_PICKFOLDERS;
   dialog->SetOptions(fos);
  
@@ -653,243 +411,25 @@ nsFilePicker::ShowFolderPicker(const nsS
   // get the folder's file system path
   return WinUtils::GetShellItemPath(item, mUnicodeFile);
 }
 
 /*
  * File open and save picker invocation
  */
 
-/* static */ bool
-nsFilePicker::GetFileNameWrapper(OPENFILENAMEW* ofn, PickerType aType)
-{
-  MOZ_SEH_TRY {
-    if (aType == PICKER_TYPE_OPEN)
-      return ::GetOpenFileNameW(ofn);
-    else if (aType == PICKER_TYPE_SAVE)
-      return ::GetSaveFileNameW(ofn);
-  } MOZ_SEH_EXCEPT(true) {
-    NS_ERROR("nsFilePicker GetFileName win32 call generated an exception! This is bad!");
-  }
-  return false;
-}
-
-bool
-nsFilePicker::FilePickerWrapper(OPENFILENAMEW* ofn, PickerType aType)
-{
-  if (!ofn)
-    return false;
-  AutoWidgetPickerState awps(mParentWidget);
-  return GetFileNameWrapper(ofn, aType);
-}
-
-bool
-nsFilePicker::ShowXPFilePicker(const nsString& aInitialDir)
-{
-  OPENFILENAMEW ofn = {0};
-  ofn.lStructSize = sizeof(ofn);
-  nsString filterBuffer = mFilterList;
-                                
-  auto fileBuffer = MakeUnique<wchar_t[]>(FILE_BUFFER_SIZE);
-  wcsncpy(fileBuffer.get(),  mDefaultFilePath.get(), FILE_BUFFER_SIZE);
-  fileBuffer[FILE_BUFFER_SIZE-1] = '\0'; // null terminate in case copy truncated
-
-  if (!aInitialDir.IsEmpty()) {
-    ofn.lpstrInitialDir = aInitialDir.get();
-  }
-
-  AutoDestroyTmpWindow adtw((HWND) (mParentWidget.get() ?
-    mParentWidget->GetNativeData(NS_NATIVE_TMP_WINDOW) : nullptr));
-
-  ofn.lpstrTitle   = (LPCWSTR)mTitle.get();
-  ofn.lpstrFilter  = (LPCWSTR)filterBuffer.get();
-  ofn.nFilterIndex = mSelectedType;
-  ofn.lpstrFile    = fileBuffer.get();
-  ofn.nMaxFile     = FILE_BUFFER_SIZE;
-  ofn.hwndOwner    = adtw.get();
-  ofn.lCustData    = reinterpret_cast<LPARAM>(this);
-  ofn.Flags = OFN_SHAREAWARE | OFN_LONGNAMES | OFN_OVERWRITEPROMPT |
-              OFN_HIDEREADONLY | OFN_PATHMUSTEXIST | OFN_ENABLESIZING | 
-              OFN_EXPLORER;
-
-  // Windows Vista and up won't allow you to use the new looking dialogs with
-  // a hook procedure.  The hook procedure fixes a problem on XP dialogs for
-  // file picker visibility.  Vista and up automatically ensures the file 
-  // picker is always visible.
-  if (!IsVistaOrLater()) {
-    ofn.lpfnHook = FilePickerHook;
-    ofn.Flags |= OFN_ENABLEHOOK;
-  }
-
-  // Handle add to recent docs settings
-  if (IsPrivacyModeEnabled() || !mAddToRecentDocs) {
-    ofn.Flags |= OFN_DONTADDTORECENT;
-  }
-
-  NS_NAMED_LITERAL_STRING(htmExt, "html");
-
-  if (!mDefaultExtension.IsEmpty()) {
-    ofn.lpstrDefExt = mDefaultExtension.get();
-  } else if (IsDefaultPathHtml()) {
-    // Get file extension from suggested filename to detect if we are
-    // saving an html file.
-    // This is supposed to append ".htm" if user doesn't supply an
-    // extension but the behavior is sort of weird:
-    // - Often appends ".html" even if you have an extension
-    // - It obeys your extension if you put quotes around name
-    ofn.lpstrDefExt = htmExt.get();
-  }
-
-  // When possible, instead of using OFN_NOCHANGEDIR to ensure the current
-  // working directory will not change from this call, we will retrieve the
-  // current working directory before the call and restore it after the 
-  // call.  This flag causes problems on Windows XP for paths that are
-  // selected like  C:test.txt where the user is currently at C:\somepath
-  // In which case expected result should be C:\somepath\test.txt
-  AutoRestoreWorkingPath restoreWorkingPath;
-  // If we can't get the current working directory, the best case is to
-  // use the OFN_NOCHANGEDIR flag
-  if (!restoreWorkingPath.HasWorkingPath()) {
-    ofn.Flags |= OFN_NOCHANGEDIR;
-  }
-
-  bool result = false;
-
-  switch(mMode) {
-    case modeOpen:
-      // FILE MUST EXIST!
-      ofn.Flags |= OFN_FILEMUSTEXIST;
-      result = FilePickerWrapper(&ofn, PICKER_TYPE_OPEN);
-      break;
-
-    case modeOpenMultiple:
-      ofn.Flags |= OFN_FILEMUSTEXIST | OFN_ALLOWMULTISELECT;
-
-      // The hook set here ensures that the buffer returned will always be
-      // large enough to hold all selected files.  The hook may modify the
-      // value of ofn.lpstrFile and deallocate the old buffer that it pointed
-      // to (fileBuffer). The hook assumes that the passed in value is heap 
-      // allocated and that the returned value should be freed by the caller.
-      // If the hook changes the buffer, it will deallocate the old buffer.
-      // This fix would be nice to have in Vista and up, but it would force
-      // the file picker to use the old style dialogs because hooks are not
-      // allowed in the new file picker UI.  We need to eventually move to
-      // the new Common File Dialogs for Vista and up.
-      if (!IsVistaOrLater()) {
-        ofn.lpfnHook = MultiFilePickerHook;
-        fileBuffer.release();
-        result = FilePickerWrapper(&ofn, PICKER_TYPE_OPEN);
-        fileBuffer.reset(ofn.lpstrFile);
-      } else {
-        result = FilePickerWrapper(&ofn, PICKER_TYPE_OPEN);
-      }
-      break;
-
-    case modeSave:
-      {
-        ofn.Flags |= OFN_NOREADONLYRETURN;
-
-        // Don't follow shortcuts when saving a shortcut, this can be used
-        // to trick users (bug 271732)
-        if (IsDefaultPathLink())
-          ofn.Flags |= OFN_NODEREFERENCELINKS;
-
-        result = FilePickerWrapper(&ofn, PICKER_TYPE_SAVE);
-        if (!result) {
-          // Error, find out what kind.
-          if (GetLastError() == ERROR_INVALID_PARAMETER ||
-              CommDlgExtendedError() == FNERR_INVALIDFILENAME) {
-            // Probably the default file name is too long or contains illegal
-            // characters. Try again, without a starting file name.
-            ofn.lpstrFile[0] = L'\0';
-            result = FilePickerWrapper(&ofn, PICKER_TYPE_SAVE);
-          }
-        }
-      }
-      break;
-
-    default:
-      NS_NOTREACHED("unsupported file picker mode");
-      return false;
-  }
-
-  if (!result)
-    return false;
-
-  // Remember what filter type the user selected
-  mSelectedType = (int16_t)ofn.nFilterIndex;
-
-  // Single file selection, we're done
-  if (mMode != modeOpenMultiple) {
-    GetQualifiedPath(fileBuffer.get(), mUnicodeFile);
-    return true;
-  }
-
-  // Set user-selected location of file or directory.  From msdn's "Open and
-  // Save As Dialog Boxes" section:
-  // If you specify OFN_EXPLORER, the directory and file name strings are '\0'
-  // separated, with an extra '\0' character after the last file name. This
-  // format enables the Explorer-style dialog boxes to return long file names
-  // that include spaces. 
-  wchar_t *current = fileBuffer.get();
-  
-  nsAutoString dirName(current);
-  // Sometimes dirName contains a trailing slash and sometimes it doesn't:
-  if (current[dirName.Length() - 1] != '\\')
-    dirName.Append((char16_t)'\\');
-  
-  while (current && *current && *(current + wcslen(current) + 1)) {
-    current = current + wcslen(current) + 1;
-    
-    nsCOMPtr<nsIFile> file = do_CreateInstance("@mozilla.org/file/local;1");
-    NS_ENSURE_TRUE(file, false);
-
-    // Only prepend the directory if the path specified is a relative path
-    nsAutoString path;
-    if (PathIsRelativeW(current)) {
-      path = dirName + nsDependentString(current);
-    } else {
-      path = current;
-    }
-
-    nsAutoString canonicalizedPath;
-    GetQualifiedPath(path.get(), canonicalizedPath);
-    if (NS_FAILED(file->InitWithPath(canonicalizedPath)) ||
-        !mFiles.AppendObject(file))
-      return false;
-  }
-  
-  // Handle the case where the user selected just one file. From msdn: If you
-  // specify OFN_ALLOWMULTISELECT and the user selects only one file the
-  // lpstrFile string does not have a separator between the path and file name.
-  if (current && *current && (current == fileBuffer.get())) {
-    nsCOMPtr<nsIFile> file = do_CreateInstance("@mozilla.org/file/local;1");
-    NS_ENSURE_TRUE(file, false);
-    
-    nsAutoString canonicalizedPath;
-    GetQualifiedPath(current, canonicalizedPath);
-    if (NS_FAILED(file->InitWithPath(canonicalizedPath)) ||
-        !mFiles.AppendObject(file))
-      return false;
-  }
-
-  return true;
-}
-
 /*
- * Show a file picker post Windows XP
- * 
+ * Show a file picker.
+ *
  * @param aInitialDir   The initial directory, the last used directory will be
  *                      used if left blank.
- * @param aWasInitError Out parameter will hold true if there was an error
- *                      before the file picker is shown.
  * @return true if a file was selected successfully.
 */
 bool
-nsFilePicker::ShowFilePicker(const nsString& aInitialDir, bool &aWasInitError)
+nsFilePicker::ShowFilePicker(const nsString& aInitialDir)
 {
   PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER);
 
   if (!IsWin8OrLater()) {
     // Some Windows 7 users are experiencing a race condition when some dlls
     // that are loaded by the file picker cause a crash while attempting to shut
     // down the COM multithreaded apartment. By instantiating EnsureMTA, we hold
     // an additional reference to the MTA that should prevent this race, since
@@ -897,28 +437,25 @@ nsFilePicker::ShowFilePicker(const nsStr
     EnsureMTA ensureMTA;
   }
 
   RefPtr<IFileDialog> dialog;
   if (mMode != modeSave) {
     if (FAILED(CoCreateInstance(CLSID_FileOpenDialog, nullptr, CLSCTX_INPROC,
                                 IID_IFileOpenDialog,
                                 getter_AddRefs(dialog)))) {
-      aWasInitError = true;
       return false;
     }
   } else {
     if (FAILED(CoCreateInstance(CLSID_FileSaveDialog, nullptr, CLSCTX_INPROC,
                                 IID_IFileSaveDialog,
                                 getter_AddRefs(dialog)))) {
-      aWasInitError = true;
       return false;
     }
   }
-  aWasInitError = false;
 
   // hook up event callbacks
   dialog->Advise(this, &mFDECookie);
 
   // options
 
   FILEOPENDIALOGOPTIONS fos = 0;
   fos |= FOS_SHAREAWARE | FOS_OVERWRITEPROMPT |
@@ -1075,32 +612,21 @@ nsFilePicker::ShowW(int16_t *aReturnVal)
   // Clear previous file selections
   mUnicodeFile.Truncate();
   mFiles.Clear();
 
   // On Win10, the picker doesn't support per-monitor DPI, so we open it
   // with our context set temporarily to system-dpi-aware
   WinUtils::AutoSystemDpiAware dpiAwareness;
 
-  // Launch the XP file/folder picker on XP and as a fallback on Vista+. 
-  // The CoCreateInstance call to CLSID_FileOpenDialog fails with "(0x80040111)
-  // ClassFactory cannot supply requested class" when the checkbox for
-  // Disable Visual Themes is on in the compatability tab within the shortcut
-  // properties.
-  bool result = false, wasInitError = true;
+  bool result = false;
   if (mMode == modeGetFolder) {
-    if (IsVistaOrLater())
-      result = ShowFolderPicker(initialDir, wasInitError);
-    if (!result && wasInitError)
-      result = ShowXPFolderPicker(initialDir);
+    result = ShowFolderPicker(initialDir);
   } else {
-    if (IsVistaOrLater())
-      result = ShowFilePicker(initialDir, wasInitError);
-    if (!result && wasInitError)
-      result = ShowXPFilePicker(initialDir);
+    result = ShowFilePicker(initialDir);
   }
 
   // exit, and return returnCancel in aReturnVal
   if (!result)
     return NS_OK;
 
   RememberLastUsedDirectory();
 
@@ -1242,58 +768,20 @@ nsFilePicker::SetFilterIndex(int32_t aFi
 void
 nsFilePicker::InitNative(nsIWidget *aParent,
                          const nsAString& aTitle)
 {
   mParentWidget = aParent;
   mTitle.Assign(aTitle);
 }
 
-void 
-nsFilePicker::GetQualifiedPath(const wchar_t *aInPath, nsString &aOutPath)
-{
-  // Prefer a qualified path over a non qualified path.
-  // Things like c:file.txt would be accepted in Win XP but would later
-  // fail to open from the download manager.
-  wchar_t qualifiedFileBuffer[MAX_PATH];
-  if (PathSearchAndQualifyW(aInPath, qualifiedFileBuffer, MAX_PATH)) {
-    aOutPath.Assign(qualifiedFileBuffer);
-  } else {
-    aOutPath.Assign(aInPath);
-  }
-}
-
-void
-nsFilePicker::AppendXPFilter(const nsAString& aTitle, const nsAString& aFilter)
-{
-  mFilterList.Append(aTitle);
-  mFilterList.Append(char16_t('\0'));
-
-  if (aFilter.EqualsLiteral("..apps"))
-    mFilterList.AppendLiteral("*.exe;*.com");
-  else
-  {
-    nsAutoString filter(aFilter);
-    filter.StripWhitespace();
-    if (filter.EqualsLiteral("*"))
-      filter.AppendLiteral(".*");
-    mFilterList.Append(filter);
-  }
-
-  mFilterList.Append(char16_t('\0'));
-}
-
 NS_IMETHODIMP
 nsFilePicker::AppendFilter(const nsAString& aTitle, const nsAString& aFilter)
 {
-  if (IsVistaOrLater()) {
-    mComFilterList.Append(aTitle, aFilter);
-  } else {
-    AppendXPFilter(aTitle, aFilter);
-  }
+  mComFilterList.Append(aTitle, aFilter);
   return NS_OK;
 }
 
 void
 nsFilePicker::RememberLastUsedDirectory()
 {
   nsCOMPtr<nsIFile> file(do_CreateInstance("@mozilla.org/file/local;1"));
   if (!file || NS_FAILED(file->InitWithPath(mUnicodeFile))) {
--- a/widget/windows/nsFilePicker.h
+++ b/widget/windows/nsFilePicker.h
@@ -82,42 +82,29 @@ public:
   HRESULT STDMETHODCALLTYPE OnFolderChanging(IFileDialog *pfd, IShellItem *psiFolder);
   HRESULT STDMETHODCALLTYPE OnFolderChange(IFileDialog *pfd);
   HRESULT STDMETHODCALLTYPE OnSelectionChange(IFileDialog *pfd);
   HRESULT STDMETHODCALLTYPE OnShareViolation(IFileDialog *pfd, IShellItem *psi, FDE_SHAREVIOLATION_RESPONSE *pResponse);
   HRESULT STDMETHODCALLTYPE OnTypeChange(IFileDialog *pfd);
   HRESULT STDMETHODCALLTYPE OnOverwrite(IFileDialog *pfd, IShellItem *psi, FDE_OVERWRITE_RESPONSE *pResponse);
 
 protected:
-  enum PickerType {
-    PICKER_TYPE_OPEN,
-    PICKER_TYPE_SAVE,
-  };
-
   /* method from nsBaseFilePicker */
   virtual void InitNative(nsIWidget *aParent,
                           const nsAString& aTitle);
-  static void GetQualifiedPath(const wchar_t *aInPath, nsString &aOutPath);
   void GetFilterListArray(nsString& aFilterList);
-  static bool GetFileNameWrapper(OPENFILENAMEW* ofn, PickerType aType);
-  bool FilePickerWrapper(OPENFILENAMEW* ofn, PickerType aType);
-  bool ShowXPFolderPicker(const nsString& aInitialDir);
-  bool ShowXPFilePicker(const nsString& aInitialDir);
-  bool ShowFolderPicker(const nsString& aInitialDir, bool &aWasInitError);
-  bool ShowFilePicker(const nsString& aInitialDir, bool &aWasInitError);
-  void AppendXPFilter(const nsAString& aTitle, const nsAString& aFilter);
+  bool ShowFolderPicker(const nsString& aInitialDir);
+  bool ShowFilePicker(const nsString& aInitialDir);
   void RememberLastUsedDirectory();
   bool IsPrivacyModeEnabled();
   bool IsDefaultPathLink();
   bool IsDefaultPathHtml();
   void SetDialogHandle(HWND aWnd);
-  bool ClosePickerIfNeeded(bool aIsXPDialog);
+  bool ClosePickerIfNeeded();
   static void PickerCallbackTimerFunc(nsITimer *aTimer, void *aPicker);
-  static UINT_PTR CALLBACK MultiFilePickerHook(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
-  static UINT_PTR CALLBACK FilePickerHook(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
 
   nsCOMPtr<nsILoadContext> mLoadContext;
   nsCOMPtr<nsIWidget>    mParentWidget;
   nsString               mTitle;
   nsCString              mFile;
   nsString               mFilterList;
   int16_t                mSelectedType;
   nsCOMArray<nsIFile>    mFiles;
--- a/widget/windows/nsLookAndFeel.cpp
+++ b/widget/windows/nsLookAndFeel.cpp
@@ -27,22 +27,18 @@ nsLookAndFeel::GetOperatingSystemVersion
   if (version != eOperatingSystemVersion_Unknown) {
     return version;
   }
 
   if (IsWin10OrLater()) {
     version = eOperatingSystemVersion_Windows10;
   } else if (IsWin8OrLater()) {
     version = eOperatingSystemVersion_Windows8;
-  } else if (IsWin7OrLater()) {
+  } else {
     version = eOperatingSystemVersion_Windows7;
-  } else if (IsVistaOrLater()) {
-    version = eOperatingSystemVersion_WindowsVista;
-  } else {
-    version = eOperatingSystemVersion_WindowsXP;
   }
 
   return version;
 }
 
 static nsresult GetColorFromTheme(nsUXThemeClass cls,
                            int32_t aPart,
                            int32_t aState,
@@ -178,27 +174,25 @@ nsLookAndFeel::NativeGetColor(ColorID aI
       idx = COLOR_GRAYTEXT;
       break;
     case eColorID_highlight:
     case eColorID__moz_html_cellhighlight:
     case eColorID__moz_menuhover:
       idx = COLOR_HIGHLIGHT;
       break;
     case eColorID__moz_menubarhovertext:
-      if (!IsVistaOrLater() || !IsAppThemed())
-      {
+      if (!IsAppThemed()) {
         idx = nsUXThemeData::sFlatMenus ?
                 COLOR_HIGHLIGHTTEXT :
                 COLOR_MENUTEXT;
         break;
       }
       // Fall through
     case eColorID__moz_menuhovertext:
-      if (IsVistaOrLater() && IsAppThemed())
-      {
+      if (IsAppThemed()) {
         res = ::GetColorFromTheme(eUXMenu,
                                   MENU_POPUPITEM, MPI_HOT, TMT_TEXTCOLOR, aColor);
         if (NS_SUCCEEDED(res))
           return res;
         // fall through to highlight case
       }
     case eColorID_highlighttext:
     case eColorID__moz_html_cellhighlighttext:
@@ -263,28 +257,27 @@ nsLookAndFeel::NativeGetColor(ColorID aI
     case eColorID__moz_comboboxtext:
       idx = COLOR_WINDOWTEXT;
       break;
     case eColorID__moz_dialog:
     case eColorID__moz_cellhighlight:
       idx = COLOR_3DFACE;
       break;
     case eColorID__moz_win_mediatext:
-      if (IsVistaOrLater() && IsAppThemed()) {
+      if (IsAppThemed()) {
         res = ::GetColorFromTheme(eUXMediaToolbar,
                                   TP_BUTTON, TS_NORMAL, TMT_TEXTCOLOR, aColor);
         if (NS_SUCCEEDED(res))
           return res;
       }
       // if we've gotten here just return -moz-dialogtext instead
       idx = COLOR_WINDOWTEXT;
       break;
     case eColorID__moz_win_communicationstext:
-      if (IsVistaOrLater() && IsAppThemed())
-      {
+      if (IsAppThemed()) {
         res = ::GetColorFromTheme(eUXCommunicationsToolbar,
                                   TP_BUTTON, TS_NORMAL, TMT_TEXTCOLOR, aColor);
         if (NS_SUCCEEDED(res))
           return res;
       }
       // if we've gotten here just return -moz-dialogtext instead
       idx = COLOR_WINDOWTEXT;
       break;
--- a/widget/windows/nsNativeThemeWin.cpp
+++ b/widget/windows/nsNativeThemeWin.cpp
@@ -34,17 +34,16 @@
 #include "gfxWindowsPlatform.h"
 #include "gfxWindowsSurface.h"
 #include "gfxWindowsNativeDrawing.h"
 
 #include "nsUXThemeData.h"
 #include "nsUXThemeConstants.h"
 #include <algorithm>
 
-using mozilla::IsVistaOrLater;
 using namespace mozilla;
 using namespace mozilla::widget;
 
 extern mozilla::LazyLogModule gWindowsLog;
 
 NS_IMPL_ISUPPORTS_INHERITED(nsNativeThemeWin, nsNativeTheme, nsITheme)
 
 nsNativeThemeWin::nsNativeThemeWin() :
@@ -296,40 +295,31 @@ DrawThemeBGRTLAware(HANDLE aTheme, HDC a
  *  classic min             1        2        0        1
  *  classic max             0        2        1        1
  *  classic close           1        2        2        1
  *
  *  aero basic min          1        2        0        2
  *  aero basic max          0        2        1        2
  *  aero basic close        1        2        1        2
  *
- *  xp theme min            0        2        0        2
- *  xp theme max            0        2        1        2
- *  xp theme close          1        2        2        2
- *
  *  'cold' button padding - generic button padding, should
  *  be handled in css.
  *                       left      top    right   bottom
  *  classic min             0        0        0        0
  *  classic max             0        0        0        0
  *  classic close           0        0        0        0
  *
  *  aero basic min          0        0        1        0
  *  aero basic max          1        0        0        0
  *  aero basic close        0        0        0        0
- *
- *  xp theme min            0        0        1        0
- *  xp theme max            1        0        0        0
- *  xp theme close          0        0        0        0
  */
 
 enum CaptionDesktopTheme {
   CAPTION_CLASSIC = 0,
   CAPTION_BASIC,
-  CAPTION_XPTHEME,
 };
 
 enum CaptionButton {
   CAPTIONBUTTON_MINIMIZE = 0,
   CAPTIONBUTTON_RESTORE,
   CAPTIONBUTTON_CLOSE,
 };
 
@@ -353,33 +343,29 @@ static CaptionButtonPadding buttonData[3
 // Adds "hot" caption button padding to minimum widget size.
 static void
 AddPaddingRect(LayoutDeviceIntSize* aSize, CaptionButton button) {
   if (!aSize)
     return;
   RECT offset;
   if (!IsAppThemed())
     offset = buttonData[CAPTION_CLASSIC].hotPadding[button];
-  else if (!IsVistaOrLater())
-    offset = buttonData[CAPTION_XPTHEME].hotPadding[button];
   else
     offset = buttonData[CAPTION_BASIC].hotPadding[button];
   aSize->width += offset.left + offset.right;
   aSize->height += offset.top + offset.bottom;
 }
 
 // If we've added padding to the minimum widget size, offset
 // the area we draw into to compensate.
 static void
 OffsetBackgroundRect(RECT& rect, CaptionButton button) {
   RECT offset;
   if (!IsAppThemed())
     offset = buttonData[CAPTION_CLASSIC].hotPadding[button];
-  else if (!IsVistaOrLater())
-    offset = buttonData[CAPTION_XPTHEME].hotPadding[button];
   else
     offset = buttonData[CAPTION_BASIC].hotPadding[button];
   rect.left += offset.left;
   rect.top += offset.top;
   rect.right -= offset.right;
   rect.bottom -= offset.bottom;
 }
 
@@ -414,62 +400,47 @@ OffsetBackgroundRect(RECT& rect, Caption
  * Progress bar related constants. These values are found by experimenting and
  * comparing against native widgets used by the system. They are very unlikely
  * exact but try to not be too wrong.
  */
 // The amount of time we animate progress meters parts across the frame.
 static const double kProgressDeterminateTimeSpan = 3.0;
 static const double kProgressIndeterminateTimeSpan = 5.0;
 // The width of the overlay used to animate the horizontal progress bar (Vista and later).
-static const int32_t kProgressHorizontalVistaOverlaySize = 120;
-// The width of the overlay used for the horizontal indeterminate progress bars on XP.
-static const int32_t kProgressHorizontalXPOverlaySize = 55;
+static const int32_t kProgressHorizontalOverlaySize = 120;
 // The height of the overlay used to animate the vertical progress bar (Vista and later).
 static const int32_t kProgressVerticalOverlaySize = 45;
 // The height of the overlay used for the vertical indeterminate progress bar (Vista and later).
 static const int32_t kProgressVerticalIndeterminateOverlaySize = 60;
 // The width of the overlay used to animate the indeterminate progress bar (Windows Classic).
 static const int32_t kProgressClassicOverlaySize = 40;
 
 /*
  * GetProgressOverlayStyle - returns the proper overlay part for themed
  * progress bars based on os and orientation.
  */
 static int32_t
 GetProgressOverlayStyle(bool aIsVertical)
-{ 
-  if (aIsVertical) {
-    if (IsVistaOrLater()) {
-      return PP_MOVEOVERLAYVERT;
-    }
-    return PP_CHUNKVERT;
-  } else {
-    if (IsVistaOrLater()) {
-      return PP_MOVEOVERLAY;
-    }
-    return PP_CHUNK;
-  }
+{
+  return aIsVertical ? PP_MOVEOVERLAYVERT : PP_MOVEOVERLAY;
 }
 
 /*
  * GetProgressOverlaySize - returns the minimum width or height for themed
  * progress bar overlays. This includes the width of indeterminate chunks
  * and vista pulse overlays.
  */
 static int32_t
 GetProgressOverlaySize(bool aIsVertical, bool aIsIndeterminate)
 {
-  if (IsVistaOrLater()) {
-    if (aIsVertical) {
-      return aIsIndeterminate ? kProgressVerticalIndeterminateOverlaySize
-                              : kProgressVerticalOverlaySize;
-    }
-    return kProgressHorizontalVistaOverlaySize;
+  if (aIsVertical) {
+    return aIsIndeterminate ? kProgressVerticalIndeterminateOverlaySize
+                            : kProgressVerticalOverlaySize;
   }
-  return kProgressHorizontalXPOverlaySize;
+  return kProgressHorizontalOverlaySize;
 }
 
 /*
  * IsProgressMeterFilled - Determines if a progress meter is at 100% fill based
  * on a comparison of the current value and maximum.
  */
 static bool
 IsProgressMeterFilled(nsIFrame* aFrame)
@@ -549,97 +520,16 @@ nsNativeThemeWin::CalculateProgressOverl
     yPos -= (int)ceil(((double)(trackWidth*2) * percent));
     overlayRect.bottom = yPos;
     overlayRect.top = yPos - overlaySize;
   }
   return overlayRect;
 }
 
 /*
- * DrawChunkProgressMeter - renders an xp style chunked progress meter. Called
- * by DrawProgressMeter.
- *
- * @param aTheme       progress theme handle
- * @param aHdc         hdc returned by gfxWindowsNativeDrawing
- * @param aPart        the PP_X progress part
- * @param aState       the theme state
- * @param aFrame       the elements frame
- * @param aWidgetRect  bounding rect for the widget
- * @param aClipRect    dirty rect that needs drawing.
- * @param aAppUnits    app units per device pixel
- * @param aIsIndeterm  is an indeterminate progress?
- * @param aIsVertical  render a vertical progress?
- * @param aIsRtl       direction is rtl
- */
-static void
-DrawChunkProgressMeter(HTHEME aTheme, HDC aHdc, int aPart,
-                       int aState, nsIFrame* aFrame, RECT* aWidgetRect,
-                       RECT* aClipRect, gfxFloat aAppUnits, bool aIsIndeterm,
-                       bool aIsVertical, bool aIsRtl)
-{
-  NS_ASSERTION(aTheme, "Bad theme.");
-  NS_ASSERTION(aHdc, "Bad hdc.");
-  NS_ASSERTION(aWidgetRect, "Bad rect.");
-  NS_ASSERTION(aClipRect, "Bad clip rect.");
-  NS_ASSERTION(aFrame, "Bad frame.");
-
-  // For horizontal meters, the theme lib paints the right graphic but doesn't
-  // paint the chunks, so we do that manually. For vertical meters, the theme
-  // library draws everything correctly.
-  if (aIsVertical) {
-    DrawThemeBackground(aTheme, aHdc, aPart, aState, aWidgetRect, aClipRect);
-    return;
-  }
-
-  // query for the proper chunk metrics
-  int chunkSize, spaceSize;
-  if (FAILED(GetThemeMetric(aTheme, aHdc, aPart, aState,
-                            TMT_PROGRESSCHUNKSIZE, &chunkSize)) ||
-      FAILED(GetThemeMetric(aTheme, aHdc, aPart, aState,
-                            TMT_PROGRESSSPACESIZE, &spaceSize))) {
-    DrawThemeBackground(aTheme, aHdc, aPart, aState, aWidgetRect, aClipRect);
-    return;
-  }
-
-  // render chunks
-  if (!aIsRtl || aIsIndeterm) {
-    for (int chunk = aWidgetRect->left; chunk <= aWidgetRect->right;
-         chunk += (chunkSize+spaceSize)) {
-      if (!aIsIndeterm && ((chunk + chunkSize) > aWidgetRect->right)) {
-        // aWidgetRect->right represents the end of the meter. Partial blocks
-        // don't get rendered with one exception, so exit here if we don't have
-        // a full chunk to draw.
-        // The above is true *except* when the meter is at 100% fill, in which
-        // case Windows renders any remaining partial block. Query the parent
-        // frame to find out if we're at 100%.
-        if (!IsProgressMeterFilled(aFrame)) {
-          break;
-        }
-      }
-      RECT bounds =
-        { chunk, aWidgetRect->top, chunk + chunkSize, aWidgetRect->bottom };
-      DrawThemeBackground(aTheme, aHdc, aPart, aState, &bounds, aClipRect);
-    }
-  } else {
-    // rtl needs to grow in the opposite direction to look right.
-    for (int chunk = aWidgetRect->right; chunk >= aWidgetRect->left;
-         chunk -= (chunkSize+spaceSize)) {
-      if ((chunk - chunkSize) < aWidgetRect->left) {
-        if (!IsProgressMeterFilled(aFrame)) {
-          break;
-        }
-      }
-      RECT bounds =
-        { chunk - chunkSize, aWidgetRect->top, chunk, aWidgetRect->bottom };
-      DrawThemeBackground(aTheme, aHdc, aPart, aState, &bounds, aClipRect);
-    }
-  }
-}
-
-/*
  * DrawProgressMeter - render an appropriate progress meter based on progress
  * meter style, orientation, and os. Note, this does not render the underlying
  * progress track.
  *
  * @param aFrame       the widget frame
  * @param aWidgetType  type of widget
  * @param aTheme       progress theme handle
  * @param aHdc         hdc returned by gfxWindowsNativeDrawing
@@ -648,111 +538,80 @@ DrawChunkProgressMeter(HTHEME aTheme, HD
  * @param aWidgetRect  bounding rect for the widget
  * @param aClipRect    dirty rect that needs drawing.
  * @param aAppUnits    app units per device pixel
  */
 void
 nsNativeThemeWin::DrawThemedProgressMeter(nsIFrame* aFrame, int aWidgetType,
                                           HANDLE aTheme, HDC aHdc,
                                           int aPart, int aState,
-                                          RECT* aWidgetRect, RECT* aClipRect,
-                                          gfxFloat aAppUnits)
+                                          RECT* aWidgetRect, RECT* aClipRect)
 {
   if (!aFrame || !aTheme || !aHdc)
     return;
 
   NS_ASSERTION(aWidgetRect, "bad rect pointer");
   NS_ASSERTION(aClipRect, "bad clip rect pointer");
 
   RECT adjWidgetRect, adjClipRect;
   adjWidgetRect = *aWidgetRect;
   adjClipRect = *aClipRect;
-  if (!IsVistaOrLater()) {
-    // Adjust clipping out by one pixel. XP progress meters are inset,
-    // Vista+ are not.
-    InflateRect(&adjWidgetRect, 1, 1);
-    InflateRect(&adjClipRect, 1, 1);
-  }
 
   nsIFrame* parentFrame = aFrame->GetParent();
   if (!parentFrame) {
     // We have no parent to work with, just bail.
     NS_WARNING("No parent frame for progress rendering. Can't paint.");
     return;
   }
 
   EventStates eventStates = GetContentState(parentFrame, aWidgetType);
   bool vertical = IsVerticalProgress(parentFrame) ||
                   aWidgetType == NS_THEME_PROGRESSCHUNK_VERTICAL;
   bool indeterminate = IsIndeterminateProgress(parentFrame, eventStates);
   bool animate = indeterminate;
 
-  if (IsVistaOrLater()) {
-    // Vista and up progress meter is fill style, rendered here. We render
-    // the pulse overlay in the follow up section below.
-    DrawThemeBackground(aTheme, aHdc, aPart, aState,
-                        &adjWidgetRect, &adjClipRect);
-    if (!IsProgressMeterFilled(aFrame)) {
-      animate = true;
-    }
-  } else if (!indeterminate) {
-    // XP progress meters are 'chunk' style.
-    DrawChunkProgressMeter(aTheme, aHdc, aPart, aState, aFrame,
-                           &adjWidgetRect, &adjClipRect, aAppUnits,
-                           indeterminate, vertical, IsFrameRTL(aFrame));
-  }    
+  // Vista and up progress meter is fill style, rendered here. We render
+  // the pulse overlay in the follow up section below.
+  DrawThemeBackground(aTheme, aHdc, aPart, aState,
+                      &adjWidgetRect, &adjClipRect);
+  if (!IsProgressMeterFilled(aFrame)) {
+    animate = true;
+  }
 
   if (animate) {
     // Indeterminate rendering
     int32_t overlayPart = GetProgressOverlayStyle(vertical);
     RECT overlayRect =
       CalculateProgressOverlayRect(aFrame, &adjWidgetRect, vertical,
                                    indeterminate, false);
-    if (IsVistaOrLater()) {
-      DrawThemeBackground(aTheme, aHdc, overlayPart, aState, &overlayRect,
-                          &adjClipRect);
-    } else {
-      DrawChunkProgressMeter(aTheme, aHdc, overlayPart, aState, aFrame,
-                             &overlayRect, &adjClipRect, aAppUnits,
-                             indeterminate, vertical, IsFrameRTL(aFrame));
-    }
+    DrawThemeBackground(aTheme, aHdc, overlayPart, aState, &overlayRect,
+                        &adjClipRect);
 
     if (!QueueAnimatedContentForRefresh(aFrame->GetContent(), 60)) {
       NS_WARNING("unable to animate progress widget!");
     }
   }
 }
 
 HANDLE
 nsNativeThemeWin::GetTheme(uint8_t aWidgetType)
 { 
-  if (!IsVistaOrLater()) {
-    // On XP or earlier, render dropdowns as textfields;
-    // doing it the right way works fine with the MS themes,
-    // but breaks on a lot of custom themes (presumably because MS
-    // apps do the textfield border business as well).
-    if (aWidgetType == NS_THEME_MENULIST)
-      aWidgetType = NS_THEME_TEXTFIELD;
-  }
-
   switch (aWidgetType) {
     case NS_THEME_BUTTON:
     case NS_THEME_RADIO:
     case NS_THEME_CHECKBOX:
     case NS_THEME_GROUPBOX:
       return nsUXThemeData::GetTheme(eUXButton);
     case NS_THEME_NUMBER_INPUT:
     case NS_THEME_TEXTFIELD:
     case NS_THEME_TEXTFIELD_MULTILINE:
     case NS_THEME_FOCUS_OUTLINE:
       return nsUXThemeData::GetTheme(eUXEdit);
     case NS_THEME_TOOLTIP:
-      // XP/2K3 should force a classic treatment of tooltips
-      return !IsVistaOrLater() ?
-        nullptr : nsUXThemeData::GetTheme(eUXTooltip);
+      return nsUXThemeData::GetTheme(eUXTooltip);
     case NS_THEME_TOOLBOX:
       return nsUXThemeData::GetTheme(eUXRebar);
     case NS_THEME_WIN_MEDIA_TOOLBOX:
       return nsUXThemeData::GetTheme(eUXMediaRebar);
     case NS_THEME_WIN_COMMUNICATIONS_TOOLBOX:
       return nsUXThemeData::GetTheme(eUXCommunicationsRebar);
     case NS_THEME_WIN_BROWSERTABBAR_TOOLBOX:
       return nsUXThemeData::GetTheme(eUXBrowserTabBarRebar);
@@ -869,22 +728,16 @@ nsNativeThemeWin::IsMenuActive(nsIFrame 
  * us; 0 means that we should use part code 0, which isn't a real part code
  * but elicits some kind of default behaviour from UXTheme when drawing
  * (but isThemeBackgroundPartiallyTransparent may not work).
  */
 nsresult 
 nsNativeThemeWin::GetThemePartAndState(nsIFrame* aFrame, uint8_t aWidgetType, 
                                        int32_t& aPart, int32_t& aState)
 {
-  if (!IsVistaOrLater()) {
-    // See GetTheme
-    if (aWidgetType == NS_THEME_MENULIST)
-      aWidgetType = NS_THEME_TEXTFIELD;
-  }
-
   switch (aWidgetType) {
     case NS_THEME_BUTTON: {
       aPart = BP_BUTTON;
       if (!aFrame) {
         aState = TS_NORMAL;
         return NS_OK;
       }
 
@@ -947,73 +800,53 @@ nsNativeThemeWin::GetThemePartAndState(n
       // same as GBS_NORMAL don't bother supporting GBS_DISABLED.
       return NS_OK;
     }
     case NS_THEME_NUMBER_INPUT:
     case NS_THEME_TEXTFIELD:
     case NS_THEME_TEXTFIELD_MULTILINE: {
       EventStates eventState = GetContentState(aFrame, aWidgetType);
 
-      if (IsVistaOrLater()) {
-        /* Note: the NOSCROLL type has a rounded corner in each
-         * corner.  The more specific HSCROLL, VSCROLL, HVSCROLL types
-         * have side and/or top/bottom edges rendered as straight
-         * horizontal lines with sharp corners to accommodate a
-         * scrollbar.  However, the scrollbar gets rendered on top of
-         * this for us, so we don't care, and can just use NOSCROLL
-         * here.
+      /* Note: the NOSCROLL type has a rounded corner in each corner.  The more
+       * specific HSCROLL, VSCROLL, HVSCROLL types have side and/or top/bottom
+       * edges rendered as straight horizontal lines with sharp corners to
+       * accommodate a scrollbar.  However, the scrollbar gets rendered on top
+       * of this for us, so we don't care, and can just use NOSCROLL here.
+       */
+      aPart = TFP_EDITBORDER_NOSCROLL;
+
+      if (!aFrame) {
+        aState = TFS_EDITBORDER_NORMAL;
+      } else if (IsDisabled(aFrame, eventState)) {
+        aState = TFS_EDITBORDER_DISABLED;
+      } else if (IsReadOnly(aFrame)) {
+        /* no special read-only state */
+        aState = TFS_EDITBORDER_NORMAL;
+      } else {
+        nsIContent* content = aFrame->GetContent();
+
+        /* XUL textboxes don't get focused themselves, because they have child
+         * html:input.. but we can check the XUL focused attributes on them
          */
-        aPart = TFP_EDITBORDER_NOSCROLL;
-
-        if (!aFrame) {
-          aState = TFS_EDITBORDER_NORMAL;
-        } else if (IsDisabled(aFrame, eventState)) {
-          aState = TFS_EDITBORDER_DISABLED;
-        } else if (IsReadOnly(aFrame)) {
-          /* no special read-only state */
+        if (content && content->IsXULElement() && IsFocused(aFrame))
+          aState = TFS_EDITBORDER_FOCUSED;
+        else if (eventState.HasAtLeastOneOfStates(NS_EVENT_STATE_ACTIVE | NS_EVENT_STATE_FOCUS))
+          aState = TFS_EDITBORDER_FOCUSED;
+        else if (eventState.HasState(NS_EVENT_STATE_HOVER))
+          aState = TFS_EDITBORDER_HOVER;
+        else
           aState = TFS_EDITBORDER_NORMAL;
-        } else {
-          nsIContent* content = aFrame->GetContent();
-
-          /* XUL textboxes don't get focused themselves, because they have child
-           * html:input.. but we can check the XUL focused attributes on them
-           */
-          if (content && content->IsXULElement() && IsFocused(aFrame))
-            aState = TFS_EDITBORDER_FOCUSED;
-          else if (eventState.HasAtLeastOneOfStates(NS_EVENT_STATE_ACTIVE | NS_EVENT_STATE_FOCUS))
-            aState = TFS_EDITBORDER_FOCUSED;
-          else if (eventState.HasState(NS_EVENT_STATE_HOVER))
-            aState = TFS_EDITBORDER_HOVER;
-          else
-            aState = TFS_EDITBORDER_NORMAL;
-        }
-      } else {
-        aPart = TFP_TEXTFIELD;
-        
-        if (!aFrame)
-          aState = TS_NORMAL;
-        else if (IsDisabled(aFrame, eventState))
-          aState = TS_DISABLED;
-        else if (IsReadOnly(aFrame))
-          aState = TFS_READONLY;
-        else
-          aState = StandardGetState(aFrame, aWidgetType, true);
       }
 
       return NS_OK;
     }
     case NS_THEME_FOCUS_OUTLINE: {
-      if (IsVistaOrLater()) {
-        // XXX the EDITBORDER values don't respect DTBG_OMITCONTENT
-        aPart = TFP_TEXTFIELD; //TFP_EDITBORDER_NOSCROLL;
-        aState = TS_FOCUSED; //TFS_EDITBORDER_FOCUSED;
-      } else {
-        aPart = TFP_TEXTFIELD;
-        aState = TS_FOCUSED;
-      }
+      // XXX the EDITBORDER values don't respect DTBG_OMITCONTENT
+      aPart = TFP_TEXTFIELD; //TFP_EDITBORDER_NOSCROLL;
+      aState = TS_FOCUSED; //TFS_EDITBORDER_FOCUSED;
       return NS_OK;
     }
     case NS_THEME_TOOLTIP: {
       aPart = TTP_STANDARD;
       aState = TS_NORMAL;
       return NS_OK;
     }
     case NS_THEME_PROGRESSBAR:
@@ -1027,21 +860,19 @@ nsNativeThemeWin::GetThemePartAndState(n
       aState = PBBS_NORMAL;
       return NS_OK;
     }
     case NS_THEME_PROGRESSCHUNK:
     case NS_THEME_PROGRESSCHUNK_VERTICAL: {
       nsIFrame* parentFrame = aFrame->GetParent();
       if (aWidgetType == NS_THEME_PROGRESSCHUNK_VERTICAL ||
           IsVerticalProgress(parentFrame)) {
-        aPart = IsVistaOrLater() ?
-          PP_FILLVERT : PP_CHUNKVERT;
+        aPart = PP_FILLVERT;
       } else {
-        aPart = IsVistaOrLater() ?
-          PP_FILL : PP_CHUNK;
+        aPart = PP_FILL;
       }
 
       aState = PBBVS_NORMAL;
       return NS_OK;
     }
     case NS_THEME_TOOLBARBUTTON: {
       aPart = BP_BUTTON;
       if (!aFrame) {
@@ -1095,18 +926,17 @@ nsNativeThemeWin::GetThemePartAndState(n
       else {
         nsIFrame *parent = aFrame->GetParent();
         EventStates parentState =
           GetContentState(parent, parent->StyleDisplay()->mAppearance);
         if (eventState.HasAllStates(NS_EVENT_STATE_HOVER | NS_EVENT_STATE_ACTIVE))
           aState += TS_ACTIVE;
         else if (eventState.HasState(NS_EVENT_STATE_HOVER))
           aState += TS_HOVER;
-        else if (IsVistaOrLater() &&
-                 parentState.HasState(NS_EVENT_STATE_HOVER))
+        else if (parentState.HasState(NS_EVENT_STATE_HOVER))
           aState = (aWidgetType - NS_THEME_SCROLLBARBUTTON_UP) + SP_BUTTON_IMPLICIT_HOVER_BASE;
         else
           aState += TS_NORMAL;
       }
       return NS_OK;
     }
     case NS_THEME_SCROLLBAR_HORIZONTAL:
     case NS_THEME_SCROLLBAR_VERTICAL: {
@@ -1199,24 +1029,17 @@ nsNativeThemeWin::GetThemePartAndState(n
     case NS_THEME_TOOLBOX:
     case NS_THEME_WIN_MEDIA_TOOLBOX:
     case NS_THEME_WIN_COMMUNICATIONS_TOOLBOX:
     case NS_THEME_WIN_BROWSERTABBAR_TOOLBOX:
     case NS_THEME_STATUSBAR:
     case NS_THEME_SCROLLBAR:
     case NS_THEME_SCROLLBAR_SMALL: {
       aState = 0;
-      if (IsVistaOrLater()) {
-        // On vista, they have a part
-        aPart = RP_BACKGROUND;
-      } else {
-        // Otherwise, they don't.  (But I bet
-        // RP_BACKGROUND would work here, too);
-        aPart = 0;
-      }
+      aPart = RP_BACKGROUND;
       return NS_OK;
     }
     case NS_THEME_TOOLBAR: {
       // Use -1 to indicate we don't wish to have the theme background drawn
       // for this item. We will pass any nessessary information via aState,
       // and will render the item using separate code.
       aPart = -1;
       aState = 0;
@@ -1331,18 +1154,17 @@ nsNativeThemeWin::GetThemePartAndState(n
       bool isMenulist = !isHTML && parentFrame->GetType() == nsGkAtoms::menuFrame;
       bool isOpen = false;
 
       // HTML select and XUL menulist dropdown buttons get state from the parent.
       if (isHTML || isMenulist)
         aFrame = parentFrame;
 
       EventStates eventState = GetContentState(aFrame, aWidgetType);
-      aPart = IsVistaOrLater() ?
-        CBP_DROPMARKER_VISTA : CBP_DROPMARKER;
+      aPart = CBP_DROPMARKER_VISTA;
 
       // For HTML controls with author styling, we should fall
       // back to the old dropmarker style to avoid clashes with
       // author-specified backgrounds and borders (bug #441034)
       if (isHTML && IsWidgetStyled(aFrame->PresContext(), aFrame, NS_THEME_MENULIST))
         aPart = CBP_DROPMARKER;
 
       if (IsDisabled(aFrame, eventState)) {
@@ -1352,38 +1174,35 @@ nsNativeThemeWin::GetThemePartAndState(n
 
       if (isHTML) {
         nsIComboboxControlFrame* ccf = do_QueryFrame(aFrame);
         isOpen = (ccf && ccf->IsDroppedDownOrHasParentPopup());
       }
       else
         isOpen = IsOpenButton(aFrame);
 
-      if (IsVistaOrLater()) {
-        if (isHTML || IsMenuListEditable(aFrame)) {
-          if (isOpen) {
-            /* Hover is propagated, but we need to know whether we're
-             * hovering just the combobox frame, not the dropdown frame.
-             * But, we can't get that information, since hover is on the
-             * content node, and they share the same content node.  So,
-             * instead, we cheat -- if the dropdown is open, we always
-             * show the hover state.  This looks fine in practice.
-             */
-            aState = TS_HOVER;
-            return NS_OK;
-          }
-        } else {
-          /* On Vista, the dropdown indicator on a menulist button in  
-           * chrome is not given a hover effect. When the frame isn't
-           * isn't HTML content, we cheat and force the dropdown state
-           * to be normal. (Bug 430434)
+      if (isHTML || IsMenuListEditable(aFrame)) {
+        if (isOpen) {
+          /* Hover is propagated, but we need to know whether we're hovering
+           * just the combobox frame, not the dropdown frame. But, we can't get
+           * that information, since hover is on the content node, and they
+           * share the same content node.  So, instead, we cheat -- if the
+           * dropdown is open, we always show the hover state.  This looks fine
+           * in practice.
            */
-          aState = TS_NORMAL;
+          aState = TS_HOVER;
           return NS_OK;
         }
+      } else {
+        /* The dropdown indicator on a menulist button in chrome is not given a
+         * hover effect. When the frame isn't isn't HTML content, we cheat and
+         * force the dropdown state to be normal. (Bug 430434)
+         */
+        aState = TS_NORMAL;
+        return NS_OK;
       }
 
       aState = TS_NORMAL;
 
       // Dropdown button active state doesn't need :hover.
       if (eventState.HasState(NS_EVENT_STATE_ACTIVE)) {
         if (isOpen && (isHTML || isMenulist)) {
           // XXX Button should look active until the mouse is released, but
@@ -1874,17 +1693,17 @@ RENDER_AGAIN:
     SetPixel(hdc, widgetRect.left, widgetRect.top, color);
     SetPixel(hdc, widgetRect.right-1, widgetRect.top, color);
     SetPixel(hdc, widgetRect.right-1, widgetRect.bottom-1, color);
     SetPixel(hdc, widgetRect.left, widgetRect.bottom-1, color);
   }
   else if (aWidgetType == NS_THEME_PROGRESSCHUNK ||
            aWidgetType == NS_THEME_PROGRESSCHUNK_VERTICAL) {
     DrawThemedProgressMeter(aFrame, aWidgetType, theme, hdc, part, state,
-                            &widgetRect, &clipRect, p2a);
+                            &widgetRect, &clipRect);
   }
   else if (aWidgetType == NS_THEME_FOCUS_OUTLINE) {
     // Inflate 'widgetRect' with the focus outline size.
     nsIntMargin border;
     if (NS_SUCCEEDED(GetWidgetBorder(aFrame->PresContext()->DeviceContext(),
                                      aFrame, aWidgetType, &border))) {
       widgetRect.left -= border.left;
       widgetRect.right += border.right;
@@ -2140,51 +1959,49 @@ nsNativeThemeWin::GetWidgetPadding(nsDev
     SIZE popupSize;
     GetThemePartSize(theme, nullptr, MENU_POPUPBORDERS, /* state */ 0, nullptr, TS_TRUE, &popupSize);
     aResult->top = aResult->bottom = popupSize.cy;
     aResult->left = aResult->right = popupSize.cx;
     ScaleForFrameDPI(aResult, aFrame);
     return ok;
   }
 
-  if (IsVistaOrLater()) {
-    if (aWidgetType == NS_THEME_NUMBER_INPUT ||
-        aWidgetType == NS_THEME_TEXTFIELD ||
-        aWidgetType == NS_THEME_TEXTFIELD_MULTILINE ||
-        aWidgetType == NS_THEME_MENULIST)
-    {
-      /* If we have author-specified padding for these elements, don't do the fixups below */
-      if (aFrame->PresContext()->HasAuthorSpecifiedRules(aFrame, NS_AUTHOR_SPECIFIED_PADDING))
-        return false;
-    }
-
-    /* textfields need extra pixels on all sides, otherwise they
-     * wrap their content too tightly.  The actual border is drawn 1px
-     * inside the specified rectangle, so Gecko will end up making the
-     * contents look too small.  Instead, we add 2px padding for the
-     * contents and fix this. (Used to be 1px added, see bug 430212)
+  if (aWidgetType == NS_THEME_NUMBER_INPUT ||
+      aWidgetType == NS_THEME_TEXTFIELD ||
+      aWidgetType == NS_THEME_TEXTFIELD_MULTILINE ||
+      aWidgetType == NS_THEME_MENULIST)
+  {
+    // If we have author-specified padding for these elements, don't do the
+    // fixups below.
+    if (aFrame->PresContext()->HasAuthorSpecifiedRules(aFrame, NS_AUTHOR_SPECIFIED_PADDING))
+      return false;
+  }
+
+  /* textfields need extra pixels on all sides, otherwise they wrap their
+   * content too tightly.  The actual border is drawn 1px inside the specified
+   * rectangle, so Gecko will end up making the contents look too small.
+   * Instead, we add 2px padding for the contents and fix this. (Used to be 1px
+   * added, see bug 430212)
+   */
+  if (aWidgetType == NS_THEME_NUMBER_INPUT ||
+      aWidgetType == NS_THEME_TEXTFIELD ||
+      aWidgetType == NS_THEME_TEXTFIELD_MULTILINE) {
+    aResult->top = aResult->bottom = 2;
+    aResult->left = aResult->right = 2;
+    ScaleForFrameDPI(aResult, aFrame);
+    return ok;
+  } else if (IsHTMLContent(aFrame) && aWidgetType == NS_THEME_MENULIST) {
+    /* For content menulist controls, we need an extra pixel so that we have
+     * room to draw our focus rectangle stuff. Otherwise, the focus rect might
+     * overlap the control's border.
      */
-    if (aWidgetType == NS_THEME_NUMBER_INPUT ||
-        aWidgetType == NS_THEME_TEXTFIELD ||
-        aWidgetType == NS_THEME_TEXTFIELD_MULTILINE) {
-      aResult->top = aResult->bottom = 2;
-      aResult->left = aResult->right = 2;
-      ScaleForFrameDPI(aResult, aFrame);
-      return ok;
-    } else if (IsHTMLContent(aFrame) && aWidgetType == NS_THEME_MENULIST) {
-      /* For content menulist controls, we need an extra pixel so
-       * that we have room to draw our focus rectangle stuff.
-       * Otherwise, the focus rect might overlap the control's
-       * border.
-       */
-      aResult->top = aResult->bottom = 1;
-      aResult->left = aResult->right = 1;
-      ScaleForFrameDPI(aResult, aFrame);
-      return ok;
-    }
+    aResult->top = aResult->bottom = 1;
+    aResult->left = aResult->right = 1;
+    ScaleForFrameDPI(aResult, aFrame);
+    return ok;
   }
 
   int32_t right, left, top, bottom;
   right = left = top = bottom = 0;
   switch (aWidgetType)
   {
     case NS_THEME_MENUIMAGE:
         right = 8;
@@ -2239,33 +2056,31 @@ nsNativeThemeWin::GetWidgetOverflow(nsDe
   /* This is disabled for now, because it causes invalidation problems --
    * see bug 420381.  The effect of not updating the overflow area is that
    * for dropdown buttons in content areas, there is a 1px border on 3 sides
    * where, if invalidated, the dropdown control probably won't be repainted.
    * This is fairly minor, as by default there is nothing in that area, and
    * a border only shows up if the widget is being hovered.
    */
 #if 0
-  if (IsVistaOrLater()) {
-    /* We explicitly draw dropdown buttons in HTML content 1px bigger
-     * up, right, and bottom so that they overlap the dropdown's border
-     * like they're supposed to.
-     */
-    if (aWidgetType == NS_THEME_MENULIST_BUTTON &&
-        IsHTMLContent(aFrame) &&
-        !IsWidgetStyled(aFrame->GetParent()->PresContext(),
-                        aFrame->GetParent(),
-                        NS_THEME_MENULIST))
-    {
-      int32_t p2a = aContext->AppUnitsPerDevPixel();
-      /* Note: no overflow on the left */
-      nsMargin m(p2a, p2a, p2a, 0);
-      aOverflowRect->Inflate (m);
-      return true;
-    }
+  /* We explicitly draw dropdown buttons in HTML content 1px bigger up, right,
+   * and bottom so that they overlap the dropdown's border like they're
+   * supposed to.
+   */
+  if (aWidgetType == NS_THEME_MENULIST_BUTTON &&
+      IsHTMLContent(aFrame) &&
+      !IsWidgetStyled(aFrame->GetParent()->PresContext(),
+                      aFrame->GetParent(),
+                      NS_THEME_MENULIST))
+  {
+    int32_t p2a = aContext->AppUnitsPerDevPixel();
+    /* Note: no overflow on the left */
+    nsMargin m(p2a, p2a, p2a, 0);
+    aOverflowRect->Inflate (m);
+    return true;
   }
 #endif
 
   if (aWidgetType == NS_THEME_FOCUS_OUTLINE) {
     nsIntMargin border;
     nsresult rv = GetWidgetBorder(aContext, aFrame, aWidgetType, &border);
     if (NS_SUCCEEDED(rv)) {
       int32_t p2a = aContext->AppUnitsPerDevPixel();
@@ -2379,32 +2194,28 @@ nsNativeThemeWin::GetMinimumWidgetSize(n
       *aIsOverridable = false;
       break;
 
     case NS_THEME_RANGE_THUMB:
     case NS_THEME_SCALETHUMB_HORIZONTAL:
     case NS_THEME_SCALETHUMB_VERTICAL:
     {
       *aIsOverridable = false;
-      // on Vista, GetThemePartAndState returns odd values for
+      // On Vista, GetThemePartAndState returns odd values for
       // scale thumbs, so use a hardcoded size instead.
-      if (IsVistaOrLater()) {
-        if (aWidgetType == NS_THEME_SCALETHUMB_HORIZONTAL ||
-            (aWidgetType == NS_THEME_RANGE_THUMB && IsRangeHorizontal(aFrame))) {
-          aResult->width = 12;
-          aResult->height = 20;
-        }
-        else {
-          aResult->width = 20;
-          aResult->height = 12;
-        }
-        ScaleForFrameDPI(aResult, aFrame);
-        return rv;
+      if (aWidgetType == NS_THEME_SCALETHUMB_HORIZONTAL ||
+          (aWidgetType == NS_THEME_RANGE_THUMB && IsRangeHorizontal(aFrame))) {
+        aResult->width = 12;
+        aResult->height = 20;
+      } else {
+        aResult->width = 20;
+        aResult->height = 12;
       }
-      break;
+      ScaleForFrameDPI(aResult, aFrame);
+      return rv;
     }
 
     case NS_THEME_SCROLLBAR:
     {
       if (nsLookAndFeel::GetInt(
             nsLookAndFeel::eIntID_UseOverlayScrollbars) != 0) {
         aResult->SizeTo(::GetSystemMetrics(SM_CXHSCROLL),
                         ::GetSystemMetrics(SM_CYVSCROLL));
@@ -2433,43 +2244,30 @@ nsNativeThemeWin::GetMinimumWidgetSize(n
 
     case NS_THEME_WINDOW_BUTTON_MAXIMIZE:
     case NS_THEME_WINDOW_BUTTON_RESTORE:
       // The only way to get accurate titlebar button info is to query a
       // window w/buttons when it's visible. nsWindow takes care of this and
       // stores that info in nsUXThemeData.
       aResult->width = nsUXThemeData::sCommandButtons[CMDBUTTONIDX_RESTORE].cx;
       aResult->height = nsUXThemeData::sCommandButtons[CMDBUTTONIDX_RESTORE].cy;
-      // For XP, subtract 4 from system metrics dimensions.
-      if (!IsVistaOrLater()) {
-        aResult->width -= 4;
-        aResult->height -= 4;
-      }
       AddPaddingRect(aResult, CAPTIONBUTTON_RESTORE);
       *aIsOverridable = false;
       return rv;
 
     case NS_THEME_WINDOW_BUTTON_MINIMIZE:
       aResult->width = nsUXThemeData::sCommandButtons[CMDBUTTONIDX_MINIMIZE].cx;
       aResult->height = nsUXThemeData::sCommandButtons[CMDBUTTONIDX_MINIMIZE].cy;
-      if (!IsVistaOrLater()) {
-        aResult->width -= 4;
-        aResult->height -= 4;
-      }
       AddPaddingRect(aResult, CAPTIONBUTTON_MINIMIZE);
       *aIsOverridable = false;
       return rv;
 
     case NS_THEME_WINDOW_BUTTON_CLOSE:
       aResult->width = nsUXThemeData::sCommandButtons[CMDBUTTONIDX_CLOSE].cx;
       aResult->height = nsUXThemeData::sCommandButtons[CMDBUTTONIDX_CLOSE].cy;
-      if (!IsVistaOrLater()) {
-        aResult->width -= 4;
-        aResult->height -= 4;
-      }
       AddPaddingRect(aResult, CAPTIONBUTTON_CLOSE);
       *aIsOverridable = false;
       return rv;
 
     case NS_THEME_WINDOW_TITLEBAR:
     case NS_THEME_WINDOW_TITLEBAR_MAXIMIZED:
       aResult->height = GetSystemMetrics(SM_CYCAPTION);
       aResult->height += GetSystemMetrics(SM_CYFRAME);
@@ -2589,28 +2387,19 @@ nsNativeThemeWin::WidgetStateChanged(nsI
       aWidgetType == NS_THEME_WINDOW_BUTTON_CLOSE ||
       aWidgetType == NS_THEME_WINDOW_BUTTON_MINIMIZE ||
       aWidgetType == NS_THEME_WINDOW_BUTTON_MAXIMIZE ||
       aWidgetType == NS_THEME_WINDOW_BUTTON_RESTORE) {
     *aShouldRepaint = true;
     return NS_OK;
   }
 
-  // On Vista, the scrollbar buttons need to change state when the track has/doesn't have hover
-  if (!IsVistaOrLater() &&
-      (aWidgetType == NS_THEME_SCROLLBAR_VERTICAL || 
-      aWidgetType == NS_THEME_SCROLLBAR_HORIZONTAL)) {
-    *aShouldRepaint = false;
-    return NS_OK;
-  }
-
   // We need to repaint the dropdown arrow in vista HTML combobox controls when
   // the control is closed to get rid of the hover effect.
-  if (IsVistaOrLater() &&
-      (aWidgetType == NS_THEME_MENULIST || aWidgetType == NS_THEME_MENULIST_BUTTON) &&
+  if ((aWidgetType == NS_THEME_MENULIST || aWidgetType == NS_THEME_MENULIST_BUTTON) &&
       IsHTMLContent(aFrame))
   {
     *aShouldRepaint = true;
     return NS_OK;
   }
 
   // XXXdwh Not sure what can really be done here.  Can at least guess for
   // specific widgets that they're highly unlikely to have certain states.
--- a/widget/windows/nsNativeThemeWin.h
+++ b/widget/windows/nsNativeThemeWin.h
@@ -112,17 +112,16 @@ protected:
   int32_t StandardGetState(nsIFrame* aFrame, uint8_t aWidgetType, bool wantFocused);
   bool IsMenuActive(nsIFrame* aFrame, uint8_t aWidgetType);
   RECT CalculateProgressOverlayRect(nsIFrame* aFrame, RECT* aWidgetRect,
                                     bool aIsVertical, bool aIsIndeterminate,
                                     bool aIsClassic);
   void DrawThemedProgressMeter(nsIFrame* aFrame, int aWidgetType,
                                HANDLE aTheme, HDC aHdc,
                                int aPart, int aState,
-                               RECT* aWidgetRect, RECT* aClipRect,
-                               gfxFloat aAppUnits);
+                               RECT* aWidgetRect, RECT* aClipRect);
 
 private:
   TimeStamp mProgressDeterminateTimeStamp;
   TimeStamp mProgressIndeterminateTimeStamp;
 };
 
 #endif
--- a/widget/windows/nsUXThemeConstants.h
+++ b/widget/windows/nsUXThemeConstants.h
@@ -62,17 +62,17 @@
 #define SP_THUMBVERT       3
 #define SP_TRACKSTARTHOR   4
 #define SP_TRACKENDHOR     5
 #define SP_TRACKSTARTVERT  6
 #define SP_TRACKENDVERT    7
 #define SP_GRIPPERHOR      8
 #define SP_GRIPPERVERT     9
 
-// Vista only; implict hover state.
+// Implicit hover state.
 // BASE + 0 = UP, + 1 = DOWN, etc.
 #define SP_BUTTON_IMPLICIT_HOVER_BASE   17
 
 // Scale constants
 #define TKP_TRACK          1
 #define TKP_TRACKVERT      2
 #define TKP_THUMB          3
 #define TKP_THUMBBOTTOM    4
--- a/widget/windows/nsUXThemeData.cpp
+++ b/widget/windows/nsUXThemeData.cpp
@@ -138,20 +138,18 @@ nsUXThemeData::InitTitlebarInfo()
   // the current theme, but they insure the buttons at least show up.
   sCommandButtons[0].cx = GetSystemMetrics(SM_CXSIZE);
   sCommandButtons[0].cy = GetSystemMetrics(SM_CYSIZE);
   sCommandButtons[1].cx = sCommandButtons[2].cx = sCommandButtons[0].cx;
   sCommandButtons[1].cy = sCommandButtons[2].cy = sCommandButtons[0].cy;
   sCommandButtons[3].cx = sCommandButtons[0].cx * 3;
   sCommandButtons[3].cy = sCommandButtons[0].cy;
 
-  // Use system metrics for pre-vista, otherwise trigger a
-  // refresh on the next layout.
-  sTitlebarInfoPopulatedAero = sTitlebarInfoPopulatedThemed =
-    !IsVistaOrLater();
+  // Trigger a refresh on the next layout.
+  sTitlebarInfoPopulatedAero = sTitlebarInfoPopulatedThemed = false;
 }
 
 // static
 void
 nsUXThemeData::UpdateTitlebarInfo(HWND aWnd)
 {
   if (!aWnd)
     return;
@@ -301,17 +299,17 @@ bool nsUXThemeData::CheckForCompositor(b
   return sCachedValue;
 }
 
 // static
 void
 nsUXThemeData::UpdateNativeThemeInfo()
 {
   // Trigger a refresh of themed button metrics if needed
-  sTitlebarInfoPopulatedThemed = !IsVistaOrLater();
+  sTitlebarInfoPopulatedThemed = false;
 
   sIsDefaultWindowsTheme = false;
   sThemeId = LookAndFeel::eWindowsTheme_Generic;
 
   HIGHCONTRAST highContrastInfo;
   highContrastInfo.cbSize = sizeof(HIGHCONTRAST);
   if (SystemParametersInfo(SPI_GETHIGHCONTRAST, 0, &highContrastInfo, 0)) {
     sIsHighContrastOn = ((highContrastInfo.dwFlags & HCF_HIGHCONTRASTON) != 0);
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -263,18 +263,17 @@ UINT            nsWindow::sHookTimerId  
 // Mouse Clicks - static variable definitions for figuring
 // out 1 - 3 Clicks.
 POINT           nsWindow::sLastMousePoint         = {0};
 POINT           nsWindow::sLastMouseMovePoint     = {0};
 LONG            nsWindow::sLastMouseDownTime      = 0L;
 LONG            nsWindow::sLastClickCount         = 0L;
 BYTE            nsWindow::sLastMouseButton        = 0;
 
-// Trim heap on minimize. (initialized, but still true.)
-int             nsWindow::sTrimOnMinimize         = 2;
+bool            nsWindow::sHaveInitializedPrefs   = false;
 
 TriStateBool nsWindow::sHasBogusPopupsDropShadowOnMultiMonitor = TRI_UNKNOWN;
 
 WPARAM nsWindow::sMouseExitwParam = 0;
 LPARAM nsWindow::sMouseExitlParamScreen = 0;
 
 static SystemTimeConverter<DWORD>&
 TimeConverter() {
@@ -748,17 +747,17 @@ nsWindow::Create(nsIWidget* aParent,
   DWORD style = WindowStyle();
   DWORD extendedStyle = WindowExStyle();
 
   if (mWindowType == eWindowType_popup) {
     if (!aParent) {
       parent = nullptr;
     }
 
-    if (IsVistaOrLater() && !IsWin8OrLater() &&
+    if (!IsWin8OrLater() &&
         HasBogusPopupsDropShadowOnMultiMonitor()) {
       extendedStyle |= WS_EX_COMPOSITED;
     }
 
     if (aInitData->mMouseTransparent) {
       // This flag makes the window transparent to mouse events
       mMouseTransparent = true;
       extendedStyle |= WS_EX_TRANSPARENT;
@@ -873,30 +872,23 @@ nsWindow::Create(nsIWidget* aParent,
   // our HWND in order to receive this message.
   DebugOnly<BOOL> wtsRegistered = ::WTSRegisterSessionNotification(mWnd,
                                                        NOTIFY_FOR_THIS_SESSION);
   NS_ASSERTION(wtsRegistered, "WTSRegisterSessionNotification failed!\n");
 
   mDefaultIMC.Init(this);
   IMEHandler::InitInputContext(this, mInputContext);
 
-  // If the internal variable set by the config.trim_on_minimize pref has not
-  // been initialized, and if this is the hidden window (conveniently created
-  // before any visible windows, and after the profile has been initialized),
-  // do some initialization work.
-  if (sTrimOnMinimize == 2 && mWindowType == eWindowType_invisible) {
-    // Our internal trim prevention logic is effective on 2K/XP at maintaining
-    // the working set when windows are minimized, but on Vista and up it has
-    // little to no effect. Since this feature has been the source of numerous
-    // bugs over the years, disable it (sTrimOnMinimize=1) on Vista and up.
-    sTrimOnMinimize =
-      Preferences::GetBool("config.trim_on_minimize",
-        IsVistaOrLater() ? 1 : 0);
+  // Do some initialization work, but only if (a) it hasn't already been done,
+  // and (b) this is the hidden window (which is conveniently created before
+  // any visible windows but after the profile has been initialized).
+  if (!sHaveInitializedPrefs && mWindowType == eWindowType_invisible) {
     sSwitchKeyboardLayout =
       Preferences::GetBool("intl.keyboard.per_window_layout", false);
+    sHaveInitializedPrefs = true;
   }
 
   // Query for command button metric data for rendering the titlebar. We
   // only do this once on the first window that has an actual titlebar
   if (ShouldCacheTitleBarInfo(mWindowType, mBorderStyle)) {
     nsUXThemeData::UpdateTitlebarInfo(mWnd);
   }
 
@@ -1615,33 +1607,34 @@ bool nsWindow::IsVisible() const
  *
  * Used in Size and Move operations for setting the proper
  * window clipping regions for window transparency.
  *
  **************************************************************/
 
 // XP and Vista visual styles sometimes require window clipping regions to be applied for proper
 // transparency. These routines are called on size and move operations.
+// XXX this is apparently still needed in Windows 7 and later
 void nsWindow::ClearThemeRegion()
 {
-  if (IsVistaOrLater() && !HasGlass() &&
+  if (!HasGlass() &&
       (mWindowType == eWindowType_popup && !IsPopupWithTitleBar() &&
        (mPopupType == ePopupTypeTooltip || mPopupType == ePopupTypePanel))) {
     SetWindowRgn(mWnd, nullptr, false);
   }
 }
 
 void nsWindow::SetThemeRegion()
 {
   // Popup types that have a visual styles region applied (bug 376408). This can be expanded
   // for other window types as needed. The regions are applied generically to the base window
   // so default constants are used for part and state. At some point we might need part and
   // state values from nsNativeThemeWin's GetThemePartAndState, but currently windows that
   // change shape based on state haven't come up.
-  if (IsVistaOrLater() && !HasGlass() &&
+  if (!HasGlass() &&
       (mWindowType == eWindowType_popup && !IsPopupWithTitleBar() &&
        (mPopupType == ePopupTypeTooltip || mPopupType == ePopupTypePanel))) {
     HRGN hRgn = nullptr;
     RECT rect = {0,0,mBounds.width,mBounds.height};
     
     HDC dc = ::GetDC(mWnd);
     GetThemeBackgroundRegion(nsUXThemeData::GetTheme(eUXTooltip), dc, TTP_STANDARD, TS_NORMAL, &rect, &hRgn);
     if (hRgn) {
@@ -2048,23 +2041,17 @@ nsWindow::SetSizeMode(nsSizeMode aMode)
         mode = SW_SHOW;
         break;
 
       case nsSizeMode_Maximized :
         mode = SW_MAXIMIZE;
         break;
 
       case nsSizeMode_Minimized :
-        // Using SW_SHOWMINIMIZED prevents the working set from being trimmed but
-        // keeps the window active in the tray. So after the window is minimized,
-        // windows will fire WM_WINDOWPOSCHANGED (OnWindowPosChanged) at which point
-        // we will do some additional processing to get the active window set right.
-        // If sTrimOnMinimize is set, we let windows handle minimization normally
-        // using SW_MINIMIZE.
-        mode = sTrimOnMinimize ? SW_MINIMIZE : SW_SHOWMINIMIZED;
+        mode = SW_MINIMIZE;
         break;
 
       default :
         mode = SW_RESTORE;
     }
 
     // Don't call ::ShowWindow if we're trying to "restore" a window that is
     // already in a normal state.  Prevents a bug where snapping to one side
@@ -5821,22 +5808,16 @@ nsWindow::ProcessMessage(UINT msg, WPARA
       }
     }
     break;
 #endif
 
     case WM_SYSCOMMAND:
     {
       WPARAM filteredWParam = (wParam &0xFFF0);
-      // prevent Windows from trimming the working set. bug 76831
-      if (!sTrimOnMinimize && filteredWParam == SC_MINIMIZE) {
-        ::ShowWindow(mWnd, SW_SHOWMINIMIZED);
-        result = true;
-      }
-
       if (mSizeMode == nsSizeMode_Fullscreen &&
           filteredWParam == SC_RESTORE &&
           GetCurrentShowCmd(mWnd) != SW_SHOWMINIMIZED) {
         MakeFullScreen(false);
         result = true;
       }
 
       // Handle the system menu manually when we're in full screen mode
@@ -6444,24 +6425,16 @@ void nsWindow::OnWindowPosChanged(WINDOW
       mSizeMode = (mFullscreenMode ? nsSizeMode_Fullscreen : nsSizeMode_Maximized);
     else if (pl.showCmd == SW_SHOWMINIMIZED)
       mSizeMode = nsSizeMode_Minimized;
     else if (mFullscreenMode)
       mSizeMode = nsSizeMode_Fullscreen;
     else
       mSizeMode = nsSizeMode_Normal;
 
-    // If !sTrimOnMinimize, we minimize windows using SW_SHOWMINIMIZED (See
-    // SetSizeMode for internal calls, and WM_SYSCOMMAND for external). This
-    // prevents the working set from being trimmed but keeps the window active.
-    // After the window is minimized, we need to do some touch up work on the
-    // active window. (bugs 76831 & 499816)
-    if (!sTrimOnMinimize && nsSizeMode_Minimized == mSizeMode)
-      ActivateOtherWindowHelper(mWnd);
-
 #ifdef WINSTATE_DEBUG_OUTPUT
     switch (mSizeMode) {
       case nsSizeMode_Normal:
           MOZ_LOG(gWindowsLog, LogLevel::Info, 
                  ("*** mSizeMode: nsSizeMode_Normal\n"));
         break;
       case nsSizeMode_Minimized:
         MOZ_LOG(gWindowsLog, LogLevel::Info, 
@@ -6572,41 +6545,16 @@ void nsWindow::OnWindowPosChanged(WINDOW
       rect.height = r.bottom - r.top;
     }
     
     // Send a gecko resize event
     OnResize(rect);
   }
 }
 
-// static
-void nsWindow::ActivateOtherWindowHelper(HWND aWnd)
-{
-  // Find the next window that is enabled, visible, and not minimized.
-  HWND hwndBelow = ::GetNextWindow(aWnd, GW_HWNDNEXT);
-  while (hwndBelow && (!::IsWindowEnabled(hwndBelow) || !::IsWindowVisible(hwndBelow) ||
-                       ::IsIconic(hwndBelow))) {
-    hwndBelow = ::GetNextWindow(hwndBelow, GW_HWNDNEXT);
-  }
-
-  // Push ourselves to the bottom of the stack, then activate the
-  // next window.
-  ::SetWindowPos(aWnd, HWND_BOTTOM, 0, 0, 0, 0,
-                 SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
-  if (hwndBelow)
-    ::SetForegroundWindow(hwndBelow);
-
-  // Play the minimize sound while we're here, since that is also
-  // forgotten when we use SW_SHOWMINIMIZED.
-  nsCOMPtr<nsISound> sound(do_CreateInstance("@mozilla.org/sound;1"));
-  if (sound) {
-    sound->PlaySystemSound(NS_LITERAL_STRING("Minimize"));
-  }
-}
-
 void nsWindow::OnWindowPosChanging(LPWINDOWPOS& info)
 {
   // Update non-client margins if the frame size is changing, and let the
   // browser know we are changing size modes, so alternative css can kick in.
   // If we're going into fullscreen mode, ignore this, since it'll reset
   // margins to normal mode. 
   if ((info->flags & SWP_FRAMECHANGED && !(info->flags & SWP_NOSIZE)) &&
       mSizeMode != nsSizeMode_Fullscreen) {
--- a/widget/windows/nsWindow.h
+++ b/widget/windows/nsWindow.h
@@ -484,17 +484,16 @@ protected:
    * Misc.
    */
   void                    StopFlashing();
   static bool             IsTopLevelMouseExit(HWND aWnd);
   virtual nsresult        SetWindowClipRegion(const nsTArray<LayoutDeviceIntRect>& aRects,
                                               bool aIntersectWithExisting) override;
   nsIntRegion             GetRegionToPaint(bool aForceFullRepaint,
                                            PAINTSTRUCT ps, HDC aDC);
-  static void             ActivateOtherWindowHelper(HWND aWnd);
   void                    ClearCachedResources();
   nsIWidgetListener*      GetPaintListener();
 
   already_AddRefed<SourceSurface> CreateScrollSnapshot() override;
 
   struct ScrollSnapshot
   {
     RefPtr<gfxWindowsSurface> surface;
@@ -550,17 +549,17 @@ protected:
   static nsWindow*      sCurrentWindow;
   static BOOL           sIsOleInitialized;
   static HCURSOR        sHCursor;
   static imgIContainer* sCursorImgContainer;
   static bool           sSwitchKeyboardLayout;
   static bool           sJustGotDeactivate;
   static bool           sJustGotActivate;
   static bool           sIsInMouseCapture;
-  static int            sTrimOnMinimize;
+  static bool           sHaveInitializedPrefs;
 
   // Always use the helper method to read this property.  See bug 603793.
   static TriStateBool   sHasBogusPopupsDropShadowOnMultiMonitor;
   static bool           HasBogusPopupsDropShadowOnMultiMonitor();
 
   // Non-client margin settings
   // Pre-calculated outward offset applied to default frames
   LayoutDeviceIntMargin mNonClientOffset;