diff --git a/layout/style/nsMediaFeatures.cpp b/layout/style/nsMediaFeatures.cpp index 8691993dbc39..8b7729d08f6d 100644 --- a/layout/style/nsMediaFeatures.cpp +++ b/layout/style/nsMediaFeatures.cpp @@ -426,11 +426,6 @@ void nsMediaFeatures::InitSystemMetrics() { (nsStaticAtom*)nsGkAtoms::_moz_windows_classic); } - rv = LookAndFeel::GetInt(LookAndFeel::IntID::TouchEnabled, &metricResult); - if (NS_SUCCEEDED(rv) && metricResult) { - sSystemMetrics->AppendElement((nsStaticAtom*)nsGkAtoms::_moz_touch_enabled); - } - rv = LookAndFeel::GetInt(LookAndFeel::IntID::SwipeAnimationEnabled, &metricResult); if (NS_SUCCEEDED(rv) && metricResult) { diff --git a/layout/style/test/chrome/bug418986-2.js b/layout/style/test/chrome/bug418986-2.js index c1fd80e9e49c..9d5d1a2ceb4e 100644 --- a/layout/style/test/chrome/bug418986-2.js +++ b/layout/style/test/chrome/bug418986-2.js @@ -74,10 +74,6 @@ var suppressed_toggles = [ ]; var toggles_enabled_in_content = []; -if (SpecialPowers.getBoolPref("layout.css.moz-touch-enabled.enabled")) { - suppressed_toggles.push("-moz-touch-enabled"); - toggles_enabled_in_content.push("-moz-touch-enabled"); -} // Possible values for '-moz-os-version' var windows_versions = ["windows-win7", "windows-win8", "windows-win10"]; diff --git a/layout/style/test/chrome/test_chrome_only_media_queries.html b/layout/style/test/chrome/test_chrome_only_media_queries.html index 347c918fec92..566ac84e4db7 100644 --- a/layout/style/test/chrome/test_chrome_only_media_queries.html +++ b/layout/style/test/chrome/test_chrome_only_media_queries.html @@ -62,10 +62,6 @@ const TOGGLES = [ "-moz-swipe-animation-enabled", ]; -if (SpecialPowers.getBoolPref("layout.css.moz-touch-enabled.enabled")) { - TOGGLES.push("-moz-touch-enabled"); -} - for (let i = 0; i < TOGGLES.length; ++i) { testToggle(TOGGLES[i]) } diff --git a/layout/style/test/test_media_queries.html b/layout/style/test/test_media_queries.html index 027a2154fef1..f34974885243 100644 --- a/layout/style/test/test_media_queries.html +++ b/layout/style/test/test_media_queries.html @@ -768,7 +768,6 @@ function run() { 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"); - expression_should_not_be_parseable("-moz-touch-enabled: -1"); expression_should_not_be_parseable("-moz-swipe-animation-enabled: -1"); expression_should_not_be_parseable("-moz-gtk-csd-available: -1"); expression_should_not_be_parseable("-moz-gtk-csd-hide-titlebar-by-default: -1"); @@ -791,7 +790,6 @@ function run() { 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"); - expression_should_not_be_parseable("-moz-touch-enabled: true"); expression_should_not_be_parseable("-moz-swipe-animation-enabled: true"); expression_should_not_be_parseable("-moz-gtk-csd-available: true"); expression_should_not_be_parseable("-moz-gtk-csd-hide-titlebar-by-default: true"); @@ -807,15 +805,6 @@ function run() { expression_should_not_be_parseable("-moz-os-version: windows-win10"); expression_should_not_be_parseable("-moz-os-version: "); - { - let should_be_parseable_if_enabled = SpecialPowers.getBoolPref('layout.css.moz-touch-enabled.enabled') - ? expression_should_be_parseable - : expression_should_not_be_parseable; - should_be_parseable_if_enabled("-moz-touch-enabled"); - should_be_parseable_if_enabled("-moz-touch-enabled: 0"); - should_be_parseable_if_enabled("-moz-touch-enabled: 1"); - } - { let should_be_parseable_if_enabled = SpecialPowers.getBoolPref('layout.css.prefers-contrast.enabled') ? expression_should_be_parseable diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml index 0d4f3e38c59d..c393bfc8ac48 100644 --- a/modules/libpref/init/StaticPrefList.yaml +++ b/modules/libpref/init/StaticPrefList.yaml @@ -6043,13 +6043,6 @@ mirror: always rust: true -# Expose the media query -moz-touch-enabled to web content. -- name: layout.css.moz-touch-enabled.enabled - type: RelaxedAtomicBool - value: false - mirror: always - rust: true - # Pref to control whether the ::marker property restrictions defined in [1] # apply. # diff --git a/servo/components/style/gecko/media_features.rs b/servo/components/style/gecko/media_features.rs index c96996a18ea7..4fea1030dbc2 100644 --- a/servo/components/style/gecko/media_features.rs +++ b/servo/components/style/gecko/media_features.rs @@ -559,19 +559,6 @@ fn eval_system_metric( query_value.map_or(supports_metric, |v| v == supports_metric) } -fn eval_moz_touch_enabled( - device: &Device, - query_value: Option, - _: Option, -) -> bool { - eval_system_metric( - device, - query_value, - atom!("-moz-touch-enabled"), - /* accessible_from_content = */ true, - ) -} - fn eval_moz_os_version( device: &Device, query_value: Option, @@ -613,7 +600,7 @@ macro_rules! system_metric_feature { /// to support new types in these entries and (2) ensuring that either /// nsPresContext::MediaFeatureValuesChanged is called when the value that /// would be returned by the evaluator function could change. -pub static MEDIA_FEATURES: [MediaFeatureDescription; 56] = [ +pub static MEDIA_FEATURES: [MediaFeatureDescription; 55] = [ feature!( atom!("width"), AllowsRanges::Yes, @@ -840,13 +827,4 @@ pub static MEDIA_FEATURES: [MediaFeatureDescription; 56] = [ system_metric_feature!(atom!("-moz-gtk-csd-close-button")), system_metric_feature!(atom!("-moz-gtk-csd-reversed-placement")), system_metric_feature!(atom!("-moz-system-dark-theme")), - // This is the only system-metric media feature that's accessible to - // content as of today. - // FIXME(emilio): Restrict (or remove?) when bug 1035774 lands. - feature!( - atom!("-moz-touch-enabled"), - AllowsRanges::No, - Evaluator::BoolInteger(eval_moz_touch_enabled), - ParsingRequirements::empty(), - ), ]; diff --git a/servo/components/style/media_queries/media_feature_expression.rs b/servo/components/style/media_queries/media_feature_expression.rs index f4eb40d1afa0..08b13136ef9e 100644 --- a/servo/components/style/media_queries/media_feature_expression.rs +++ b/servo/components/style/media_queries/media_feature_expression.rs @@ -221,9 +221,6 @@ fn consume_operation_or_colon(input: &mut Parser) -> Result, () fn disabled_by_pref(feature: &Atom, context: &ParserContext) -> bool { #[cfg(feature = "gecko")] { - if *feature == atom!("-moz-touch-enabled") { - return !static_prefs::pref!("layout.css.moz-touch-enabled.enabled"); - } if *feature == atom!("forced-colors") { return !static_prefs::pref!("layout.css.forced-colors.enabled"); } diff --git a/xpcom/ds/StaticAtoms.py b/xpcom/ds/StaticAtoms.py index 681bf07416a0..3c154badb366 100644 --- a/xpcom/ds/StaticAtoms.py +++ b/xpcom/ds/StaticAtoms.py @@ -2242,7 +2242,6 @@ STATIC_ATOMS = [ Atom("_moz_windows_classic", "-moz-windows-classic"), Atom("_moz_windows_glass", "-moz-windows-glass"), Atom("_moz_os_version", "-moz-os-version"), - Atom("_moz_touch_enabled", "-moz-touch-enabled"), Atom("_moz_menubar_drag", "-moz-menubar-drag"), Atom("_moz_device_pixel_ratio", "-moz-device-pixel-ratio"), Atom("_moz_device_orientation", "-moz-device-orientation"),