[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 07:13:35 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit e3a5634f9d3ef979c3a3a7df4a2effa895a71e0b
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Dec 11 16:23:30 2002 +0000
Rolled out changes I accidentally checked in last night.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2999 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index c06e14d..a064a33 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,7 @@
+2002-12-11 Darin Adler <darin at apple.com>
+
+ Rolled out changes I accidentally checked in last night.
+
2002-12-10 John Sullivan <sullivan at apple.com>
Fixed more "Alexander"s that were lurking in places I forgot
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index c06e14d..a064a33 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,7 @@
+2002-12-11 Darin Adler <darin at apple.com>
+
+ Rolled out changes I accidentally checked in last night.
+
2002-12-10 John Sullivan <sullivan at apple.com>
Fixed more "Alexander"s that were lurking in places I forgot
diff --git a/WebCore/khtml/ecma/kjs_window.lut.h b/WebCore/khtml/ecma/kjs_window.lut.h
index b8f163b..a2801fb 100644
--- a/WebCore/khtml/ecma/kjs_window.lut.h
+++ b/WebCore/khtml/ecma/kjs_window.lut.h
@@ -22,132 +22,122 @@ const struct HashTable ScreenTable = { 2, 10, ScreenTableEntries, 7 };
namespace KJS {
const struct HashEntry WindowTableEntries[] = {
- { "close", Window::Close, DontDelete|Function, 0, 0 },
- { 0, 0, 0, 0, 0 },
- { "alert", Window::Alert, DontDelete|Function, 1, 0 },
- { "outerHeight", Window::OuterHeight, DontDelete|ReadOnly, 0, &WindowTableEntries[92] },
- { "ondragdrop", Window::Ondragdrop, DontDelete, 0, 0 },
{ 0, 0, 0, 0, 0 },
- { "offscreenBuffering", Window::OffscreenBuffering, DontDelete|ReadOnly, 0, 0 },
- { "setTimeout", Window::SetTimeout, DontDelete|Function, 2, 0 },
+ { "Option", Window::Option, DontDelete|ReadOnly, 0, &WindowTableEntries[104] },
+ { "closed", Window::Closed, DontDelete|ReadOnly, 0, &WindowTableEntries[87] },
{ 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0 },
- { "DOMException", Window::DOMException, DontDelete, 0, &WindowTableEntries[103] },
- { "closed", Window::Closed, DontDelete|ReadOnly, 0, &WindowTableEntries[96] },
- { "event", Window::Event, DontDelete|ReadOnly, 0, &WindowTableEntries[108] },
- { 0, 0, 0, 0, 0 },
{ "onload", Window::Onload, DontDelete, 0, 0 },
{ "frames", Window::Frames, DontDelete|ReadOnly, 0, 0 },
- { "screenX", Window::ScreenX, DontDelete|ReadOnly, 0, &WindowTableEntries[105] },
- { "clientInformation", Window::ClientInformation, DontDelete|ReadOnly, 0, &WindowTableEntries[94] },
- { "CSSRule", Window::CSSRule, DontDelete, 0, 0 },
- { "length", Window::Length, DontDelete|ReadOnly, 0, &WindowTableEntries[91] },
- { "personalbar", Window::Personalbar, DontDelete|ReadOnly, 0, 0 },
+ { 0, 0, 0, 0, 0 },
+ { "screenLeft", Window::ScreenLeft, DontDelete|ReadOnly, 0, &WindowTableEntries[90] },
+ { "CSSRule", Window::CSSRule, DontDelete, 0, &WindowTableEntries[91] },
+ { "length", Window::Length, DontDelete|ReadOnly, 0, &WindowTableEntries[81] },
+ { "pageYOffset", Window::PageYOffset, DontDelete|ReadOnly, 0, 0 },
+ { "onmouseout", Window::Onmouseout, DontDelete, 0, &WindowTableEntries[111] },
{ "clearInterval", Window::ClearInterval, DontDelete|Function, 1, 0 },
{ 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0 },
- { "onmouseup", Window::Onmouseup, DontDelete, 0, 0 },
- { "NodeFilter", Window::NodeFilter, DontDelete, 0, 0 },
- { "opener", Window::Opener, DontDelete|ReadOnly, 0, 0 },
- { "parent", Window::Parent, DontDelete|ReadOnly, 0, &WindowTableEntries[113] },
{ 0, 0, 0, 0, 0 },
+ { "opener", Window::Opener, DontDelete|ReadOnly, 0, &WindowTableEntries[82] },
+ { "parent", Window::Parent, DontDelete|ReadOnly, 0, &WindowTableEntries[83] },
+ { "Range", Window::Range, DontDelete, 0, 0 },
{ 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0 },
- { "scrollX", Window::ScrollX, DontDelete|ReadOnly, 0, &WindowTableEntries[110] },
- { "scroll", Window::Scroll, DontDelete|Function, 2, &WindowTableEntries[98] },
+ { "name", Window::Name, DontDelete, 0, 0 },
+ { "navigator", Window::_Navigator, DontDelete|ReadOnly, 0, &WindowTableEntries[84] },
{ 0, 0, 0, 0, 0 },
- { "Node", Window::Node, DontDelete, 0, &WindowTableEntries[112] },
+ { "innerWidth", Window::InnerWidth, DontDelete|ReadOnly, 0, 0 },
{ "onblur", Window::Onblur, DontDelete, 0, 0 },
{ 0, 0, 0, 0, 0 },
- { "onmove", Window::Onmove, DontDelete, 0, 0 },
- { "Image", Window::Image, DontDelete|ReadOnly, 0, &WindowTableEntries[104] },
- { "onkeypress", Window::Onkeypress, DontDelete, 0, 0 },
- { 0, 0, 0, 0, 0 },
- { "scrollBy", Window::ScrollBy, DontDelete|Function, 2, &WindowTableEntries[101] },
- { 0, 0, 0, 0, 0 },
- { 0, 0, 0, 0, 0 },
- { "resizeBy", Window::ResizeBy, DontDelete|Function, 2, 0 },
- { "onabort", Window::Onabort, DontDelete, 0, 0 },
- { 0, 0, 0, 0, 0 },
- { "addEventListener", Window::AddEventListener, DontDelete|Function, 3, 0 },
- { "Range", Window::Range, DontDelete, 0, &WindowTableEntries[93] },
- { "pageYOffset", Window::PageYOffset, DontDelete|ReadOnly, 0, &WindowTableEntries[97] },
- { "crypto", Window::Crypto, DontDelete|ReadOnly, 0, &WindowTableEntries[89] },
- { "prompt", Window::Prompt, DontDelete|Function, 2, 0 },
- { "resizeTo", Window::ResizeTo, DontDelete|Function, 2, 0 },
- { "status", Window::Status, DontDelete, 0, &WindowTableEntries[114] },
- { 0, 0, 0, 0, 0 },
- { 0, 0, 0, 0, 0 },
- { "location", Window::_Location, DontDelete, 0, &WindowTableEntries[95] },
- { "screenTop", Window::ScreenTop, DontDelete|ReadOnly, 0, &WindowTableEntries[116] },
+ { "onclick", Window::Onclick, DontDelete, 0, &WindowTableEntries[105] },
+ { "onmousedown", Window::Onmousedown, DontDelete, 0, 0 },
{ 0, 0, 0, 0, 0 },
+ { "self", Window::Self, DontDelete|ReadOnly, 0, &WindowTableEntries[99] },
+ { "scrollX", Window::ScrollX, DontDelete|ReadOnly, 0, &WindowTableEntries[88] },
+ { "scrollY", Window::ScrollY, DontDelete|ReadOnly, 0, &WindowTableEntries[106] },
{ 0, 0, 0, 0, 0 },
- { "onselect", Window::Onselect, DontDelete, 0, 0 },
- { "name", Window::Name, DontDelete, 0, &WindowTableEntries[119] },
- { "document", Window::Document, DontDelete|ReadOnly, 0, 0 },
- { "onerror", Window::Onerror, DontDelete, 0, &WindowTableEntries[122] },
+ { "innerHeight", Window::InnerHeight, DontDelete|ReadOnly, 0, 0 },
{ 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0 },
- { "ondblclick", Window::Ondblclick, DontDelete, 0, 0 },
- { "onkeyup", Window::Onkeyup, DontDelete, 0, 0 },
{ 0, 0, 0, 0, 0 },
+ { "confirm", Window::Confirm, DontDelete|Function, 1, &WindowTableEntries[93] },
{ "Event", Window::EventCtor, DontDelete, 0, 0 },
- { "self", Window::Self, DontDelete|ReadOnly, 0, 0 },
- { 0, 0, 0, 0, 0 },
- { "top", Window::Top, DontDelete|ReadOnly, 0, 0 },
- { "innerHeight", Window::InnerHeight, DontDelete|ReadOnly, 0, &WindowTableEntries[90] },
- { "history", Window::_History, DontDelete|ReadOnly, 0, 0 },
- { 0, 0, 0, 0, 0 },
+ { "crypto", Window::Crypto, DontDelete|ReadOnly, 0, 0 },
+ { "defaultStatus", Window::DefaultStatus, DontDelete, 0, &WindowTableEntries[92] },
{ 0, 0, 0, 0, 0 },
+ { "status", Window::Status, DontDelete, 0, &WindowTableEntries[80] },
+ { "onchange", Window::Onchange, DontDelete, 0, &WindowTableEntries[101] },
+ { "onabort", Window::Onabort, DontDelete, 0, 0 },
{ 0, 0, 0, 0, 0 },
- { "open", Window::Open, DontDelete|Function, 3, &WindowTableEntries[121] },
- { 0, 0, 0, 0, 0 },
- { "onsubmit", Window::Onsubmit, DontDelete, 0, 0 },
- { "navigator", Window::_Navigator, DontDelete|ReadOnly, 0, &WindowTableEntries[107] },
- { "defaultstatus", Window::DefaultStatus, DontDelete, 0, 0 },
+ { "setTimeout", Window::SetTimeout, DontDelete|Function, 2, 0 },
{ 0, 0, 0, 0, 0 },
+ { "konqueror", Window::_Konqueror, DontDelete|ReadOnly, 0, 0 },
{ 0, 0, 0, 0, 0 },
+ { "scrollbars", Window::Scrollbars, DontDelete|ReadOnly, 0, &WindowTableEntries[85] },
{ 0, 0, 0, 0, 0 },
+ { "outerHeight", Window::OuterHeight, DontDelete|ReadOnly, 0, &WindowTableEntries[102] },
+ { "resizeBy", Window::ResizeBy, DontDelete|Function, 2, &WindowTableEntries[107] },
+ { "NodeFilter", Window::NodeFilter, DontDelete, 0, 0 },
+ { "onreset", Window::Onreset, DontDelete, 0, 0 },
+ { "offscreenBuffering", Window::OffscreenBuffering, DontDelete|ReadOnly, 0, 0 },
+ { "clientInformation", Window::ClientInformation, DontDelete|ReadOnly, 0, 0 },
+ { "scrollTo", Window::ScrollTo, DontDelete|Function, 2, &WindowTableEntries[95] },
+ { "DOMException", Window::DOMException, DontDelete, 0, 0 },
+ { "alert", Window::Alert, DontDelete|Function, 1, 0 },
+ { "resizeTo", Window::ResizeTo, DontDelete|Function, 2, &WindowTableEntries[96] },
+ { "onerror", Window::Onerror, DontDelete, 0, 0 },
{ 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0 },
+ { "location", Window::_Location, DontDelete, 0, 0 },
+ { "onkeyup", Window::Onkeyup, DontDelete, 0, 0 },
+ { "addEventListener", Window::AddEventListener, DontDelete|Function, 3, 0 },
+ { "focus", Window::Focus, DontDelete|Function, 0, 0 },
+ { "personalbar", Window::Personalbar, DontDelete|ReadOnly, 0, &WindowTableEntries[110] },
+ { "event", Window::Event, DontDelete|ReadOnly, 0, 0 },
+ { "document", Window::Document, DontDelete|ReadOnly, 0, &WindowTableEntries[86] },
+ { "defaultstatus", Window::DefaultStatus, DontDelete, 0, &WindowTableEntries[79] },
+ { "history", Window::_History, DontDelete|ReadOnly, 0, 0 },
{ 0, 0, 0, 0, 0 },
- { "defaultStatus", Window::DefaultStatus, DontDelete, 0, &WindowTableEntries[109] },
- { "innerWidth", Window::InnerWidth, DontDelete|ReadOnly, 0, 0 },
- { "konqueror", Window::_Konqueror, DontDelete|ReadOnly, 0, 0 },
- { "outerWidth", Window::OuterWidth, DontDelete|ReadOnly, 0, &WindowTableEntries[99] },
- { "pageXOffset", Window::PageXOffset, DontDelete|ReadOnly, 0, &WindowTableEntries[111] },
- { "screenY", Window::ScreenY, DontDelete|ReadOnly, 0, &WindowTableEntries[102] },
- { "screenLeft", Window::ScreenLeft, DontDelete|ReadOnly, 0, &WindowTableEntries[117] },
- { "scrollbars", Window::Scrollbars, DontDelete|ReadOnly, 0, &WindowTableEntries[100] },
- { "scrollTo", Window::ScrollTo, DontDelete|Function, 2, 0 },
- { "scrollY", Window::ScrollY, DontDelete|ReadOnly, 0, 0 },
+ { "clearTimeout", Window::ClearTimeout, DontDelete|Function, 1, 0 },
+ { "screenTop", Window::ScreenTop, DontDelete|ReadOnly, 0, 0 },
+ { "Node", Window::Node, DontDelete, 0, &WindowTableEntries[112] },
+ { "outerWidth", Window::OuterWidth, DontDelete|ReadOnly, 0, 0 },
+ { "pageXOffset", Window::PageXOffset, DontDelete|ReadOnly, 0, &WindowTableEntries[109] },
+ { "screenX", Window::ScreenX, DontDelete|ReadOnly, 0, 0 },
+ { "screenY", Window::ScreenY, DontDelete|ReadOnly, 0, &WindowTableEntries[100] },
+ { "scroll", Window::Scroll, DontDelete|Function, 2, &WindowTableEntries[89] },
+ { "scrollBy", Window::ScrollBy, DontDelete|Function, 2, 0 },
{ "moveBy", Window::MoveBy, DontDelete|Function, 2, 0 },
- { "moveTo", Window::MoveTo, DontDelete|Function, 2, &WindowTableEntries[115] },
+ { "moveTo", Window::MoveTo, DontDelete|Function, 2, 0 },
{ "window", Window::_Window, DontDelete|ReadOnly, 0, 0 },
+ { "top", Window::Top, DontDelete|ReadOnly, 0, &WindowTableEntries[98] },
{ "screen", Window::_Screen, DontDelete|ReadOnly, 0, 0 },
- { "Option", Window::Option, DontDelete|ReadOnly, 0, &WindowTableEntries[106] },
- { "confirm", Window::Confirm, DontDelete|Function, 1, 0 },
- { "clearTimeout", Window::ClearTimeout, DontDelete|Function, 1, 0 },
- { "focus", Window::Focus, DontDelete|Function, 0, 0 },
- { "blur", Window::Blur, DontDelete|Function, 0, 0 },
+ { "Image", Window::Image, DontDelete|ReadOnly, 0, 0 },
+ { "prompt", Window::Prompt, DontDelete|Function, 2, &WindowTableEntries[94] },
+ { "open", Window::Open, DontDelete|Function, 3, 0 },
+ { "blur", Window::Blur, DontDelete|Function, 0, &WindowTableEntries[97] },
+ { "close", Window::Close, DontDelete|Function, 0, 0 },
{ "setInterval", Window::SetInterval, DontDelete|Function, 2, 0 },
- { "captureEvents", Window::CaptureEvents, DontDelete|Function, 0, &WindowTableEntries[118] },
+ { "captureEvents", Window::CaptureEvents, DontDelete|Function, 0, &WindowTableEntries[103] },
{ "releaseEvents", Window::ReleaseEvents, DontDelete|Function, 0, 0 },
{ "removeEventListener", Window::RemoveEventListener, DontDelete|Function, 3, 0 },
- { "onchange", Window::Onchange, DontDelete, 0, 0 },
- { "onclick", Window::Onclick, DontDelete, 0, 0 },
+ { "ondblclick", Window::Ondblclick, DontDelete, 0, 0 },
+ { "ondragdrop", Window::Ondragdrop, DontDelete, 0, 0 },
{ "onfocus", Window::Onfocus, DontDelete, 0, 0 },
{ "onkeydown", Window::Onkeydown, DontDelete, 0, 0 },
- { "onmousedown", Window::Onmousedown, DontDelete, 0, 0 },
- { "onmousemove", Window::Onmousemove, DontDelete, 0, &WindowTableEntries[120] },
- { "onmouseout", Window::Onmouseout, DontDelete, 0, 0 },
+ { "onkeypress", Window::Onkeypress, DontDelete, 0, 0 },
+ { "onmousemove", Window::Onmousemove, DontDelete, 0, &WindowTableEntries[108] },
{ "onmouseover", Window::Onmouseover, DontDelete, 0, 0 },
- { "onreset", Window::Onreset, DontDelete, 0, 0 },
+ { "onmouseup", Window::Onmouseup, DontDelete, 0, 0 },
+ { "onmove", Window::Onmove, DontDelete, 0, 0 },
{ "onresize", Window::Onresize, DontDelete, 0, 0 },
+ { "onselect", Window::Onselect, DontDelete, 0, 0 },
+ { "onsubmit", Window::Onsubmit, DontDelete, 0, 0 },
{ "onunload", Window::Onunload, DontDelete, 0, 0 }
};
-const struct HashTable WindowTable = { 2, 123, WindowTableEntries, 89 };
+const struct HashTable WindowTable = { 2, 113, WindowTableEntries, 79 };
}; // namespace
diff --git a/WebCore/khtml/html/html_documentimpl.cpp b/WebCore/khtml/html/html_documentimpl.cpp
index 13f0a84..c200ab3 100644
--- a/WebCore/khtml/html/html_documentimpl.cpp
+++ b/WebCore/khtml/html/html_documentimpl.cpp
@@ -296,6 +296,14 @@ static bool isTransitional(const QString &spec, int start)
return false;
}
+#ifdef APPLE_CHANGES
+void HTMLDocumentImpl::clearTimers()
+{
+ view()->unscheduleRelayout();
+ view()->unscheduleRepaint();
+}
+#endif
+
void HTMLDocumentImpl::close()
{
// First fire the onload.
diff --git a/WebCore/khtml/html/html_documentimpl.h b/WebCore/khtml/html/html_documentimpl.h
index 3d0a485..578f1fb 100644
--- a/WebCore/khtml/html/html_documentimpl.h
+++ b/WebCore/khtml/html/html_documentimpl.h
@@ -64,6 +64,7 @@ public:
#if APPLE_CHANGES
DOMString policyBaseURL() const { return m_policyBaseURL; }
void setPolicyBaseURL(const DOMString &s) { m_policyBaseURL = s; }
+ void clearTimers();
#endif
HTMLElementImpl *body();
diff --git a/WebCore/khtml/khtml_part.cpp b/WebCore/khtml/khtml_part.cpp
index 87feea7..9c5f014 100644
--- a/WebCore/khtml/khtml_part.cpp
+++ b/WebCore/khtml/khtml_part.cpp
@@ -951,7 +951,9 @@ void KHTMLPart::clear()
d->m_redirectLockHistory = true;
d->m_bHTTPRefresh = false;
d->m_bClearing = false;
+#if !APPLE_CHANGES
d->m_frameNameId = 1;
+#endif
d->m_bFirstData = true;
d->m_bMousePressed = false;
diff --git a/WebCore/khtml/khtmlpart_p.h b/WebCore/khtml/khtmlpart_p.h
index 8d7f949..f7b66d5 100644
--- a/WebCore/khtml/khtmlpart_p.h
+++ b/WebCore/khtml/khtmlpart_p.h
@@ -126,7 +126,9 @@ public:
m_javaContext = 0;
#endif
m_cacheId = 0;
+#if !APPLE_CHANGES
m_frameNameId = 1;
+#endif
m_restored = false;
@@ -219,7 +221,15 @@ public:
bool m_metaRefreshEnabled :1;
bool m_bPluginsOverride :1;
bool m_restored :1;
+#if APPLE_CHANGES
+ // Made this static so frame names are globally unique and unsigned
+ // so overflow is handled more gracefully.
+ static unsigned m_frameNameId;
+ bool m_savingPageState:1;
+ bool m_restoringPageState:1;
+#else
int m_frameNameId;
+#endif
int m_dcop_counter;
DCOPObject *m_dcopobject;
diff --git a/WebCore/kwq/KWQKHTMLPart.h b/WebCore/kwq/KWQKHTMLPart.h
index 61b273d..b165c3c 100644
--- a/WebCore/kwq/KWQKHTMLPart.h
+++ b/WebCore/kwq/KWQKHTMLPart.h
@@ -147,11 +147,6 @@ public:
static void widgetWillReleaseView(NSView *);
- static void setCurrentEvent(NSEvent *event) { _currentEvent = event; }
- static NSEvent *currentEvent() { return _currentEvent; }
-
- void clearTimers();
-
private:
virtual void khtmlMousePressEvent(khtml::MousePressEvent *);
virtual void khtmlMouseDoubleClickEvent(khtml::MouseDoubleClickEvent *);
@@ -178,8 +173,6 @@ private:
bool _ownsView;
NSView *_mouseDownView;
-
- static NSEvent *_currentEvent;
static QPtrList<KWQKHTMLPart> &mutableInstances();
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index b2ac087..8c53db7 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -33,6 +33,7 @@
#import "khtmlpart_p.h"
#import "khtmlview.h"
#import "kjs_window.h"
+#import <kjs/property_map.h>
#import "WebCoreBridge.h"
#import "WebCoreBridgePrivate.h"
@@ -44,8 +45,6 @@
#import "xml/dom2_eventsimpl.h"
-#import <JavaScriptCore/property_map.h>
-
#undef _KWQ_TIMING
using DOM::DocumentImpl;
@@ -72,7 +71,7 @@ using KJS::Window;
using KParts::ReadOnlyPart;
using KParts::URLArgs;
-NSEvent *KWQKHTMLPart::_currentEvent = nil;
+unsigned KHTMLPartPrivate::m_frameNameId = 0;
void KHTMLPart::completed()
{
@@ -179,13 +178,13 @@ void KWQKHTMLPart::submitForm(const KURL &url, const URLArgs &args)
{
if (!args.doPost()) {
[bridgeForFrameName(args.frameName) loadURL:url.url().getNSString() reload:args.reload
- triggeringEvent:_currentEvent isFormSubmission:YES];
+ triggeringEvent:[NSApp currentEvent] isFormSubmission:YES];
} else {
QString contentType = args.contentType();
ASSERT(contentType.startsWith("Content-Type: "));
[bridgeForFrameName(args.frameName) postWithURL:url.url().getNSString()
data:[NSData dataWithBytes:args.postData.data() length:args.postData.size()]
- contentType:contentType.mid(14).getNSString() triggeringEvent:_currentEvent];
+ contentType:contentType.mid(14).getNSString() triggeringEvent:[NSApp currentEvent]];
}
}
@@ -210,7 +209,7 @@ void KWQKHTMLPart::slotData(NSString *encoding, bool forceEncoding, const char *
void KWQKHTMLPart::urlSelected(const KURL &url, int button, int state, const URLArgs &args)
{
[bridgeForFrameName(args.frameName) loadURL:url.url().getNSString() reload:args.reload
- triggeringEvent:_currentEvent isFormSubmission:NO];
+ triggeringEvent:[NSApp currentEvent] isFormSubmission:NO];
}
class KWQPluginPart : public ReadOnlyPart
@@ -312,13 +311,8 @@ void KWQKHTMLPart::redirectionTimerStartedOrStopped()
void KWQKHTMLPart::paint(QPainter *p, const QRect &rect)
{
#ifndef NDEBUG
- NSView *v = view()->getView();
- if (v) {
- [v lockFocus];
- [[NSColor redColor] set];
- NSRectFill(rect);
- [v unlockFocus];
- }
+ [[NSColor redColor] set];
+ [NSBezierPath fillRect:[view()->getView() visibleRect]];
#endif
if (renderer()) {
@@ -667,7 +661,17 @@ void KWQKHTMLPart::addMetaData(const QString &key, const QString &value)
bool KWQKHTMLPart::keyEvent(NSEvent *event)
{
ASSERT([event type] == NSKeyDown || [event type] == NSKeyUp);
- ASSERT(!_currentEvent);
+
+ const char *characters = [[event characters] lossyCString];
+ int ascii = (characters != nil && strlen(characters) == 1) ? characters[0] : 0;
+
+
+ QKeyEvent qEvent([event type] == NSKeyDown ? QEvent::KeyPress : QEvent::KeyRelease,
+ [event keyCode],
+ ascii,
+ [_bridge stateForEvent:event],
+ QString::fromNSString([event characters]),
+ [event isARepeat]);
// Check for cases where we are too early for events -- possible unmatched key up
// from pressing return in the location bar.
@@ -679,18 +683,6 @@ bool KWQKHTMLPart::keyEvent(NSEvent *event)
if (!node) {
return false;
}
-
- _currentEvent = event;
-
- const char *characters = [[event characters] lossyCString];
- int ascii = (characters != nil && strlen(characters) == 1) ? characters[0] : 0;
-
- QKeyEvent qEvent([event type] == NSKeyDown ? QEvent::KeyPress : QEvent::KeyRelease,
- [event keyCode],
- ascii,
- [_bridge stateForEvent:event],
- QString::fromNSString([event characters]),
- [event isARepeat]);
bool result = node->dispatchKeyEvent(&qEvent);
@@ -706,8 +698,6 @@ bool KWQKHTMLPart::keyEvent(NSEvent *event)
result = result && node->dispatchKeyEvent(&qEvent);
}
- _currentEvent = nil;
-
return result;
}
@@ -753,24 +743,24 @@ bool KWQKHTMLPart::handleMouseDownEventForWidget(khtml::MouseEvent *event)
// Figure out which view to send the event to.
RenderObject *target = event->innerNode().handle()->renderer();
- if (!target || !target->isWidget()) {
+ if (!target->isWidget()) {
return false;
}
- NSView *nodeView = static_cast<RenderWidget *>(target)->widget()->getView();
- ASSERT(nodeView);
- ASSERT([nodeView superview]);
- NSView *topView = nodeView;
+ NSView *outerView = static_cast<RenderWidget *>(target)->widget()->getOuterView();
+ ASSERT(outerView);
+ ASSERT([outerView superview]);
+ NSView *topView = outerView;
NSView *superview;
while ((superview = [topView superview])) {
topView = superview;
}
- NSView *view = [nodeView hitTest:[[nodeView superview] convertPoint:[_currentEvent locationInWindow] fromView:topView]];
+ NSView *view = [outerView hitTest:[[outerView superview] convertPoint:[[NSApp currentEvent] locationInWindow] fromView:topView]];
if (view == nil) {
ERROR("KHTML says we hit a RenderWidget, but AppKit doesn't agree we hit the corresponding NSView");
return false;
}
- [view mouseDown:_currentEvent];
+ [view mouseDown:[NSApp currentEvent]];
// Remember which view we sent the event to, so we can direct the release event properly.
_mouseDownView = view;
@@ -785,7 +775,7 @@ void KWQKHTMLPart::khtmlMouseReleaseEvent(MouseReleaseEvent *event)
return;
}
- [_mouseDownView mouseUp:_currentEvent];
+ [_mouseDownView mouseUp:[NSApp currentEvent]];
_mouseDownView = nil;
}
@@ -800,11 +790,3 @@ void KWQKHTMLPart::widgetWillReleaseView(NSView *view)
}
}
}
-
-void KWQKHTMLPart::clearTimers()
-{
- if (view()) {
- view()->unscheduleRelayout();
- view()->unscheduleRepaint();
- }
-}
diff --git a/WebCore/kwq/KWQWidget.mm b/WebCore/kwq/KWQWidget.mm
index f389267..1706d7e 100644
--- a/WebCore/kwq/KWQWidget.mm
+++ b/WebCore/kwq/KWQWidget.mm
@@ -72,7 +72,7 @@ QWidget::QWidget(NSView *view)
QWidget::~QWidget()
{
- KWQKHTMLPart::widgetWillReleaseView(data->view);
+ KWQKHTMLPart::widgetWillReleaseView(getOuterView());
[data->view release];
delete data;
}
@@ -164,7 +164,7 @@ int QWidget::baselinePosition() const
QWidget *QWidget::topLevelWidget() const
{
NSWindow *window = nil;
- NSView *view = data->view;
+ NSView *view = getView();
window = [view window];
while (window == nil && view != nil) {
@@ -197,7 +197,7 @@ void QWidget::setFocus()
renderWidget->view()->addChild(this, x, y);
}
- [[data->view window] makeFirstResponder:data->view];
+ [[getView() window] makeFirstResponder:getView()];
}
void QWidget::clearFocus()
@@ -210,7 +210,7 @@ QWidget::FocusPolicy QWidget::focusPolicy() const
// This is the AppKit rule for what can be tabbed to.
// An NSControl that accepts first responder, and has an editable, enabled cell.
- NSView *view = data->view;
+ NSView *view = getView();
if (![view acceptsFirstResponder] || ![view isKindOfClass:[NSControl class]]) {
return NoFocus;
}
@@ -370,22 +370,22 @@ NSView *QWidget::getOuterView() const
void QWidget::lockDrawingFocus()
{
- [data->view lockFocus];
+ [getView() lockFocus];
}
void QWidget::unlockDrawingFocus()
{
- [data->view unlockFocus];
+ [getView() unlockFocus];
}
void QWidget::disableFlushDrawing()
{
- [[data->view window] disableFlushWindow];
+ [[getView() window] disableFlushWindow];
}
void QWidget::enableFlushDrawing()
{
- NSWindow *window = [data->view window];
+ NSWindow *window = [getView() window];
[window enableFlushWindow];
[window flushWindow];
}
diff --git a/WebCore/kwq/WebCoreBridge.mm b/WebCore/kwq/WebCoreBridge.mm
index 90cf466..0eebc1b 100644
--- a/WebCore/kwq/WebCoreBridge.mm
+++ b/WebCore/kwq/WebCoreBridge.mm
@@ -52,19 +52,16 @@
#import "WebCoreDOMPrivate.h"
-#import <JavaScriptCore/property_map.h>
+#import <kjs/property_map.h>
using KParts::URLArgs;
using DOM::DocumentImpl;
-using DOM::Node;
-using DOM::NodeImpl;
using khtml::parseURL;
using khtml::RenderImage;
using khtml::RenderObject;
using khtml::RenderPart;
-using khtml::RenderStyle;
using KJS::SavedProperties;
@@ -82,18 +79,18 @@ NSString *WebCoreElementStringKey = @"WebElementString";
@interface KWQPageState : NSObject
{
- DocumentImpl *document;
+ DOM::DocumentImpl *document;
KURL *URL;
- SavedProperties *windowProperties;
- SavedProperties *locationProperties;
- RenderObject *docRenderer;
+ KJS::SavedProperties *windowProperties;
+ KJS::SavedProperties *locationProperties;
+ khtml::RenderObject *docRenderer;
}
-- initWithDocument: (DocumentImpl *)doc URL: (KURL)u windowProperties: (SavedProperties *)wp locationProperties: (SavedProperties *)lp;
-- (DocumentImpl *)document;
+- initWithDocument: (DOM::DocumentImpl *)doc URL: (KURL)u windowProperties: (KJS::SavedProperties *)wp locationProperties: (KJS::SavedProperties *)lp;
+- (DOM::DocumentImpl *)document;
- (KURL *)URL;
-- (SavedProperties *)windowProperties;
-- (SavedProperties *)locationProperties;
-- (RenderObject *)renderer;
+- (KJS::SavedProperties *)windowProperties;
+- (KJS::SavedProperties *)locationProperties;
+- (khtml::RenderObject *)renderer;
@end
@implementation WebCoreBridge
@@ -231,23 +228,20 @@ NSString *WebCoreElementStringKey = @"WebElementString";
- (BOOL)saveDocumentToPageCache
{
DocumentImpl *doc = _part->xmlDocImpl();
- if (!doc) {
- return NO;
+ if (doc != 0){
+ KJS::SavedProperties *windowProperties = new KJS::SavedProperties();
+ KJS::SavedProperties *locationProperties = new KJS::SavedProperties();
+
+ _part->saveWindowProperties(windowProperties);
+ _part->saveLocationProperties(locationProperties);
+ if (doc->isHTMLDocument()) {
+ DOM::HTMLDocumentImpl* hdoc = static_cast<HTMLDocumentImpl*>(doc);
+ hdoc->clearTimers();
+ }
+ KWQPageState *pageState = [[[KWQPageState alloc] initWithDocument: doc URL:_part->m_url windowProperties:windowProperties locationProperties:locationProperties] autorelease];
+ return [self saveDocumentToPageCache: pageState];
}
-
- _part->clearTimers();
-
- SavedProperties *windowProperties = new SavedProperties;
- _part->saveWindowProperties(windowProperties);
-
- SavedProperties *locationProperties = new SavedProperties;
- _part->saveLocationProperties(locationProperties);
-
- KWQPageState *pageState = [[[KWQPageState alloc] initWithDocument:doc
- URL:_part->m_url
- windowProperties:windowProperties
- locationProperties:locationProperties] autorelease];
- return [self saveDocumentToPageCache:pageState];
+ return false;
}
- (BOOL)canCachePage
@@ -432,14 +426,10 @@ NSString *WebCoreElementStringKey = @"WebElementString";
- (void)mouseUp:(NSEvent *)event
{
- ASSERT(!KWQKHTMLPart::currentEvent());
-
if (!_part->view()) {
return;
}
- KWQKHTMLPart::setCurrentEvent(event);
-
NSPoint p = [event locationInWindow];
int button, state;
@@ -469,24 +459,19 @@ NSString *WebCoreElementStringKey = @"WebElementString";
if (clickCount > 0 && clickCount % 2 == 0) {
QMouseEvent doubleClickEvent(QEvent::MouseButtonDblClick, QPoint(p), button, state, clickCount);
_part->view()->viewportMouseDoubleClickEvent(&doubleClickEvent);
- } else {
+ }
+ else {
QMouseEvent releaseEvent(QEvent::MouseButtonRelease, QPoint(p), button, state, clickCount);
_part->view()->viewportMouseReleaseEvent(&releaseEvent);
}
-
- KWQKHTMLPart::setCurrentEvent(nil);
}
- (void)mouseDown:(NSEvent *)event
{
- ASSERT(!KWQKHTMLPart::currentEvent());
-
if (!_part->view()) {
return;
}
- KWQKHTMLPart::setCurrentEvent(event);
-
NSPoint p = [event locationInWindow];
int button, state;
@@ -508,44 +493,30 @@ NSString *WebCoreElementStringKey = @"WebElementString";
QMouseEvent kEvent(QEvent::MouseButtonPress, QPoint(p), button, state, [event clickCount]);
_part->view()->viewportMousePressEvent(&kEvent);
-
- KWQKHTMLPart::setCurrentEvent(nil);
}
- (void)mouseMoved:(NSEvent *)event
{
- ASSERT(!KWQKHTMLPart::currentEvent());
-
if (!_part->view()) {
return;
}
- KWQKHTMLPart::setCurrentEvent(event);
-
NSPoint p = [event locationInWindow];
QMouseEvent kEvent(QEvent::MouseMove, QPoint(p), 0, [self stateForEvent:event]);
_part->view()->viewportMouseMoveEvent(&kEvent);
-
- KWQKHTMLPart::setCurrentEvent(nil);
}
- (void)mouseDragged:(NSEvent *)event
{
- ASSERT(!KWQKHTMLPart::currentEvent());
-
if (!_part->view()) {
return;
}
- KWQKHTMLPart::setCurrentEvent(event);
-
NSPoint p = [event locationInWindow];
QMouseEvent kEvent(QEvent::MouseMove, QPoint(p), Qt::LeftButton, Qt::LeftButton);
_part->view()->viewportMouseMoveEvent(&kEvent);
-
- KWQKHTMLPart::setCurrentEvent(nil);
}
- (NSDictionary *)elementAtPoint:(NSPoint)point
@@ -698,22 +669,22 @@ NSString *WebCoreElementStringKey = @"WebElementString";
_part->xmlDocImpl()->setSelection([(WebCoreDOMNode *)start impl], startOffset, [(WebCoreDOMNode *)end impl], endOffset);
}
-static NSAttributedString *attributedString(NodeImpl *_startNode, int startOffset, NodeImpl *endNode, int endOffset)
+static NSAttributedString *attributedString(DOM::NodeImpl *_startNode, int startOffset, DOM::NodeImpl *endNode, int endOffset)
{
bool hasNewLine = true;
bool hasParagraphBreak = true;
- Node n = _startNode;
- RenderObject *renderer;
+ DOM::Node n = _startNode;
+ khtml::RenderObject *renderer;
NSFont *font;
NSMutableAttributedString *result = [[[NSMutableAttributedString alloc] init] autorelease];
NSAttributedString *partialString;
while(!n.isNull()) {
renderer = n.handle()->renderer();
- if (n.nodeType() == Node::TEXT_NODE && renderer) {
+ if (n.nodeType() == DOM::Node::TEXT_NODE && renderer) {
QString text;
QString str = n.nodeValue().string();
- RenderStyle *style = 0;
+khtml::RenderStyle *style = 0;
font = nil;
style = renderer->style();
@@ -801,7 +772,7 @@ static NSAttributedString *attributedString(NodeImpl *_startNode, int startOffse
if(n == endNode)
break;
- Node next = n.firstChild();
+DOM::Node next = n.firstChild();
if(next.isNull())
next = n.nextSibling();
@@ -945,7 +916,7 @@ static NSAttributedString *attributedString(NodeImpl *_startNode, int startOffse
@end
@implementation KWQPageState
-- initWithDocument:(DocumentImpl *)doc URL:(KURL)u windowProperties:(SavedProperties *)wp locationProperties:(SavedProperties *)lp
+- initWithDocument: (DOM::DocumentImpl *)doc URL: (KURL)u windowProperties: (KJS::SavedProperties *)wp locationProperties: (KJS::SavedProperties *)lp
{
[super init];
doc->ref();
@@ -962,8 +933,10 @@ static NSAttributedString *attributedString(NodeImpl *_startNode, int startOffse
{
KHTMLView *view = document->view();
- KWQ(view->part())->clearTimers();
-
+ if (document->isHTMLDocument()) {
+ DOM::HTMLDocumentImpl* hdoc = static_cast<HTMLDocumentImpl*>(document);
+ hdoc->clearTimers();
+ }
document->setInPageCache(NO);
document->detach();
document->deref();
@@ -979,7 +952,7 @@ static NSAttributedString *attributedString(NodeImpl *_startNode, int startOffse
[super dealloc];
}
-- (DocumentImpl *)document
+- (DOM::DocumentImpl *)document
{
return document;
}
@@ -989,19 +962,21 @@ static NSAttributedString *attributedString(NodeImpl *_startNode, int startOffse
return URL;
}
-- (SavedProperties *)windowProperties
+- (KJS::SavedProperties *)windowProperties
{
return windowProperties;
}
-- (SavedProperties *)locationProperties
+- (KJS::SavedProperties *)locationProperties
{
return locationProperties;
}
-- (RenderObject *)renderer
+- (khtml::RenderObject *)renderer
{
return docRenderer;
}
+
@end
+
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list