mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
layout: Remove get_font_arc in favor of clone_font.
Since they do the same.
This commit is contained in:
parent
b49eb6f566
commit
fa26e87030
4 changed files with 5 additions and 10 deletions
|
@ -2005,7 +2005,7 @@ impl Fragment {
|
|||
}
|
||||
// See CSS 2.1 § 10.8.1.
|
||||
let font_metrics = text::font_metrics_for_style(&mut layout_context.font_context(),
|
||||
self.style.get_font_arc());
|
||||
self.style.clone_font());
|
||||
let line_height = text::line_height_from_style(&*self.style, &font_metrics);
|
||||
InlineMetrics::from_font_metrics(&info.run.font_metrics, line_height)
|
||||
}
|
||||
|
@ -2085,7 +2085,7 @@ impl Fragment {
|
|||
vertical_align::T::middle => {
|
||||
let font_metrics =
|
||||
text::font_metrics_for_style(&mut layout_context.font_context(),
|
||||
style.get_font_arc());
|
||||
style.clone_font());
|
||||
offset += (content_inline_metrics.ascent -
|
||||
content_inline_metrics.space_below_baseline -
|
||||
font_metrics.x_height).scale_by(0.5)
|
||||
|
|
|
@ -1089,7 +1089,7 @@ impl InlineFlow {
|
|||
return LineMetrics::new(Au(0), Au(0))
|
||||
}
|
||||
|
||||
let font_style = style.get_font_arc();
|
||||
let font_style = style.clone_font();
|
||||
let font_metrics = text::font_metrics_for_style(font_context, font_style);
|
||||
let line_height = text::line_height_from_style(style, &font_metrics);
|
||||
let inline_metrics = InlineMetrics::from_font_metrics(&font_metrics, line_height);
|
||||
|
@ -1112,7 +1112,7 @@ impl InlineFlow {
|
|||
for inline_context in fragments.iter()
|
||||
.filter_map(|fragment| fragment.inline_context.as_ref()) {
|
||||
for node in &inline_context.nodes {
|
||||
let font_style = node.style.get_font_arc();
|
||||
let font_style = node.style.clone_font();
|
||||
let font_metrics = text::font_metrics_for_style(font_context, font_style);
|
||||
let line_height = text::line_height_from_style(&*node.style, &font_metrics);
|
||||
let inline_metrics = InlineMetrics::from_font_metrics(&font_metrics, line_height);
|
||||
|
|
|
@ -154,7 +154,7 @@ impl TextRunScanner {
|
|||
let word_break;
|
||||
{
|
||||
let in_fragment = self.clump.front().unwrap();
|
||||
let font_style = in_fragment.style().get_font_arc();
|
||||
let font_style = in_fragment.style().clone_font();
|
||||
let inherited_text_style = in_fragment.style().get_inheritedtext();
|
||||
fontgroup = font_context.layout_font_group_for_style(font_style);
|
||||
compression = match in_fragment.white_space() {
|
||||
|
|
|
@ -1322,11 +1322,6 @@ impl ComputedValues {
|
|||
))
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get_font_arc(&self) -> Arc<style_structs::Font> {
|
||||
self.font.clone()
|
||||
}
|
||||
|
||||
// http://dev.w3.org/csswg/css-transforms/#grouping-property-values
|
||||
pub fn get_used_transform_style(&self) -> computed_values::transform_style::T {
|
||||
use computed_values::mix_blend_mode;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue