mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
style: Add a non-native-theme media query.
Differential Revision: https://phabricator.services.mozilla.com/D102457
This commit is contained in:
parent
eec92977f7
commit
f4a8acc558
1 changed files with 17 additions and 1 deletions
|
@ -537,6 +537,16 @@ fn eval_moz_print_preview(
|
||||||
query_value.map_or(is_print_preview, |v| v == is_print_preview)
|
query_value.map_or(is_print_preview, |v| v == is_print_preview)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn eval_moz_non_native_content_theme(
|
||||||
|
device: &Device,
|
||||||
|
query_value: Option<bool>,
|
||||||
|
_: Option<RangeOrOperator>,
|
||||||
|
) -> bool {
|
||||||
|
let non_native_theme =
|
||||||
|
unsafe { bindings::Gecko_MediaFeatures_ShouldAvoidNativeTheme(device.document()) };
|
||||||
|
query_value.map_or(non_native_theme, |v| v == non_native_theme)
|
||||||
|
}
|
||||||
|
|
||||||
fn eval_moz_is_resource_document(
|
fn eval_moz_is_resource_document(
|
||||||
device: &Device,
|
device: &Device,
|
||||||
query_value: Option<bool>,
|
query_value: Option<bool>,
|
||||||
|
@ -604,7 +614,7 @@ macro_rules! system_metric_feature {
|
||||||
/// to support new types in these entries and (2) ensuring that either
|
/// to support new types in these entries and (2) ensuring that either
|
||||||
/// nsPresContext::MediaFeatureValuesChanged is called when the value that
|
/// nsPresContext::MediaFeatureValuesChanged is called when the value that
|
||||||
/// would be returned by the evaluator function could change.
|
/// would be returned by the evaluator function could change.
|
||||||
pub static MEDIA_FEATURES: [MediaFeatureDescription; 55] = [
|
pub static MEDIA_FEATURES: [MediaFeatureDescription; 56] = [
|
||||||
feature!(
|
feature!(
|
||||||
atom!("width"),
|
atom!("width"),
|
||||||
AllowsRanges::Yes,
|
AllowsRanges::Yes,
|
||||||
|
@ -808,6 +818,12 @@ pub static MEDIA_FEATURES: [MediaFeatureDescription; 55] = [
|
||||||
Evaluator::BoolInteger(eval_moz_print_preview),
|
Evaluator::BoolInteger(eval_moz_print_preview),
|
||||||
ParsingRequirements::CHROME_AND_UA_ONLY,
|
ParsingRequirements::CHROME_AND_UA_ONLY,
|
||||||
),
|
),
|
||||||
|
feature!(
|
||||||
|
atom!("-moz-non-native-content-theme"),
|
||||||
|
AllowsRanges::No,
|
||||||
|
Evaluator::BoolInteger(eval_moz_non_native_content_theme),
|
||||||
|
ParsingRequirements::CHROME_AND_UA_ONLY,
|
||||||
|
),
|
||||||
system_metric_feature!(atom!("-moz-scrollbar-start-backward")),
|
system_metric_feature!(atom!("-moz-scrollbar-start-backward")),
|
||||||
system_metric_feature!(atom!("-moz-scrollbar-start-forward")),
|
system_metric_feature!(atom!("-moz-scrollbar-start-forward")),
|
||||||
system_metric_feature!(atom!("-moz-scrollbar-end-backward")),
|
system_metric_feature!(atom!("-moz-scrollbar-end-backward")),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue