mirror of
https://github.com/servo/servo.git
synced 2025-06-25 09:34:32 +01:00
style: Make anonymous scrollbar caching work on mac by default, and unify scrollbars.css across platforms
We make it work on macOS by setting pointer-events: none + opacity: 0 rather than visibility: hidden, and tweaking the caching setup to be Android-like. Now that the scrollbars sheet is the same across platforms, move it to where the rest of the UA sheets are. This way we guarantee that the RDM vs. Android difference is less (just the ifdef at the top of the sheet). Depends on D128084 Differential Revision: https://phabricator.services.mozilla.com/D128085
This commit is contained in:
parent
750c9ee814
commit
8c6af822b0
1 changed files with 16 additions and 1 deletions
|
@ -607,6 +607,16 @@ fn eval_moz_windows_non_native_menus(
|
||||||
query_value.map_or(use_non_native_menus, |v| v == use_non_native_menus)
|
query_value.map_or(use_non_native_menus, |v| v == use_non_native_menus)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn eval_moz_overlay_scrollbars(
|
||||||
|
device: &Device,
|
||||||
|
query_value: Option<bool>,
|
||||||
|
_: Option<RangeOrOperator>,
|
||||||
|
) -> bool {
|
||||||
|
let use_overlay =
|
||||||
|
unsafe { bindings::Gecko_MediaFeatures_UseOverlayScrollbars(device.document()) };
|
||||||
|
query_value.map_or(use_overlay, |v| v == use_overlay)
|
||||||
|
}
|
||||||
|
|
||||||
fn get_lnf_int(int_id: i32) -> i32 {
|
fn get_lnf_int(int_id: i32) -> i32 {
|
||||||
unsafe { bindings::Gecko_GetLookAndFeelInt(int_id) }
|
unsafe { bindings::Gecko_GetLookAndFeelInt(int_id) }
|
||||||
}
|
}
|
||||||
|
@ -902,13 +912,18 @@ pub static MEDIA_FEATURES: [MediaFeatureDescription; 61] = [
|
||||||
Evaluator::BoolInteger(eval_moz_windows_non_native_menus),
|
Evaluator::BoolInteger(eval_moz_windows_non_native_menus),
|
||||||
ParsingRequirements::CHROME_AND_UA_ONLY,
|
ParsingRequirements::CHROME_AND_UA_ONLY,
|
||||||
),
|
),
|
||||||
|
feature!(
|
||||||
|
atom!("-moz-overlay-scrollbars"),
|
||||||
|
AllowsRanges::No,
|
||||||
|
Evaluator::BoolInteger(eval_moz_overlay_scrollbars),
|
||||||
|
ParsingRequirements::CHROME_AND_UA_ONLY,
|
||||||
|
),
|
||||||
|
|
||||||
lnf_int_feature!(atom!("-moz-scrollbar-start-backward"), ScrollArrowStyle, get_scrollbar_start_backward),
|
lnf_int_feature!(atom!("-moz-scrollbar-start-backward"), ScrollArrowStyle, get_scrollbar_start_backward),
|
||||||
lnf_int_feature!(atom!("-moz-scrollbar-start-forward"), ScrollArrowStyle, get_scrollbar_start_forward),
|
lnf_int_feature!(atom!("-moz-scrollbar-start-forward"), ScrollArrowStyle, get_scrollbar_start_forward),
|
||||||
lnf_int_feature!(atom!("-moz-scrollbar-end-backward"), ScrollArrowStyle, get_scrollbar_end_backward),
|
lnf_int_feature!(atom!("-moz-scrollbar-end-backward"), ScrollArrowStyle, get_scrollbar_end_backward),
|
||||||
lnf_int_feature!(atom!("-moz-scrollbar-end-forward"), ScrollArrowStyle, get_scrollbar_end_forward),
|
lnf_int_feature!(atom!("-moz-scrollbar-end-forward"), ScrollArrowStyle, get_scrollbar_end_forward),
|
||||||
lnf_int_feature!(atom!("-moz-scrollbar-thumb-proportional"), ScrollSliderStyle),
|
lnf_int_feature!(atom!("-moz-scrollbar-thumb-proportional"), ScrollSliderStyle),
|
||||||
lnf_int_feature!(atom!("-moz-overlay-scrollbars"), UseOverlayScrollbars),
|
|
||||||
lnf_int_feature!(atom!("-moz-menubar-drag"), MenuBarDrag),
|
lnf_int_feature!(atom!("-moz-menubar-drag"), MenuBarDrag),
|
||||||
lnf_int_feature!(atom!("-moz-windows-default-theme"), WindowsDefaultTheme),
|
lnf_int_feature!(atom!("-moz-windows-default-theme"), WindowsDefaultTheme),
|
||||||
lnf_int_feature!(atom!("-moz-mac-graphite-theme"), MacGraphiteTheme),
|
lnf_int_feature!(atom!("-moz-mac-graphite-theme"), MacGraphiteTheme),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue