servo: Merge #17817 - style: Move a conditional import to where it's used (from emilio:always-be-removing-the-ugly); r=stshine
authorEmilio Cobos Álvarez <emilio@crisal.io>
Fri, 21 Jul 2017 13:31:13 -0700
changeset 419013 a6b857d87680ed39db4a64a2309e864a93194b7f
parent 419012 394b3d22db1988839462c9832f4ef309aef556a1
child 419014 6f9ddd2f1395af7e3ea5f3d30f14aee4a575b951
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersstshine
bugs17817
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
servo: Merge #17817 - style: Move a conditional import to where it's used (from emilio:always-be-removing-the-ugly); r=stshine To avoid yet another cfg(). Source-Repo: https://github.com/servo/servo Source-Revision: d1c4d7a6af44de97f86205cb1a19408492f17833
servo/components/style/style_adjuster.rs
--- a/servo/components/style/style_adjuster.rs
+++ b/servo/components/style/style_adjuster.rs
@@ -7,19 +7,16 @@
 
 use app_units::Au;
 use properties::{self, CascadeFlags, ComputedValues};
 use properties::{IS_ROOT_ELEMENT, SKIP_ROOT_AND_ITEM_BASED_DISPLAY_FIXUP, StyleBuilder};
 use properties::longhands::display::computed_value::T as display;
 use properties::longhands::float::computed_value::T as float;
 use properties::longhands::overflow_x::computed_value::T as overflow;
 use properties::longhands::position::computed_value::T as position;
-#[cfg(feature = "gecko")]
-use properties::longhands::unicode_bidi::computed_value::T as unicode_bidi;
-
 
 /// An unsized struct that implements all the adjustment methods.
 pub struct StyleAdjuster<'a, 'b: 'a> {
     style: &'a mut StyleBuilder<'b>,
 }
 
 impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> {
     /// Trivially constructs a new StyleAdjuster.
@@ -385,16 +382,18 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> {
     /// * suppress border and padding for ruby level containers,
     /// * correct unicode-bidi.
     #[cfg(feature = "gecko")]
     fn adjust_for_ruby(&mut self,
                        layout_parent_style: &ComputedValues,
                        flags: CascadeFlags) {
         use properties::SKIP_ROOT_AND_ITEM_BASED_DISPLAY_FIXUP;
         use properties::computed_value_flags::SHOULD_SUPPRESS_LINEBREAK;
+        use properties::longhands::unicode_bidi::computed_value::T as unicode_bidi;
+
         let self_display = self.style.get_box().clone_display();
         // Check whether line break should be suppressed for this element.
         if self.should_suppress_linebreak(layout_parent_style) {
             self.style.flags.insert(SHOULD_SUPPRESS_LINEBREAK);
             // Inlinify the display type if allowed.
             if !flags.contains(SKIP_ROOT_AND_ITEM_BASED_DISPLAY_FIXUP) {
                 let inline_display = self_display.inlinify();
                 if self_display != inline_display {