diff options
Diffstat (limited to 'components/script/dom/element.rs')
-rw-r--r-- | components/script/dom/element.rs | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs index a84773dd195..514fc50720f 100644 --- a/components/script/dom/element.rs +++ b/components/script/dom/element.rs @@ -64,7 +64,7 @@ use style; use style::legacy::{UnsignedIntegerAttribute, from_declaration}; use style::properties::{PropertyDeclarationBlock, PropertyDeclaration, parse_style_attribute}; use style::properties::DeclaredValue::SpecifiedValue; -use style::properties::longhands::{self, border_spacing, height}; +use style::properties::longhands::{self, background_image, border_spacing, height}; use style::values::CSSFloat; use style::values::specified::{self, CSSColor, CSSRGBA}; use util::geometry::Au; @@ -280,6 +280,19 @@ impl RawLayoutElementHelpers for Element { CSSColor { parsed: Color::RGBA(color), authored: None })))); } + let background = if self.is_htmlbodyelement() { + let this: &HTMLBodyElement = mem::transmute(self); + this.get_background() + } else { + None + }; + + if let Some(url) = background { + hints.push(from_declaration( + PropertyDeclaration::BackgroundImage(SpecifiedValue( + background_image::SpecifiedValue(Some(specified::Image::Url(url))))))); + } + let color = if self.is_htmlfontelement() { let this: &HTMLFontElement = mem::transmute(self); this.get_color() |