diff options
author | bors-servo <release+servo@mozilla.com> | 2013-08-15 11:06:00 -0700 |
---|---|---|
committer | bors-servo <release+servo@mozilla.com> | 2013-08-15 11:06:00 -0700 |
commit | d1bee3fe3d8fcf023d2648b285362cb293c27d39 (patch) | |
tree | 3a9c061f17d17d04b6f673c51c1e18963e5286f0 /src/components/script/html | |
parent | 034536e5313b634e02f151ebb98d64b2914b955d (diff) | |
parent | cba0caf7a504b067ec4acaac9a0c53b6fa32f40f (diff) | |
download | servo-d1bee3fe3d8fcf023d2648b285362cb293c27d39.tar.gz servo-d1bee3fe3d8fcf023d2648b285362cb293c27d39.zip |
auto merge of #730 : metajack/servo/style_setter, r=metajack,me
Rebasing to land #719.
Diffstat (limited to 'src/components/script/html')
-rw-r--r-- | src/components/script/html/hubbub_html_parser.rs | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index 19885aafdd2..779cd85a71e 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -42,10 +42,11 @@ use dom::htmltablesectionelement::HTMLTableSectionElement; use dom::htmltextareaelement::HTMLTextAreaElement; use dom::htmltitleelement::HTMLTitleElement; use dom::htmlulistelement::HTMLUListElement; -use dom::element::{Element, Attr}; +use dom::element::Element; use dom::htmlelement::HTMLElement; use dom::node::{AbstractNode, Comment, Doctype, ElementNodeTypeId, Node, ScriptView}; use dom::node::{Text}; +use dom::bindings::utils::str; use html::cssparse::{InlineProvenance, StylesheetProvenance, UrlProvenance, spawn_css_parser}; use js::jsapi::JSContext; use newcss::stylesheet::Stylesheet; @@ -343,14 +344,7 @@ pub fn parse_html(cx: *JSContext, debug!("-- attach attrs"); 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)); - } + element.set_attr(&str(attr.name.clone()), &str(attr.value.clone())); } } |