[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:42 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit a9ca05fed412e777b0f7f325b4f0b83a25c19f32
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Dec 11 20:26:33 2002 +0000

    WebCore:
    
            Reviewed by John.
    
    	- fixed handling of mouse events so I could turn the mechanism on all the way
    	- fixed anomalies in the red-painting-for-null-view-detection
    	- fixed 3123105 -- REGRESSION: Crash in KHTMLView::unscheduleRelayout on exit
    	- fixed 3124047 -- REGRESSION: crash in KWQKHTMLPart::handleMouseDownEventForWidget at nwa.com
    
            * kwq/KWQKHTMLPart.h: Add setCurrentEvent()/currentEvent()/_currentEvent back, because we can
    	end up doing a lot of work and processing a lot of events before we get around to handling the
    	current event, so [NSApp currentEvent] won't cut it. Also add clearTimers, passSubframeEventToSubframe,
    	an overload for handleMouseDownEventForWidget, and _mouseDownWasInSubframe boolean.
    
            * kwq/KWQKHTMLPart.mm:
            (KWQKHTMLPart::submitForm): Use _currentEvent.
            (KWQKHTMLPart::urlSelected): Use _currentEvent.
            (KWQKHTMLPart::paint): Fixed red-drawing-for-debug code by using KWQPainter instead of going
    	directly to the AppKit level.
            (KWQKHTMLPart::keyEvent): Moved the check for null node up a bit, and set _currentEvent.
            (KWQKHTMLPart::handleMouseDownEventForWidget): Break into two pieces, so we can share the
    	code with the new passSubframeEventToSubframe. Set _mouseDownWasInSubframe to false
    	when setting _mouseDownView. Use getView() instead of getOuterView() since we really don't
    	care about the WebView after all. Use _currentEvent. Add a check for nodes that lack a renderer
    	to fix the crash at nwa.com above.
            (KWQKHTMLPart::khtmlMouseReleaseEvent): Use _currentEvent.
            (KWQKHTMLPart::clearTimers): Added. Checks for null view, which fixes the crash on exit above.
            (KWQKHTMLPart::passSubframeEventToSubframe): Added. Checks for the categories of events that we
    	can pass to subframes, which are mouse down, up, and dragged events, and passes them along.
    	This is the main fix that makes subframes work properly.
    
            * khtml/khtmlview.cpp:
            (KHTMLView::viewportMousePressEvent): Add call to the new passSubframeEventToSubframe.
            (KHTMLView::viewportMouseDoubleClickEvent): Ditto.
            (KHTMLView::viewportMouseMoveEvent): Ditto.
            (KHTMLView::viewportMouseReleaseEvent): Ditto.
    
            * kwq/WebCoreBridge.mm:
            (-[WebCoreBridge saveDocumentToPageCache]): Call clearTimers on the part now, instead of the document.
            (-[WebCoreBridge mouseUp:]): Call setCurrentEvent.
            (-[WebCoreBridge mouseDown:]): Ditto.
            (-[WebCoreBridge mouseMoved:]): Ditto.
            (-[WebCoreBridge mouseDragged:]): Ditto.
            (-[KWQPageState initWithDocument:URL:windowProperties:locationProperties:]): Call clearTimers on the
    	part now, instead of the document.
    
    	- other changes
    
            * khtml/ecma/kjs_window.lut.h: Let this be regenerated. I think I accidentally checked
    	in an obsolete version of this earlier.
    
            * khtml/html/html_documentimpl.h: Remove clearTimers(). We don't need it here in APPLE_CHANGES.
            * khtml/html/html_documentimpl.cpp: Ditto.
    
            * khtml/khtmlpart_p.h: Removed unneeded APPLE_CHANGES. We don't use m_frameNameId any more, nor
    	do we need m_savingPageState or m_restoringPageState.
            * khtml/khtml_part.cpp: (KHTMLPart::clear): Removed unneeded APPLE_CHANGES, now that we don't
    	use m_frameNameId any more.
    
            * kwq/KWQWidget.mm: (KWQWidget::getOuterView): Tolerate nil for view here, so we can use this from
            the QWidget destructor.
    
    WebKit:
    
            Reviewed by John.
    
    	- turned on the mechanism that passes events through WebCore, now that it's working better
    
            * WebView.subproj/WebHTMLViewPrivate.m:
            (-[WebHTMLView hitTest:]): Moved this function in here. Rewrote it. It has a new feature where
    	you can set a global and do a normal hit test, needed for the mouse-moved handling below. Also,
    	for efficiency, it does the actual hit testing of itself, rather than calling super, which recurses,
    	and ignoring the result. The sum total is that it always returns self for mouse-moved events, so
    	we pass them all over the bridge at the topmost frame.
    
            (-[WebHTMLView _updateMouseoverWithEvent:]):
            * WebView.subproj/WebHTMLView.m: Moved hitTest: out of here.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3003 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index a064a33..c6a12bb 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,5 +1,67 @@
 2002-12-11  Darin Adler  <darin at apple.com>
 
+        Reviewed by John.
+
+	- fixed handling of mouse events so I could turn the mechanism on all the way
+	- fixed anomalies in the red-painting-for-null-view-detection
+	- fixed 3123105 -- REGRESSION: Crash in KHTMLView::unscheduleRelayout on exit
+	- fixed 3124047 -- REGRESSION: crash in KWQKHTMLPart::handleMouseDownEventForWidget at nwa.com
+
+        * kwq/KWQKHTMLPart.h: Add setCurrentEvent()/currentEvent()/_currentEvent back, because we can
+	end up doing a lot of work and processing a lot of events before we get around to handling the
+	current event, so [NSApp currentEvent] won't cut it. Also add clearTimers, passSubframeEventToSubframe,
+	an overload for handleMouseDownEventForWidget, and _mouseDownWasInSubframe boolean.
+
+        * kwq/KWQKHTMLPart.mm:
+        (KWQKHTMLPart::submitForm): Use _currentEvent.
+        (KWQKHTMLPart::urlSelected): Use _currentEvent.
+        (KWQKHTMLPart::paint): Fixed red-drawing-for-debug code by using KWQPainter instead of going
+	directly to the AppKit level.
+        (KWQKHTMLPart::keyEvent): Moved the check for null node up a bit, and set _currentEvent.
+        (KWQKHTMLPart::handleMouseDownEventForWidget): Break into two pieces, so we can share the
+	code with the new passSubframeEventToSubframe. Set _mouseDownWasInSubframe to false
+	when setting _mouseDownView. Use getView() instead of getOuterView() since we really don't
+	care about the WebView after all. Use _currentEvent. Add a check for nodes that lack a renderer
+	to fix the crash at nwa.com above.
+        (KWQKHTMLPart::khtmlMouseReleaseEvent): Use _currentEvent.
+        (KWQKHTMLPart::clearTimers): Added. Checks for null view, which fixes the crash on exit above.
+        (KWQKHTMLPart::passSubframeEventToSubframe): Added. Checks for the categories of events that we
+	can pass to subframes, which are mouse down, up, and dragged events, and passes them along.
+	This is the main fix that makes subframes work properly.
+
+        * khtml/khtmlview.cpp:
+        (KHTMLView::viewportMousePressEvent): Add call to the new passSubframeEventToSubframe.
+        (KHTMLView::viewportMouseDoubleClickEvent): Ditto.
+        (KHTMLView::viewportMouseMoveEvent): Ditto.
+        (KHTMLView::viewportMouseReleaseEvent): Ditto.
+
+        * kwq/WebCoreBridge.mm:
+        (-[WebCoreBridge saveDocumentToPageCache]): Call clearTimers on the part now, instead of the document.
+        (-[WebCoreBridge mouseUp:]): Call setCurrentEvent.
+        (-[WebCoreBridge mouseDown:]): Ditto.
+        (-[WebCoreBridge mouseMoved:]): Ditto.
+        (-[WebCoreBridge mouseDragged:]): Ditto.
+        (-[KWQPageState initWithDocument:URL:windowProperties:locationProperties:]): Call clearTimers on the
+	part now, instead of the document.
+
+	- other changes
+
+        * khtml/ecma/kjs_window.lut.h: Let this be regenerated. I think I accidentally checked
+	in an obsolete version of this earlier.
+
+        * khtml/html/html_documentimpl.h: Remove clearTimers(). We don't need it here in APPLE_CHANGES.
+        * khtml/html/html_documentimpl.cpp: Ditto.
+
+        * khtml/khtmlpart_p.h: Removed unneeded APPLE_CHANGES. We don't use m_frameNameId any more, nor
+	do we need m_savingPageState or m_restoringPageState.
+        * khtml/khtml_part.cpp: (KHTMLPart::clear): Removed unneeded APPLE_CHANGES, now that we don't
+	use m_frameNameId any more.
+        
+        * kwq/KWQWidget.mm: (KWQWidget::getOuterView): Tolerate nil for view here, so we can use this from
+        the QWidget destructor.
+
+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>
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index a064a33..c6a12bb 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,5 +1,67 @@
 2002-12-11  Darin Adler  <darin at apple.com>
 
+        Reviewed by John.
+
+	- fixed handling of mouse events so I could turn the mechanism on all the way
+	- fixed anomalies in the red-painting-for-null-view-detection
+	- fixed 3123105 -- REGRESSION: Crash in KHTMLView::unscheduleRelayout on exit
+	- fixed 3124047 -- REGRESSION: crash in KWQKHTMLPart::handleMouseDownEventForWidget at nwa.com
+
+        * kwq/KWQKHTMLPart.h: Add setCurrentEvent()/currentEvent()/_currentEvent back, because we can
+	end up doing a lot of work and processing a lot of events before we get around to handling the
+	current event, so [NSApp currentEvent] won't cut it. Also add clearTimers, passSubframeEventToSubframe,
+	an overload for handleMouseDownEventForWidget, and _mouseDownWasInSubframe boolean.
+
+        * kwq/KWQKHTMLPart.mm:
+        (KWQKHTMLPart::submitForm): Use _currentEvent.
+        (KWQKHTMLPart::urlSelected): Use _currentEvent.
+        (KWQKHTMLPart::paint): Fixed red-drawing-for-debug code by using KWQPainter instead of going
+	directly to the AppKit level.
+        (KWQKHTMLPart::keyEvent): Moved the check for null node up a bit, and set _currentEvent.
+        (KWQKHTMLPart::handleMouseDownEventForWidget): Break into two pieces, so we can share the
+	code with the new passSubframeEventToSubframe. Set _mouseDownWasInSubframe to false
+	when setting _mouseDownView. Use getView() instead of getOuterView() since we really don't
+	care about the WebView after all. Use _currentEvent. Add a check for nodes that lack a renderer
+	to fix the crash at nwa.com above.
+        (KWQKHTMLPart::khtmlMouseReleaseEvent): Use _currentEvent.
+        (KWQKHTMLPart::clearTimers): Added. Checks for null view, which fixes the crash on exit above.
+        (KWQKHTMLPart::passSubframeEventToSubframe): Added. Checks for the categories of events that we
+	can pass to subframes, which are mouse down, up, and dragged events, and passes them along.
+	This is the main fix that makes subframes work properly.
+
+        * khtml/khtmlview.cpp:
+        (KHTMLView::viewportMousePressEvent): Add call to the new passSubframeEventToSubframe.
+        (KHTMLView::viewportMouseDoubleClickEvent): Ditto.
+        (KHTMLView::viewportMouseMoveEvent): Ditto.
+        (KHTMLView::viewportMouseReleaseEvent): Ditto.
+
+        * kwq/WebCoreBridge.mm:
+        (-[WebCoreBridge saveDocumentToPageCache]): Call clearTimers on the part now, instead of the document.
+        (-[WebCoreBridge mouseUp:]): Call setCurrentEvent.
+        (-[WebCoreBridge mouseDown:]): Ditto.
+        (-[WebCoreBridge mouseMoved:]): Ditto.
+        (-[WebCoreBridge mouseDragged:]): Ditto.
+        (-[KWQPageState initWithDocument:URL:windowProperties:locationProperties:]): Call clearTimers on the
+	part now, instead of the document.
+
+	- other changes
+
+        * khtml/ecma/kjs_window.lut.h: Let this be regenerated. I think I accidentally checked
+	in an obsolete version of this earlier.
+
+        * khtml/html/html_documentimpl.h: Remove clearTimers(). We don't need it here in APPLE_CHANGES.
+        * khtml/html/html_documentimpl.cpp: Ditto.
+
+        * khtml/khtmlpart_p.h: Removed unneeded APPLE_CHANGES. We don't use m_frameNameId any more, nor
+	do we need m_savingPageState or m_restoringPageState.
+        * khtml/khtml_part.cpp: (KHTMLPart::clear): Removed unneeded APPLE_CHANGES, now that we don't
+	use m_frameNameId any more.
+        
+        * kwq/KWQWidget.mm: (KWQWidget::getOuterView): Tolerate nil for view here, so we can use this from
+        the QWidget destructor.
+
+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>
diff --git a/WebCore/khtml/ecma/kjs_window.lut.h b/WebCore/khtml/ecma/kjs_window.lut.h
index a2801fb..b8f163b 100644
--- a/WebCore/khtml/ecma/kjs_window.lut.h
+++ b/WebCore/khtml/ecma/kjs_window.lut.h
@@ -22,122 +22,132 @@ 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 },
-   { "Option", Window::Option, DontDelete|ReadOnly, 0, &WindowTableEntries[104] },
-   { "closed", Window::Closed, DontDelete|ReadOnly, 0, &WindowTableEntries[87] },
+   { "offscreenBuffering", Window::OffscreenBuffering, DontDelete|ReadOnly, 0, 0 },
+   { "setTimeout", Window::SetTimeout, DontDelete|Function, 2, 0 },
    { 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 },
-   { 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] },
+   { "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 },
    { "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 },
-   { "name", Window::Name, DontDelete, 0, 0 },
-   { "navigator", Window::_Navigator, DontDelete|ReadOnly, 0, &WindowTableEntries[84] },
+   { "scrollX", Window::ScrollX, DontDelete|ReadOnly, 0, &WindowTableEntries[110] },
+   { "scroll", Window::Scroll, DontDelete|Function, 2, &WindowTableEntries[98] },
    { 0, 0, 0, 0, 0 },
-   { "innerWidth", Window::InnerWidth, DontDelete|ReadOnly, 0, 0 },
+   { "Node", Window::Node, DontDelete, 0, &WindowTableEntries[112] },
    { "onblur", Window::Onblur, DontDelete, 0, 0 },
    { 0, 0, 0, 0, 0 },
-   { "onclick", Window::Onclick, DontDelete, 0, &WindowTableEntries[105] },
-   { "onmousedown", Window::Onmousedown, DontDelete, 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 },
-   { "self", Window::Self, DontDelete|ReadOnly, 0, &WindowTableEntries[99] },
-   { "scrollX", Window::ScrollX, DontDelete|ReadOnly, 0, &WindowTableEntries[88] },
-   { "scrollY", Window::ScrollY, DontDelete|ReadOnly, 0, &WindowTableEntries[106] },
+   { "scrollBy", Window::ScrollBy, DontDelete|Function, 2, &WindowTableEntries[101] },
    { 0, 0, 0, 0, 0 },
-   { "innerHeight", Window::InnerHeight, DontDelete|ReadOnly, 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 },
-   { "confirm", Window::Confirm, DontDelete|Function, 1, &WindowTableEntries[93] },
-   { "Event", Window::EventCtor, DontDelete, 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 },
+   { "location", Window::_Location, DontDelete, 0, &WindowTableEntries[95] },
+   { "screenTop", Window::ScreenTop, DontDelete|ReadOnly, 0, &WindowTableEntries[116] },
    { 0, 0, 0, 0, 0 },
-   { "setTimeout", Window::SetTimeout, DontDelete|Function, 2, 0 },
    { 0, 0, 0, 0, 0 },
-   { "konqueror", Window::_Konqueror, DontDelete|ReadOnly, 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] },
    { 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 },
+   { "ondblclick", Window::Ondblclick, DontDelete, 0, 0 },
+   { "onkeyup", Window::Onkeyup, DontDelete, 0, 0 },
    { 0, 0, 0, 0, 0 },
+   { "Event", Window::EventCtor, DontDelete, 0, 0 },
+   { "self", Window::Self, DontDelete|ReadOnly, 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] },
+   { "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 },
-   { "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 },
+   { 0, 0, 0, 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 },
+   { 0, 0, 0, 0, 0 },
+   { 0, 0, 0, 0, 0 },
+   { 0, 0, 0, 0, 0 },
+   { 0, 0, 0, 0, 0 },
+   { 0, 0, 0, 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 },
    { "moveBy", Window::MoveBy, DontDelete|Function, 2, 0 },
-   { "moveTo", Window::MoveTo, DontDelete|Function, 2, 0 },
+   { "moveTo", Window::MoveTo, DontDelete|Function, 2, &WindowTableEntries[115] },
    { "window", Window::_Window, DontDelete|ReadOnly, 0, 0 },
-   { "top", Window::Top, DontDelete|ReadOnly, 0, &WindowTableEntries[98] },
    { "screen", Window::_Screen, DontDelete|ReadOnly, 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 },
+   { "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 },
    { "setInterval", Window::SetInterval, DontDelete|Function, 2, 0 },
-   { "captureEvents", Window::CaptureEvents, DontDelete|Function, 0, &WindowTableEntries[103] },
+   { "captureEvents", Window::CaptureEvents, DontDelete|Function, 0, &WindowTableEntries[118] },
    { "releaseEvents", Window::ReleaseEvents, DontDelete|Function, 0, 0 },
    { "removeEventListener", Window::RemoveEventListener, DontDelete|Function, 3, 0 },
-   { "ondblclick", Window::Ondblclick, DontDelete, 0, 0 },
-   { "ondragdrop", Window::Ondragdrop, DontDelete, 0, 0 },
+   { "onchange", Window::Onchange, DontDelete, 0, 0 },
+   { "onclick", Window::Onclick, DontDelete, 0, 0 },
    { "onfocus", Window::Onfocus, DontDelete, 0, 0 },
    { "onkeydown", Window::Onkeydown, DontDelete, 0, 0 },
-   { "onkeypress", Window::Onkeypress, DontDelete, 0, 0 },
-   { "onmousemove", Window::Onmousemove, DontDelete, 0, &WindowTableEntries[108] },
+   { "onmousedown", Window::Onmousedown, DontDelete, 0, 0 },
+   { "onmousemove", Window::Onmousemove, DontDelete, 0, &WindowTableEntries[120] },
+   { "onmouseout", Window::Onmouseout, DontDelete, 0, 0 },
    { "onmouseover", Window::Onmouseover, DontDelete, 0, 0 },
-   { "onmouseup", Window::Onmouseup, DontDelete, 0, 0 },
-   { "onmove", Window::Onmove, DontDelete, 0, 0 },
+   { "onreset", Window::Onreset, 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, 113, WindowTableEntries, 79 };
+const struct HashTable WindowTable = { 2, 123, WindowTableEntries, 89 };
 
 }; // namespace
 
diff --git a/WebCore/khtml/html/html_documentimpl.cpp b/WebCore/khtml/html/html_documentimpl.cpp
index c200ab3..13f0a84 100644
--- a/WebCore/khtml/html/html_documentimpl.cpp
+++ b/WebCore/khtml/html/html_documentimpl.cpp
@@ -296,14 +296,6 @@ 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 578f1fb..3d0a485 100644
--- a/WebCore/khtml/html/html_documentimpl.h
+++ b/WebCore/khtml/html/html_documentimpl.h
@@ -64,7 +64,6 @@ 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 9c5f014..87feea7 100644
--- a/WebCore/khtml/khtml_part.cpp
+++ b/WebCore/khtml/khtml_part.cpp
@@ -951,9 +951,7 @@ 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 f7b66d5..8d7f949 100644
--- a/WebCore/khtml/khtmlpart_p.h
+++ b/WebCore/khtml/khtmlpart_p.h
@@ -126,9 +126,7 @@ public:
     m_javaContext = 0;
 #endif
     m_cacheId = 0;
-#if !APPLE_CHANGES
     m_frameNameId = 1;
-#endif
 
     m_restored = false;
 
@@ -221,15 +219,7 @@ 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/khtml/khtmlview.cpp b/WebCore/khtml/khtmlview.cpp
index 94bae22..a5cd656 100644
--- a/WebCore/khtml/khtmlview.cpp
+++ b/WebCore/khtml/khtmlview.cpp
@@ -448,6 +448,9 @@ void KHTMLView::viewportMousePressEvent( QMouseEvent *_mouse )
 	d->clickY = ym;
     }
 #else
+    if (KWQ(m_part)->passSubframeEventToSubframe(mev))
+        return;
+
     d->clickX = xm;
     d->clickY = ym;
     d->clickCount = _mouse->clickCount();
@@ -481,6 +484,9 @@ void KHTMLView::viewportMouseDoubleClickEvent( QMouseEvent *_mouse )
     m_part->xmlDocImpl()->prepareMouseEvent( false, xm, ym, &mev );
 
 #if APPLE_CHANGES
+    if (KWQ(m_part)->passSubframeEventToSubframe(mev))
+        return;
+
     d->clickCount = _mouse->clickCount();
     bool swallowEvent = dispatchMouseEvent(EventImpl::MOUSEUP_EVENT,mev.innerNode.handle(),true,
                                            d->clickCount,_mouse,false,DOM::NodeImpl::MouseRelease);
@@ -531,6 +537,11 @@ void KHTMLView::viewportMouseMoveEvent( QMouseEvent * _mouse )
 
     DOM::NodeImpl::MouseEvent mev( _mouse->stateAfter(), DOM::NodeImpl::MouseMove );
     m_part->xmlDocImpl()->prepareMouseEvent( false, xm, ym, &mev );
+#if APPLE_CHANGES
+    if (KWQ(m_part)->passSubframeEventToSubframe(mev))
+        return;
+#endif
+
     bool swallowEvent = dispatchMouseEvent(EventImpl::MOUSEMOVE_EVENT,mev.innerNode.handle(),false,
                                            0,_mouse,true,DOM::NodeImpl::MouseMove);
 
@@ -632,6 +643,10 @@ void KHTMLView::viewportMouseReleaseEvent( QMouseEvent * _mouse )
 
     DOM::NodeImpl::MouseEvent mev( _mouse->stateAfter(), DOM::NodeImpl::MouseRelease );
     m_part->xmlDocImpl()->prepareMouseEvent( false, xm, ym, &mev );
+#if APPLE_CHANGES
+    if (KWQ(m_part)->passSubframeEventToSubframe(mev))
+        return;
+#endif
 
     bool swallowEvent = dispatchMouseEvent(EventImpl::MOUSEUP_EVENT,mev.innerNode.handle(),true,
                                            d->clickCount,_mouse,false,DOM::NodeImpl::MouseRelease);
diff --git a/WebCore/kwq/KWQKHTMLPart.h b/WebCore/kwq/KWQKHTMLPart.h
index b165c3c..760f31e 100644
--- a/WebCore/kwq/KWQKHTMLPart.h
+++ b/WebCore/kwq/KWQKHTMLPart.h
@@ -28,6 +28,8 @@
 
 #include "khtml_part.h"
 
+#include "dom_nodeimpl.h"
+
 class KHTMLPartPrivate;
 
 namespace khtml {
@@ -147,12 +149,20 @@ public:
     
     static void widgetWillReleaseView(NSView *);
     
+    static void setCurrentEvent(NSEvent *event) { _currentEvent = event; }
+    static NSEvent *currentEvent() { return _currentEvent; }
+    
+    void clearTimers();
+    
+    bool passSubframeEventToSubframe(DOM::NodeImpl::MouseEvent &);
+    
 private:
     virtual void khtmlMousePressEvent(khtml::MousePressEvent *);
     virtual void khtmlMouseDoubleClickEvent(khtml::MouseDoubleClickEvent *);
     virtual void khtmlMouseReleaseEvent(khtml::MouseReleaseEvent *);
     
     bool handleMouseDownEventForWidget(khtml::MouseEvent *);
+    bool handleMouseDownEventForWidget(khtml::RenderWidget *);
 
     void setPolicyBaseURL(const DOM::DOMString &);
 
@@ -173,6 +183,9 @@ private:
     bool _ownsView;
     
     NSView *_mouseDownView;
+    bool _mouseDownWasInSubframe;
+    
+    static NSEvent *_currentEvent;
 
     static QPtrList<KWQKHTMLPart> &mutableInstances();
 
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index 8c53db7..2ca0e6a 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -33,7 +33,6 @@
 #import "khtmlpart_p.h"
 #import "khtmlview.h"
 #import "kjs_window.h"
-#import <kjs/property_map.h>
 
 #import "WebCoreBridge.h"
 #import "WebCoreBridgePrivate.h"
@@ -45,6 +44,8 @@
 
 #import "xml/dom2_eventsimpl.h"
 
+#import <JavaScriptCore/property_map.h>
+
 #undef _KWQ_TIMING
 
 using DOM::DocumentImpl;
@@ -71,7 +72,7 @@ using KJS::Window;
 using KParts::ReadOnlyPart;
 using KParts::URLArgs;
 
-unsigned KHTMLPartPrivate::m_frameNameId = 0;
+NSEvent *KWQKHTMLPart::_currentEvent = nil;
 
 void KHTMLPart::completed()
 {
@@ -119,6 +120,7 @@ KWQKHTMLPart::KWQKHTMLPart()
     , _completedWithBool(this, SIGNAL(completed(bool)))
     , _ownsView(false)
     , _mouseDownView(nil)
+    , _mouseDownWasInSubframe(false)
 {
     // Must init the cache before connecting to any signals
     Cache::init();
@@ -178,13 +180,13 @@ void KWQKHTMLPart::submitForm(const KURL &url, const URLArgs &args)
 {
     if (!args.doPost()) {
         [bridgeForFrameName(args.frameName) loadURL:url.url().getNSString() reload:args.reload
-            triggeringEvent:[NSApp currentEvent] isFormSubmission:YES];
+            triggeringEvent:_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:[NSApp currentEvent]];
+            contentType:contentType.mid(14).getNSString() triggeringEvent:_currentEvent];
     }
 }
 
@@ -209,7 +211,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:[NSApp currentEvent] isFormSubmission:NO];
+        triggeringEvent:_currentEvent isFormSubmission:NO];
 }
 
 class KWQPluginPart : public ReadOnlyPart
@@ -311,8 +313,7 @@ void KWQKHTMLPart::redirectionTimerStartedOrStopped()
 void KWQKHTMLPart::paint(QPainter *p, const QRect &rect)
 {
 #ifndef NDEBUG
-    [[NSColor redColor] set];
-    [NSBezierPath fillRect:[view()->getView() visibleRect]];
+    p->fillRect(rect.x(), rect.y(), rect.width(), rect.height(), QColor(0xFF, 0, 0));
 #endif
 
     if (renderer()) {
@@ -662,17 +663,6 @@ bool KWQKHTMLPart::keyEvent(NSEvent *event)
 {
     ASSERT([event type] == NSKeyDown || [event type] == NSKeyUp);
 
-    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.
     DocumentImpl *doc = xmlDocImpl();
@@ -683,6 +673,18 @@ 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);
 
@@ -698,6 +700,8 @@ bool KWQKHTMLPart::keyEvent(NSEvent *event)
 	result = result && node->dispatchKeyEvent(&qEvent);
     }
 
+    _currentEvent = nil;
+
     return result;
 }
 
@@ -743,27 +747,35 @@ bool KWQKHTMLPart::handleMouseDownEventForWidget(khtml::MouseEvent *event)
     
     // Figure out which view to send the event to.
     RenderObject *target = event->innerNode().handle()->renderer();
-    if (!target->isWidget()) {
+    if (!target || !target->isWidget()) {
         return false;
     }
-    NSView *outerView = static_cast<RenderWidget *>(target)->widget()->getOuterView();
-    ASSERT(outerView);
-    ASSERT([outerView superview]);
-    NSView *topView = outerView;
+    return handleMouseDownEventForWidget(static_cast<RenderWidget *>(target));
+}
+
+bool KWQKHTMLPart::handleMouseDownEventForWidget(RenderWidget *renderWidget)
+{
+    _mouseDownView = nil;
+    
+    NSView *nodeView = renderWidget->widget()->getView();
+    ASSERT(nodeView);
+    ASSERT([nodeView superview]);
+    NSView *topView = nodeView;
     NSView *superview;
     while ((superview = [topView superview])) {
         topView = superview;
     }
-    NSView *view = [outerView hitTest:[[outerView superview] convertPoint:[[NSApp currentEvent] locationInWindow] fromView:topView]];
+    NSView *view = [nodeView hitTest:[[nodeView superview] convertPoint:[_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:[NSApp currentEvent]];
+    [view mouseDown:_currentEvent];
     
     // Remember which view we sent the event to, so we can direct the release event properly.
     _mouseDownView = view;
+    _mouseDownWasInSubframe = false;
     
     return true;
 }
@@ -775,7 +787,7 @@ void KWQKHTMLPart::khtmlMouseReleaseEvent(MouseReleaseEvent *event)
         return;
     }
     
-    [_mouseDownView mouseUp:[NSApp currentEvent]];
+    [_mouseDownView mouseUp:_currentEvent];
     _mouseDownView = nil;
 }
 
@@ -790,3 +802,48 @@ void KWQKHTMLPart::widgetWillReleaseView(NSView *view)
         }
     }
 }
+
+void KWQKHTMLPart::clearTimers()
+{
+    KHTMLView *v = d->m_view;
+    if (v) {
+        v->unscheduleRelayout();
+        v->unscheduleRepaint();
+    }
+}
+
+bool KWQKHTMLPart::passSubframeEventToSubframe(DOM::NodeImpl::MouseEvent &event)
+{
+    switch ([_currentEvent type]) {
+    	case NSLeftMouseDown: {
+            NodeImpl *node = event.innerNode.handle();
+            if (!node) {
+                return false;
+            }
+            RenderPart *renderPart = dynamic_cast<RenderPart *>(node->renderer());
+            if (!renderPart) {
+                return false;
+            }
+            if (!handleMouseDownEventForWidget(renderPart)) {
+                return false;
+            }
+            _mouseDownWasInSubframe = true;
+            return true;
+        }
+        case NSLeftMouseUp:
+            if (!(_mouseDownView && _mouseDownWasInSubframe)) {
+                return false;
+            }
+            [_mouseDownView mouseUp:_currentEvent];
+            _mouseDownView = nil;
+            return true;
+        case NSLeftMouseDragged:
+            if (!(_mouseDownView && _mouseDownWasInSubframe)) {
+                return false;
+            }
+            [_mouseDownView mouseDragged:_currentEvent];
+            return true;
+        default:
+            return false;
+    }
+}
diff --git a/WebCore/kwq/KWQWidget.mm b/WebCore/kwq/KWQWidget.mm
index 1706d7e..2c4844f 100644
--- a/WebCore/kwq/KWQWidget.mm
+++ b/WebCore/kwq/KWQWidget.mm
@@ -360,7 +360,6 @@ NSView *QWidget::getOuterView() const
     // If this widget's view is a WebCoreFrameView the we resize its containing view, a WebView.
     // The scroll view contained by the WebView will be autosized.
     NSView *view = data->view;
-    ASSERT(view);
     if ([view conformsToProtocol:@protocol(WebCoreFrameView)]) {
         view = [view superview];
         ASSERT(view);
diff --git a/WebCore/kwq/WebCoreBridge.mm b/WebCore/kwq/WebCoreBridge.mm
index 0eebc1b..3bb7433 100644
--- a/WebCore/kwq/WebCoreBridge.mm
+++ b/WebCore/kwq/WebCoreBridge.mm
@@ -52,16 +52,19 @@
 
 #import "WebCoreDOMPrivate.h"
 
-#import <kjs/property_map.h>
+#import <JavaScriptCore/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;
 
@@ -79,18 +82,18 @@ NSString *WebCoreElementStringKey = 		@"WebElementString";
 
 @interface KWQPageState : NSObject
 {
-    DOM::DocumentImpl *document;
+    DocumentImpl *document;
     KURL *URL;
-    KJS::SavedProperties *windowProperties;
-    KJS::SavedProperties *locationProperties;
-    khtml::RenderObject *docRenderer; 
+    SavedProperties *windowProperties;
+    SavedProperties *locationProperties;
+    RenderObject *docRenderer; 
 }
-- initWithDocument: (DOM::DocumentImpl *)doc URL: (KURL)u windowProperties: (KJS::SavedProperties *)wp locationProperties: (KJS::SavedProperties *)lp;
-- (DOM::DocumentImpl *)document;
+- initWithDocument: (DocumentImpl *)doc URL: (KURL)u windowProperties: (SavedProperties *)wp locationProperties: (SavedProperties *)lp;
+- (DocumentImpl *)document;
 - (KURL *)URL;
-- (KJS::SavedProperties *)windowProperties;
-- (KJS::SavedProperties *)locationProperties;
-- (khtml::RenderObject *)renderer;
+- (SavedProperties *)windowProperties;
+- (SavedProperties *)locationProperties;
+- (RenderObject *)renderer;
 @end
 
 @implementation WebCoreBridge
@@ -228,20 +231,23 @@ NSString *WebCoreElementStringKey = 		@"WebElementString";
 - (BOOL)saveDocumentToPageCache
 {
     DocumentImpl *doc = _part->xmlDocImpl();
-    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];
+    if (!doc) {
+        return NO;
     }
-    return false;
+    
+    _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];
 }
 
 - (BOOL)canCachePage
@@ -430,6 +436,8 @@ NSString *WebCoreElementStringKey = 		@"WebElementString";
         return;
     }
     
+    KWQKHTMLPart::setCurrentEvent(event);
+
     NSPoint p = [event locationInWindow];
 
     int button, state;
@@ -459,11 +467,12 @@ 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
@@ -472,6 +481,8 @@ NSString *WebCoreElementStringKey = 		@"WebElementString";
         return;
     }
     
+    KWQKHTMLPart::setCurrentEvent(event);
+
     NSPoint p = [event locationInWindow];
     
     int button, state;     
@@ -493,6 +504,8 @@ NSString *WebCoreElementStringKey = 		@"WebElementString";
     
     QMouseEvent kEvent(QEvent::MouseButtonPress, QPoint(p), button, state, [event clickCount]);
     _part->view()->viewportMousePressEvent(&kEvent);
+    
+    KWQKHTMLPart::setCurrentEvent(nil);
 }
 
 - (void)mouseMoved:(NSEvent *)event
@@ -501,10 +514,14 @@ NSString *WebCoreElementStringKey = 		@"WebElementString";
         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
@@ -513,10 +530,14 @@ NSString *WebCoreElementStringKey = 		@"WebElementString";
         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
@@ -669,22 +690,22 @@ NSString *WebCoreElementStringKey = 		@"WebElementString";
     _part->xmlDocImpl()->setSelection([(WebCoreDOMNode *)start impl], startOffset, [(WebCoreDOMNode *)end impl], endOffset);
 }
 
-static NSAttributedString *attributedString(DOM::NodeImpl *_startNode, int startOffset, DOM::NodeImpl *endNode, int endOffset)
+static NSAttributedString *attributedString(NodeImpl *_startNode, int startOffset, NodeImpl *endNode, int endOffset)
 {
     bool hasNewLine = true;
     bool hasParagraphBreak = true;
-    DOM::Node n = _startNode;
-    khtml::RenderObject *renderer;
+    Node n = _startNode;
+    RenderObject *renderer;
     NSFont *font;
     NSMutableAttributedString *result = [[[NSMutableAttributedString alloc] init] autorelease];
     NSAttributedString *partialString;
 
     while(!n.isNull()) {
         renderer = n.handle()->renderer();
-        if (n.nodeType() == DOM::Node::TEXT_NODE && renderer) {
+        if (n.nodeType() == Node::TEXT_NODE && renderer) {
             QString text;
             QString str = n.nodeValue().string();
-khtml::RenderStyle *style = 0;
+            RenderStyle *style = 0;
 
             font = nil;
             style = renderer->style();
@@ -772,7 +793,7 @@ khtml::RenderStyle *style = 0;
         if(n == endNode)
             break;
 
-DOM::Node next = n.firstChild();
+        Node next = n.firstChild();
         if(next.isNull())
             next = n.nextSibling();
 
@@ -916,7 +937,7 @@ DOM::Node next = n.firstChild();
 @end
 
 @implementation KWQPageState
-- initWithDocument: (DOM::DocumentImpl *)doc URL: (KURL)u windowProperties: (KJS::SavedProperties *)wp locationProperties: (KJS::SavedProperties *)lp
+- initWithDocument:(DocumentImpl *)doc URL:(KURL)u windowProperties:(SavedProperties *)wp locationProperties:(SavedProperties *)lp
 {
     [super init];
     doc->ref();
@@ -933,10 +954,8 @@ DOM::Node next = n.firstChild();
 {
     KHTMLView *view = document->view();
 
-    if (document->isHTMLDocument()) {
-        DOM::HTMLDocumentImpl* hdoc = static_cast<HTMLDocumentImpl*>(document);
-        hdoc->clearTimers();
-    }
+    KWQ(view->part())->clearTimers();
+
     document->setInPageCache(NO);
     document->detach();
     document->deref();
@@ -952,7 +971,7 @@ DOM::Node next = n.firstChild();
     [super dealloc];
 }
 
-- (DOM::DocumentImpl *)document
+- (DocumentImpl *)document
 {
     return document;
 }
@@ -962,21 +981,19 @@ DOM::Node next = n.firstChild();
     return URL;
 }
 
-- (KJS::SavedProperties *)windowProperties
+- (SavedProperties *)windowProperties
 {
     return windowProperties;
 }
 
-- (KJS::SavedProperties *)locationProperties
+- (SavedProperties *)locationProperties
 {
     return locationProperties;
 }
 
-- (khtml::RenderObject *)renderer
+- (RenderObject *)renderer
 {
     return docRenderer;
 }
 
-
 @end
-
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index db0afc5..cd00652 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,19 @@
+2002-12-11  Darin Adler  <darin at apple.com>
+
+        Reviewed by John.
+
+	- turned on the mechanism that passes events through WebCore, now that it's working better
+
+        * WebView.subproj/WebHTMLViewPrivate.m:
+        (-[WebHTMLView hitTest:]): Moved this function in here. Rewrote it. It has a new feature where
+	you can set a global and do a normal hit test, needed for the mouse-moved handling below. Also,
+	for efficiency, it does the actual hit testing of itself, rather than calling super, which recurses,
+	and ignoring the result. The sum total is that it always returns self for mouse-moved events, so
+	we pass them all over the bridge at the topmost frame.
+
+        (-[WebHTMLView _updateMouseoverWithEvent:]):
+        * WebView.subproj/WebHTMLView.m: Moved hitTest: out of here.
+
 2002-12-11  John Sullivan  <sullivan at apple.com>
 
 	- fixed 3124640 -- Crash importing IE Favorites if there 
diff --git a/WebKit/WebView.subproj/WebHTMLView.m b/WebKit/WebView.subproj/WebHTMLView.m
index 42b86df..2ee1ada 100644
--- a/WebKit/WebView.subproj/WebHTMLView.m
+++ b/WebKit/WebView.subproj/WebHTMLView.m
@@ -750,7 +750,7 @@
     }
 
     // Give khtml a crack at the event only if we haven't started,
-    // or potentially starated, a drag
+    // or potentially started, a drag
     if (!linkURL && !imageURL){
         [[self _bridge] mouseDragged:event];
     }
@@ -924,23 +924,4 @@
 {
 }
 
-- (NSView *)hitTest:(NSPoint)point
-{
-    // WebHTMLView objects handle all clicks for objects inside them.
-    // They are passed along to subviews by WebCore.
-    // But this doesn't apply to anything inside nested WebViews.
-    NSView *hitView = [super hitTest:point];
-    NSView *superview = hitView;
-    while (superview) {
-        if (superview == self) {
-            return self;
-        }
-        if ([superview isKindOfClass:[WebView class]]) {
-            return hitView;
-        }
-        superview = [superview superview];
-    }
-    return nil;
-}
-
 @end
diff --git a/WebKit/WebView.subproj/WebHTMLViewPrivate.m b/WebKit/WebView.subproj/WebHTMLViewPrivate.m
index 8e3cdd8..62cb6fc 100644
--- a/WebKit/WebView.subproj/WebHTMLViewPrivate.m
+++ b/WebKit/WebView.subproj/WebHTMLViewPrivate.m
@@ -24,6 +24,8 @@
 #import <WebKit/WebViewPrivate.h>
 #import <WebKit/WebWindowOperationsDelegate.h>
 
+static BOOL doRealHitTest = NO;
+
 @interface NSView (AppKitSecretsIKnowAbout)
 - (void)_recursiveDisplayRectIfNeededIgnoringOpacity:(NSRect)rect isVisibleRect:(BOOL)isVisibleRect rectIsVisibleRectForView:(NSView *)visibleView topView:(BOOL)topView;
 - (void)_recursiveDisplayAllDirtyWithLockFocus:(BOOL)needsLockFocus visRect:(NSRect)visRect;
@@ -261,11 +263,23 @@
     [super scrollPoint:point];
 }
 
+- (NSView *)hitTest:(NSPoint)point
+{
+    // Keep real hitTest: available for use below.
+    if (doRealHitTest) {
+        return [super hitTest:point];
+    }
+    // WebHTMLView objects handle all clicks for objects inside them.
+    return [[self superview] mouse:point inRect:[self frame]] ? self : nil;
+}
+
 - (void)_updateMouseoverWithEvent:(NSEvent *)event
 {
     WebHTMLView *view = nil;
     if ([event window] == [self window]) {
+        doRealHitTest = YES;
         NSView *hitView = [[[self window] contentView] hitTest:[event locationInWindow]];
+        doRealHitTest = NO;
         while (hitView) {
             if ([hitView isKindOfClass:[WebHTMLView class]]) {
                 view = (WebHTMLView *)hitView;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list