Commit 9f3a7873 authored by darin's avatar darin

- fixed 3107286 -- REGRESSION: unrepro assertion failure in KWQKHTMLPart.mm keyEvent

        * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::keyEvent):
	Handle case of nil document as well as case of nil focus node.

        * kwq/WebCoreBridge.mm: Tweak whitespace.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2803 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 591c3909
2002-11-21 Darin Adler <darin@apple.com>
- fixed 3107286 -- REGRESSION: unrepro assertion failure in KWQKHTMLPart.mm keyEvent
* kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::keyEvent):
Handle case of nil document as well as case of nil focus node.
* kwq/WebCoreBridge.mm: Tweak whitespace.
2002-11-20 Darin Adler <darin@apple.com> 2002-11-20 Darin Adler <darin@apple.com>
- fixed 3107383 -- clicking link on cnet.com leads to assertion failure - fixed 3107383 -- clicking link on cnet.com leads to assertion failure
......
2002-11-21 Darin Adler <darin@apple.com>
- fixed 3107286 -- REGRESSION: unrepro assertion failure in KWQKHTMLPart.mm keyEvent
* kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::keyEvent):
Handle case of nil document as well as case of nil focus node.
* kwq/WebCoreBridge.mm: Tweak whitespace.
2002-11-20 Darin Adler <darin@apple.com> 2002-11-20 Darin Adler <darin@apple.com>
- fixed 3107383 -- clicking link on cnet.com leads to assertion failure - fixed 3107383 -- clicking link on cnet.com leads to assertion failure
......
2002-11-21 Darin Adler <darin@apple.com>
- fixed 3107286 -- REGRESSION: unrepro assertion failure in KWQKHTMLPart.mm keyEvent
* kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::keyEvent):
Handle case of nil document as well as case of nil focus node.
* kwq/WebCoreBridge.mm: Tweak whitespace.
2002-11-20 Darin Adler <darin@apple.com> 2002-11-20 Darin Adler <darin@apple.com>
- fixed 3107383 -- clicking link on cnet.com leads to assertion failure - fixed 3107383 -- clicking link on cnet.com leads to assertion failure
......
...@@ -563,15 +563,18 @@ bool KWQKHTMLPart::keyEvent(NSEvent *event) ...@@ -563,15 +563,18 @@ bool KWQKHTMLPart::keyEvent(NSEvent *event)
QString::fromNSString([event characters]), QString::fromNSString([event characters]),
[event isARepeat]); [event isARepeat]);
ASSERT(part->xmlDocImpl()); // Check for cases where we are too early for events -- possible unmatched key up
// from pressing return in the location bar.
if (!part->xmlDocImpl()->focusNode()) { DocumentImpl *doc = document();
// Too early for events - possible unmatched key up from if (!doc) {
// pressing return in the location bar. return false;
}
NodeImpl *node = doc->focusNode();
if (!node) {
return false; return false;
} }
bool result = part->xmlDocImpl()->focusNode()->dispatchKeyEvent(&qEvent); bool result = node->dispatchKeyEvent(&qEvent);
// We want to send both a down and a press for the initial key event // We want to send both a down and a press for the initial key event
if (![event isARepeat]) { if (![event isARepeat]) {
...@@ -582,7 +585,7 @@ bool KWQKHTMLPart::keyEvent(NSEvent *event) ...@@ -582,7 +585,7 @@ bool KWQKHTMLPart::keyEvent(NSEvent *event)
QString::fromNSString([event characters]), QString::fromNSString([event characters]),
true); true);
result = result && part->xmlDocImpl()->focusNode()->dispatchKeyEvent(&qEvent); result = result && node->dispatchKeyEvent(&qEvent);
} }
return result; return result;
......
...@@ -820,7 +820,7 @@ static NSAttributedString *attributedString(DOM::NodeImpl *_startNode, int start ...@@ -820,7 +820,7 @@ static NSAttributedString *attributedString(DOM::NodeImpl *_startNode, int start
- (BOOL)interceptKeyEvent:(NSEvent *)event toView:(NSView *)view - (BOOL)interceptKeyEvent:(NSEvent *)event toView:(NSView *)view
{ {
return _part->kwq->keyEvent(event); return _part->kwq->keyEvent(event);
} }
@end @end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment