servo: Merge #14582 - fix feature check for Gecko-specific assertions (from heycam:cfg); r=emilio
authorCameron McCormack <cam@mcc.id.au>
Wed, 14 Dec 2016 05:13:17 -0800
changeset 478502 4f041c806f946dd5f869d3a05449b71bb6b89210
parent 478501 93b1445bc137f128bbf05a4c532ad5bd0e4d7169
child 478503 8fb10a3f223485259d33e80b82d279b5f2e49adf
push id44079
push userbmo:gps@mozilla.com
push dateSat, 04 Feb 2017 00:14:49 +0000
reviewersemilio
servo: Merge #14582 - fix feature check for Gecko-specific assertions (from heycam:cfg); r=emilio r? @emilio Source-Repo: https://github.com/servo/servo Source-Revision: 65b891c23fbb85c32ae07e2c5495b82b29b3331a
servo/components/style/dom.rs
servo/components/style/matching.rs
--- a/servo/components/style/dom.rs
+++ b/servo/components/style/dom.rs
@@ -245,17 +245,17 @@ pub trait TElement : PartialEq + Debug +
     fn did_process_child(&self) -> isize;
 
     /// Returns true if this element's style is display:none. Panics if
     /// the element has no style.
     fn is_display_none(&self) -> bool {
         let data = self.borrow_data().unwrap();
         // See the comment on `cascade_node` about getting the up-to-date parent
         // style for why we allow this on Gecko.
-        debug_assert!(cfg!(gecko) || data.has_current_styles());
+        debug_assert!(cfg!(feature = "gecko") || data.has_current_styles());
         data.styles().is_display_none()
     }
 
     /// Gets a reference to the ElementData container.
     fn get_data(&self) -> Option<&AtomicRefCell<ElementData>>;
 
     /// Immutably borrows the ElementData.
     fn borrow_data(&self) -> Option<AtomicRef<ElementData>> {
--- a/servo/components/style/matching.rs
+++ b/servo/components/style/matching.rs
@@ -734,17 +734,17 @@ pub trait MatchMethods : TElement {
         let parent_data = parent.as_ref().map(|x| x.borrow_data().unwrap());
         let parent_style = parent_data.as_ref().map(|d| {
             // Sometimes Gecko eagerly styles things without processing pending
             // restyles first. In general we'd like to avoid this, but there can
             // be good reasons (for example, needing to construct a frame for
             // some small piece of newly-added content in order to do something
             // specific with that frame, but not wanting to flush all of
             // layout).
-            debug_assert!(cfg!(gecko) || d.has_current_styles());
+            debug_assert!(cfg!(feature = "gecko") || d.has_current_styles());
             &d.styles().primary.values
         });
 
         let mut new_styles;
         let mut possibly_expired_animations = vec![];
 
         let damage = {
             debug_assert!(!data.has_current_styles());