diff options
author | bors-servo <metajack+bors@gmail.com> | 2015-10-05 02:33:02 -0600 |
---|---|---|
committer | bors-servo <metajack+bors@gmail.com> | 2015-10-05 02:33:02 -0600 |
commit | 7debfd1f4c30a018f46caa1e6bffa165e1ef7515 (patch) | |
tree | 067bb6abfce8469910a1fbfde502626e685cafbb /components/script/dom/element.rs | |
parent | 460f067b9da42cf7663f22428547b81f43ea60c1 (diff) | |
parent | 770e3bab35be88daaf6142249848f114c0d62915 (diff) | |
download | servo-7debfd1f4c30a018f46caa1e6bffa165e1ef7515.tar.gz servo-7debfd1f4c30a018f46caa1e6bffa165e1ef7515.zip |
Auto merge of #7683 - frewsxcv:html-font-element-size-attr, r=nox
Implement `size` attribute for <font> element
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7683)
<!-- Reviewable:end -->
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 f99bd564dbe..d1db97128f0 100644 --- a/components/script/dom/element.rs +++ b/components/script/dom/element.rs @@ -71,7 +71,7 @@ use std::sync::Arc; use string_cache::{Atom, Namespace, QualName}; use style::legacy::{UnsignedIntegerAttribute, from_declaration}; use style::properties::DeclaredValue; -use style::properties::longhands::{self, background_image, border_spacing, font_family}; +use style::properties::longhands::{self, background_image, border_spacing, font_family, font_size}; use style::properties::{PropertyDeclaration, PropertyDeclarationBlock, parse_style_attribute}; use style::values::CSSFloat; use style::values::specified::{self, CSSColor, CSSRGBA}; @@ -302,6 +302,19 @@ impl RawLayoutElementHelpers for Element { font_family)]))))); } + let font_size = if let Some(this) = HTMLFontElementCast::to_ref(self) { + this.get_size() + } else { + None + }; + + if let Some(font_size) = font_size { + hints.push(from_declaration( + PropertyDeclaration::FontSize( + DeclaredValue::Value( + font_size::SpecifiedValue(font_size))))) + } + let cellspacing = if let Some(this) = HTMLTableElementCast::to_ref(self) { this.get_cellspacing() } else { |