[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
darin
darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:54:47 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit db9d82e2ccfddc0484fd172883ede97a6b9d3238
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Sat Oct 26 06:43:54 2002 +0000
WebCore:
Remove some user-visible strings. We can't have any strings that need
localization in WebCore, given our translation strategy.
* khtml/html/html_formimpl.cpp: (HTMLInputElementImpl::encoding):
Put APPLE_CHANGES around some i18n dialog code.
* khtml/khtml_part.cpp: (KHTMLPart::submitForm): Ditto.
* khtml/rendering/render_frames.cpp:
(RenderPartObject::slotPartLoadingErrorNotify): Ditto.
* khtml/ecma/kjs_window.cpp:
(Window::get): Ditto.
(Window::scheduleClose): Ditto.
(WindowFunc::tryCall): Put APPLE_CHANGES in to use JavaScript-specific methods
in the part of calling the generic ones from KMessageBox.
* ForwardingHeaders/kmessagebox.h: Added (empty file).
* kwq/KWQKHTMLPartImpl.h: Added new runJavaScript functions.
* kwq/KWQKHTMLPartImpl.mm:
(KWQKHTMLPartImpl::runJavaScriptAlert): Added.
(KWQKHTMLPartImpl::runJavaScriptConfirm): Added.
* kwq/WebCoreViewFactory.h: Added runJavaScriptAlertPanelWithMessage and
runJavaScriptConfirmPanelWithMessage.
* kwq/kdeui/kmessagebox.h: Removed.
* kwq/KWQKMessageBox.mm: Removed.
* WebCore.pbproj/project.pbxproj: Removed the KMessageBox files.
WebKit:
* WebCoreSupport.subproj/WebViewFactory.m:
(-[WebViewFactory runJavaScriptAlertPanelWithMessage:]): Added.
(-[WebViewFactory runJavaScriptConfirmPanelWithMessage:]): Added.
* English.lproj/Localizable.strings: Update.
* English.lproj/StringsNotToBeLocalized.txt: Update.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2476 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 31fddcc..22aa13d 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,33 @@
+2002-10-25 Darin Adler <darin at apple.com>
+
+ Remove some user-visible strings. We can't have any strings that need
+ localization in WebCore, given our translation strategy.
+
+ * khtml/html/html_formimpl.cpp: (HTMLInputElementImpl::encoding):
+ Put APPLE_CHANGES around some i18n dialog code.
+ * khtml/khtml_part.cpp: (KHTMLPart::submitForm): Ditto.
+ * khtml/rendering/render_frames.cpp:
+ (RenderPartObject::slotPartLoadingErrorNotify): Ditto.
+ * khtml/ecma/kjs_window.cpp:
+ (Window::get): Ditto.
+ (Window::scheduleClose): Ditto.
+ (WindowFunc::tryCall): Put APPLE_CHANGES in to use JavaScript-specific methods
+ in the part of calling the generic ones from KMessageBox.
+
+ * ForwardingHeaders/kmessagebox.h: Added (empty file).
+
+ * kwq/KWQKHTMLPartImpl.h: Added new runJavaScript functions.
+ * kwq/KWQKHTMLPartImpl.mm:
+ (KWQKHTMLPartImpl::runJavaScriptAlert): Added.
+ (KWQKHTMLPartImpl::runJavaScriptConfirm): Added.
+
+ * kwq/WebCoreViewFactory.h: Added runJavaScriptAlertPanelWithMessage and
+ runJavaScriptConfirmPanelWithMessage.
+
+ * kwq/kdeui/kmessagebox.h: Removed.
+ * kwq/KWQKMessageBox.mm: Removed.
+ * WebCore.pbproj/project.pbxproj: Removed the KMessageBox files.
+
2002-10-25 Richard Williamson <rjw at apple.com>
Removed debug logging.
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 31fddcc..22aa13d 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,33 @@
+2002-10-25 Darin Adler <darin at apple.com>
+
+ Remove some user-visible strings. We can't have any strings that need
+ localization in WebCore, given our translation strategy.
+
+ * khtml/html/html_formimpl.cpp: (HTMLInputElementImpl::encoding):
+ Put APPLE_CHANGES around some i18n dialog code.
+ * khtml/khtml_part.cpp: (KHTMLPart::submitForm): Ditto.
+ * khtml/rendering/render_frames.cpp:
+ (RenderPartObject::slotPartLoadingErrorNotify): Ditto.
+ * khtml/ecma/kjs_window.cpp:
+ (Window::get): Ditto.
+ (Window::scheduleClose): Ditto.
+ (WindowFunc::tryCall): Put APPLE_CHANGES in to use JavaScript-specific methods
+ in the part of calling the generic ones from KMessageBox.
+
+ * ForwardingHeaders/kmessagebox.h: Added (empty file).
+
+ * kwq/KWQKHTMLPartImpl.h: Added new runJavaScript functions.
+ * kwq/KWQKHTMLPartImpl.mm:
+ (KWQKHTMLPartImpl::runJavaScriptAlert): Added.
+ (KWQKHTMLPartImpl::runJavaScriptConfirm): Added.
+
+ * kwq/WebCoreViewFactory.h: Added runJavaScriptAlertPanelWithMessage and
+ runJavaScriptConfirmPanelWithMessage.
+
+ * kwq/kdeui/kmessagebox.h: Removed.
+ * kwq/KWQKMessageBox.mm: Removed.
+ * WebCore.pbproj/project.pbxproj: Removed the KMessageBox files.
+
2002-10-25 Richard Williamson <rjw at apple.com>
Removed debug logging.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 31fddcc..22aa13d 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,33 @@
+2002-10-25 Darin Adler <darin at apple.com>
+
+ Remove some user-visible strings. We can't have any strings that need
+ localization in WebCore, given our translation strategy.
+
+ * khtml/html/html_formimpl.cpp: (HTMLInputElementImpl::encoding):
+ Put APPLE_CHANGES around some i18n dialog code.
+ * khtml/khtml_part.cpp: (KHTMLPart::submitForm): Ditto.
+ * khtml/rendering/render_frames.cpp:
+ (RenderPartObject::slotPartLoadingErrorNotify): Ditto.
+ * khtml/ecma/kjs_window.cpp:
+ (Window::get): Ditto.
+ (Window::scheduleClose): Ditto.
+ (WindowFunc::tryCall): Put APPLE_CHANGES in to use JavaScript-specific methods
+ in the part of calling the generic ones from KMessageBox.
+
+ * ForwardingHeaders/kmessagebox.h: Added (empty file).
+
+ * kwq/KWQKHTMLPartImpl.h: Added new runJavaScript functions.
+ * kwq/KWQKHTMLPartImpl.mm:
+ (KWQKHTMLPartImpl::runJavaScriptAlert): Added.
+ (KWQKHTMLPartImpl::runJavaScriptConfirm): Added.
+
+ * kwq/WebCoreViewFactory.h: Added runJavaScriptAlertPanelWithMessage and
+ runJavaScriptConfirmPanelWithMessage.
+
+ * kwq/kdeui/kmessagebox.h: Removed.
+ * kwq/KWQKMessageBox.mm: Removed.
+ * WebCore.pbproj/project.pbxproj: Removed the KMessageBox files.
+
2002-10-25 Richard Williamson <rjw at apple.com>
Removed debug logging.
diff --git a/JavaScriptCore/dummy.cpp b/WebCore/ForwardingHeaders/kmessagebox.h
similarity index 100%
copy from JavaScriptCore/dummy.cpp
copy to WebCore/ForwardingHeaders/kmessagebox.h
diff --git a/WebCore/WebCore.pbproj/project.pbxproj b/WebCore/WebCore.pbproj/project.pbxproj
index c7a6662..6135aac 100644
--- a/WebCore/WebCore.pbproj/project.pbxproj
+++ b/WebCore/WebCore.pbproj/project.pbxproj
@@ -241,7 +241,6 @@
F587862902DE398401EA4122,
F587862A02DE398401EA4122,
F587862B02DE398401EA4122,
- F587862C02DE398401EA4122,
F587863102DE39E601EA4122,
F587863B02DE3A1401EA4122,
F587863C02DE3A1401EA4122,
@@ -536,7 +535,6 @@
F587859302DE375901EA4122,
F587859502DE375901EA4122,
F587859602DE375901EA4122,
- F587859702DE375901EA4122,
F587859802DE375901EA4122,
F587859902DE375901EA4122,
F587859A02DE375901EA4122,
@@ -4517,12 +4515,6 @@
path = KWQKLocale.mm;
refType = 4;
};
- F587850502DE375901EA4122 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = KWQKMessageBox.mm;
- refType = 4;
- };
F587850602DE375901EA4122 = {
fileEncoding = 30;
isa = PBXFileReference;
@@ -5323,12 +5315,6 @@
settings = {
};
};
- F587859702DE375901EA4122 = {
- fileRef = F587850502DE375901EA4122;
- isa = PBXBuildFile;
- settings = {
- };
- };
F587859802DE375901EA4122 = {
fileRef = F587850602DE375901EA4122;
isa = PBXBuildFile;
@@ -6176,13 +6162,6 @@
path = kdeui/klistbox.h;
refType = 4;
};
- F587862302DE398401EA4122 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- name = kmessagebox.h;
- path = kdeui/kmessagebox.h;
- refType = 4;
- };
F587862602DE398401EA4122 = {
fileRef = F587861D02DE398401EA4122;
isa = PBXBuildFile;
@@ -6219,12 +6198,6 @@
settings = {
};
};
- F587862C02DE398401EA4122 = {
- fileRef = F587862302DE398401EA4122;
- isa = PBXBuildFile;
- settings = {
- };
- };
F587862F02DE398601EA4122 = {
children = (
F587861D02DE398401EA4122,
@@ -6234,8 +6207,6 @@
F58784F002DE375901EA4122,
F587862102DE398401EA4122,
F587862202DE398401EA4122,
- F587862302DE398401EA4122,
- F587850502DE375901EA4122,
);
isa = PBXGroup;
name = kdeui;
diff --git a/WebCore/khtml/ecma/kjs_window.cpp b/WebCore/khtml/ecma/kjs_window.cpp
index 8aedf3c..008a98c 100644
--- a/WebCore/khtml/ecma/kjs_window.cpp
+++ b/WebCore/khtml/ecma/kjs_window.cpp
@@ -388,8 +388,9 @@ Value Window::get(ExecState *exec, const UString &p) const
case Document:
if (isSafeScript(exec))
{
-#ifndef APPLE_CHANGES
+#if APPLE_CHANGES
// FIXME: need to figure out and emulate point of this code.
+#else
if (m_part->document().isNull()) {
kdDebug(6070) << "Document.write: adding <HTML><BODY> to create document" << endl;
m_part->begin();
@@ -856,7 +857,7 @@ void Window::scheduleClose()
{
kdDebug(6070) << "Window::scheduleClose window.close() " << m_part << endl;
Q_ASSERT(winq);
-#ifdef APPLE_CHANGES
+#if APPLE_CHANGES
m_part->impl->scheduleClose();
#else
QTimer::singleShot( 0, winq, SLOT( timeoutClose() ) );
@@ -986,12 +987,20 @@ Value WindowFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
switch (id) {
case Window::Alert:
part->xmlDocImpl()->updateRendering();
+#if APPLE_CHANGES
+ part->impl->runJavaScriptAlert(str);
+#else
KMessageBox::error(widget, QStyleSheet::convertFromPlainText(str), "JavaScript");
+#endif
return Undefined();
case Window::Confirm:
part->xmlDocImpl()->updateRendering();
+#if APPLE_CHANGES
+ return Boolean(part->impl->runJavaScriptConfirm(str));
+#else
return Boolean((KMessageBox::warningYesNo(widget, QStyleSheet::convertFromPlainText(str), "JavaScript",
i18n("OK"), i18n("Cancel")) == KMessageBox::Yes));
+#endif
case Window::Prompt:
part->xmlDocImpl()->updateRendering();
bool ok;
@@ -1016,17 +1025,19 @@ Value WindowFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
int policy = config->readUnsignedNumEntry( "WindowOpenPolicy", 0 ); // 0=allow, 1=ask, 2=deny, 3=smart
delete config;
if ( policy == 1 ) {
+#if !APPLE_CHANGES
if ( KMessageBox::questionYesNo(widget,
i18n( "This site is trying to open up a new browser "
"window using Javascript.\n"
"Do you want to allow this?" ),
i18n( "Confirmation: Javascript Popup" ) ) == KMessageBox::Yes )
+#endif
policy = 0;
} else if ( policy == 3 ) // smart
{
// window.open disabled unless from a key/mouse event
if (static_cast<ScriptInterpreter *>(exec->interpreter())->isWindowOpenAllowed())
-#ifndef APPLE_CHANGES
+#if !APPLE_CHANGES
policy = 0;
#else
{
@@ -1051,7 +1062,7 @@ Value WindowFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
winargs.menuBarVisible = false;
winargs.toolBarsVisible = false;
winargs.statusBarVisible = false;
-#ifdef APPLE_CHANGES
+#if APPLE_CHANGES
winargs.scrollbarsVisible = false;
#endif
QStringList flist = QStringList::split(',', features);
@@ -1071,14 +1082,14 @@ Value WindowFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
winargs.x = val.toInt() + screen.x();
if (winargs.x < screen.x() || winargs.x > screen.right())
winargs.x = screen.x(); // only safe choice until size is determined
-#ifdef APPLE_CHANGES
+#if APPLE_CHANGES
winargs.xSet = true;
#endif
} else if (key == "top" || key == "screeny") {
winargs.y = val.toInt() + screen.y();
if (winargs.y < screen.y() || winargs.y > screen.bottom())
winargs.y = screen.y(); // only safe choice until size is determined
-#ifdef APPLE_CHANGES
+#if APPLE_CHANGES
winargs.ySet = true;
#endif
} else if (key == "height") {
@@ -1087,7 +1098,7 @@ Value WindowFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
winargs.height = screen.height();
if (winargs.height < 100)
winargs.height = 100;
-#ifdef APPLE_CHANGES
+#if APPLE_CHANGES
winargs.heightSet = true;
#endif
} else if (key == "width") {
@@ -1096,7 +1107,7 @@ Value WindowFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
winargs.width = screen.width();
if (winargs.width < 100)
winargs.width = 100;
-#ifdef APPLE_CHANGES
+#if APPLE_CHANGES
winargs.widthSet = true;
#endif
} else {
@@ -1121,7 +1132,7 @@ Value WindowFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
winargs.resizable = (val == "1" || val == "yes");
else if (key == "fullscreen")
winargs.fullscreen = (val == "1" || val == "yes");
-#ifdef APPLE_CHANGES
+#if APPLE_CHANGES
else if (key == "scrollbars")
winargs.scrollbarsVisible = (val == "1" || val == "yes");
#endif
@@ -1166,8 +1177,9 @@ Value WindowFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
khtmlpart->setOpener(part);
khtmlpart->setOpenedByJS(true);
if (khtmlpart->document().isNull()) {
-#ifndef APPLE_CHANGES
+#if APPLE_CHANGES
// FIXME: need to figure out and emulate point of this code.
+#else
khtmlpart->begin();
khtmlpart->write("<HTML><BODY>");
khtmlpart->end();
@@ -1309,7 +1321,7 @@ Value WindowFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
widget->setActiveWindow();
return Undefined();
case Window::Blur:
-#ifdef APPLE_CHANGES
+#if APPLE_CHANGES
part->impl->unfocusWindow();
#else
// TODO
@@ -1331,8 +1343,13 @@ Value WindowFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
// To conform to the SPEC, we only ask if the window
// has more than one entry in the history (NS does that too).
History history(exec,part);
- if ( history.get( exec, "length" ).toInt32(exec) <= 1 ||
- KMessageBox::questionYesNo( window->part()->widget(), i18n("Close window?"), i18n("Confirmation Required") ) == KMessageBox::Yes )
+ if ( history.get( exec, "length" ).toInt32(exec) <= 1
+#if APPLE_CHANGES
+ // FIXME: How are we going to handle this?
+#else
+ || KMessageBox::questionYesNo( window->part()->widget(), i18n("Close window?"), i18n("Confirmation Required") ) == KMessageBox::Yes
+#endif
+ )
(const_cast<Window*>(window))->scheduleClose();
}
else
diff --git a/WebCore/khtml/html/html_formimpl.cpp b/WebCore/khtml/html/html_formimpl.cpp
index 7dd7654..83d4354 100644
--- a/WebCore/khtml/html/html_formimpl.cpp
+++ b/WebCore/khtml/html/html_formimpl.cpp
@@ -1206,7 +1206,11 @@ bool HTMLInputElementImpl::encoding(const QTextCodec* codec, khtml::encodingList
KIO::UDSEntry filestat;
if (!KIO::NetAccess::stat(fileurl, filestat)) {
+#if APPLE_CHANGES
+ // FIXME: Figure out how to report this error.
+#else
KMessageBox::sorry(0L, i18n("Error fetching file for submission:\n%1").arg(KIO::NetAccess::lastErrorString()));
+#endif
return false;
}
@@ -1235,7 +1239,11 @@ bool HTMLInputElementImpl::encoding(const QTextCodec* codec, khtml::encodingList
return false;
}
else {
+#if APPLE_CHANGES
+ // FIXME: Figure out how to report this error.
+#else
KMessageBox::sorry(0L, i18n("Error fetching file for submission:\n%1").arg(KIO::NetAccess::lastErrorString()));
+#endif
return false;
}
break;
diff --git a/WebCore/khtml/khtml_part.cpp b/WebCore/khtml/khtml_part.cpp
index 912345f..3bb392a 100644
--- a/WebCore/khtml/khtml_part.cpp
+++ b/WebCore/khtml/khtml_part.cpp
@@ -3093,8 +3093,10 @@ void KHTMLPart::submitForm( const char *action, const QString &url, const QByteA
}
}
+#if !APPLE_CHANGES
if (triedToAttach)
KMessageBox::information(NULL, i18n("This site attempted to attach a file from your computer in the form submission. The attachment was removed for your protection."), i18n("KDE"), "WarnTriedAttach");
+#endif
// 2) Append body=
QString bodyEnc;
diff --git a/WebCore/khtml/rendering/render_frames.cpp b/WebCore/khtml/rendering/render_frames.cpp
index 19f0db4..bc0bfda 100644
--- a/WebCore/khtml/rendering/render_frames.cpp
+++ b/WebCore/khtml/rendering/render_frames.cpp
@@ -845,6 +845,9 @@ bool RenderPartObject::partLoadingErrorNotify( khtml::ChildFrame *childFrame, co
void RenderPartObject::slotPartLoadingErrorNotify()
{
+#if APPLE_CHANGES
+ // FIXME: What are we going to do for this case?
+#else
// First we need to find out the servicetype - again - this code is too duplicated !
HTMLEmbedElementImpl *embed = 0;
QString serviceType;
@@ -887,6 +890,7 @@ void RenderPartObject::slotPartLoadingErrorNotify()
ext->createNewWindow( pluginPageURL );
}
}
+#endif // APPLE_CHANGES
}
// duplication of RenderFormElement... FIX THIS!
diff --git a/WebCore/kwq/KWQKHTMLPart.h b/WebCore/kwq/KWQKHTMLPart.h
index 2d7c01d..515e910 100644
--- a/WebCore/kwq/KWQKHTMLPart.h
+++ b/WebCore/kwq/KWQKHTMLPart.h
@@ -113,6 +113,9 @@ public:
static void setDocumentFocus(QWidget *);
static void clearDocumentFocus(QWidget *);
+ static void runJavaScriptAlert(const QString &message);
+ static bool runJavaScriptConfirm(const QString &message);
+
static WebCoreBridge *bridgeForWidget(QWidget *);
// Incoming calls, used by the bridge.
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index 20d6840..b48d41e 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -23,19 +23,20 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#import <KWQKHTMLPartImpl.h>
+#import "KWQKHTMLPartImpl.h"
-#import <htmltokenizer.h>
-#import <html_documentimpl.h>
-#import <render_root.h>
-#import <render_frames.h>
-#import <render_text.h>
-#import <khtmlpart_p.h>
-#import <khtmlview.h>
+#import "htmltokenizer.h"
+#import "html_documentimpl.h"
+#import "render_root.h"
+#import "render_frames.h"
+#import "render_text.h"
+#import "khtmlpart_p.h"
+#import "khtmlview.h"
-#import <WebCoreBridge.h>
+#import "WebCoreBridge.h"
+#import "WebCoreViewFactory.h"
-#import <KWQLogging.h>
+#import "KWQLogging.h"
#undef _KWQ_TIMING
@@ -489,3 +490,12 @@ QString KWQKHTMLPartImpl::referrer() const
return d->m_referrer;
}
+void KWQKHTMLPartImpl::runJavaScriptAlert(const QString &message)
+{
+ [[WebCoreViewFactory sharedFactory] runJavaScriptAlertPanelWithMessage:message.getNSString()];
+}
+
+bool KWQKHTMLPartImpl::runJavaScriptConfirm(const QString &message)
+{
+ return [[WebCoreViewFactory sharedFactory] runJavaScriptConfirmPanelWithMessage:message.getNSString()];
+}
diff --git a/WebCore/kwq/KWQKHTMLPartImpl.h b/WebCore/kwq/KWQKHTMLPartImpl.h
index 2d7c01d..515e910 100644
--- a/WebCore/kwq/KWQKHTMLPartImpl.h
+++ b/WebCore/kwq/KWQKHTMLPartImpl.h
@@ -113,6 +113,9 @@ public:
static void setDocumentFocus(QWidget *);
static void clearDocumentFocus(QWidget *);
+ static void runJavaScriptAlert(const QString &message);
+ static bool runJavaScriptConfirm(const QString &message);
+
static WebCoreBridge *bridgeForWidget(QWidget *);
// Incoming calls, used by the bridge.
diff --git a/WebCore/kwq/KWQKHTMLPartImpl.mm b/WebCore/kwq/KWQKHTMLPartImpl.mm
index 20d6840..b48d41e 100644
--- a/WebCore/kwq/KWQKHTMLPartImpl.mm
+++ b/WebCore/kwq/KWQKHTMLPartImpl.mm
@@ -23,19 +23,20 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#import <KWQKHTMLPartImpl.h>
+#import "KWQKHTMLPartImpl.h"
-#import <htmltokenizer.h>
-#import <html_documentimpl.h>
-#import <render_root.h>
-#import <render_frames.h>
-#import <render_text.h>
-#import <khtmlpart_p.h>
-#import <khtmlview.h>
+#import "htmltokenizer.h"
+#import "html_documentimpl.h"
+#import "render_root.h"
+#import "render_frames.h"
+#import "render_text.h"
+#import "khtmlpart_p.h"
+#import "khtmlview.h"
-#import <WebCoreBridge.h>
+#import "WebCoreBridge.h"
+#import "WebCoreViewFactory.h"
-#import <KWQLogging.h>
+#import "KWQLogging.h"
#undef _KWQ_TIMING
@@ -489,3 +490,12 @@ QString KWQKHTMLPartImpl::referrer() const
return d->m_referrer;
}
+void KWQKHTMLPartImpl::runJavaScriptAlert(const QString &message)
+{
+ [[WebCoreViewFactory sharedFactory] runJavaScriptAlertPanelWithMessage:message.getNSString()];
+}
+
+bool KWQKHTMLPartImpl::runJavaScriptConfirm(const QString &message)
+{
+ return [[WebCoreViewFactory sharedFactory] runJavaScriptConfirmPanelWithMessage:message.getNSString()];
+}
diff --git a/WebCore/kwq/KWQKMessageBox.mm b/WebCore/kwq/KWQKMessageBox.mm
deleted file mode 100644
index 852af12..0000000
--- a/WebCore/kwq/KWQKMessageBox.mm
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (C) 2001, 2002 Apple Computer, 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.
- */
-
-#import <kmessagebox.h>
-#import <Cocoa/Cocoa.h>
-
-void KMessageBox::error(QWidget *, const QString &message,
- const QString &caption, bool notify)
-{
- if (caption.isNull())
- NSRunAlertPanel(nil, @"%@", nil, nil, nil, message.getNSString());
- else
- NSRunAlertPanel(caption.getNSString(), @"%@", nil, nil, nil, message.getNSString());
-}
-
-int KMessageBox::warningYesNo(QWidget *, const QString &message,
- const QString &caption,
- const QString &buttonYes,
- const QString &buttonNo,
- bool notify)
-{
- NSString *yes = buttonYes.isNull() ? nil : @"OK";
- NSString *no = buttonNo.isNull() ? nil : @"Cancel";
- int result;
-
- if (caption.isNull())
- result = NSRunAlertPanel(nil, @"%@", yes, no, nil, message.getNSString());
- else
- result = NSRunAlertPanel(caption.getNSString(), @"%@", yes, no, nil, message.getNSString());
-
- if (result == NSAlertDefaultReturn)
- return 1;
- return 0;
-}
-
-int KMessageBox::questionYesNo(QWidget *, const QString &message,
- const QString &caption,
- const QString &buttonYes,
- const QString &buttonNo,
- const QString &dontAskAgain)
-{
- NSString *yes = buttonYes.isNull() ? nil : @"OK";
- NSString *no = buttonNo.isNull() ? nil : @"Cancel";
- int result;
-
- if (caption.isNull())
- result = NSRunAlertPanel(nil, @"%@", yes, no, nil, message.getNSString());
- else
- result = NSRunAlertPanel(caption.getNSString(), @"%@", yes, no, nil, message.getNSString());
-
- if (result == NSAlertDefaultReturn)
- return 1;
- return 0;
-}
-
-void KMessageBox::sorry(QWidget *, const QString &message,
- const QString &caption, bool notify)
-{
- if (caption.isNull())
- NSRunAlertPanel(nil, @"%@", nil, nil, nil, message.getNSString());
- else
- NSRunAlertPanel(caption.getNSString(), @"%@", nil, nil, nil, message.getNSString());
-}
-
-void KMessageBox::information(QWidget *, const QString &message, const QString &, const char *)
-{
- NSRunAlertPanel(nil, @"%@", nil, nil, nil, message.getNSString());
-}
diff --git a/WebCore/kwq/WebCoreViewFactory.h b/WebCore/kwq/WebCoreViewFactory.h
index c1344cd..e1c5ea0 100644
--- a/WebCore/kwq/WebCoreViewFactory.h
+++ b/WebCore/kwq/WebCoreViewFactory.h
@@ -34,6 +34,8 @@
- (NSView <WebCoreFileButton> *)fileButton;
+- (void)runJavaScriptAlertPanelWithMessage:(NSString *)message;
+- (BOOL)runJavaScriptConfirmPanelWithMessage:(NSString *)message;
- (BOOL)runJavaScriptTextInputPanelWithPrompt:(NSString *)prompt defaultText:(NSString *)defaultText returningText:(NSString **)result;
- (NSArray *)pluginsInfo; // array of id <WebCorePluginInfo>
diff --git a/WebCore/kwq/kdeui/kmessagebox.h b/WebCore/kwq/kdeui/kmessagebox.h
deleted file mode 100644
index 8f77bc5..0000000
--- a/WebCore/kwq/kdeui/kmessagebox.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2001, 2002 Apple Computer, 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 KMESSAGEBOX_H_
-#define KMESSAGEBOX_H_
-
-#include <qwidget.h>
-#include <qstring.h>
-
-class KMessageBox {
-public:
- enum { Ok = 1, Cancel = 2, Yes = 3, No = 4, Continue = 5 };
-
- static void information(QWidget *, const QString &information,
- const QString &, const char *);
-
- static void error(QWidget *, const QString &,
- const QString &caption=QString::null, bool notify=true);
-
- static int warningYesNo(QWidget *, const QString &,
- const QString &caption=QString::null,
- const QString &buttonYes=QString::null,
- const QString &buttonNo=QString::null,
- bool notify=true);
-
- static int questionYesNo(QWidget *, const QString &,
- const QString &caption=QString::null,
- const QString &buttonYes=QString::null,
- const QString &buttonNo=QString::null,
- const QString &dontAskAgainName=QString::null);
-
- static void sorry(QWidget *, const QString &,
- const QString &caption=QString::null, bool notify=true);
-};
-
-#endif
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index afad36a..ecb1e53 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,12 @@
+2002-10-25 Darin Adler <darin at apple.com>
+
+ * WebCoreSupport.subproj/WebViewFactory.m:
+ (-[WebViewFactory runJavaScriptAlertPanelWithMessage:]): Added.
+ (-[WebViewFactory runJavaScriptConfirmPanelWithMessage:]): Added.
+
+ * English.lproj/Localizable.strings: Update.
+ * English.lproj/StringsNotToBeLocalized.txt: Update.
+
2002-10-25 Richard Williamson <rjw at apple.com>
Implemented support for bidi text layout.
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index afad36a..ecb1e53 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,12 @@
+2002-10-25 Darin Adler <darin at apple.com>
+
+ * WebCoreSupport.subproj/WebViewFactory.m:
+ (-[WebViewFactory runJavaScriptAlertPanelWithMessage:]): Added.
+ (-[WebViewFactory runJavaScriptConfirmPanelWithMessage:]): Added.
+
+ * English.lproj/Localizable.strings: Update.
+ * English.lproj/StringsNotToBeLocalized.txt: Update.
+
2002-10-25 Richard Williamson <rjw at apple.com>
Implemented support for bidi text layout.
diff --git a/WebKit/English.lproj/Localizable.strings b/WebKit/English.lproj/Localizable.strings
index c570a74..7f50737 100644
Binary files a/WebKit/English.lproj/Localizable.strings and b/WebKit/English.lproj/Localizable.strings differ
diff --git a/WebKit/English.lproj/StringsNotToBeLocalized.txt b/WebKit/English.lproj/StringsNotToBeLocalized.txt
index cc55598..2526da1 100644
--- a/WebKit/English.lproj/StringsNotToBeLocalized.txt
+++ b/WebKit/English.lproj/StringsNotToBeLocalized.txt
@@ -1,9 +1,11 @@
" "
" "
" >>>"
+"%@"
"%@-%d"
"%@."
"%@/%@"
+"%d"
"%lf"
"%s renderFramePart %p (%f,%f) w %f, h %f\n"
","
@@ -170,6 +172,8 @@ Misc.subproj/WebKitLogging.m
Panels.subproj/WebAuthenticationPanel.m:"%@:%u"
Plugins.subproj/WebBasePluginPackage.m:"name: %@\npath: %@\nmimeTypes:\n%@\npluginDescription:%@"
Plugins.subproj/WebNetscapePluginPackage.m:"main"
+WebCoreSupport.subproj/WebBridge.m:"height"
+WebCoreSupport.subproj/WebBridge.m:"width"
WebCoreSupport.subproj/WebCookieAdapter.m:"Cookie"
WebCoreSupport.subproj/WebTextRenderer.m:"YES"
WebView.subproj/WebPreferences.m:"latin1"
diff --git a/WebKit/WebCoreSupport.subproj/WebViewFactory.m b/WebKit/WebCoreSupport.subproj/WebViewFactory.m
index 5e28f45..2467c6c 100644
--- a/WebKit/WebCoreSupport.subproj/WebViewFactory.m
+++ b/WebKit/WebCoreSupport.subproj/WebViewFactory.m
@@ -6,12 +6,14 @@
// Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
//
-#import <WebKit/WebFileButton.h>
-#import <WebKit/WebJavaScriptTextInputPanel.h>
-#import <WebKit/WebPluginDatabase.h>
#import <WebKit/WebViewFactory.h>
#import <WebFoundation/WebAssertions.h>
+#import <WebFoundation/WebLocalizableStrings.h>
+
+#import <WebKit/WebFileButton.h>
+#import <WebKit/WebJavaScriptTextInputPanel.h>
+#import <WebKit/WebPluginDatabase.h>
@implementation WebViewFactory
@@ -23,6 +25,17 @@
ASSERT([[self sharedFactory] isKindOfClass:self]);
}
+- (void)runJavaScriptAlertPanelWithMessage:(NSString *)message
+{
+ NSRunAlertPanel(UI_STRING("JavaScript", "title of JavaScript alert panel"), @"%@", nil, nil, nil, message);
+}
+
+- (BOOL)runJavaScriptConfirmPanelWithMessage:(NSString *)message
+{
+ return NSRunAlertPanel(UI_STRING("JavaScript", "title of JavaScript alert panel"), @"%@", nil,
+ UI_STRING("Cancel", "standard button label"), nil, message) == NSAlertDefaultReturn;
+}
+
- (BOOL)runJavaScriptTextInputPanelWithPrompt:(NSString *)prompt defaultText:(NSString *)defaultText returningText:(NSString **)result
{
WebJavaScriptTextInputPanel *panel = [[WebJavaScriptTextInputPanel alloc] initWithPrompt:prompt text:defaultText];
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list