diff options
author | bors-servo <metajack+bors@gmail.com> | 2015-09-03 16:09:02 -0600 |
---|---|---|
committer | bors-servo <metajack+bors@gmail.com> | 2015-09-03 16:09:02 -0600 |
commit | 05deb3dcc8be9a0a623536467628aa68ae754918 (patch) | |
tree | 1cdbfff77d566d70200d3f133987e8e2c35311fd /components/script/dom | |
parent | 0ad284766b3f12097dce1e5858b5d07e870478eb (diff) | |
parent | c651c2f3dbeb4f0687b6dad71ae6fc56b0ef4994 (diff) | |
download | servo-05deb3dcc8be9a0a623536467628aa68ae754918.tar.gz servo-05deb3dcc8be9a0a623536467628aa68ae754918.zip |
Auto merge of #7518 - servo:custom-properties, r=pcwalton
Initial support for CSS Custom Properties
https://drafts.csswg.org/css-variables/
Missing:
* `var()` in shorthand property declarations.
* Correct handling of EOF in custom property declarations.
r? @pcwalton
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7518)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom')
-rw-r--r-- | components/script/dom/element.rs | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs index 83574e7b6fa..f9d3920cfd3 100644 --- a/components/script/dom/element.rs +++ b/components/script/dom/element.rs @@ -62,7 +62,7 @@ use dom::virtualmethods::{VirtualMethods, vtable_for}; use devtools_traits::AttrInfo; use smallvec::VecLike; use style::legacy::{UnsignedIntegerAttribute, from_declaration}; -use style::properties::DeclaredValue::SpecifiedValue; +use style::properties::DeclaredValue; use style::properties::longhands::{self, background_image, border_spacing}; use style::properties::{PropertyDeclarationBlock, PropertyDeclaration, parse_style_attribute}; use style::values::CSSFloat; @@ -271,7 +271,7 @@ impl RawLayoutElementHelpers for Element { if let Some(color) = bgcolor { hints.push(from_declaration( - PropertyDeclaration::BackgroundColor(SpecifiedValue( + PropertyDeclaration::BackgroundColor(DeclaredValue::Value( CSSColor { parsed: Color::RGBA(color), authored: None })))); } @@ -284,7 +284,7 @@ impl RawLayoutElementHelpers for Element { if let Some(url) = background { hints.push(from_declaration( - PropertyDeclaration::BackgroundImage(SpecifiedValue( + PropertyDeclaration::BackgroundImage(DeclaredValue::Value( background_image::SpecifiedValue(Some(specified::Image::Url(url))))))); } @@ -297,7 +297,7 @@ impl RawLayoutElementHelpers for Element { if let Some(color) = color { hints.push(from_declaration( - PropertyDeclaration::Color(SpecifiedValue(CSSRGBA { + PropertyDeclaration::Color(DeclaredValue::Value(CSSRGBA { parsed: color, authored: None, })))); @@ -313,7 +313,7 @@ impl RawLayoutElementHelpers for Element { if let Some(cellspacing) = cellspacing { let width_value = specified::Length::Absolute(Au::from_px(cellspacing as i32)); hints.push(from_declaration( - PropertyDeclaration::BorderSpacing(SpecifiedValue( + PropertyDeclaration::BorderSpacing(DeclaredValue::Value( border_spacing::SpecifiedValue { horizontal: width_value, vertical: width_value, @@ -343,7 +343,7 @@ impl RawLayoutElementHelpers for Element { let value = specified::Length::ServoCharacterWidth( specified::CharacterWidth(size)); hints.push(from_declaration( - PropertyDeclaration::Width(SpecifiedValue( + PropertyDeclaration::Width(DeclaredValue::Value( specified::LengthOrPercentageOrAuto::Length(value))))); } @@ -367,13 +367,13 @@ impl RawLayoutElementHelpers for Element { let width_value = specified::LengthOrPercentageOrAuto::Percentage(specified::Percentage(percentage)); hints.push(from_declaration( - PropertyDeclaration::Width(SpecifiedValue(width_value)))); + PropertyDeclaration::Width(DeclaredValue::Value(width_value)))); } LengthOrPercentageOrAuto::Length(length) => { let width_value = specified::LengthOrPercentageOrAuto::Length( specified::Length::Absolute(length)); hints.push(from_declaration( - PropertyDeclaration::Width(SpecifiedValue(width_value)))); + PropertyDeclaration::Width(DeclaredValue::Value(width_value)))); } } @@ -391,13 +391,13 @@ impl RawLayoutElementHelpers for Element { let height_value = specified::LengthOrPercentageOrAuto::Percentage(specified::Percentage(percentage)); hints.push(from_declaration( - PropertyDeclaration::Height(SpecifiedValue(height_value)))); + PropertyDeclaration::Height(DeclaredValue::Value(height_value)))); } LengthOrPercentageOrAuto::Length(length) => { let height_value = specified::LengthOrPercentageOrAuto::Length( specified::Length::Absolute(length)); hints.push(from_declaration( - PropertyDeclaration::Height(SpecifiedValue(height_value)))); + PropertyDeclaration::Height(DeclaredValue::Value(height_value)))); } } @@ -420,7 +420,7 @@ impl RawLayoutElementHelpers for Element { // https://html.spec.whatwg.org/multipage/#textarea-effective-width let value = specified::Length::ServoCharacterWidth(specified::CharacterWidth(cols)); hints.push(from_declaration( - PropertyDeclaration::Width(SpecifiedValue( + PropertyDeclaration::Width(DeclaredValue::Value( specified::LengthOrPercentageOrAuto::Length(value))))); } @@ -441,7 +441,7 @@ impl RawLayoutElementHelpers for Element { // https://html.spec.whatwg.org/multipage/#textarea-effective-height let value = specified::Length::FontRelative(specified::FontRelativeLength::Em(rows as CSSFloat)); hints.push(from_declaration( - PropertyDeclaration::Height(SpecifiedValue( + PropertyDeclaration::Height(DeclaredValue::Value( specified::LengthOrPercentageOrAuto::Length(value))))); } @@ -456,16 +456,16 @@ impl RawLayoutElementHelpers for Element { if let Some(border) = border { let width_value = specified::Length::Absolute(Au::from_px(border as i32)); hints.push(from_declaration( - PropertyDeclaration::BorderTopWidth(SpecifiedValue( + PropertyDeclaration::BorderTopWidth(DeclaredValue::Value( longhands::border_top_width::SpecifiedValue(width_value))))); hints.push(from_declaration( - PropertyDeclaration::BorderLeftWidth(SpecifiedValue( + PropertyDeclaration::BorderLeftWidth(DeclaredValue::Value( longhands::border_left_width::SpecifiedValue(width_value))))); hints.push(from_declaration( - PropertyDeclaration::BorderBottomWidth(SpecifiedValue( + PropertyDeclaration::BorderBottomWidth(DeclaredValue::Value( longhands::border_bottom_width::SpecifiedValue(width_value))))); hints.push(from_declaration( - PropertyDeclaration::BorderRightWidth(SpecifiedValue( + PropertyDeclaration::BorderRightWidth(DeclaredValue::Value( longhands::border_right_width::SpecifiedValue(width_value))))); } } |