Skip to content

Commit

Permalink
Implemented HTMLScriptElement.Src
Browse files Browse the repository at this point in the history
  • Loading branch information
Isabelle Carter committed Oct 22, 2013
1 parent 4d8f7fd commit 0e94eb5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/script/dom/htmlscriptelement.rs
Expand Up @@ -4,14 +4,15 @@

use dom::bindings::utils::{DOMString, ErrorResult};
use dom::htmlelement::HTMLElement;
use servo_util::tree::ElementLike;

pub struct HTMLScriptElement {
htmlelement: HTMLElement,
}

impl HTMLScriptElement {
pub fn Src(&self) -> DOMString {
None
self.htmlelement.element.get_attr("src").map(|s| s.to_str())
}

pub fn SetSrc(&mut self, _src: &DOMString) -> ErrorResult {
Expand Down
18 changes: 18 additions & 0 deletions src/test/html/content/test_script_src_attribute.html
@@ -0,0 +1,18 @@
<html>
<head id="foo">
<title></title>
<script src="harness.js"></script>
</head>
<script>
let script = document.getElementById("test");

{
is(script.src, "/x.js");
}

finish();
</script>
<body>
<script src="/x.js" id="test"/>
</body>
</html>

5 comments on commit 0e94eb5

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from jdm
at ibnc@0e94eb5

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging ibnc/servo/script_dev = 0e94eb5 into auto

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ibnc/servo/script_dev = 0e94eb5 merged ok, testing candidate = f3f6e62

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = f3f6e62

Please sign in to comment.