Change parsing behavior and implement to_computed_value function

This commit is contained in:
Nazım Can Altınova 2016-08-27 21:49:35 +03:00
parent 4eb93c85bc
commit 8372f295b3
5 changed files with 227 additions and 106 deletions

View file

@ -15,8 +15,8 @@ use url::Url;
use values::computed::basic_shape as computed_basic_shape;
use values::computed::{Context, ToComputedValue, ComputedValueAsSpecified};
use values::specified::UrlExtraData;
use values::specified::position::Position;
use values::specified::{BorderRadiusSize, LengthOrPercentage, Percentage};
use values::specified::position::{Keyword, Position};
use values::specified::{BorderRadiusSize, LengthOrPercentage};
/// A shape source, for some reference box
///
@ -265,10 +265,10 @@ impl Circle {
} else {
// Defaults to origin
Position {
horiz_keyword: None,
horiz_position: Some(LengthOrPercentage::Percentage(Percentage(0.5))),
vert_keyword: None,
vert_position: Some(LengthOrPercentage::Percentage(Percentage(0.5))),
horiz_keyword: Some(Keyword::Center),
horiz_position: None,
vert_keyword: Some(Keyword::Center),
vert_position: None,
}
};
Ok(Circle {
@ -331,10 +331,10 @@ impl Ellipse {
} else {
// Defaults to origin
Position {
horiz_keyword: None,
horiz_position: Some(LengthOrPercentage::Percentage(Percentage(0.5))),
vert_keyword: None,
vert_position: Some(LengthOrPercentage::Percentage(Percentage(0.5))),
horiz_keyword: Some(Keyword::Center),
horiz_position: None,
vert_keyword: Some(Keyword::Center),
vert_position: None,
}
};
Ok(Ellipse {