mirror of
https://github.com/servo/servo.git
synced 2025-06-20 15:18:58 +01:00
Pass a Namespace to Element::get_attr.
This commit is contained in:
parent
e64ee3557e
commit
95913d1fed
8 changed files with 24 additions and 17 deletions
|
@ -9,6 +9,7 @@ use dom::htmlheadingelement::{Heading1, Heading2, Heading3, Heading4, Heading5,
|
|||
use dom::htmliframeelement::IFrameSize;
|
||||
use dom::htmlformelement::HTMLFormElement;
|
||||
use dom::namespace;
|
||||
use dom::namespace::Null;
|
||||
use dom::node::{AbstractNode, ElementNodeTypeId};
|
||||
use dom::types::*;
|
||||
use html::cssparse::{InlineProvenance, StylesheetProvenance, UrlProvenance, spawn_css_parser};
|
||||
|
@ -347,7 +348,7 @@ pub fn parse_html(cx: *JSContext,
|
|||
// Handle CSS style sheets from <link> elements
|
||||
ElementNodeTypeId(HTMLLinkElementTypeId) => {
|
||||
do node.with_imm_element |element| {
|
||||
match (element.get_attr(None, "rel"), element.get_attr(None, "href")) {
|
||||
match (element.get_attr(Null, "rel"), element.get_attr(Null, "href")) {
|
||||
(Some(rel), Some(href)) => {
|
||||
if "stylesheet" == rel {
|
||||
debug!("found CSS stylesheet: {:s}", href);
|
||||
|
@ -366,7 +367,7 @@ pub fn parse_html(cx: *JSContext,
|
|||
let iframe_chan = iframe_chan.take();
|
||||
let sandboxed = iframe_element.is_sandboxed();
|
||||
let elem = &mut iframe_element.htmlelement.element;
|
||||
let src_opt = elem.get_attr(None, "src").map(|x| x.to_str());
|
||||
let src_opt = elem.get_attr(Null, "src").map(|x| x.to_str());
|
||||
for src in src_opt.iter() {
|
||||
let iframe_url = make_url(src.clone(), Some(url2.clone()));
|
||||
iframe_element.frame = Some(iframe_url.clone());
|
||||
|
@ -462,7 +463,7 @@ pub fn parse_html(cx: *JSContext,
|
|||
unsafe {
|
||||
let scriptnode: AbstractNode = NodeWrapping::from_hubbub_node(script);
|
||||
do scriptnode.with_imm_element |script| {
|
||||
match script.get_attr(None, "src") {
|
||||
match script.get_attr(Null, "src") {
|
||||
Some(src) => {
|
||||
debug!("found script: {:s}", src);
|
||||
let new_url = make_url(src.to_str(), Some(url3.clone()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue