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>
- 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>
- 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>
- fixed 3107383 -- clicking link on cnet.com leads to assertion failure
......
......@@ -563,15 +563,18 @@ bool KWQKHTMLPart::keyEvent(NSEvent *event)
QString::fromNSString([event characters]),
[event isARepeat]);
ASSERT(part->xmlDocImpl());
if (!part->xmlDocImpl()->focusNode()) {
// Too early for events - possible unmatched key up from
// pressing return in the location bar.
// Check for cases where we are too early for events -- possible unmatched key up
// from pressing return in the location bar.
DocumentImpl *doc = document();
if (!doc) {
return false;
}
NodeImpl *node = doc->focusNode();
if (!node) {
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
if (![event isARepeat]) {
......@@ -582,7 +585,7 @@ bool KWQKHTMLPart::keyEvent(NSEvent *event)
QString::fromNSString([event characters]),
true);
result = result && part->xmlDocImpl()->focusNode()->dispatchKeyEvent(&qEvent);
result = result && node->dispatchKeyEvent(&qEvent);
}
return result;
......
......@@ -820,7 +820,7 @@ static NSAttributedString *attributedString(DOM::NodeImpl *_startNode, int start
- (BOOL)interceptKeyEvent:(NSEvent *)event toView:(NSView *)view
{
return _part->kwq->keyEvent(event);
return _part->kwq->keyEvent(event);
}
@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