mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
style: Use horizontal metrics for ch in vertical mixed/sideways writing modes and for ex always.
Differential Revision: https://phabricator.services.mozilla.com/D23426
This commit is contained in:
parent
d5f208e18c
commit
d4635f1d12
3 changed files with 42 additions and 8 deletions
|
@ -20,7 +20,7 @@ use crate::context::{PostAnimationTasks, QuirksMode, SharedStyleContext, UpdateA
|
|||
use crate::data::ElementData;
|
||||
use crate::dom::{LayoutIterator, NodeInfo, OpaqueNode, TDocument, TElement, TNode, TShadowRoot};
|
||||
use crate::element_state::{DocumentState, ElementState};
|
||||
use crate::font_metrics::{FontMetrics, FontMetricsProvider};
|
||||
use crate::font_metrics::{FontMetrics, FontMetricsOrientation, FontMetricsProvider};
|
||||
use crate::gecko::data::GeckoStyleSheet;
|
||||
use crate::gecko::selector_parser::{NonTSPseudoClass, PseudoElement, SelectorImpl};
|
||||
use crate::gecko::snapshot_helpers;
|
||||
|
@ -1035,6 +1035,7 @@ impl FontMetricsProvider for GeckoFontMetricsProvider {
|
|||
&self,
|
||||
context: &crate::values::computed::Context,
|
||||
base_size: FontBaseSize,
|
||||
orientation: FontMetricsOrientation,
|
||||
) -> FontMetrics {
|
||||
let pc = match context.device().pres_context() {
|
||||
Some(pc) => pc,
|
||||
|
@ -1056,10 +1057,14 @@ impl FontMetricsProvider for GeckoFontMetricsProvider {
|
|||
},
|
||||
};
|
||||
|
||||
let vertical_metrics = match orientation {
|
||||
FontMetricsOrientation::MatchContext => wm.is_vertical() && wm.is_upright(),
|
||||
FontMetricsOrientation::Horizontal => false,
|
||||
};
|
||||
let gecko_metrics = unsafe {
|
||||
bindings::Gecko_GetFontMetrics(
|
||||
pc,
|
||||
wm.is_vertical() && !wm.is_sideways(),
|
||||
vertical_metrics,
|
||||
font.gecko(),
|
||||
size.0,
|
||||
// we don't use the user font set in a media query
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue