diff options
author | bors-servo <metajack+bors@gmail.com> | 2014-10-16 15:06:19 -0600 |
---|---|---|
committer | bors-servo <metajack+bors@gmail.com> | 2014-10-16 15:06:19 -0600 |
commit | 83196ddb26b5611bccfa2d709396daeff259bcd1 (patch) | |
tree | 73d0a42e4bd696456c72739d45666c1208bebf28 /components/layout/inline.rs | |
parent | 8d3b107568ab965b518b8003b702a5db993fa7d0 (diff) | |
parent | a6fcec468fd2334b2854cc3d53ceb7c299641971 (diff) | |
download | servo-83196ddb26b5611bccfa2d709396daeff259bcd1.tar.gz servo-83196ddb26b5611bccfa2d709396daeff259bcd1.zip |
auto merge of #3697 : pcwalton/servo/get-layout-font-group, r=glennw
Seems to be a 38% layout win on a site I tested with a lot of text.
Other browser engines typically do not duplicate the information in the font style struct. `FontStyle` actually predates @SimonSapin's CSS selector matching library. It's time to get rid of it!
r? @glennw
Diffstat (limited to 'components/layout/inline.rs')
-rw-r--r-- | components/layout/inline.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/components/layout/inline.rs b/components/layout/inline.rs index 70b7ffa7d3e..3fd918502ed 100644 --- a/components/layout/inline.rs +++ b/components/layout/inline.rs @@ -930,8 +930,8 @@ impl InlineFlow { return (Au(0), Au(0)) } - let font_style = text::computed_style_to_font_style(style); - let font_metrics = text::font_metrics_for_style(font_context, &font_style); + let font_style = style.get_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); @@ -944,8 +944,8 @@ impl InlineFlow { match frag.inline_context { Some(ref inline_context) => { for style in inline_context.styles.iter() { - let font_style = text::computed_style_to_font_style(&**style); - let font_metrics = text::font_metrics_for_style(font_context, &font_style); + let font_style = style.get_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); |