mirror of
https://github.com/servo/servo.git
synced 2025-07-23 15:23:42 +01:00
style: Re-enable font metrics querying for ch and ex units in Stylo traversal.
This commit is contained in:
parent
d9ac109db6
commit
aa9bb07a93
1 changed files with 17 additions and 20 deletions
|
@ -22,7 +22,7 @@ use dom::{self, AnimationRules, DescendantsBit, LayoutIterator, NodeInfo, TEleme
|
||||||
use dom::{OpaqueNode, PresentationalHintsSynthetizer};
|
use dom::{OpaqueNode, PresentationalHintsSynthetizer};
|
||||||
use element_state::ElementState;
|
use element_state::ElementState;
|
||||||
use error_reporting::RustLogReporter;
|
use error_reporting::RustLogReporter;
|
||||||
use font_metrics::{FontMetricsProvider, FontMetricsQueryResult};
|
use font_metrics::{FontMetrics, FontMetricsProvider, FontMetricsQueryResult};
|
||||||
use gecko::global_style_data::GLOBAL_STYLE_DATA;
|
use gecko::global_style_data::GLOBAL_STYLE_DATA;
|
||||||
use gecko::selector_parser::{SelectorImpl, NonTSPseudoClass, PseudoElement};
|
use gecko::selector_parser::{SelectorImpl, NonTSPseudoClass, PseudoElement};
|
||||||
use gecko::snapshot_helpers;
|
use gecko::snapshot_helpers;
|
||||||
|
@ -476,25 +476,22 @@ impl FontMetricsProvider for GeckoFontMetricsProvider {
|
||||||
sizes.size_for_generic(font_family)
|
sizes.size_for_generic(font_family)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn query(&self, _font: &Font, _font_size: Au, _wm: WritingMode,
|
fn query(&self, font: &Font, font_size: Au, wm: WritingMode,
|
||||||
_in_media_query: bool, _device: &Device) -> FontMetricsQueryResult {
|
in_media_query: bool, device: &Device) -> FontMetricsQueryResult {
|
||||||
// Disabled until we can make font metrics thread safe (bug 1356105)
|
use gecko_bindings::bindings::Gecko_GetFontMetrics;
|
||||||
//
|
let gecko_metrics = unsafe {
|
||||||
// use gecko_bindings::bindings::Gecko_GetFontMetrics;
|
Gecko_GetFontMetrics(&*device.pres_context,
|
||||||
// let gecko_metrics = unsafe {
|
wm.is_vertical() && !wm.is_sideways(),
|
||||||
// Gecko_GetFontMetrics(&*device.pres_context,
|
font.gecko(),
|
||||||
// wm.is_vertical() && !wm.is_sideways(),
|
font_size.0,
|
||||||
// font.gecko(),
|
// we don't use the user font set in a media query
|
||||||
// font_size.0,
|
!in_media_query)
|
||||||
// // we don't use the user font set in a media query
|
};
|
||||||
// !in_media_query)
|
let metrics = FontMetrics {
|
||||||
// };
|
x_height: Au(gecko_metrics.mXSize),
|
||||||
// let metrics = FontMetrics {
|
zero_advance_measure: Au(gecko_metrics.mChSize),
|
||||||
// x_height: Au(gecko_metrics.mXSize),
|
};
|
||||||
// zero_advance_measure: Au(gecko_metrics.mChSize),
|
FontMetricsQueryResult::Available(metrics)
|
||||||
// };
|
|
||||||
// FontMetricsQueryResult::Available(metrics)
|
|
||||||
FontMetricsQueryResult::NotAvailable
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue