mirror of
https://github.com/servo/servo.git
synced 2025-06-16 20:34:30 +00:00
auto merge of #678 : metajack/servo/style-attributes, r=jdm
If a style attribute is given for a node, it is parsed and attached to the Element. When selector matching runs on the Element, the style attribute's stylesheet is passed in. Fixes #86.
This commit is contained in:
commit
b017785aad
5 changed files with 30 additions and 15 deletions
|
@ -317,6 +317,13 @@ pub fn parse_html(cx: *JSContext,
|
|||
do node.as_mut_element |element| {
|
||||
for tag.attributes.iter().advance |attr| {
|
||||
element.attrs.push(Attr::new(attr.name.clone(), attr.value.clone()));
|
||||
|
||||
if "style" == attr.name {
|
||||
element.style_attribute = Some(
|
||||
Stylesheet::from_attribute(
|
||||
url::from_str("http://www.example.com/").unwrap(),
|
||||
attr.value));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -379,7 +386,6 @@ pub fn parse_html(cx: *JSContext,
|
|||
}
|
||||
}
|
||||
|
||||
//TODO (Issue #86): handle inline styles ('style' attr)
|
||||
_ => {}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue