aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/html/hubbub_html_parser.rs
diff options
context:
space:
mode:
authorJames Graham <james@hoppipolla.co.uk>2013-09-10 10:24:40 +0100
committerJosh Matthews <josh@joshmatthews.net>2013-11-12 17:39:04 +0900
commit15b9d4d19967ed96bd459bf15cae5b793567c227 (patch)
tree5e1237d9bd62386b327e30e52bf8870f5ff9f107 /src/components/script/html/hubbub_html_parser.rs
parent433f19f5a310f71273f03504261568d393e648ea (diff)
downloadservo-15b9d4d19967ed96bd459bf15cae5b793567c227.tar.gz
servo-15b9d4d19967ed96bd459bf15cae5b793567c227.zip
Initial support for Attr and namespaces.
Diffstat (limited to 'src/components/script/html/hubbub_html_parser.rs')
-rw-r--r--src/components/script/html/hubbub_html_parser.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs
index 07f5fb7f0df..44e06eb14fc 100644
--- a/src/components/script/html/hubbub_html_parser.rs
+++ b/src/components/script/html/hubbub_html_parser.rs
@@ -8,6 +8,7 @@ use dom::htmlelement::HTMLElement;
use dom::htmlheadingelement::{Heading1, Heading2, Heading3, Heading4, Heading5, Heading6};
use dom::htmliframeelement::IFrameSize;
use dom::htmlformelement::HTMLFormElement;
+use dom::namespace;
use dom::node::{AbstractNode, ElementNodeTypeId, ScriptView};
use dom::types::*;
use html::cssparse::{InlineProvenance, StylesheetProvenance, UrlProvenance, spawn_css_parser};
@@ -339,7 +340,10 @@ pub fn parse_html(cx: *JSContext,
debug!("-- attach attrs");
do node.as_mut_element |element| {
for attr in tag.attributes.iter() {
- element.set_attr(node, &Some(attr.name.clone()), &Some(attr.value.clone()));
+ element.set_attribute(node,
+ namespace::Null,
+ &Some(attr.name.clone()),
+ &Some(attr.value.clone()));
}
}
@@ -350,7 +354,7 @@ pub fn parse_html(cx: *JSContext,
do node.with_imm_element |element| {
match (element.get_attr("rel"), element.get_attr("href")) {
(Some(rel), Some(href)) => {
- if rel == "stylesheet" {
+ if "stylesheet" == rel {
debug!("found CSS stylesheet: {:s}", href);
let url = make_url(href.to_str(), Some(url2.clone()));
css_chan2.send(CSSTaskNewFile(UrlProvenance(url)));