Index: client/dom/src/frog_DOMImplementation.dart |
diff --git a/client/dom/templates/dom/frog/impl_HTMLIFrameElement.darttemplate b/client/dom/src/frog_DOMImplementation.dart |
similarity index 64% |
copy from client/dom/templates/dom/frog/impl_HTMLIFrameElement.darttemplate |
copy to client/dom/src/frog_DOMImplementation.dart |
index 8cbdf855618aedea1b41e6d0b3165cba0c8b34f6..5f426c7518c185d76ba4e8af2ba71e56cedb5536 100644 |
--- a/client/dom/templates/dom/frog/impl_HTMLIFrameElement.darttemplate |
+++ b/client/dom/src/frog_DOMImplementation.dart |
@@ -2,17 +2,6 @@ |
// for details. All rights reserved. Use of this source code is governed by a |
// BSD-style license that can be found in the LICENSE file. |
-class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { |
-$!MEMBERS |
- |
- Window get _contentWindow() native "return this.contentWindow;"; |
- |
- // Override contentWindow to return secure wrapper. |
- Window get contentWindow() { |
- return _DOMWindowCrossFrameImpl._createSafe(_contentWindow); |
- } |
-} |
- |
// TODO(vsm): Unify with Dartium version. |
class _DOMWindowCrossFrameImpl implements DOMType, DOMWindow { |
// Private window. |
@@ -29,9 +18,9 @@ class _DOMWindowCrossFrameImpl implements DOMType, DOMWindow { |
bool get closed() => _window.closed; |
int get length() => _window.length; |
- DOMWindow get opener() => _createDOMWindowCrossFrame(_window.opener); |
- DOMWindow get parent() => _createDOMWindowCrossFrame(_window.parent); |
- DOMWindow get top() => _createDOMWindowCrossFrame(_window.top); |
+ DOMWindow get opener() => _createSafe(_window.opener); |
+ DOMWindow get parent() => _createSafe(_window.parent); |
+ DOMWindow get top() => _createSafe(_window.top); |
// Methods. |
void focus() { |
sra1
2012/02/29 20:39:46
nit: use =>
|
@@ -60,9 +49,11 @@ class _DOMWindowCrossFrameImpl implements DOMType, DOMWindow { |
_DOMWindowCrossFrameImpl(this._window); |
static DOMWindow _createSafe(w) { |
- // TODO(vsm): Check if it's the top-level window. Return unwrapped. |
- |
- // TODO(vsm): Cache or implement equality. |
- return new _DOMWindowCrossFrameImpl(w); |
+ if (w === window) { |
sra1
2012/02/29 20:39:46
It is a good thing that global get:window does not
|
+ return w; |
+ } else { |
+ // TODO(vsm): Cache or implement equality. |
+ return new _DOMWindowCrossFrameImpl(w); |
+ } |
} |
} |