mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
style: Make the pres context optional in the style system.
Differential Revision: https://phabricator.services.mozilla.com/D21239
This commit is contained in:
parent
4e3e4c106a
commit
e723a5b7d6
4 changed files with 85 additions and 38 deletions
|
@ -1044,9 +1044,13 @@ impl FontMetricsProvider for GeckoFontMetricsProvider {
|
|||
device: &Device,
|
||||
) -> FontMetricsQueryResult {
|
||||
use crate::gecko_bindings::bindings::Gecko_GetFontMetrics;
|
||||
let pc = match device.pres_context() {
|
||||
Some(pc) => pc,
|
||||
None => return FontMetricsQueryResult::NotAvailable,
|
||||
};
|
||||
let gecko_metrics = unsafe {
|
||||
Gecko_GetFontMetrics(
|
||||
device.pres_context(),
|
||||
pc,
|
||||
wm.is_vertical() && !wm.is_sideways(),
|
||||
font.gecko(),
|
||||
font_size.0,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue