Commit e6a10e86 authored by bdash's avatar bdash

2007-10-20 Rodney Dawes <dobey@wayofthemonkey.com>

        Reviewd by Darin.

        http://bugs.webkit.org/show_bug.cgi?id=15563
        Fix conflict with X11 Window type in WebCore

        * WebCore/bindings/js/JSDocumentCustom.cpp:
        * WebCore/bindings/js/JSHTMLDocumentCustom.cpp:
        * WebCore/bindings/js/JSHTMLFrameSetElementCustom.cpp:
        * WebCore/bindings/js/kjs_dom.cpp:
        * WebCore/bindings/js/kjs_events.cpp:
        * WebCore/bindings/js/kjs_proxy.cpp:
        * WebCore/history/CachedPage.cpp:
        * WebCore/page/Chrome.cpp:
        * WebCore/page/Frame.cpp:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@26816 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 819a76ea
2007-10-20 Rodney Dawes <dobey@wayofthemonkey.com>
Reviewd by Darin.
http://bugs.webkit.org/show_bug.cgi?id=15563
Fix conflict with X11 Window type in WebCore
* WebCore/bindings/js/JSDocumentCustom.cpp:
* WebCore/bindings/js/JSHTMLDocumentCustom.cpp:
* WebCore/bindings/js/JSHTMLFrameSetElementCustom.cpp:
* WebCore/bindings/js/kjs_dom.cpp:
* WebCore/bindings/js/kjs_events.cpp:
* WebCore/bindings/js/kjs_proxy.cpp:
* WebCore/history/CachedPage.cpp:
* WebCore/page/Chrome.cpp:
* WebCore/page/Frame.cpp:
2007-10-20 Simon Hausmann <hausmann@kde.org>
Build fix, not reviewed.
......
......@@ -49,7 +49,7 @@ JSValue* JSDocument::location(ExecState* exec) const
if (!frame)
return jsNull();
Window* win = Window::retrieveWindow(frame);
KJS::Window* win = KJS::Window::retrieveWindow(frame);
ASSERT(win);
return win->location();
}
......@@ -94,7 +94,7 @@ JSValue* toJS(ExecState* exec, Document* doc)
// Make sure the document is kept around by the window object, and works right with the
// back/forward cache.
if (doc->frame())
Window::retrieveWindow(doc->frame())->putDirect("document", ret, DontDelete|ReadOnly);
KJS::Window::retrieveWindow(doc->frame())->putDirect("document", ret, DontDelete|ReadOnly);
else {
size_t nodeCount = 0;
for (Node* n = doc; n; n = n->traverseNextNode())
......
......@@ -64,7 +64,7 @@ JSValue* JSHTMLDocument::nameGetter(ExecState* exec, JSObject* originalObject, c
Frame* frame;
if (node->hasTagName(iframeTag) && (frame = static_cast<HTMLIFrameElement*>(node)->contentFrame()))
return Window::retrieve(frame);
return KJS::Window::retrieve(frame);
return toJS(exec, node);
}
......@@ -97,7 +97,7 @@ JSValue* JSHTMLDocument::open(ExecState* exec, const List& args)
if (args.size() > 2) {
Frame* frame = static_cast<HTMLDocument*>(impl())->frame();
if (frame) {
Window* window = Window::retrieveWindow(frame);
KJS::Window* window = KJS::Window::retrieveWindow(frame);
if (window) {
JSObject* functionObject = window->get(exec, "open")->getObject();
if (!functionObject || !functionObject->implementsCall())
......
......@@ -51,7 +51,7 @@ JSValue* JSHTMLFrameSetElement::nameGetter(ExecState* exec, JSObject* originalOb
Node* frame = element->children()->namedItem(propertyName);
if (Document* doc = static_cast<HTMLFrameElement*>(frame)->contentDocument()) {
if (Window* window = Window::retrieveWindow(doc->frame()))
if (KJS::Window* window = KJS::Window::retrieveWindow(doc->frame()))
return window;
}
......
......@@ -62,7 +62,7 @@ bool checkNodeSecurity(ExecState* exec, Node* n)
return false;
// Check to see if the currently executing interpreter is allowed to access the specified node
Window* win = Window::retrieveWindow(n->document()->frame());
KJS::Window* win = KJS::Window::retrieveWindow(n->document()->frame());
return win && win->isSafeScript(exec);
}
......
......@@ -66,7 +66,7 @@ void JSAbstractEventListener::handleEvent(Event* ele, bool isWindowEvent)
if (!listener)
return;
Window* window = windowObj();
KJS::Window* window = windowObj();
// Null check as clearWindowObj() can clear this and we still get called back by
// xmlhttprequest objects. See http://bugs.webkit.org/show_bug.cgi?id=13275
if (!window)
......@@ -97,7 +97,7 @@ void JSAbstractEventListener::handleEvent(Event* ele, bool isWindowEvent)
List args;
args.append(toJS(exec, event));
// Set the event we're handling in the Window object
// Set the event we're handling in the KJS::Window object
window->setCurrentEvent(event);
// ... and in the interpreter
interpreter->setCurrentEvent(event);
......@@ -152,13 +152,13 @@ bool JSAbstractEventListener::isHTMLEventListener() const
// -------------------------------------------------------------------------
JSUnprotectedEventListener::JSUnprotectedEventListener(JSObject* listener, Window* win, bool html)
JSUnprotectedEventListener::JSUnprotectedEventListener(JSObject* listener, KJS::Window* win, bool html)
: JSAbstractEventListener(html)
, m_listener(listener)
, m_win(win)
{
if (m_listener) {
Window::UnprotectedListenersMap& listeners = html
KJS::Window::UnprotectedListenersMap& listeners = html
? m_win->jsUnprotectedHTMLEventListeners() : m_win->jsUnprotectedEventListeners();
listeners.set(m_listener, this);
}
......@@ -167,7 +167,7 @@ JSUnprotectedEventListener::JSUnprotectedEventListener(JSObject* listener, Windo
JSUnprotectedEventListener::~JSUnprotectedEventListener()
{
if (m_listener && m_win) {
Window::UnprotectedListenersMap& listeners = isHTMLEventListener()
KJS::Window::UnprotectedListenersMap& listeners = isHTMLEventListener()
? m_win->jsUnprotectedHTMLEventListeners() : m_win->jsUnprotectedEventListeners();
listeners.remove(m_listener);
}
......@@ -178,7 +178,7 @@ JSObject* JSUnprotectedEventListener::listenerObj() const
return m_listener;
}
Window* JSUnprotectedEventListener::windowObj() const
KJS::Window* JSUnprotectedEventListener::windowObj() const
{
return m_win;
}
......@@ -214,13 +214,13 @@ static EventListenerCounter eventListenerCounter;
// -------------------------------------------------------------------------
JSEventListener::JSEventListener(JSObject* listener, Window* win, bool html)
JSEventListener::JSEventListener(JSObject* listener, KJS::Window* win, bool html)
: JSAbstractEventListener(html)
, m_listener(listener)
, m_win(win)
{
if (m_listener) {
Window::ListenersMap& listeners = html
KJS::Window::ListenersMap& listeners = html
? m_win->jsHTMLEventListeners() : m_win->jsEventListeners();
listeners.set(m_listener, this);
}
......@@ -232,7 +232,7 @@ JSEventListener::JSEventListener(JSObject* listener, Window* win, bool html)
JSEventListener::~JSEventListener()
{
if (m_listener && m_win) {
Window::ListenersMap& listeners = isHTMLEventListener()
KJS::Window::ListenersMap& listeners = isHTMLEventListener()
? m_win->jsHTMLEventListeners() : m_win->jsEventListeners();
listeners.remove(m_listener);
}
......@@ -246,7 +246,7 @@ JSObject* JSEventListener::listenerObj() const
return m_listener;
}
Window* JSEventListener::windowObj() const
KJS::Window* JSEventListener::windowObj() const
{
return m_win;
}
......@@ -258,7 +258,7 @@ void JSEventListener::clearWindowObj()
// -------------------------------------------------------------------------
JSLazyEventListener::JSLazyEventListener(const String& functionName, const String& code, Window* win, Node* node, int lineNumber)
JSLazyEventListener::JSLazyEventListener(const String& functionName, const String& code, KJS::Window* win, Node* node, int lineNumber)
: JSEventListener(0, win, true)
, m_functionName(functionName)
, m_code(code)
......@@ -334,7 +334,7 @@ void JSLazyEventListener::parseCode() const
m_code = String();
if (m_listener) {
Window::ListenersMap& listeners = isHTMLEventListener()
KJS::Window::ListenersMap& listeners = isHTMLEventListener()
? windowObj()->jsHTMLEventListeners() : windowObj()->jsEventListeners();
listeners.set(m_listener, const_cast<JSLazyEventListener*>(this));
}
......
......@@ -81,7 +81,7 @@ JSValue* KJSProxy::evaluate(const String& filename, int baseLine, const String&
// so we start the keep alive timer here.
m_frame->keepAlive();
JSValue* thisNode = Window::retrieve(m_frame);
JSValue* thisNode = KJS::Window::retrieve(m_frame);
m_script->startTimeoutCheck();
Completion comp = m_script->evaluate(filename, baseLine, reinterpret_cast<const KJS::UChar*>(str.characters()), str.length(), thisNode);
......@@ -103,10 +103,10 @@ JSValue* KJSProxy::evaluate(const String& filename, int baseLine, const String&
void KJSProxy::clear() {
// clear resources allocated by the interpreter, and make it ready to be used by another page
// We have to keep it, so that the Window object for the frame remains the same.
// We have to keep it, so that the KJS::Window object for the frame remains the same.
// (we used to delete and re-create it, previously)
if (m_script) {
Window *win = Window::retrieveWindow(m_frame);
KJS::Window *win = KJS::Window::retrieveWindow(m_frame);
if (win)
win->clear();
}
......@@ -116,7 +116,7 @@ EventListener* KJSProxy::createHTMLEventHandler(const String& functionName, cons
{
initScriptIfNeeded();
JSLock lock;
return new JSLazyEventListener(functionName, code, Window::retrieveWindow(m_frame), node, m_handlerLineno);
return new JSLazyEventListener(functionName, code, KJS::Window::retrieveWindow(m_frame), node, m_handlerLineno);
}
#if ENABLE(SVG)
......@@ -124,7 +124,7 @@ EventListener* KJSProxy::createSVGEventHandler(const String& functionName, const
{
initScriptIfNeeded();
JSLock lock;
return new JSSVGLazyEventListener(functionName, code, Window::retrieveWindow(m_frame), node, m_handlerLineno);
return new JSSVGLazyEventListener(functionName, code, KJS::Window::retrieveWindow(m_frame), node, m_handlerLineno);
}
#endif
......
......@@ -88,7 +88,7 @@ CachedPage::CachedPage(Page* page)
Frame* mainFrame = page->mainFrame();
KJSProxy* proxy = mainFrame->scriptProxy();
Window* window = Window::retrieveWindow(mainFrame);
KJS::Window* window = KJS::Window::retrieveWindow(mainFrame);
mainFrame->clearTimers();
......@@ -124,7 +124,7 @@ void CachedPage::restore(Page* page)
Frame* mainFrame = page->mainFrame();
KJSProxy* proxy = mainFrame->scriptProxy();
Window* window = Window::retrieveWindow(mainFrame);
KJS::Window* window = KJS::Window::retrieveWindow(mainFrame);
JSLock lock;
......
......@@ -369,7 +369,7 @@ PageGroupLoadDeferrer::PageGroupLoadDeferrer(Page* page, bool deferSelf)
#if !PLATFORM(MAC)
for (Frame* frame = otherPage->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
if (Window* window = Window::retrieveWindow(frame)) {
if (KJS::Window* window = KJS::Window::retrieveWindow(frame)) {
PausedTimeouts* timeouts = window->pauseTimeouts();
m_pausedTimeouts.append(make_pair(frame, timeouts));
......@@ -396,7 +396,7 @@ PageGroupLoadDeferrer::~PageGroupLoadDeferrer()
count = m_pausedTimeouts.size();
for (size_t i = 0; i < count; i++) {
Window* window = Window::retrieveWindow(m_pausedTimeouts[i].first.get());
KJS::Window* window = KJS::Window::retrieveWindow(m_pausedTimeouts[i].first.get());
if (window)
window->resumeTimeouts(m_pausedTimeouts[i].second);
delete m_pausedTimeouts[i].second;
......
......@@ -84,7 +84,6 @@
using namespace std;
using KJS::JSLock;
using KJS::Window;
namespace WebCore {
......@@ -194,7 +193,7 @@ Frame::~Frame()
#endif
if (d->m_jscript && d->m_jscript->haveInterpreter())
static_cast<Window*>(d->m_jscript->interpreter()->globalObject())->disconnectFrame();
static_cast<KJS::Window*>(d->m_jscript->interpreter()->globalObject())->disconnectFrame();
disconnectOwnerElement();
......@@ -1765,7 +1764,7 @@ void Frame::pageDestroyed()
// This will stop any JS timers
if (d->m_jscript && d->m_jscript->haveInterpreter())
if (Window* w = Window::retrieveWindow(this))
if (KJS::Window* w = KJS::Window::retrieveWindow(this))
w->disconnectFrame();
d->m_page = 0;
......
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