Commit 5630e07f authored by darin's avatar darin
Browse files

Reviewed by Maciej.

        - killed more KWQ, KWinModule and QVariant

        * ForwardingHeaders/kwinmodule.h: Removed.
        * ForwardingHeaders/qvariant.h: Removed.

        * kwq/KWQKWinModule.h: Removed.
        * kwq/KWQKWinModule.mm: Removed.
        * kwq/KWQVariant.cpp: Removed.
        * kwq/KWQVariant.h: Removed.

        * WebCore.vcproj/WebCore/WebCore.vcproj: Updated for removal.
        * WebCore.xcodeproj/project.pbxproj: Ditto.

        * khtml/ecma/kjs_binding.h:
        * khtml/ecma/kjs_binding.cpp: Remove QVariant stuff.

        * bridge/mac/WebCoreFrameBridge.mm:
        (-[WebCoreFrameBridge stringByEvaluatingJavaScriptFromString:forceUserGesture:]):
        * khtml/ecma/kjs_events.cpp: (KJS::JSAbstractEventListener::handleEvent):
        * khtml/ecma/kjs_proxy.h:
        * khtml/ecma/kjs_proxy.cpp: (WebCore::KJSProxyImpl::evaluate):
        * page/Frame.h:
        * page/Frame.cpp:
        (getString):
        (Frame::replaceContentsWithScriptResult):
        (Frame::executeScript):
        (Frame::executeScheduledScript):
        (Frame::changeLocation):
        (Frame::urlSelected):
        (Frame::submitForm):
        Changed to use JSValue instead of QVariant for result of executing JavaScript.

        * kwq/KWQObject.h: Removed a bunch of unneeded includes and forward declarations.

        * bridge/mac/MacFrame.mm:
        * khtml/ecma/kjs_window.h:
        * khtml/ecma/kjs_window.cpp:
        * khtml/html/html_inlineimpl.cpp:
        * khtml/html/htmltokenizer.cpp:
        * khtml/xml/DocumentImpl.cpp:
        * khtml/xml/NodeImpl.cpp:
        * khtml/xml/dom2_eventsimpl.cpp:
        * khtml/xml/xml_tokenizer.cpp:
        * kwq/KWQComboBox.mm:
        * kwq/KWQFileButton.mm:
        * kwq/KWQListBox.mm:
        * kwq/KWQObject.cpp:
        * kwq/KWQSlider.mm:
        * kwq/KWQTextArea.mm:
        * kwq/KWQTextField.mm:
        * loader/CachedImage.h:
        * page/FrameView.h:
        * page/FrameView.cpp:
        * rendering/render_form.cpp:
        Updated includes, since KWQObject.h now includes less.
        Also updated callers to executeScript since one overload was removed.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@12474 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 32e61d94
2006-01-29 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- killed more KWQ, KWinModule and QVariant
* ForwardingHeaders/kwinmodule.h: Removed.
* ForwardingHeaders/qvariant.h: Removed.
* kwq/KWQKWinModule.h: Removed.
* kwq/KWQKWinModule.mm: Removed.
* kwq/KWQVariant.cpp: Removed.
* kwq/KWQVariant.h: Removed.
* WebCore.vcproj/WebCore/WebCore.vcproj: Updated for removal.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* khtml/ecma/kjs_binding.h:
* khtml/ecma/kjs_binding.cpp: Remove QVariant stuff.
* bridge/mac/WebCoreFrameBridge.mm:
(-[WebCoreFrameBridge stringByEvaluatingJavaScriptFromString:forceUserGesture:]):
* khtml/ecma/kjs_events.cpp: (KJS::JSAbstractEventListener::handleEvent):
* khtml/ecma/kjs_proxy.h:
* khtml/ecma/kjs_proxy.cpp: (WebCore::KJSProxyImpl::evaluate):
* page/Frame.h:
* page/Frame.cpp:
(getString):
(Frame::replaceContentsWithScriptResult):
(Frame::executeScript):
(Frame::executeScheduledScript):
(Frame::changeLocation):
(Frame::urlSelected):
(Frame::submitForm):
Changed to use JSValue instead of QVariant for result of executing JavaScript.
* kwq/KWQObject.h: Removed a bunch of unneeded includes and forward declarations.
* bridge/mac/MacFrame.mm:
* khtml/ecma/kjs_window.h:
* khtml/ecma/kjs_window.cpp:
* khtml/html/html_inlineimpl.cpp:
* khtml/html/htmltokenizer.cpp:
* khtml/xml/DocumentImpl.cpp:
* khtml/xml/NodeImpl.cpp:
* khtml/xml/dom2_eventsimpl.cpp:
* khtml/xml/xml_tokenizer.cpp:
* kwq/KWQComboBox.mm:
* kwq/KWQFileButton.mm:
* kwq/KWQListBox.mm:
* kwq/KWQObject.cpp:
* kwq/KWQSlider.mm:
* kwq/KWQTextArea.mm:
* kwq/KWQTextField.mm:
* loader/CachedImage.h:
* page/FrameView.h:
* page/FrameView.cpp:
* rendering/render_form.cpp:
Updated includes, since KWQObject.h now includes less.
Also updated callers to executeScript since one overload was removed.
2006-01-29 Eric Seidel <eseidel@apple.com>
 
Reviewed by darin.
......
......@@ -534,14 +534,6 @@
RelativePath="..\..\kwq\KWQValueVector.h"
>
</File>
<File
RelativePath="..\..\kwq\KWQVariant.cpp"
>
</File>
<File
RelativePath="..\..\kwq\KWQVariant.h"
>
</File>
<File
RelativePath="..\..\kwq\KWQView.h"
>
......
......@@ -171,7 +171,6 @@
93F1996008245E59001E9ABC /* KWQKPartsHistoryProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = F587866B02DE3B3201EA4122 /* KWQKPartsHistoryProvider.h */; };
93F1996308245E59001E9ABC /* KWQKSSLKeyGen.h in Headers */ = {isa = PBXBuildFile; fileRef = F587866202DE3B1101EA4122 /* KWQKSSLKeyGen.h */; };
93F1996708245E59001E9ABC /* KWQKURL.h in Headers */ = {isa = PBXBuildFile; fileRef = F587860202DE382001EA4122 /* KWQKURL.h */; };
93F1996908245E59001E9ABC /* KWQKWinModule.h in Headers */ = {isa = PBXBuildFile; fileRef = F587860502DE382001EA4122 /* KWQKWinModule.h */; };
93F1996B08245E59001E9ABC /* KWQLineEdit.h in Headers */ = {isa = PBXBuildFile; fileRef = F587869802DE3B8601EA4122 /* KWQLineEdit.h */; };
93F1996C08245E59001E9ABC /* KWQListBox.h in Headers */ = {isa = PBXBuildFile; fileRef = F587851302DE375901EA4122 /* KWQListBox.h */; };
93F1996D08245E59001E9ABC /* KWQListImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = F587851502DE375901EA4122 /* KWQListImpl.h */; };
......@@ -203,7 +202,6 @@
93F1999C08245E59001E9ABC /* KWQTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = F58786C002DE3B8601EA4122 /* KWQTimer.h */; };
93F1999D08245E59001E9ABC /* KWQValueList.h in Headers */ = {isa = PBXBuildFile; fileRef = F58786C202DE3B8601EA4122 /* KWQValueList.h */; };
93F1999E08245E59001E9ABC /* KWQValueListImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = F587853B02DE375901EA4122 /* KWQValueListImpl.h */; };
93F1999F08245E59001E9ABC /* KWQVariant.h in Headers */ = {isa = PBXBuildFile; fileRef = F58786C302DE3B8601EA4122 /* KWQVariant.h */; };
93F199A108245E59001E9ABC /* KWQView.h in Headers */ = {isa = PBXBuildFile; fileRef = F587854002DE375901EA4122 /* KWQView.h */; };
93F199A208245E59001E9ABC /* KWQWidget.h in Headers */ = {isa = PBXBuildFile; fileRef = F58786C502DE3B8601EA4122 /* KWQWidget.h */; };
93F199A308245E59001E9ABC /* KWQWindowWidget.h in Headers */ = {isa = PBXBuildFile; fileRef = F587854302DE375901EA4122 /* KWQWindowWidget.h */; };
......@@ -297,7 +295,6 @@
93F19A3108245E59001E9ABC /* KWQLoader.mm in Sources */ = {isa = PBXBuildFile; fileRef = F587850302DE375901EA4122 /* KWQLoader.mm */; };
93F19A3208245E59001E9ABC /* KWQKLocale.mm in Sources */ = {isa = PBXBuildFile; fileRef = F587850402DE375901EA4122 /* KWQKLocale.mm */; };
93F19A3608245E59001E9ABC /* KWQKURL.mm in Sources */ = {isa = PBXBuildFile; fileRef = F587850E02DE375901EA4122 /* KWQKURL.mm */; };
93F19A3808245E59001E9ABC /* KWQKWinModule.mm in Sources */ = {isa = PBXBuildFile; fileRef = F587851002DE375901EA4122 /* KWQKWinModule.mm */; };
93F19A3A08245E59001E9ABC /* KWQLineEdit.mm in Sources */ = {isa = PBXBuildFile; fileRef = F587851202DE375901EA4122 /* KWQLineEdit.mm */; };
93F19A3B08245E59001E9ABC /* KWQListBox.mm in Sources */ = {isa = PBXBuildFile; fileRef = F587851402DE375901EA4122 /* KWQListBox.mm */; };
93F19A3C08245E59001E9ABC /* KWQListImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F587851602DE375901EA4122 /* KWQListImpl.cpp */; };
......@@ -316,7 +313,6 @@
93F19A5408245E59001E9ABC /* KWQTextStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F587853902DE375901EA4122 /* KWQTextStream.cpp */; };
93F19A5508245E59001E9ABC /* KWQTimer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F587853A02DE375901EA4122 /* KWQTimer.cpp */; };
93F19A5608245E59001E9ABC /* KWQValueListImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F587853C02DE375901EA4122 /* KWQValueListImpl.cpp */; };
93F19A5708245E59001E9ABC /* KWQVariant.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F587853D02DE375901EA4122 /* KWQVariant.cpp */; };
93F19A5908245E59001E9ABC /* KWQWidget.mm in Sources */ = {isa = PBXBuildFile; fileRef = F587854202DE375901EA4122 /* KWQWidget.mm */; };
93F19A5A08245E59001E9ABC /* KWQWindowWidget.mm in Sources */ = {isa = PBXBuildFile; fileRef = F587854402DE375901EA4122 /* KWQWindowWidget.mm */; };
93F19A5C08245E59001E9ABC /* WebCoreCookieAdapter.m in Sources */ = {isa = PBXBuildFile; fileRef = F587854A02DE375901EA4122 /* WebCoreCookieAdapter.m */; };
......@@ -2135,7 +2131,6 @@
F587850302DE375901EA4122 /* KWQLoader.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQLoader.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F587850402DE375901EA4122 /* KWQKLocale.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQKLocale.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F587850E02DE375901EA4122 /* KWQKURL.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQKURL.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F587851002DE375901EA4122 /* KWQKWinModule.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQKWinModule.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F587851202DE375901EA4122 /* KWQLineEdit.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQLineEdit.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F587851302DE375901EA4122 /* KWQListBox.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQListBox.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F587851402DE375901EA4122 /* KWQListBox.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQListBox.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
......@@ -2160,7 +2155,6 @@
F587853A02DE375901EA4122 /* KWQTimer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KWQTimer.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F587853B02DE375901EA4122 /* KWQValueListImpl.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQValueListImpl.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F587853C02DE375901EA4122 /* KWQValueListImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KWQValueListImpl.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F587853D02DE375901EA4122 /* KWQVariant.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KWQVariant.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F587854002DE375901EA4122 /* KWQView.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQView.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F587854202DE375901EA4122 /* KWQWidget.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQWidget.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F587854302DE375901EA4122 /* KWQWindowWidget.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQWindowWidget.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
......@@ -2181,7 +2175,6 @@
F58785F402DE382001EA4122 /* KWQKDebug.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQKDebug.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F58785FA02DE382001EA4122 /* KWQKLocale.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQKLocale.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F587860202DE382001EA4122 /* KWQKURL.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQKURL.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F587860502DE382001EA4122 /* KWQKWinModule.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQKWinModule.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F587862002DE398401EA4122 /* KWQKCursor.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQKCursor.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F587863402DE3A1401EA4122 /* KWQKHTMLFactory.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQKHTMLFactory.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F587863A02DE3A1401EA4122 /* KWQKHTMLSettings.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQKHTMLSettings.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
......@@ -2222,7 +2215,6 @@
F58786BF02DE3B8601EA4122 /* KWQTextStream.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQTextStream.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F58786C002DE3B8601EA4122 /* KWQTimer.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQTimer.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F58786C202DE3B8601EA4122 /* KWQValueList.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQValueList.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F58786C302DE3B8601EA4122 /* KWQVariant.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQVariant.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F58786C502DE3B8601EA4122 /* KWQWidget.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQWidget.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F58EF58E02DFDFB7018635CA /* WebCore.exp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.exports; name = WebCore.exp; path = ../WebCore.exp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F5A1B04902DE8ABA018635CA /* linkCursor.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = linkCursor.tiff; path = Resources/linkCursor.tiff; sourceTree = "<group>"; };
......@@ -3691,8 +3683,6 @@
F587850402DE375901EA4122 /* KWQKLocale.mm */,
F587860202DE382001EA4122 /* KWQKURL.h */,
F587850E02DE375901EA4122 /* KWQKURL.mm */,
F587860502DE382001EA4122 /* KWQKWinModule.h */,
F587851002DE375901EA4122 /* KWQKWinModule.mm */,
);
name = kdecore;
sourceTree = "<group>";
......@@ -3808,8 +3798,6 @@
F58786C202DE3B8601EA4122 /* KWQValueList.h */,
F587853B02DE375901EA4122 /* KWQValueListImpl.h */,
F587853C02DE375901EA4122 /* KWQValueListImpl.cpp */,
F58786C302DE3B8601EA4122 /* KWQVariant.h */,
F587853D02DE375901EA4122 /* KWQVariant.cpp */,
F58786C502DE3B8601EA4122 /* KWQWidget.h */,
F587854202DE375901EA4122 /* KWQWidget.mm */,
A85D7A8D0879EC64006A9172 /* KWQWMatrix.h */,
......@@ -3896,7 +3884,6 @@
93F1996008245E59001E9ABC /* KWQKPartsHistoryProvider.h in Headers */,
93F1996308245E59001E9ABC /* KWQKSSLKeyGen.h in Headers */,
93F1996708245E59001E9ABC /* KWQKURL.h in Headers */,
93F1996908245E59001E9ABC /* KWQKWinModule.h in Headers */,
93F1996B08245E59001E9ABC /* KWQLineEdit.h in Headers */,
93F1996C08245E59001E9ABC /* KWQListBox.h in Headers */,
93F1996D08245E59001E9ABC /* KWQListImpl.h in Headers */,
......@@ -3928,7 +3915,6 @@
93F1999C08245E59001E9ABC /* KWQTimer.h in Headers */,
93F1999D08245E59001E9ABC /* KWQValueList.h in Headers */,
93F1999E08245E59001E9ABC /* KWQValueListImpl.h in Headers */,
93F1999F08245E59001E9ABC /* KWQVariant.h in Headers */,
93F199A108245E59001E9ABC /* KWQView.h in Headers */,
93F199A208245E59001E9ABC /* KWQWidget.h in Headers */,
93F199A308245E59001E9ABC /* KWQWindowWidget.h in Headers */,
......@@ -5010,7 +4996,6 @@
93F19A3108245E59001E9ABC /* KWQLoader.mm in Sources */,
93F19A3208245E59001E9ABC /* KWQKLocale.mm in Sources */,
93F19A3608245E59001E9ABC /* KWQKURL.mm in Sources */,
93F19A3808245E59001E9ABC /* KWQKWinModule.mm in Sources */,
93F19A3A08245E59001E9ABC /* KWQLineEdit.mm in Sources */,
93F19A3B08245E59001E9ABC /* KWQListBox.mm in Sources */,
93F19A3C08245E59001E9ABC /* KWQListImpl.cpp in Sources */,
......@@ -5029,7 +5014,6 @@
93F19A5408245E59001E9ABC /* KWQTextStream.cpp in Sources */,
93F19A5508245E59001E9ABC /* KWQTimer.cpp in Sources */,
93F19A5608245E59001E9ABC /* KWQValueListImpl.cpp in Sources */,
93F19A5708245E59001E9ABC /* KWQVariant.cpp in Sources */,
93F19A5908245E59001E9ABC /* KWQWidget.mm in Sources */,
93F19A5A08245E59001E9ABC /* KWQWindowWidget.mm in Sources */,
93F19A5C08245E59001E9ABC /* WebCoreCookieAdapter.m in Sources */,
......
......@@ -37,6 +37,7 @@
#import "KWQAccObjectCache.h"
#import "KWQClipboard.h"
#import "KWQEditCommand.h"
#import "KWQEvent.h"
#import "KWQExceptions.h"
#import "KWQFormData.h"
#import "KWQFoundationExtras.h"
......
......@@ -100,6 +100,7 @@ using KJS::ExecState;
using KJS::Interpreter;
using KJS::JSLock;
using KJS::JSObject;
using KJS::JSValue;
using KJS::SavedProperties;
using KJS::SavedBuiltins;
using KJS::Window;
......@@ -1463,11 +1464,14 @@ static HTMLFormElementImpl *formElementFromDOMElement(DOMElement *element)
return [self stringByEvaluatingJavaScriptFromString:string forceUserGesture:true];
}
//
- (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)string forceUserGesture:(BOOL)forceUserGesture
{
m_frame->createEmptyDocument();
return m_frame->executeScript(QString::fromNSString(string), forceUserGesture).asString().getNSString();
JSValue* result = m_frame->executeScript(0, QString::fromNSString(string), forceUserGesture);
if (!result || !result->isString())
return 0;
JSLock lock;
return result->getString().domString();
}
- (WebScriptObject *)windowScriptObject
......
/*
* This file is part of the KDE libraries
* Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
* Copyright (C) 2004 Apple Computer, Inc.
* Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -352,25 +352,6 @@ DOMString valueToStringWithNullCheck(ExecState *exec, JSValue *val)
return val->toString(exec).domString();
}
QVariant ValueToVariant(ExecState* exec, JSValue *val) {
QVariant res;
switch (val->type()) {
case BooleanType:
res = QVariant(val->toBoolean(exec), 0);
break;
case NumberType:
res = QVariant(val->toNumber(exec));
break;
case StringType:
res = QVariant(val->toString(exec).qstring());
break;
default:
// everything else will be 'invalid'
break;
}
return res;
}
static const char * const exceptionNames[] = {
0,
"INDEX_SIZE_ERR",
......
......@@ -2,7 +2,7 @@
/*
* This file is part of the KDE libraries
* Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
* Copyright (C) 2003 Apple Computer, Inc.
* Copyright (C) 2003, 2004, 2005, 2006 Apple Computer, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -19,11 +19,10 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _KJS_BINDING_H_
#define _KJS_BINDING_H_
#ifndef KJS_BINDING_H_
#define KJS_BINDING_H_
#include <kjs/interpreter.h>
#include <qvariant.h>
#include <kjs/lookup.h>
#if __APPLE__
......@@ -165,11 +164,6 @@ namespace KJS {
*/
DOM::DOMString valueToStringWithNullCheck(ExecState* exec, JSValue *val);
/**
* Convert a KJS value into a QVariant
*/
QVariant ValueToVariant(ExecState* exec, JSValue *val);
} // namespace
#endif
......@@ -124,8 +124,8 @@ void JSAbstractEventListener::handleEvent(EventListenerEvent ele, bool isWindowE
if (!retval->isUndefinedOrNull() && event->storesResultAsString())
event->storeResult(retval->toString(exec).domString());
if (html) {
QVariant ret = ValueToVariant(exec, retval);
if (ret.type() == QVariant::Bool && !ret.toBool())
bool retvalbool;
if (retval->getBoolean(retvalbool) && !retvalbool)
event->preventDefault();
}
}
......
......@@ -49,9 +49,9 @@ KJSProxyImpl::~KJSProxyImpl()
Collector::collect();
}
QVariant KJSProxyImpl::evaluate(const DOMString& filename, int baseLine, const DOMString& str, NodeImpl *n)
JSValue* KJSProxyImpl::evaluate(const DOMString& filename, int baseLine, const DOMString& str, NodeImpl *n)
{
// evaluate code. Returns the JS return value or an invalid QVariant
// evaluate code. Returns the JS return value or 0
// if there was none, an error occured or the type couldn't be converted.
initScript();
......@@ -65,23 +65,20 @@ QVariant KJSProxyImpl::evaluate(const DOMString& filename, int baseLine, const D
JSLock lock;
KJS::JSValue* thisNode = n ? Window::retrieve(m_frame) : getDOMNode(m_script->globalExec(), n);
JSValue* thisNode = n ? Window::retrieve(m_frame) : getDOMNode(m_script->globalExec(), n);
Completion comp = m_script->evaluate(filename, baseLine, reinterpret_cast<KJS::UChar *>(str.unicode()), str.length(), thisNode);
bool success = ( comp.complType() == Normal ) || ( comp.complType() == ReturnValue );
if (comp.complType() == Normal || comp.complType() == ReturnValue)
return comp.value();
// let's try to convert the return value
if (success && comp.value())
return ValueToVariant(m_script->globalExec(), comp.value());
if ( comp.complType() == Throw ) {
if (comp.complType() == Throw) {
UString errorMessage = comp.value()->toString(m_script->globalExec());
int lineNumber = comp.value()->toObject(m_script->globalExec())->get(m_script->globalExec(), "line")->toInt32(m_script->globalExec());
int lineNumber = comp.value()->toObject(m_script->globalExec())->get(m_script->globalExec(), "line")->toInt32(m_script->globalExec());
UString sourceURL = comp.value()->toObject(m_script->globalExec())->get(m_script->globalExec(), "sourceURL")->toString(m_script->globalExec());
m_frame->addMessageToConsole(errorMessage.domString(), lineNumber, sourceURL.domString());
}
return QVariant();
return 0;
}
void KJSProxyImpl::clear() {
......@@ -99,7 +96,7 @@ EventListener *KJSProxyImpl::createHTMLEventHandler(const DOMString& code, NodeI
{
initScript();
JSLock lock;
return new JSLazyEventListener(code, KJS::Window::retrieveWindow(m_frame), node, m_handlerLineno);
return new JSLazyEventListener(code, Window::retrieveWindow(m_frame), node, m_handlerLineno);
}
#if SVG_SUPPORT
......@@ -107,7 +104,7 @@ EventListener *KJSProxyImpl::createSVGEventHandler(const DOMString& code, NodeIm
{
initScript();
JSLock lock;
return new JSSVGLazyEventListener(code, KJS::Window::retrieveWindow(m_frame), node, m_handlerLineno);
return new JSSVGLazyEventListener(code, Window::retrieveWindow(m_frame), node, m_handlerLineno);
}
#endif
......@@ -120,7 +117,7 @@ void KJSProxyImpl::finishedWithEvent(EventImpl *event)
m_script->forgetDOMObject(event);
}
KJS::ScriptInterpreter *KJSProxyImpl::interpreter()
ScriptInterpreter *KJSProxyImpl::interpreter()
{
if (!m_script)
initScript();
......@@ -147,11 +144,11 @@ void KJSProxyImpl::initScript()
return;
// Build the global object - which is a Window instance
KJS::JSLock lock;
JSLock lock;
JSObject *globalObject( new Window(m_frame) );
// Create a KJS interpreter for this frame
m_script = new KJS::ScriptInterpreter(globalObject, m_frame);
m_script = new ScriptInterpreter(globalObject, m_frame);
globalObject->put(m_script->globalExec(), "debug", new TestFunctionImp(), Internal);
QString userAgent = m_frame->userAgent();
......
......@@ -21,12 +21,11 @@
#ifndef KJS_PROXY_H
#define KJS_PROXY_H
#include <qvariant.h>
class Frame;
class QString;
namespace KJS {
class JSValue;
class ScriptInterpreter;
}
......@@ -41,7 +40,7 @@ class KJSProxyImpl {
public:
KJSProxyImpl(Frame*);
~KJSProxyImpl();
QVariant evaluate(const DOMString& filename, int baseLine, const DOMString& code, NodeImpl*);
KJS::JSValue* evaluate(const DOMString& filename, int baseLine, const DOMString& code, NodeImpl*);
void clear();
EventListener* createHTMLEventHandler(const DOMString& code, NodeImpl*);
#if SVG_SUPPORT
......
......@@ -27,6 +27,7 @@
#include "FrameView.h"
#include "JSMutationEvent.h"
#include "JSXMLHttpRequest.h"
#include "KWQEvent.h"
#include "KWQKConfigBase.h"
#include "KWQLogging.h"
#include "Screen.h"
......@@ -56,7 +57,6 @@
#include <kdebug.h>
#include <kjs/collector.h>
#include <klocale.h>
#include <kwinmodule.h>
#include <qtimer.h>
#if KHTML_XSLT
......@@ -1871,7 +1871,7 @@ void ScheduledAction::execute(Window *window)
}
}
} else
window->m_frame->executeScript(m_code);
window->m_frame->executeScript(0, m_code);
// Update our document's rendering following the execution of the timeout callback.
// FIXME: Why? Why not other documents, for example?
......
......@@ -26,6 +26,7 @@
#include <kxmlcore/HashMap.h>
#include <qguardedptr.h>
#include <qobject.h>
#include <qstring.h>
class Frame;
class FrameView;
......
......@@ -26,19 +26,20 @@
#include "config.h"
#include "html/html_inlineimpl.h"
#include "css/csshelper.h"
#include "EventNames.h"
#include "Frame.h"
#include "KWQEvent.h"
#include "csshelper.h"
#include "cssproperties.h"
#include "css/cssstyleselector.h"
#include "cssstyleselector.h"
#include "cssvalues.h"
#include "html/html_documentimpl.h"
#include "html/html_imageimpl.h"
#include "Frame.h"
#include "rendering/render_br.h"
#include "rendering/render_flow.h"
#include "rendering/render_image.h"
#include "xml/EventNames.h"
#include "xml/dom2_eventsimpl.h"
#include "dom2_eventsimpl.h"
#include "html_documentimpl.h"
#include "html_imageimpl.h"
#include "htmlnames.h"
#include "render_flow.h"
#include "render_image.h"
#include "rendering/render_br.h"
namespace WebCore {
......
......@@ -35,6 +35,7 @@
#include "Frame.h"
#include "FrameView.h"
#include "HTMLElementImpl.h"
#include "KWQEvent.h"
#include "SystemTime.h"
#include "csshelper.h"
#include "html_documentimpl.h"
......@@ -42,7 +43,6 @@
#include "htmlparser.h"
#include "kjs_proxy.h"
#include <ctype.h>
#include <qvariant.h>
#include <stdlib.h>
// turn off inlining to allow proper linking on newer gcc (xmltokenizer.cpp also uses findEntity())
......
......@@ -33,6 +33,7 @@
#include "FramePrivate.h"
#include "FrameView.h"
#include "KWQAccObjectCache.h"
#include "KWQEvent.h"
#include "KWQLogging.h"
#include "NameNodeListImpl.h"
#include "SegmentedString.h"
......
......@@ -31,6 +31,7 @@
#include "EventNames.h"
#include "Frame.h"
#include "FrameView.h"
#include "KWQEvent.h"
#include "dom2_events.h"
#include "dom2_eventsimpl.h"
#include "dom_atomicstring.h"
......
......@@ -27,6 +27,7 @@
#include "DocumentImpl.h"
#include "EventNames.h"
#include "FrameView.h"
#include "KWQEvent.h"
#include "SystemTime.h"
#include "dom2_events.h"
#include "dom2_viewsimpl.h"
......
......@@ -41,7 +41,6 @@
#include "kentities.h" // for xhtml entity name lookup
#include <libxml/parser.h>
#include <libxml/parserInternals.h>
#include <qvariant.h>
#include <kxmlcore/Vector.h>
#if SVG_SUPPORT
......@@ -879,7 +878,7 @@ void XMLTokenizer::executeScripts()
// another page, etc. (also in notifyFinished())
// ### the script may add another script node after this one which should be executed
if (m_view)
m_view->frame()->executeScript(scriptCode);
m_view->frame()->executeScript(0, scriptCode);
}
}
......@@ -897,7 +896,7 @@ void XMLTokenizer::notifyFinished(CachedObject *finishedObj)
DOMString scriptSource = m_cachedScript->script();
m_cachedScript->deref(this);
m_cachedScript = 0;
m_view->frame()->executeScript(scriptSource.qstring());
m_view->frame()->executeScript(0, scriptSource.qstring());
executeScripts();
}
}
......
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