mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Implement Document.defaultView - fixes #4518
This commit is contained in:
parent
141b5d038f
commit
c10049327a
4 changed files with 18 additions and 3 deletions
|
@ -994,6 +994,11 @@ impl<'a> DocumentMethods for JSRef<'a, Document> {
|
||||||
self.ready_state.get()
|
self.ready_state.get()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://html.spec.whatwg.org/multipage/browsers.html#dom-document-defaultview
|
||||||
|
fn DefaultView(self) -> Temporary<Window> {
|
||||||
|
Temporary::new(self.window)
|
||||||
|
}
|
||||||
|
|
||||||
global_event_handlers!()
|
global_event_handlers!()
|
||||||
event_handler!(readystatechange, GetOnreadystatechange, SetOnreadystatechange)
|
event_handler!(readystatechange, GetOnreadystatechange, SetOnreadystatechange)
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,5 +84,8 @@ partial interface Document {
|
||||||
|
|
||||||
// special event handler IDL attributes that only apply to Document objects
|
// special event handler IDL attributes that only apply to Document objects
|
||||||
[LenientThis] attribute EventHandler onreadystatechange;
|
[LenientThis] attribute EventHandler onreadystatechange;
|
||||||
|
|
||||||
|
// user interaction
|
||||||
|
readonly attribute Window defaultView;
|
||||||
};
|
};
|
||||||
Document implements GlobalEventHandlers;
|
Document implements GlobalEventHandlers;
|
||||||
|
|
10
tests/content/test_document_defaultView.html
Normal file
10
tests/content/test_document_defaultView.html
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<script src="harness.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<script>
|
||||||
|
is(document.defaultView, window);
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -36,9 +36,6 @@
|
||||||
[Document interface: operation writeln(DOMString)]
|
[Document interface: operation writeln(DOMString)]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Document interface: attribute defaultView]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Document interface: attribute activeElement]
|
[Document interface: attribute activeElement]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue