mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Change parsing behavior and implement to_computed_value function
This commit is contained in:
parent
4eb93c85bc
commit
8372f295b3
5 changed files with 227 additions and 106 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue