mirror of
https://github.com/servo/servo.git
synced 2025-06-21 15:49:04 +01:00
commit
f3f6e62f7f
2 changed files with 20 additions and 1 deletions
|
@ -4,6 +4,7 @@
|
|||
|
||||
use dom::bindings::utils::{DOMString, ErrorResult};
|
||||
use dom::htmlelement::HTMLElement;
|
||||
use servo_util::tree::ElementLike;
|
||||
|
||||
pub struct HTMLScriptElement {
|
||||
htmlelement: HTMLElement,
|
||||
|
@ -11,7 +12,7 @@ pub struct HTMLScriptElement {
|
|||
|
||||
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 {
|
||||
|
|
18
src/test/html/content/test_script_src_attribute.html
Normal file
18
src/test/html/content/test_script_src_attribute.html
Normal file
|
@ -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>
|
Loading…
Add table
Add a link
Reference in a new issue