mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +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 element_state::ElementState;
|
||||
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::selector_parser::{SelectorImpl, NonTSPseudoClass, PseudoElement};
|
||||
use gecko::snapshot_helpers;
|
||||
|
@ -476,25 +476,22 @@ impl FontMetricsProvider for GeckoFontMetricsProvider {
|
|||
sizes.size_for_generic(font_family)
|
||||
}
|
||||
|
||||
fn query(&self, _font: &Font, _font_size: Au, _wm: WritingMode,
|
||||
_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 {
|
||||
// Gecko_GetFontMetrics(&*device.pres_context,
|
||||
// wm.is_vertical() && !wm.is_sideways(),
|
||||
// font.gecko(),
|
||||
// font_size.0,
|
||||
// // we don't use the user font set in a media query
|
||||
// !in_media_query)
|
||||
// };
|
||||
// let metrics = FontMetrics {
|
||||
// x_height: Au(gecko_metrics.mXSize),
|
||||
// zero_advance_measure: Au(gecko_metrics.mChSize),
|
||||
// };
|
||||
// FontMetricsQueryResult::Available(metrics)
|
||||
FontMetricsQueryResult::NotAvailable
|
||||
fn query(&self, font: &Font, font_size: Au, wm: WritingMode,
|
||||
in_media_query: bool, device: &Device) -> FontMetricsQueryResult {
|
||||
use gecko_bindings::bindings::Gecko_GetFontMetrics;
|
||||
let gecko_metrics = unsafe {
|
||||
Gecko_GetFontMetrics(&*device.pres_context,
|
||||
wm.is_vertical() && !wm.is_sideways(),
|
||||
font.gecko(),
|
||||
font_size.0,
|
||||
// we don't use the user font set in a media query
|
||||
!in_media_query)
|
||||
};
|
||||
let metrics = FontMetrics {
|
||||
x_height: Au(gecko_metrics.mXSize),
|
||||
zero_advance_measure: Au(gecko_metrics.mChSize),
|
||||
};
|
||||
FontMetricsQueryResult::Available(metrics)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue