From 94ae3bbd0bd783b0f46f3801de21216ad7e7f38f Mon Sep 17 00:00:00 2001 From: Glenn Watson Date: Mon, 21 Jul 2014 14:59:07 +1000 Subject: [PATCH] Remove unused field before other upcoming changes. --- src/components/gfx/font.rs | 6 +++--- src/components/gfx/text/text_run.rs | 5 +---- src/components/layout/text.rs | 6 ++---- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/components/gfx/font.rs b/src/components/gfx/font.rs index a17bf199979..fbc86138f88 100644 --- a/src/components/gfx/font.rs +++ b/src/components/gfx/font.rs @@ -8,7 +8,7 @@ use std::str; use std::rc::Rc; use std::cell::RefCell; use servo_util::cache::{Cache, HashCache}; -use style::computed_values::{text_decoration, font_weight, font_style}; +use style::computed_values::{font_weight, font_style}; use sync::Arc; use servo_util::geometry::Au; @@ -170,11 +170,11 @@ impl FontGroup { } } - pub fn create_textrun(&self, text: String, decoration: text_decoration::T) -> TextRun { + pub fn create_textrun(&self, text: String) -> TextRun { assert!(self.fonts.len() > 0); // TODO(Issue #177): Actually fall back through the FontGroup when a font is unsuitable. - TextRun::new(&mut *self.fonts.get(0).borrow_mut(), text.clone(), decoration) + TextRun::new(&mut *self.fonts.get(0).borrow_mut(), text.clone()) } } diff --git a/src/components/gfx/text/text_run.rs b/src/components/gfx/text/text_run.rs index 719660c676d..70c10f1c64c 100644 --- a/src/components/gfx/text/text_run.rs +++ b/src/components/gfx/text/text_run.rs @@ -7,7 +7,6 @@ use servo_util::geometry::Au; use servo_util::range::Range; use servo_util::vec::{Comparator, FullBinarySearchMethods}; use std::slice::Items; -use style::computed_values::text_decoration; use sync::Arc; use text::glyph::{CharIndex, GlyphStore}; use font::FontHandleMethods; @@ -20,7 +19,6 @@ pub struct TextRun { pub font_template: Arc, pub pt_size: f64, pub font_metrics: FontMetrics, - pub decoration: text_decoration::T, /// The glyph runs that make up this text run. pub glyphs: Arc>, } @@ -119,14 +117,13 @@ impl<'a> Iterator> for LineIterator<'a> { } impl<'a> TextRun { - pub fn new(font: &mut Font, text: String, decoration: text_decoration::T) -> TextRun { + pub fn new(font: &mut Font, text: String) -> TextRun { let glyphs = TextRun::break_and_shape(font, text.as_slice()); let run = TextRun { text: Arc::new(text), font_metrics: font.metrics.clone(), font_template: font.handle.get_template(), pt_size: font.pt_size, - decoration: decoration, glyphs: Arc::new(glyphs), }; return run; diff --git a/src/components/layout/text.rs b/src/components/layout/text.rs index c6fa2bdf742..e283cf432d3 100644 --- a/src/components/layout/text.rs +++ b/src/components/layout/text.rs @@ -122,7 +122,6 @@ impl TextRunScanner { }; let font_style = old_fragment.font_style(); - let decoration = old_fragment.text_decoration(); // TODO(#115): Use the actual CSS `white-space` property of the relevant style. let compression = match old_fragment.white_space() { @@ -145,7 +144,7 @@ impl TextRunScanner { // and then letting `FontGroup` decide which `Font` to stick into the text run. let fontgroup = font_context.get_layout_font_group_for_style(&font_style); let run = box fontgroup.create_textrun( - transformed_text.clone(), decoration); + transformed_text.clone()); debug!("TextRunScanner: pushing single text fragment in range: {} ({})", self.clump, @@ -168,7 +167,6 @@ impl TextRunScanner { let in_fragment = &in_fragments[self.clump.begin().to_uint()]; let font_style = in_fragment.font_style(); let fontgroup = font_context.get_layout_font_group_for_style(&font_style); - let decoration = in_fragment.text_decoration(); // TODO(#115): Use the actual CSS `white-space` property of the relevant style. let compression = match in_fragment.white_space() { @@ -222,7 +220,7 @@ impl TextRunScanner { let run = if clump.length() != CharIndex(0) && run_str.len() > 0 { Some(Arc::new(box TextRun::new( &mut *fontgroup.fonts.get(0).borrow_mut(), - run_str.to_string(), decoration))) + run_str.to_string()))) } else { None };