bindings: Window must be LocalDOMWindow by definition.

Window.idl declares that Window is ImplementedAs=LocalDOMWindow.
It also declares self/window/frames/opener/parent/top attributes
return Window, so LocalDOMWindow::self/window/frames/opener/parent/
top member functions must return LocalDOMWindow, not DOMWindow.

dcheng@, you can change Window.idl to declare ImplementedAs=DOMWindow
instead of LocalDOMWindow, if necessary.  Otherwise, please keep the
consistency here.

BUG=425623

Review URL: https://codereview.chromium.org/700803002

git-svn-id: svn://svn.chromium.org/blink/trunk@184827 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent d6ab0826
...@@ -1296,7 +1296,7 @@ void LocalDOMWindow::setDefaultStatus(const String& string) ...@@ -1296,7 +1296,7 @@ void LocalDOMWindow::setDefaultStatus(const String& string)
host->chrome().setStatusbarText(frame(), m_defaultStatus); host->chrome().setStatusbarText(frame(), m_defaultStatus);
} }
DOMWindow* LocalDOMWindow::self() const LocalDOMWindow* LocalDOMWindow::self() const
{ {
if (!frame()) if (!frame())
return 0; return 0;
...@@ -1304,7 +1304,7 @@ DOMWindow* LocalDOMWindow::self() const ...@@ -1304,7 +1304,7 @@ DOMWindow* LocalDOMWindow::self() const
return frame()->domWindow(); return frame()->domWindow();
} }
DOMWindow* LocalDOMWindow::opener() const LocalDOMWindow* LocalDOMWindow::opener() const
{ {
if (!frame()) if (!frame())
return 0; return 0;
...@@ -1316,7 +1316,7 @@ DOMWindow* LocalDOMWindow::opener() const ...@@ -1316,7 +1316,7 @@ DOMWindow* LocalDOMWindow::opener() const
return opener->domWindow(); return opener->domWindow();
} }
DOMWindow* LocalDOMWindow::parent() const LocalDOMWindow* LocalDOMWindow::parent() const
{ {
if (!frame()) if (!frame())
return 0; return 0;
...@@ -1328,7 +1328,7 @@ DOMWindow* LocalDOMWindow::parent() const ...@@ -1328,7 +1328,7 @@ DOMWindow* LocalDOMWindow::parent() const
return frame()->domWindow(); return frame()->domWindow();
} }
DOMWindow* LocalDOMWindow::top() const LocalDOMWindow* LocalDOMWindow::top() const
{ {
if (!frame()) if (!frame())
return 0; return 0;
......
...@@ -124,10 +124,12 @@ public: ...@@ -124,10 +124,12 @@ public:
void setStatus(const String&) override; void setStatus(const String&) override;
String defaultStatus() const override; String defaultStatus() const override;
void setDefaultStatus(const String&) override; void setDefaultStatus(const String&) override;
DOMWindow* self() const override; LocalDOMWindow* self() const override;
DOMWindow* opener() const override; LocalDOMWindow* window() const { return self(); }
DOMWindow* parent() const override; LocalDOMWindow* frames() const { return self(); }
DOMWindow* top() const override; LocalDOMWindow* opener() const override;
LocalDOMWindow* parent() const override;
LocalDOMWindow* top() const override;
Document* document() const override; Document* document() const override;
StyleMedia* styleMedia() const override; StyleMedia* styleMedia() const override;
double devicePixelRatio() const override; double devicePixelRatio() const override;
......
...@@ -122,7 +122,7 @@ ...@@ -122,7 +122,7 @@
// Self referential attributes // Self referential attributes
[Replaceable, DoNotCheckSecurity] readonly attribute Window self; [Replaceable, DoNotCheckSecurity] readonly attribute Window self;
[DoNotCheckSecurity, Unforgeable] readonly attribute Window window; [DoNotCheckSecurity, Unforgeable] readonly attribute Window window;
[Replaceable, DoNotCheckSecurity] readonly attribute Window frames; [Replaceable, DoNotCheckSecurity] readonly attribute Window frames;
[DoNotCheckSecurity, Custom=Setter] attribute Window opener; [DoNotCheckSecurity, Custom=Setter] attribute Window opener;
[Replaceable, DoNotCheckSecurity] readonly attribute Window parent; [Replaceable, DoNotCheckSecurity] readonly attribute Window parent;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment