Commit 6f399844 authored by weinig's avatar weinig

Reviewed by Geoff.

        Patch for http://bugs.webkit.org/show_bug.cgi?id=14211
        Move the BarInfo object out of the JS bindings

        * DerivedSources.make:
        * WebCore.pro:
        * WebCore.vcproj/WebCore.vcproj:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/kjs_window.cpp:
        (KJS::WindowPrivate::WindowPrivate):
        (KJS::Window::mark):
        (KJS::Window::getValueProperty):
        (KJS::Window::clearHelperObjectProperties):
        (KJS::Window::disconnectFrame):
        * bindings/js/kjs_window.h:
        (KJS::Window::):
        * page/BarInfo.cpp: Added.
        (WebCore::BarInfo::BarInfo):
        (WebCore::BarInfo::disconnectFrame):
        (WebCore::BarInfo::visible):
        * page/BarInfo.h: Added.
        (WebCore::BarInfo::):
        * page/BarInfo.idl: Added.
        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::~DOMWindow):
        (WebCore::DOMWindow::disconnectFrame):
        (WebCore::DOMWindow::locationbar):
        (WebCore::DOMWindow::menubar):
        (WebCore::DOMWindow::personalbar):
        (WebCore::DOMWindow::scrollbars):
        (WebCore::DOMWindow::statusbar):
        (WebCore::DOMWindow::toolbar):
        * page/DOMWindow.h:
        * page/DOMWindow.idl:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@23573 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 58815091
2007-06-18 Sam Weinig <sam@webkit.org>
Reviewed by Geoff.
Patch for http://bugs.webkit.org/show_bug.cgi?id=14211
Move the BarInfo object out of the JS bindings
* DerivedSources.make:
* WebCore.pro:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/kjs_window.cpp:
(KJS::WindowPrivate::WindowPrivate):
(KJS::Window::mark):
(KJS::Window::getValueProperty):
(KJS::Window::clearHelperObjectProperties):
(KJS::Window::disconnectFrame):
* bindings/js/kjs_window.h:
(KJS::Window::):
* page/BarInfo.cpp: Added.
(WebCore::BarInfo::BarInfo):
(WebCore::BarInfo::disconnectFrame):
(WebCore::BarInfo::visible):
* page/BarInfo.h: Added.
(WebCore::BarInfo::):
* page/BarInfo.idl: Added.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::~DOMWindow):
(WebCore::DOMWindow::disconnectFrame):
(WebCore::DOMWindow::locationbar):
(WebCore::DOMWindow::menubar):
(WebCore::DOMWindow::personalbar):
(WebCore::DOMWindow::scrollbars):
(WebCore::DOMWindow::statusbar):
(WebCore::DOMWindow::toolbar):
* page/DOMWindow.h:
* page/DOMWindow.idl:
2007-06-18 Sam Weinig <sam@webkit.org>
Reviewed by Darin.
......@@ -299,6 +299,7 @@ all : \
DocTypeStrings.cpp \
HTMLEntityNames.c \
JSAttr.h \
JSBarInfo.h \
JSCDATASection.h \
JSCSSCharsetRule.h \
JSCSSFontFaceRule.h \
......
......@@ -256,6 +256,7 @@ IDL_BINDINGS += \
html/HTMLTextAreaElement.idl \
html/HTMLTitleElement.idl \
html/HTMLUListElement.idl \
page/BarInfo.idl \
page/DOMWindow.idl \
xml/DOMParser.idl \
xml/XMLSerializer.idl
......@@ -557,6 +558,7 @@ SOURCES += \
loader/SubresourceLoader.cpp \
loader/TextDocument.cpp \
loader/TextResourceDecoder.cpp \
page/BarInfo.cpp \
page/Chrome.cpp \
page/ContextMenuController.cpp \
page/DOMWindow.cpp \
......
......@@ -346,6 +346,14 @@
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSAttr.h"
>
</File>
<File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSBarInfo.cpp"
>
</File>
<File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSBarInfo.h"
>
</File>
<File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSCanvasGradient.cpp"
>
......@@ -2337,6 +2345,14 @@
<Filter
Name="page"
>
<File
RelativePath="..\page\BarInfo.cpp"
>
</File>
<File
RelativePath="..\page\BarInfo.h"
>
</File>
<File
RelativePath="..\page\Chrome.cpp"
>
......
......@@ -2734,6 +2734,11 @@
BC06EDE40BFD6D0D00856E9D /* JSHTMLTableCellElement.h in Headers */ = {isa = PBXBuildFile; fileRef = BC06EDE20BFD6D0D00856E9D /* JSHTMLTableCellElement.h */; };
BC06EE040BFD71AA00856E9D /* JSHTMLTableElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC06EE020BFD71AA00856E9D /* JSHTMLTableElement.cpp */; };
BC06EE050BFD71AA00856E9D /* JSHTMLTableElement.h in Headers */ = {isa = PBXBuildFile; fileRef = BC06EE030BFD71AA00856E9D /* JSHTMLTableElement.h */; };
BC124EE70C2641CD009E2349 /* BarInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC124EE40C2641CD009E2349 /* BarInfo.cpp */; };
BC124EE80C2641CD009E2349 /* BarInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = BC124EE50C2641CD009E2349 /* BarInfo.h */; };
BC124EE90C2641CD009E2349 /* BarInfo.idl in Resources */ = {isa = PBXBuildFile; fileRef = BC124EE60C2641CD009E2349 /* BarInfo.idl */; };
BC124EFF0C26447A009E2349 /* JSBarInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC124EFD0C26447A009E2349 /* JSBarInfo.cpp */; };
BC124F000C26447A009E2349 /* JSBarInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = BC124EFE0C26447A009E2349 /* JSBarInfo.h */; };
BC17F9660B64EBB8004A65CB /* JSHTMLSelectElementCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC17F9650B64EBB8004A65CB /* JSHTMLSelectElementCustom.cpp */; };
BC18C5D00B2A886F0018461D /* TextBreakIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = BC18C5CE0B2A886F0018461D /* TextBreakIterator.h */; };
BC18C5D10B2A886F0018461D /* TextBreakIteratorICU.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC18C5CF0B2A886F0018461D /* TextBreakIteratorICU.cpp */; };
......@@ -6027,6 +6032,11 @@
BC06F24A06D18A7E004A6FA3 /* XSLStyleSheet.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = XSLStyleSheet.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
BC06F24B06D18A7E004A6FA3 /* XSLTProcessor.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XSLTProcessor.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
BC06F24C06D18A7E004A6FA3 /* XSLTProcessor.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = XSLTProcessor.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
BC124EE40C2641CD009E2349 /* BarInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = BarInfo.cpp; sourceTree = "<group>"; };
BC124EE50C2641CD009E2349 /* BarInfo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = BarInfo.h; sourceTree = "<group>"; };
BC124EE60C2641CD009E2349 /* BarInfo.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = BarInfo.idl; sourceTree = "<group>"; };
BC124EFD0C26447A009E2349 /* JSBarInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSBarInfo.cpp; sourceTree = "<group>"; };
BC124EFE0C26447A009E2349 /* JSBarInfo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSBarInfo.h; sourceTree = "<group>"; };
BC17F9650B64EBB8004A65CB /* JSHTMLSelectElementCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLSelectElementCustom.cpp; sourceTree = "<group>"; };
BC18C5CE0B2A886F0018461D /* TextBreakIterator.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = TextBreakIterator.h; sourceTree = "<group>"; };
BC18C5CF0B2A886F0018461D /* TextBreakIteratorICU.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = TextBreakIteratorICU.cpp; sourceTree = "<group>"; };
......@@ -6470,6 +6480,8 @@
14DFB33F0A7DF7630018F769 /* Derived Sources */ = {
isa = PBXGroup;
children = (
BC124EFD0C26447A009E2349 /* JSBarInfo.cpp */,
BC124EFE0C26447A009E2349 /* JSBarInfo.h */,
65DF31D809D1C122000BE325 /* JSAttr.cpp */,
65DF31D909D1C123000BE325 /* JSAttr.h */,
65DF323309D1DE65000BE325 /* JSCanvasGradient.cpp */,
......@@ -7198,19 +7210,26 @@
children = (
93C09A820B064F05005ABD4D /* mac */,
8538F0000AD71770006A81D1 /* AbstractView.idl */,
BC124EE40C2641CD009E2349 /* BarInfo.cpp */,
BC124EE50C2641CD009E2349 /* BarInfo.h */,
BC124EE60C2641CD009E2349 /* BarInfo.idl */,
14D8238A0AF92DF60004F057 /* Chrome.cpp */,
14D823500AF92A790004F057 /* Chrome.h */,
14D824060AF93AEB0004F057 /* ChromeClient.h */,
065AD4F20B0C2EDA005A2B1D /* ContextMenuClient.h */,
065AD4F30B0C2EDA005A2B1D /* ContextMenuController.cpp */,
065AD4F40B0C2EDA005A2B1D /* ContextMenuController.h */,
14D824060AF93AEB0004F057 /* ChromeClient.h */,
1403B99609EB13AF00797C7F /* DOMWindow.cpp */,
1403B99509EB13AF00797C7F /* DOMWindow.h */,
1403B90C09EB124500797C7F /* DOMWindow.idl */,
93C09A520B064DB3005ABD4D /* EventHandler.h */,
A718760D0B2A120100A16ECE /* DragActions.h */,
A7CA59620B27C1F200FA021D /* DragClient.h */,
A7CA595C0B27BD9E00FA021D /* DragController.cpp */,
A7CA595B0B27BD9E00FA021D /* DragController.h */,
93C09A800B064F00005ABD4D /* EventHandler.cpp */,
14993BE40B2F2B1C0050497F /* FocusController.h */,
93C09A520B064DB3005ABD4D /* EventHandler.h */,
14993BE30B2F2B1C0050497F /* FocusController.cpp */,
14993BE40B2F2B1C0050497F /* FocusController.h */,
062287830B4DB322000C34DF /* FocusDirection.h */,
65BF02290974816300C43196 /* Frame.cpp */,
65BF022A0974816300C43196 /* Frame.h */,
......@@ -7225,12 +7244,8 @@
65FEA86809833ADE00BED4AB /* Page.cpp */,
65A21467097A329100B9050A /* Page.h */,
65D1C1C909932B22000CB324 /* Plugin.h */,
F587863A02DE3A1401EA4122 /* Settings.h */,
A7CA595B0B27BD9E00FA021D /* DragController.h */,
A7CA595C0B27BD9E00FA021D /* DragController.cpp */,
A7CA59620B27C1F200FA021D /* DragClient.h */,
A718760D0B2A120100A16ECE /* DragActions.h */,
14C9A5E90B3D105F005A0232 /* Settings.cpp */,
F587863A02DE3A1401EA4122 /* Settings.h */,
);
path = page;
sourceTree = "<group>";
......@@ -11559,6 +11574,8 @@
BC6DC7A10C1A4BFA004E2017 /* JSHTMLAllCollection.h in Headers */,
BCFE2F120C1B58380020235F /* JSRect.h in Headers */,
BC4368E80C226E32005EFB5F /* Rect.h in Headers */,
BC124EE80C2641CD009E2349 /* BarInfo.h in Headers */,
BC124F000C26447A009E2349 /* JSBarInfo.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -11672,6 +11689,7 @@
BC491B4F0C023E2D009D6316 /* HTMLMarqueeElement.idl in Resources */,
1AB1AE7A0C051FDE00139F4F /* zoomInCursor.png in Resources */,
1AB1AE7B0C051FDE00139F4F /* zoomOutCursor.png in Resources */,
BC124EE90C2641CD009E2349 /* BarInfo.idl in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -12983,6 +13001,8 @@
BCCBAD3B0C18BFF800CE890F /* JSHTMLCollectionCustom.cpp in Sources */,
BCCBAD400C18C14200CE890F /* JSHTMLCollection.cpp in Sources */,
BCFE2F110C1B58370020235F /* JSRect.cpp in Sources */,
BC124EE70C2641CD009E2349 /* BarInfo.cpp in Sources */,
BC124EFF0C26447A009E2349 /* JSBarInfo.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -86,12 +86,6 @@ struct WindowPrivate {
, history(0)
, loc(0)
, m_selection(0)
, m_locationbar(0)
, m_menubar(0)
, m_personalbar(0)
, m_scrollbars(0)
, m_statusbar(0)
, m_toolbar(0)
, m_evt(0)
, m_returnValueSlot(0)
{
......@@ -105,12 +99,6 @@ struct WindowPrivate {
mutable History* history;
mutable Location* loc;
mutable Selection* m_selection;
mutable BarInfo* m_locationbar;
mutable BarInfo* m_menubar;
mutable BarInfo* m_personalbar;
mutable BarInfo* m_scrollbars;
mutable BarInfo* m_statusbar;
mutable BarInfo* m_toolbar;
WebCore::Event *m_evt;
JSValue **m_returnValueSlot;
typedef HashMap<int, DOMWindowTimer*> TimeoutsMap;
......@@ -255,11 +243,9 @@ const ClassInfo Window::info = { "Window", 0, &WindowTable, 0 };
innerWidth Window::InnerWidth DontDelete|ReadOnly
length Window::Length DontDelete|ReadOnly
location Window::Location_ DontDelete
locationbar Window::Locationbar DontDelete
name Window::Name DontDelete
navigator Window::Navigator_ DontDelete|ReadOnly
clientInformation Window::ClientInformation DontDelete|ReadOnly
menubar Window::Menubar DontDelete|ReadOnly
offscreenBuffering Window::OffscreenBuffering DontDelete|ReadOnly
opener Window::Opener DontDelete|ReadOnly
outerHeight Window::OuterHeight DontDelete|ReadOnly
......@@ -267,14 +253,10 @@ const ClassInfo Window::info = { "Window", 0, &WindowTable, 0 };
pageXOffset Window::PageXOffset DontDelete|ReadOnly
pageYOffset Window::PageYOffset DontDelete|ReadOnly
parent Window::Parent DontDelete|ReadOnly
personalbar Window::Personalbar DontDelete|ReadOnly
screenX Window::ScreenX DontDelete|ReadOnly
screenY Window::ScreenY DontDelete|ReadOnly
screenLeft Window::ScreenLeft DontDelete|ReadOnly
screenTop Window::ScreenTop DontDelete|ReadOnly
scrollbars Window::Scrollbars DontDelete|ReadOnly
statusbar Window::Statusbar DontDelete|ReadOnly
toolbar Window::Toolbar DontDelete|ReadOnly
scroll Window::Scroll DontDelete|Function 2
scrollBy Window::ScrollBy DontDelete|Function 2
scrollTo Window::ScrollTo DontDelete|Function 2
......@@ -428,48 +410,6 @@ bool Window::find(const String& string, bool caseSensitive, bool backwards, bool
return m_frame->findString(string, !backwards, caseSensitive, wrap, false);
}
BarInfo *Window::locationbar(ExecState *exec) const
{
if (!d->m_locationbar)
d->m_locationbar = new BarInfo(exec, m_frame, BarInfo::Locationbar);
return d->m_locationbar;
}
BarInfo *Window::menubar(ExecState *exec) const
{
if (!d->m_menubar)
d->m_menubar = new BarInfo(exec, m_frame, BarInfo::Menubar);
return d->m_menubar;
}
BarInfo *Window::personalbar(ExecState *exec) const
{
if (!d->m_personalbar)
d->m_personalbar = new BarInfo(exec, m_frame, BarInfo::Personalbar);
return d->m_personalbar;
}
BarInfo *Window::statusbar(ExecState *exec) const
{
if (!d->m_statusbar)
d->m_statusbar = new BarInfo(exec, m_frame, BarInfo::Statusbar);
return d->m_statusbar;
}
BarInfo *Window::toolbar(ExecState *exec) const
{
if (!d->m_toolbar)
d->m_toolbar = new BarInfo(exec, m_frame, BarInfo::Toolbar);
return d->m_toolbar;
}
BarInfo *Window::scrollbars(ExecState *exec) const
{
if (!d->m_scrollbars)
d->m_scrollbars = new BarInfo(exec, m_frame, BarInfo::Scrollbars);
return d->m_scrollbars;
}
// reference our special objects during garbage collection
void Window::mark()
{
......@@ -482,18 +422,6 @@ void Window::mark()
d->loc->mark();
if (d->m_selection && !d->m_selection->marked())
d->m_selection->mark();
if (d->m_locationbar && !d->m_locationbar->marked())
d->m_locationbar->mark();
if (d->m_menubar && !d->m_menubar->marked())
d->m_menubar->mark();
if (d->m_personalbar && !d->m_personalbar->marked())
d->m_personalbar->mark();
if (d->m_scrollbars && !d->m_scrollbars->marked())
d->m_scrollbars->mark();
if (d->m_statusbar && !d->m_statusbar->marked())
d->m_statusbar->mark();
if (d->m_toolbar && !d->m_toolbar->marked())
d->m_toolbar->mark();
}
static bool allowPopUp(ExecState *exec, Window *window)
......@@ -751,10 +679,6 @@ JSValue *Window::getValueProperty(ExecState *exec, int token) const
const_cast<Window *>(this)->putDirect("clientInformation", n, DontDelete|ReadOnly);
return n;
}
case Locationbar:
return locationbar(exec);
case Menubar:
return menubar(exec);
case OffscreenBuffering:
return jsBoolean(true);
case Opener:
......@@ -777,8 +701,6 @@ JSValue *Window::getValueProperty(ExecState *exec, int token) const
return jsNumber(m_frame->view()->contentsY());
case Parent:
return retrieve(m_frame->tree()->parent() ? m_frame->tree()->parent() : m_frame);
case Personalbar:
return personalbar(exec);
case ScreenLeft:
case ScreenX:
return jsNumber(m_frame->page()->chrome()->windowRect().x());
......@@ -795,12 +717,6 @@ JSValue *Window::getValueProperty(ExecState *exec, int token) const
return jsUndefined();
updateLayout();
return jsNumber(m_frame->view()->contentsY());
case Scrollbars:
return scrollbars(exec);
case Statusbar:
return statusbar(exec);
case Toolbar:
return toolbar(exec);
case Self:
case Window_:
return retrieve(m_frame);
......@@ -1374,12 +1290,6 @@ void Window::clearHelperObjectProperties()
d->history = 0;
d->loc = 0;
d->m_selection = 0;
d->m_locationbar = 0;
d->m_menubar = 0;
d->m_personalbar = 0;
d->m_scrollbars = 0;
d->m_statusbar = 0;
d->m_toolbar = 0;
d->m_evt = 0;
}
......@@ -2014,18 +1924,6 @@ void Window::disconnectFrame()
d->loc->m_frame = 0;
if (d->m_selection)
d->m_selection->m_frame = 0;
if (d->m_locationbar)
d->m_locationbar->m_frame = 0;
if (d->m_menubar)
d->m_menubar->m_frame = 0;
if (d->m_personalbar)
d->m_personalbar->m_frame = 0;
if (d->m_statusbar)
d->m_statusbar->m_frame = 0;
if (d->m_toolbar)
d->m_toolbar->m_frame = 0;
if (d->m_scrollbars)
d->m_scrollbars->m_frame = 0;
if (d->history)
d->history->disconnectFrame();
}
......@@ -2385,50 +2283,6 @@ JSValue *SelectionFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const
return jsUndefined();
}
////////////////////// BarInfo Object ////////////////////////
const ClassInfo BarInfo::info = { "BarInfo", 0, &BarInfoTable, 0 };
/*
@begin BarInfoTable 1
visible BarInfo::Visible DontDelete|ReadOnly
@end
*/
BarInfo::BarInfo(ExecState *exec, Frame *f, Type barType)
: m_frame(f)
, m_type(barType)
{
setPrototype(exec->lexicalInterpreter()->builtinObjectPrototype());
}
JSValue *BarInfo::getValueProperty(ExecState *exec, int token) const
{
ASSERT(token == Visible);
switch (m_type) {
case Locationbar:
return jsBoolean(m_frame->page()->chrome()->toolbarsVisible());
case Toolbar:
return jsBoolean(m_frame->page()->chrome()->toolbarsVisible());
case Personalbar:
return jsBoolean(m_frame->page()->chrome()->toolbarsVisible());
case Menubar:
return jsBoolean(m_frame->page()->chrome()->menubarVisible());
case Scrollbars:
return jsBoolean(m_frame->page()->chrome()->scrollbarsVisible());
case Statusbar:
return jsBoolean(m_frame->page()->chrome()->statusbarVisible());
default:
return jsBoolean(false);
}
}
bool BarInfo::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
{
if (!m_frame)
return false;
return getStaticValueSlot<BarInfo, JSObject>(exec, &BarInfoTable, this, propertyName, slot);
}
////////////////////// History Object ////////////////////////
const ClassInfo History::info = { "History", 0, &HistoryTable, 0 };
......
......@@ -132,12 +132,6 @@ namespace KJS {
Location *location() const;
Selection *selection() const;
bool find(const WebCore::String&, bool, bool, bool, bool, bool, bool) const;
BarInfo *locationbar(ExecState*) const;
BarInfo *menubar(ExecState*) const;
BarInfo *personalbar(ExecState*) const;
BarInfo *scrollbars(ExecState*) const;
BarInfo *statusbar(ExecState*) const;
BarInfo *toolbar(ExecState*) const;
// Finds a wrapper of a JS EventListener, returns 0 if no existing one.
JSEventListener* findJSEventListener(JSValue*, bool html = false);
......@@ -170,9 +164,9 @@ namespace KJS {
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
enum { AToB, BToA, Closed, Crypto, DefaultStatus, Status, DOMException, Frames, History_, Event_, InnerHeight,
InnerWidth, Length, Location_, Locationbar, Name, Navigator_, ClientInformation,
Menubar, OffscreenBuffering, Opener, OuterHeight, OuterWidth, PageXOffset, PageYOffset,
Parent, Personalbar, ScreenX, ScreenY, Scrollbars, Scroll, ScrollBy,
InnerWidth, Length, Location_, Name, Navigator_, ClientInformation,
OffscreenBuffering, Opener, OuterHeight, OuterWidth, PageXOffset, PageYOffset,
Parent, ScreenX, ScreenY, Scroll, ScrollBy,
ScreenTop, ScreenLeft,
ScrollTo, ScrollX, ScrollY, MoveBy, MoveTo, ResizeBy, ResizeTo, Self, Window_, Top, Screen_,
Image, Option, Alert, Confirm, Prompt, Open, Print, SetTimeout, ClearTimeout,
......@@ -183,7 +177,7 @@ namespace KJS {
Onfocus, Onkeydown, Onkeypress, Onkeyup, Onload, Onmousedown, Onmousemove,
Onmouseout, Onmouseover, Onmouseup, OnWindowMouseWheel, Onreset, Onresize, Onscroll, Onsearch,
Onselect, Onsubmit, Onunload, Onbeforeunload,
Statusbar, Toolbar, FrameElement, ShowModalDialog, Find, Stop };
FrameElement, ShowModalDialog, Find, Stop };
private:
JSValue* getListener(ExecState*, const WebCore::AtomicString& eventType) const;
......@@ -255,22 +249,6 @@ namespace KJS {
WebCore::Frame* m_frame;
};
class BarInfo : public DOMObject {
public:
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
JSValue *getValueProperty(ExecState *exec, int token) const;
enum { Visible };
enum Type { Locationbar, Menubar, Personalbar, Scrollbars, Statusbar, Toolbar };
WebCore::Frame* frame() const { return m_frame; }
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
private:
friend class Window;
BarInfo(ExecState*, WebCore::Frame*, Type);
WebCore::Frame* m_frame;
Type m_type;
};
} // namespace
namespace WebCore {
......
/*
* Copyright (C) 2007 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "BarInfo.h"
#include "Chrome.h"
#include "Frame.h"
#include "Page.h"
namespace WebCore {
BarInfo::BarInfo(Frame* frame, Type type)
: m_frame(frame)
, m_type(type)
{
}
void BarInfo::disconnectFrame()
{
m_frame = 0;
}
bool BarInfo::visible() const
{
if (!m_frame)
return false;
switch (m_type) {
case Locationbar:
return m_frame->page()->chrome()->toolbarsVisible();
case Toolbar:
return m_frame->page()->chrome()->toolbarsVisible();
case Personalbar:
return m_frame->page()->chrome()->toolbarsVisible();
case Menubar:
return m_frame->page()->chrome()->menubarVisible();
case Scrollbars:
return m_frame->page()->chrome()->scrollbarsVisible();
case Statusbar:
return m_frame->page()->chrome()->statusbarVisible();
default:
return false;
}
}
} // namespace WebCore
/*
* Copyright (C) 2007 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef BarInfo_h
#define BarInfo_h
#include "Shared.h"
namespace WebCore {
class Frame;
class BarInfo : public Shared<BarInfo> {
public:
enum Type { Locationbar, Menubar, Personalbar, Scrollbars, Statusbar, Toolbar };
BarInfo(Frame*, Type);
void disconnectFrame();
bool visible() const;
private:
Frame* m_frame;
Type m_type;
};
} // namespace WebCore
#endif // BarInfo_h
/*
* Copyright (C) 2007 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/