File tree 7 files changed +50
-5
lines changed
browser/base/content/test
servo/components/style/gecko
7 files changed +50
-5
lines changed Original file line number Diff line number Diff line change @@ -249,7 +249,12 @@ async function performLargePopupTests(win) {
249
249
// might return floating point values. We don't care about sub-pixel
250
250
// accuracy, and only care about the final pixel value, so we add a
251
251
// fuzz-factor of 1.
252
- const fuzzFactor = 1 ;
252
+ //
253
+ // FIXME(emilio): In win7 scroll position is off by 20px more, but that's
254
+ // not reproducible in win10 even with the win7 "native" menus enabled.
255
+ const fuzzFactor = matchMedia ( "(-moz-platform: windows-win7)" ) . matches
256
+ ? 21
257
+ : 1 ;
253
258
SimpleTest . isfuzzy (
254
259
selectPopup . children [ selectedOption ] . getBoundingClientRect ( ) . bottom ,
255
260
selectPopup . getBoundingClientRect ( ) . bottom - bpBottom + marginBottom ,
Original file line number Diff line number Diff line change @@ -309,7 +309,12 @@ let customPropsDefinitionFileMap = new Map();
309
309
function neverMatches ( mediaList ) {
310
310
const perPlatformMediaQueryMap = {
311
311
macosx : [ "(-moz-platform: macos)" ] ,
312
- win : [ "(-moz-platform: windows)" ] ,
312
+ win : [
313
+ "(-moz-platform: windows)" ,
314
+ "(-moz-platform: windows-win7)" ,
315
+ "(-moz-platform: windows-win8)" ,
316
+ "(-moz-platform: windows-win10)" ,
317
+ ] ,
313
318
linux : [ "(-moz-platform: linux)" ] ,
314
319
android : [ "(-moz-platform: android)" ] ,
315
320
} ;
Original file line number Diff line number Diff line change 33
33
# include " mozilla/WindowsVersion.h"
34
34
#endif
35
35
36
+ // -- native controls patch includes --
37
+ #include " mozilla/StaticPrefs_widget.h"
38
+ // -- end native controls patch includes --
39
+
36
40
using namespace mozilla ;
37
41
using mozilla::dom::DisplayMode;
38
42
using mozilla::dom::Document;
@@ -252,10 +256,24 @@ bool Gecko_MediaFeatures_MatchesPlatform(StylePlatform aPlatform) {
252
256
#if defined(XP_WIN)
253
257
case StylePlatform::Windows:
254
258
return true ;
255
- case StylePlatform::WindowsWinXP: {
256
- if (!IsVistaOrLater ()) {
259
+ case StylePlatform::WindowsWin10:
260
+ case StylePlatform::WindowsWinXP:
261
+ case StylePlatform::WindowsWin7:
262
+ case StylePlatform::WindowsWin8: {
263
+ int overridePref =
264
+ StaticPrefs::widget_ev_native_controls_patch_override_win_version ();
265
+ bool doesOverride = overridePref > 0 ;
266
+
267
+ if ((!doesOverride && IsWin10OrLater ()) || overridePref == 10 ) {
268
+ return aPlatform == StylePlatform::WindowsWin10;
269
+ }
270
+ if ((!doesOverride && IsWin8OrLater ()) || overridePref == 8 ) {
271
+ return aPlatform == StylePlatform::WindowsWin8;
272
+ }
273
+ if ((!doesOverride && !IsVistaOrLater ()) || overridePref == 5 ) {
257
274
return aPlatform == StylePlatform::WindowsWinXP;
258
275
}
276
+ return aPlatform == StylePlatform::WindowsWin7;
259
277
}
260
278
#elif defined(ANDROID)
261
279
case StylePlatform::Android:
Original file line number Diff line number Diff line change @@ -34,6 +34,9 @@ const CHROME_ONLY_QUERIES = [
34
34
"(-moz-platform: windows)" ,
35
35
"(-moz-platform: macos)" ,
36
36
"(-moz-platform: android)" ,
37
+ "(-moz-platform: windows-win7)" ,
38
+ "(-moz-platform: windows-win8)" ,
39
+ "(-moz-platform: windows-win10)" ,
37
40
"(-moz-content-prefers-color-scheme: dark)" ,
38
41
"(-moz-content-prefers-color-scheme: light)" ,
39
42
"(-moz-gtk-theme-family: unknown)" ,
Original file line number Diff line number Diff line change 17510
17510
value: false
17511
17511
mirror: always
17512
17512
17513
+ - name: widget.ev-native-controls-patch.override-win-version
17514
+ type: int32_t
17515
+ value: 0
17516
+ mirror: always
17517
+
17513
17518
- name: widget.native-controls.force-dwm-report-off
17514
17519
type: bool
17515
17520
value: false
Original file line number Diff line number Diff line change @@ -561,6 +561,12 @@ pub enum Platform {
561
561
Windows ,
562
562
/// Matches only Windows XP.
563
563
WindowsWinXP ,
564
+ /// Matches only Windows 7.
565
+ WindowsWin7 ,
566
+ /// Matches only Windows 8.
567
+ WindowsWin8 ,
568
+ /// Matches windows 10 and actually matches windows 11 too, as of right now.
569
+ WindowsWin10 ,
564
570
}
565
571
566
572
fn eval_moz_platform ( _: & Context , query_value : Option < Platform > ) -> bool {
Original file line number Diff line number Diff line change 2262
2262
Atom ("forcemessagemanager" , "forcemessagemanager" ),
2263
2263
Atom ("initialBrowsingContextGroupId" , "initialBrowsingContextGroupId" ),
2264
2264
Atom ("manualactiveness" , "manualactiveness" ),
2265
- # Windows XP media query name because I'm too r3tard to do it properly
2265
+ # windows media query names
2266
2266
Atom ("windows_winxp" , "windows-winxp" ),
2267
+ Atom ("windows_win7" , "windows-win7" ),
2268
+ Atom ("windows_win8" , "windows-win8" ),
2269
+ Atom ("windows_win10" , "windows-win10" ),
2267
2270
# Names for system metrics.
2268
2271
Atom ("_moz_bool_pref" , "-moz-bool-pref" ),
2269
2272
Atom ("_moz_scrollbar_start_backward" , "-moz-scrollbar-start-backward" ),
You can’t perform that action at this time.
0 commit comments