From: adele@apple.com Date: Fri, 6 Mar 2009 22:12:38 +0000 (+0000) Subject: 2009-03-06 Adele Peterson X-Git-Url: http://git.webkit.org/?p=WebKit-https.git;a=commitdiff_plain;h=660a0d0852cd78d38652437c6cafd99e78f00f70;ds=sidebyside 2009-03-06 Adele Peterson Reviewed by Oliver Hunt. Fix for REGRESSION (Safari 3-4): I can't tab back to the URL field in an empty window (key loop is broken) I haven't been able to make a test for this since the problem is not reproducible within an empty iframe. * page/EventHandler.cpp: (WebCore::eventTargetNodeForDocument): We used to ensure that every html document had a body element. That is no longer true, so we should return the document element for a truly empty document. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@41501 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog index 00faffd..51f0ef1 100644 --- a/WebCore/ChangeLog +++ b/WebCore/ChangeLog @@ -1,3 +1,14 @@ +2009-03-06 Adele Peterson + + Reviewed by Oliver Hunt. + + Fix for REGRESSION (Safari 3-4): I can't tab back to the URL field in an empty window (key loop is broken) + + I haven't been able to make a test for this since the problem is not reproducible within an empty iframe. + + * page/EventHandler.cpp: (WebCore::eventTargetNodeForDocument): We used to ensure that every html document had a body element. + That is no longer true, so we should return the document element for a truly empty document. + 2009-03-06 Jay Campan Reviewed by Darin Fisher. diff --git a/WebCore/page/EventHandler.cpp b/WebCore/page/EventHandler.cpp index 186ace4..54fc035 100644 --- a/WebCore/page/EventHandler.cpp +++ b/WebCore/page/EventHandler.cpp @@ -1744,14 +1744,10 @@ static Node* eventTargetNodeForDocument(Document* doc) if (!doc) return 0; Node* node = doc->focusedNode(); - if (!node) { - if (doc->isHTMLDocument()) - node = doc->body(); - else - node = doc->documentElement(); - if (!node) - return 0; - } + if (!node && doc->isHTMLDocument()) + node = doc->body(); + if (!node) + node = doc->documentElement(); return node; }