From 93dcf227cd10b645dd6221270562a375c6c7aef7 Mon Sep 17 00:00:00 2001 From: Tim Nguyen Date: Thu, 21 May 2015 12:16:00 +0200 Subject: [PATCH] Bug 1166867 - Support -moz-os-version: windows-win10. r=jimm --- layout/style/nsMediaFeatures.cpp | 1 + widget/LookAndFeel.h | 9 +++++---- widget/windows/nsLookAndFeel.cpp | 8 +++++--- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/layout/style/nsMediaFeatures.cpp b/layout/style/nsMediaFeatures.cpp index 30cbbb28b884..d3a15e748002 100644 --- a/layout/style/nsMediaFeatures.cpp +++ b/layout/style/nsMediaFeatures.cpp @@ -61,6 +61,7 @@ const OperatingSystemVersionInfo osVersionStrings[] = { { 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 diff --git a/widget/LookAndFeel.h b/widget/LookAndFeel.h index df3fa4a52f1f..98816b2d3ea2 100644 --- a/widget/LookAndFeel.h +++ b/widget/LookAndFeel.h @@ -165,7 +165,7 @@ public: // Hyperlink color extracted from the system, not affected by the // browser.anchor_color user pref. - // There is no OS-specified safe background color for this text, + // There is no OS-specified safe background color for this text, // but it is used regularly within Windows and the Gnome DE on Dialog and // Window colors. eColorID__moz_nativehyperlinktext, @@ -393,13 +393,13 @@ public: * is shown. */ eIntID_PhysicalHomeButton, - + /* * Controls whether overlay scrollbars display when the user moves * the mouse in a scrollable frame. */ eIntID_ScrollbarDisplayOnMouseMove, - + /* * Overlay scrollbar animation constants. */ @@ -430,6 +430,7 @@ public: eOperatingSystemVersion_WindowsVista, eOperatingSystemVersion_Windows7, eOperatingSystemVersion_Windows8, + eOperatingSystemVersion_Windows10, eOperatingSystemVersion_Unknown }; @@ -444,7 +445,7 @@ public: enum { // single arrow at each end eScrollArrowStyle_Single = - eScrollArrow_StartBackward | eScrollArrow_EndForward, + eScrollArrow_StartBackward | eScrollArrow_EndForward, // both arrows at bottom/right, none at top/left eScrollArrowStyle_BothAtBottom = eScrollArrow_EndBackward | eScrollArrow_EndForward, diff --git a/widget/windows/nsLookAndFeel.cpp b/widget/windows/nsLookAndFeel.cpp index 7058ef31f03f..e4177d57bfd5 100644 --- a/widget/windows/nsLookAndFeel.cpp +++ b/widget/windows/nsLookAndFeel.cpp @@ -28,7 +28,9 @@ nsLookAndFeel::GetOperatingSystemVersion() return version; } - if (IsWin8OrLater()) { + if (IsWin10OrLater()) { + version = eOperatingSystemVersion_Windows10; + } else if (IsWin8OrLater()) { version = eOperatingSystemVersion_Windows8; } else if (IsWin7OrLater()) { version = eOperatingSystemVersion_Windows7; @@ -59,7 +61,7 @@ static nsresult GetColorFromTheme(nsUXThemeClass cls, static int32_t GetSystemParam(long flag, int32_t def) { - DWORD value; + DWORD value; return ::SystemParametersInfo(flag, 0, &value, 0) ? value : def; } @@ -354,7 +356,7 @@ nsLookAndFeel::GetIntImpl(IntID aID, int32_t &aResult) aResult = ::GetSystemMetrics(SM_CYDRAG) - 1; break; case eIntID_UseAccessibilityTheme: - // High contrast is a misnomer under Win32 -- any theme can be used with it, + // High contrast is a misnomer under Win32 -- any theme can be used with it, // e.g. normal contrast with large fonts, low contrast, etc. // The high contrast flag really means -- use this theme and don't override it. aResult = nsUXThemeData::IsHighContrastOn();