From ef7c676881f9c9fc16a084d3991d238380feb678 Mon Sep 17 00:00:00 2001 From: darin Date: Fri, 22 Apr 2005 16:30:28 +0000 Subject: [PATCH] Reviewed by John. - fixed Google Suggest no longer works due to lack of "frameElement" * khtml/ecma/kjs_window.h: Added FrameElement. * khtml/ecma/kjs_window.cpp: (Window::get): Added "frameElement". * khtml/ecma/kjs_window.lut.h: Regenerated. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@9038 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- WebCore/ChangeLog-2005-08-23 | 10 ++++++++++ WebCore/khtml/ecma/kjs_window.cpp | 11 +++++++++++ WebCore/khtml/ecma/kjs_window.h | 2 +- WebCore/khtml/ecma/kjs_window.lut.h | 2 +- 4 files changed, 23 insertions(+), 2 deletions(-) diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23 index ebefa8317bb6..fef2a0ec948c 100644 --- a/WebCore/ChangeLog-2005-08-23 +++ b/WebCore/ChangeLog-2005-08-23 @@ -1,3 +1,13 @@ +2005-04-22 Darin Adler + + Reviewed by John. + + - fixed Google Suggest no longer works due to lack of "frameElement" + + * khtml/ecma/kjs_window.h: Added FrameElement. + * khtml/ecma/kjs_window.cpp: (Window::get): Added "frameElement". + * khtml/ecma/kjs_window.lut.h: Regenerated. + 2005-04-22 Darin Adler Reviewed by John. diff --git a/WebCore/khtml/ecma/kjs_window.cpp b/WebCore/khtml/ecma/kjs_window.cpp index 1b6380ad99f8..06879cb70146 100644 --- a/WebCore/khtml/ecma/kjs_window.cpp +++ b/WebCore/khtml/ecma/kjs_window.cpp @@ -66,6 +66,7 @@ using DOM::DocumentImpl; using DOM::DOMString; +using DOM::ElementImpl; using DOM::Node; using DOM::Position; using khtml::TypingCommand; @@ -291,6 +292,7 @@ const ClassInfo Window::info = { "Window", 0, &WindowTable, 0 }; onselect Window::Onselect DontDelete onsubmit Window::Onsubmit DontDelete onunload Window::Onunload DontDelete + frameElement Window::FrameElement DontDelete|ReadOnly @end */ IMPLEMENT_PROTOFUNC(WindowFunc) @@ -824,6 +826,15 @@ Value Window::get(ExecState *exec, const Identifier &p) const return getListener(exec,DOM::EventImpl::UNLOAD_EVENT); else return Undefined(); + case FrameElement: { + DocumentImpl *document = m_part->xmlDocImpl(); + if (!document) + return Undefined(); + ElementImpl *frameElement = document->ownerElement(); + if (!frameElement) + return Undefined(); + return Value(frameElement); + } } } diff --git a/WebCore/khtml/ecma/kjs_window.h b/WebCore/khtml/ecma/kjs_window.h index 848ce57c5d59..07d0adbbfa6d 100644 --- a/WebCore/khtml/ecma/kjs_window.h +++ b/WebCore/khtml/ecma/kjs_window.h @@ -142,7 +142,7 @@ namespace KJS { Onfocus, Onkeydown, Onkeypress, Onkeyup, Onload, Onmousedown, Onmousemove, Onmouseout, Onmouseover, Onmouseup, Onmove, Onreset, Onresize, Onscroll, Onsearch, Onselect, Onsubmit, Onunload, - Statusbar, Toolbar }; + Statusbar, Toolbar, FrameElement }; protected: Value getListener(ExecState *exec, int eventId) const; void setListener(ExecState *exec, int eventId, Value func); diff --git a/WebCore/khtml/ecma/kjs_window.lut.h b/WebCore/khtml/ecma/kjs_window.lut.h index 053bf7c10045..5db7ae8907da 100644 --- a/WebCore/khtml/ecma/kjs_window.lut.h +++ b/WebCore/khtml/ecma/kjs_window.lut.h @@ -76,7 +76,7 @@ const struct HashEntry WindowTableEntries[] = { { "innerWidth", Window::InnerWidth, DontDelete|ReadOnly, 0, &WindowTableEntries[119] }, { "defaultstatus", Window::DefaultStatus, DontDelete, 0, 0 }, { "name", Window::Name, DontDelete, 0, 0 }, - { 0, 0, 0, 0, 0 }, + { "frameElement", Window::FrameElement, DontDelete|ReadOnly, 0, 0 }, { "offscreenBuffering", Window::OffscreenBuffering, DontDelete|ReadOnly, 0, 0 }, { 0, 0, 0, 0, 0 }, { "onscroll", Window::Onscroll, DontDelete, 0, 0 }, -- 2.36.0