From ac663083950b2e00573395d68348302df94e3ac1 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Wed, 19 Jul 2017 13:11:28 +0200 Subject: Add `@media(-moz-windows-accent-color-applies)` #31 point 3 --- layout/style/nsCSSRuleProcessor.cpp | 5 +++++ layout/style/nsMediaFeatures.cpp | 8 ++++++++ layout/style/test/test_media_queries.html | 5 +++++ 3 files changed, 18 insertions(+) (limited to 'layout/style') diff --git a/layout/style/nsCSSRuleProcessor.cpp b/layout/style/nsCSSRuleProcessor.cpp index 07a4ef57b..4dc7ea1c8 100644 --- a/layout/style/nsCSSRuleProcessor.cpp +++ b/layout/style/nsCSSRuleProcessor.cpp @@ -1127,6 +1127,11 @@ InitSystemMetrics() sSystemMetrics->AppendElement(nsGkAtoms::mac_yosemite_theme); } + rv = LookAndFeel::GetInt(LookAndFeel::eIntID_WindowsAccentColorApplies, &metricResult); + if (NS_SUCCEEDED(rv) && metricResult) { + sSystemMetrics->AppendElement(nsGkAtoms::windows_accent_color_applies); + } + rv = LookAndFeel::GetInt(LookAndFeel::eIntID_DWMCompositor, &metricResult); if (NS_SUCCEEDED(rv) && metricResult) { sSystemMetrics->AppendElement(nsGkAtoms::windows_compositor); diff --git a/layout/style/nsMediaFeatures.cpp b/layout/style/nsMediaFeatures.cpp index c07a4123e..f314835a4 100644 --- a/layout/style/nsMediaFeatures.cpp +++ b/layout/style/nsMediaFeatures.cpp @@ -715,6 +715,14 @@ nsMediaFeatures::features[] = { { &nsGkAtoms::mac_yosemite_theme }, GetSystemMetric }, + { + &nsGkAtoms::_moz_windows_accent_color_applies, + nsMediaFeature::eMinMaxNotAllowed, + nsMediaFeature::eBoolInteger, + nsMediaFeature::eNoRequirements, + { &nsGkAtoms::windows_accent_color_applies }, + GetSystemMetric + }, { &nsGkAtoms::_moz_windows_compositor, nsMediaFeature::eMinMaxNotAllowed, diff --git a/layout/style/test/test_media_queries.html b/layout/style/test/test_media_queries.html index 1edac15ae..479306a55 100644 --- a/layout/style/test/test_media_queries.html +++ b/layout/style/test/test_media_queries.html @@ -628,6 +628,7 @@ function run() { expression_should_be_parseable("-moz-windows-default-theme"); expression_should_be_parseable("-moz-mac-graphite-theme"); expression_should_be_parseable("-moz-mac-yosemite-theme"); + expression_should_be_parseable("-moz-windows-accent-color-applies"); expression_should_be_parseable("-moz-windows-compositor"); expression_should_be_parseable("-moz-windows-classic"); expression_should_be_parseable("-moz-windows-glass"); @@ -643,6 +644,7 @@ function run() { expression_should_be_parseable("-moz-windows-default-theme: 0"); expression_should_be_parseable("-moz-mac-graphite-theme: 0"); expression_should_be_parseable("-moz-mac-yosemite-theme: 0"); + expression_should_be_parseable("-moz-windows-accent-color-applies: 0"); expression_should_be_parseable("-moz-windows-compositor: 0"); expression_should_be_parseable("-moz-windows-classic: 0"); expression_should_be_parseable("-moz-windows-glass: 0"); @@ -658,6 +660,7 @@ function run() { expression_should_be_parseable("-moz-windows-default-theme: 1"); expression_should_be_parseable("-moz-mac-graphite-theme: 1"); expression_should_be_parseable("-moz-mac-yosemite-theme: 1"); + expression_should_be_parseable("-moz-windows-accent-color-applies: 1"); expression_should_be_parseable("-moz-windows-compositor: 1"); expression_should_be_parseable("-moz-windows-classic: 1"); expression_should_be_parseable("-moz-windows-glass: 1"); @@ -673,6 +676,7 @@ function run() { expression_should_not_be_parseable("-moz-windows-default-theme: -1"); expression_should_not_be_parseable("-moz-mac-graphite-theme: -1"); expression_should_not_be_parseable("-moz-mac-yosemite-theme: -1"); + expression_should_not_be_parseable("-moz-windows-accent-color-applies: -1"); expression_should_not_be_parseable("-moz-windows-compositor: -1"); expression_should_not_be_parseable("-moz-windows-classic: -1"); expression_should_not_be_parseable("-moz-windows-glass: -1"); @@ -688,6 +692,7 @@ function run() { expression_should_not_be_parseable("-moz-windows-default-theme: true"); expression_should_not_be_parseable("-moz-mac-graphite-theme: true"); expression_should_not_be_parseable("-moz-mac-yosemite-theme: true"); + expression_should_not_be_parseable("-moz-windows-accent-color-applies: true"); expression_should_not_be_parseable("-moz-windows-compositor: true"); expression_should_not_be_parseable("-moz-windows-classic: true"); expression_should_not_be_parseable("-moz-windows-glass: true"); -- cgit v1.2.3 From f843f02860d8acd709fe89bfa891892d907de81a Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Wed, 19 Jul 2017 13:24:55 +0200 Subject: Add -moz-win-accentcolor(text) #31 points 1 and 2 --- layout/style/nsCSSKeywordList.h | 2 ++ layout/style/nsCSSProps.cpp | 2 ++ 2 files changed, 4 insertions(+) (limited to 'layout/style') diff --git a/layout/style/nsCSSKeywordList.h b/layout/style/nsCSSKeywordList.h index febdd32c6..933ff6e7b 100644 --- a/layout/style/nsCSSKeywordList.h +++ b/layout/style/nsCSSKeywordList.h @@ -742,6 +742,8 @@ CSS_KEY(button-focus, button_focus) CSS_KEY(-moz-win-media-toolbox, _moz_win_media_toolbox) CSS_KEY(-moz-win-communications-toolbox, _moz_win_communications_toolbox) CSS_KEY(-moz-win-browsertabbar-toolbox, _moz_win_browsertabbar_toolbox) +CSS_KEY(-moz-win-accentcolor, _moz_win_accentcolor) +CSS_KEY(-moz-win-accentcolortext, _moz_win_accentcolortext) CSS_KEY(-moz-win-mediatext, _moz_win_mediatext) CSS_KEY(-moz-win-communicationstext, _moz_win_communicationstext) CSS_KEY(-moz-win-glass, _moz_win_glass) diff --git a/layout/style/nsCSSProps.cpp b/layout/style/nsCSSProps.cpp index ec28d06f8..f3a7f898d 100644 --- a/layout/style/nsCSSProps.cpp +++ b/layout/style/nsCSSProps.cpp @@ -1174,6 +1174,8 @@ const KTableEntry nsCSSProps::kColorKTable[] = { { eCSSKeyword__moz_oddtreerow, LookAndFeel::eColorID__moz_oddtreerow }, { eCSSKeyword__moz_visitedhyperlinktext, NS_COLOR_MOZ_VISITEDHYPERLINKTEXT }, { eCSSKeyword_currentcolor, NS_COLOR_CURRENTCOLOR }, + { eCSSKeyword__moz_win_accentcolor, LookAndFeel::eColorID__moz_win_accentcolor }, + { eCSSKeyword__moz_win_accentcolortext, LookAndFeel::eColorID__moz_win_accentcolortext }, { eCSSKeyword__moz_win_mediatext, LookAndFeel::eColorID__moz_win_mediatext }, { eCSSKeyword__moz_win_communicationstext, LookAndFeel::eColorID__moz_win_communicationstext }, { eCSSKeyword__moz_nativehyperlinktext, LookAndFeel::eColorID__moz_nativehyperlinktext }, -- cgit v1.2.3 From 0f285318cdf3336aabda0cfa6bc306b2274f14e8 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Wed, 19 Jul 2017 16:34:50 +0200 Subject: Add -moz-windows-accent-color-is-dark #31 point 4 --- layout/style/nsCSSRuleProcessor.cpp | 5 +++++ layout/style/nsMediaFeatures.cpp | 8 ++++++++ 2 files changed, 13 insertions(+) (limited to 'layout/style') diff --git a/layout/style/nsCSSRuleProcessor.cpp b/layout/style/nsCSSRuleProcessor.cpp index 4dc7ea1c8..8760a330e 100644 --- a/layout/style/nsCSSRuleProcessor.cpp +++ b/layout/style/nsCSSRuleProcessor.cpp @@ -1132,6 +1132,11 @@ InitSystemMetrics() sSystemMetrics->AppendElement(nsGkAtoms::windows_accent_color_applies); } + rv = LookAndFeel::GetInt(LookAndFeel::eIntID_WindowsAccentColorIsDark, &metricResult); + if (NS_SUCCEEDED(rv) && metricResult) { + sSystemMetrics->AppendElement(nsGkAtoms::windows_accent_color_is_dark); + } + rv = LookAndFeel::GetInt(LookAndFeel::eIntID_DWMCompositor, &metricResult); if (NS_SUCCEEDED(rv) && metricResult) { sSystemMetrics->AppendElement(nsGkAtoms::windows_compositor); diff --git a/layout/style/nsMediaFeatures.cpp b/layout/style/nsMediaFeatures.cpp index f314835a4..052ce58e8 100644 --- a/layout/style/nsMediaFeatures.cpp +++ b/layout/style/nsMediaFeatures.cpp @@ -723,6 +723,14 @@ nsMediaFeatures::features[] = { { &nsGkAtoms::windows_accent_color_applies }, GetSystemMetric }, + { + &nsGkAtoms::_moz_windows_accent_color_is_dark, + nsMediaFeature::eMinMaxNotAllowed, + nsMediaFeature::eBoolInteger, + nsMediaFeature::eNoRequirements, + { &nsGkAtoms::windows_accent_color_is_dark }, + GetSystemMetric + }, { &nsGkAtoms::_moz_windows_compositor, nsMediaFeature::eMinMaxNotAllowed, -- cgit v1.2.3