mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
script: Implement the color
attribute of the <font>
element.
Improves Hacker News.
This commit is contained in:
parent
c981e9b2e3
commit
7d9eda916b
9 changed files with 105 additions and 143 deletions
|
@ -17,7 +17,8 @@ use dom::bindings::codegen::Bindings::HTMLInputElementBinding::HTMLInputElementM
|
|||
use dom::bindings::codegen::Bindings::NamedNodeMapBinding::NamedNodeMapMethods;
|
||||
use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods;
|
||||
use dom::bindings::codegen::InheritTypes::{ElementCast, ElementDerived, EventTargetCast};
|
||||
use dom::bindings::codegen::InheritTypes::{HTMLBodyElementDerived, HTMLInputElementCast};
|
||||
use dom::bindings::codegen::InheritTypes::{HTMLBodyElementDerived, HTMLFontElementDerived};
|
||||
use dom::bindings::codegen::InheritTypes::{HTMLInputElementCast};
|
||||
use dom::bindings::codegen::InheritTypes::{HTMLInputElementDerived, HTMLTableElementCast};
|
||||
use dom::bindings::codegen::InheritTypes::{HTMLTableElementDerived, HTMLTableCellElementDerived};
|
||||
use dom::bindings::codegen::InheritTypes::{HTMLTableRowElementDerived, HTMLTextAreaElementDerived};
|
||||
|
@ -45,6 +46,7 @@ use dom::htmlanchorelement::HTMLAnchorElement;
|
|||
use dom::htmlbodyelement::{HTMLBodyElement, HTMLBodyElementHelpers};
|
||||
use dom::htmlcollection::HTMLCollection;
|
||||
use dom::htmlelement::HTMLElementTypeId;
|
||||
use dom::htmlfontelement::{HTMLFontElement, HTMLFontElementHelpers};
|
||||
use dom::htmlinputelement::{HTMLInputElement, RawLayoutHTMLInputElementHelpers, HTMLInputElementHelpers};
|
||||
use dom::htmltableelement::{HTMLTableElement, HTMLTableElementHelpers};
|
||||
use dom::htmltablecellelement::{HTMLTableCellElement, HTMLTableCellElementHelpers};
|
||||
|
@ -64,7 +66,7 @@ use style::properties::{PropertyDeclarationBlock, PropertyDeclaration, parse_sty
|
|||
use style::properties::DeclaredValue::SpecifiedValue;
|
||||
use style::properties::longhands::{self, border_spacing};
|
||||
use style::values::CSSFloat;
|
||||
use style::values::specified::{self, CSSColor};
|
||||
use style::values::specified::{self, CSSColor, CSSRGBA};
|
||||
use util::geometry::Au;
|
||||
use util::namespace;
|
||||
use util::smallvec::VecLike;
|
||||
|
@ -269,6 +271,20 @@ impl RawLayoutElementHelpers for Element {
|
|||
CSSColor { parsed: Color::RGBA(color), authored: None }))));
|
||||
}
|
||||
|
||||
let color = if self.is_htmlfontelement() {
|
||||
let this: &HTMLFontElement = mem::transmute(self);
|
||||
this.get_color()
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
if let Some(color) = color {
|
||||
hints.push(from_declaration(
|
||||
PropertyDeclaration::Color(SpecifiedValue(CSSRGBA {
|
||||
parsed: color,
|
||||
authored: None,
|
||||
}))));
|
||||
}
|
||||
|
||||
let cellspacing = if self.is_htmltableelement() {
|
||||
let this: &HTMLTableElement = mem::transmute(self);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue