mirror of
https://github.com/servo/servo.git
synced 2025-08-17 11:25:35 +01:00
Introduce a ToCssWithGuard trait
This commit is contained in:
parent
3ae2ecbec2
commit
fe4e70c5f8
16 changed files with 104 additions and 54 deletions
|
@ -15,7 +15,7 @@ use cssparser::ToCss as ParserToCss;
|
|||
use euclid::size::TypedSize2D;
|
||||
use media_queries::Device;
|
||||
use parser::{ParserContext, log_css_error};
|
||||
use shared_lock::SharedRwLockReadGuard;
|
||||
use shared_lock::{SharedRwLockReadGuard, ToCssWithGuard};
|
||||
use std::ascii::AsciiExt;
|
||||
use std::borrow::Cow;
|
||||
use std::fmt;
|
||||
|
@ -505,9 +505,10 @@ impl ViewportRule {
|
|||
}
|
||||
}
|
||||
|
||||
impl ToCss for ViewportRule {
|
||||
impl ToCssWithGuard for ViewportRule {
|
||||
// Serialization of ViewportRule is not specced.
|
||||
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
|
||||
fn to_css<W>(&self, _guard: &SharedRwLockReadGuard, dest: &mut W) -> fmt::Result
|
||||
where W: fmt::Write {
|
||||
try!(dest.write_str("@viewport { "));
|
||||
let mut iter = self.declarations.iter();
|
||||
try!(iter.next().unwrap().to_css(dest));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue