mirror of
https://github.com/servo/servo.git
synced 2025-08-08 23:15:33 +01:00
Various fixes in style
This commit is contained in:
parent
840e4c90d5
commit
97422ad252
3 changed files with 20 additions and 20 deletions
|
@ -798,26 +798,26 @@ fn build_identity_transform_list(list: &Vec<TransformOperation>) -> Vec<Transfor
|
|||
let mut result = vec!();
|
||||
|
||||
for operation in list {
|
||||
match operation {
|
||||
&TransformOperation::Matrix(..) => {
|
||||
match *operation {
|
||||
TransformOperation::Matrix(..) => {
|
||||
let identity = ComputedMatrix::identity();
|
||||
result.push(TransformOperation::Matrix(identity));
|
||||
}
|
||||
&TransformOperation::Skew(..) => {
|
||||
TransformOperation::Skew(..) => {
|
||||
result.push(TransformOperation::Skew(0.0, 0.0));
|
||||
}
|
||||
&TransformOperation::Translate(..) => {
|
||||
TransformOperation::Translate(..) => {
|
||||
result.push(TransformOperation::Translate(LengthOrPercentage::zero(),
|
||||
LengthOrPercentage::zero(),
|
||||
Au(0)));
|
||||
}
|
||||
&TransformOperation::Scale(..) => {
|
||||
TransformOperation::Scale(..) => {
|
||||
result.push(TransformOperation::Scale(1.0, 1.0, 1.0));
|
||||
}
|
||||
&TransformOperation::Rotate(..) => {
|
||||
TransformOperation::Rotate(..) => {
|
||||
result.push(TransformOperation::Rotate(0.0, 0.0, 1.0, Angle(0.0)));
|
||||
}
|
||||
&TransformOperation::Perspective(..) => {
|
||||
TransformOperation::Perspective(..) => {
|
||||
// http://dev.w3.org/csswg/css-transforms/#identity-transform-function
|
||||
let identity = ComputedMatrix::identity();
|
||||
result.push(TransformOperation::Matrix(identity));
|
||||
|
|
|
@ -25,16 +25,16 @@ pub enum Range<T> {
|
|||
|
||||
impl Range<specified::Length> {
|
||||
fn to_computed_range(&self, viewport_size: Size2D<Au>) -> Range<Au> {
|
||||
let compute_width = |width| {
|
||||
let compute_width = |&width| {
|
||||
match width {
|
||||
&specified::Length::Absolute(value) => value,
|
||||
&specified::Length::FontRelative(value) => {
|
||||
specified::Length::Absolute(value) => value,
|
||||
specified::Length::FontRelative(value) => {
|
||||
// http://dev.w3.org/csswg/mediaqueries3/#units
|
||||
// em units are relative to the initial font-size.
|
||||
let initial_font_size = longhands::font_size::get_initial_value();
|
||||
value.to_computed_value(initial_font_size, initial_font_size)
|
||||
}
|
||||
&specified::Length::ViewportPercentage(value) =>
|
||||
specified::Length::ViewportPercentage(value) =>
|
||||
value.to_computed_value(viewport_size),
|
||||
_ => unreachable!()
|
||||
}
|
||||
|
|
|
@ -46,10 +46,10 @@ impl ToCss for Zoom {
|
|||
fn to_css<W>(&self, dest: &mut W) -> fmt::Result
|
||||
where W: fmt::Write
|
||||
{
|
||||
match self {
|
||||
&Zoom::Number(number) => write!(dest, "{}", number),
|
||||
&Zoom::Percentage(percentage) => write!(dest, "{}%", percentage * 100.),
|
||||
&Zoom::Auto => write!(dest, "auto")
|
||||
match *self {
|
||||
Zoom::Number(number) => write!(dest, "{}", number),
|
||||
Zoom::Percentage(percentage) => write!(dest, "{}%", percentage * 100.),
|
||||
Zoom::Auto => write!(dest, "auto")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -71,10 +71,10 @@ impl Zoom {
|
|||
|
||||
#[inline]
|
||||
pub fn to_f32(&self) -> Option<f32> {
|
||||
match self {
|
||||
&Zoom::Number(number) => Some(number as f32),
|
||||
&Zoom::Percentage(percentage) => Some(percentage as f32),
|
||||
&Zoom::Auto => None
|
||||
match *self {
|
||||
Zoom::Number(number) => Some(number as f32),
|
||||
Zoom::Percentage(percentage) => Some(percentage as f32),
|
||||
Zoom::Auto => None
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -193,7 +193,7 @@ pub struct ViewportRule {
|
|||
}
|
||||
|
||||
impl ViewportRule {
|
||||
pub fn parse<'a>(input: &mut Parser, context: &'a ParserContext)
|
||||
pub fn parse(input: &mut Parser, context: &ParserContext)
|
||||
-> Result<ViewportRule, ()>
|
||||
{
|
||||
let parser = ViewportRuleParser { context: context };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue