mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
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:
parent
89e01f1df6
commit
1a3b32a248
2 changed files with 21 additions and 1 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue