style: Expose scrollbar-inline-size as a chrome-only environment variable

After the previous patches this is rather straight-forward.

Reviewed in: https://phabricator.services.mozilla.com/D168148
This commit is contained in:
Emilio Cobos Álvarez 2023-02-17 21:15:06 +00:00 committed by Martin Robinson
parent 89e01f1df6
commit 1a3b32a248
2 changed files with 21 additions and 1 deletions

View file

@ -199,6 +199,18 @@ impl Device {
unsafe { bindings::Gecko_GetBaseSize(self.document(), language.as_ptr(), generic) }
}
/// Gets the size of the scrollbar in CSS pixels.
pub fn scrollbar_inline_size(&self) -> Length {
let pc = match self.pres_context() {
Some(pc) => pc,
// XXX: we could have a more reasonable default perhaps.
None => return Length::new(0.0),
};
Length::new(unsafe {
bindings::Gecko_GetScrollbarInlineSize(pc)
})
}
/// Queries font metrics
pub fn query_font_metrics(
&self,