top属性

WindowBase? top
覆盖

对窗口层次中最高窗口的引用。

如果这个WindowBase是最高层的WindowBasetop将返回对本身的引用。

// Add an IFrame to the current window.
IFrameElement myIFrame = new IFrameElement();
window.document.body.elements.add(myIFrame);

// Add an IFrame inside of the other IFrame.
IFrameElement innerIFrame = new IFrameElement();
myIFrame.elements.add(innerIFrame);

print(myIframe.contentWindow.top == window) // 'true'
print(innerIFrame.contentWindow.top == window) // 'true'

print(window.top == window) // 'true'

实现

WindowBase? get top => _convertNativeToDart_Window(this._get_top);