Commit 440c6c13 authored by Emilio Cobos Álvarez's avatar Emilio Cobos Álvarez
Browse files

Bug 1599181 - Fix serialization of @namespace rule. r=boris

This code comes from:

I audited other callers of write_str, they seem ok.

Differential Revision:

extra : moz-landing-system : lando
parent 3b4a5c56
......@@ -7,8 +7,9 @@
use crate::shared_lock::{SharedRwLockReadGuard, ToCssWithGuard};
use crate::str::CssStringWriter;
use crate::{Namespace, Prefix};
use cssparser::SourceLocation;
use cssparser::{self, SourceLocation};
use std::fmt::{self, Write};
use style_traits::{CssWriter, ToCss};
/// A `@namespace` rule.
#[derive(Clone, Debug, PartialEq, ToShmem)]
......@@ -27,13 +28,12 @@ impl ToCssWithGuard for NamespaceRule {
fn to_css(&self, _guard: &SharedRwLockReadGuard, dest: &mut CssStringWriter) -> fmt::Result {
dest.write_str("@namespace ")?;
if let Some(ref prefix) = self.prefix {
let prefix = prefix.to_string();
cssparser::serialize_identifier(&prefix, dest)?;
dest.write_str(" ")?;
// FIXME(emilio): Pretty sure this needs some escaping, or something?
self.url.to_string().to_css(&mut CssWriter::new(dest))?;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment