diff --git a/components/style/stylesheets/document_rule.rs b/components/style/stylesheets/document_rule.rs index df1aac0fae2..104f13ec710 100644 --- a/components/style/stylesheets/document_rule.rs +++ b/components/style/stylesheets/document_rule.rs @@ -176,7 +176,8 @@ impl UrlMatchingFunction { /// The `@document` rule's condition is written as a comma-separated list of /// URL matching functions, and the condition evaluates to true whenever any /// one of those functions evaluates to true. -#[derive(Clone, Debug)] +#[css(comma, iterable)] +#[derive(Clone, Debug, ToCss)] pub struct DocumentCondition(Vec); impl DocumentCondition { @@ -194,20 +195,3 @@ impl DocumentCondition { ) } } - -impl ToCss for DocumentCondition { - fn to_css(&self, dest: &mut CssWriter) -> fmt::Result - where - W: Write, - { - let mut iter = self.0.iter(); - let first = iter.next() - .expect("Empty DocumentCondition, should contain at least one URL matching function"); - first.to_css(dest)?; - for url_matching_function in iter { - dest.write_str(", ")?; - url_matching_function.to_css(dest)?; - } - Ok(()) - } -}