mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Implement Window#top.
This commit is contained in:
parent
52e857dd7b
commit
8b45f9f51c
4 changed files with 10 additions and 10 deletions
|
@ -33,6 +33,7 @@
|
||||||
readonly attribute Window frames;
|
readonly attribute Window frames;
|
||||||
//[Replaceable] readonly attribute unsigned long length;
|
//[Replaceable] readonly attribute unsigned long length;
|
||||||
//[Unforgeable] readonly attribute WindowProxy top;
|
//[Unforgeable] readonly attribute WindowProxy top;
|
||||||
|
readonly attribute Window top;
|
||||||
// attribute any opener;
|
// attribute any opener;
|
||||||
//readonly attribute WindowProxy parent;
|
//readonly attribute WindowProxy parent;
|
||||||
readonly attribute Window parent;
|
readonly attribute Window parent;
|
||||||
|
|
|
@ -442,6 +442,15 @@ impl<'a> WindowMethods for &'a Window {
|
||||||
self.parent().unwrap_or(self.Window())
|
self.parent().unwrap_or(self.Window())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://html.spec.whatwg.org/multipage/#dom-top
|
||||||
|
fn Top(self) -> Root<Window> {
|
||||||
|
let mut window = self.Window();
|
||||||
|
while let Some(parent) = window.parent() {
|
||||||
|
window = parent;
|
||||||
|
}
|
||||||
|
window
|
||||||
|
}
|
||||||
|
|
||||||
fn Performance(self) -> Root<Performance> {
|
fn Performance(self) -> Root<Performance> {
|
||||||
self.performance.or_init(|| {
|
self.performance.or_init(|| {
|
||||||
Performance::new(self, self.navigation_start,
|
Performance::new(self, self.navigation_start,
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
[034.html]
|
|
||||||
type: testharness
|
|
||||||
[ scheduler: innerHTML adding frames with JS in]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
[039.html]
|
|
||||||
type: testharness
|
|
||||||
[ scheduler: IFRAMEs added with DOM]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue