From 3e2d87d8db66b59897b168d56f8f0d1e84799c53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Tue, 15 Aug 2017 07:47:12 +0200 Subject: [PATCH] style: Simplify the ruby text adjustment. StyleBuilder keeps a reference to the parent style, so no need to get it as an argument. --- components/style/style_adjuster.rs | 8 ++++---- ports/geckolib/glue.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/components/style/style_adjuster.rs b/components/style/style_adjuster.rs index 06ff2df66d70..3b3513c45e05 100644 --- a/components/style/style_adjuster.rs +++ b/components/style/style_adjuster.rs @@ -108,9 +108,9 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> { /// /// Note that this, for Gecko, comes through Servo_ComputedValues_Inherit. #[cfg(feature = "gecko")] - pub fn adjust_for_text(&mut self, parent_style: &ComputedValues) { + pub fn adjust_for_text(&mut self) { self.adjust_for_text_combine_upright(); - self.adjust_for_text_in_ruby(parent_style); + self.adjust_for_text_in_ruby(); self.set_bits(); } @@ -144,9 +144,9 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> { /// set (e.g. ruby or ruby containers), thus we may not inherit the flag /// from them. #[cfg(feature = "gecko")] - fn adjust_for_text_in_ruby(&mut self, parent_style: &ComputedValues) { + fn adjust_for_text_in_ruby(&mut self) { use properties::computed_value_flags::SHOULD_SUPPRESS_LINEBREAK; - let parent_display = parent_style.get_box().clone_display(); + let parent_display = self.style.get_parent_box().clone_display(); if parent_display.is_ruby_type() { self.style.flags.insert(SHOULD_SUPPRESS_LINEBREAK); } diff --git a/ports/geckolib/glue.rs b/ports/geckolib/glue.rs index d7d59aa6f36e..4f58012b31df 100644 --- a/ports/geckolib/glue.rs +++ b/ports/geckolib/glue.rs @@ -1821,7 +1821,7 @@ pub extern "C" fn Servo_ComputedValues_Inherit( if for_text { StyleAdjuster::new(&mut style) - .adjust_for_text(reference); + .adjust_for_text(); } style.build()