From 960701032df6956d9fb640a26d315122f7b2c4be Mon Sep 17 00:00:00 2001 From: Cary Clark Date: Wed, 2 Dec 2009 08:59:01 -0500 Subject: nav to container if it wants key events When a text field or text area (or plugin) has another navable element completely overlaying it, allow the trackball to move from that inner element to the outer one. Also, allow this to get a 'second chance' -- treat the case when one element overlays another as a spacial nav and allow it to retry in nav find algorithms. fixes http://b/2266756 --- WebKit/android/nav/CachedFrame.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'WebKit/android/nav/CachedFrame.cpp') diff --git a/WebKit/android/nav/CachedFrame.cpp b/WebKit/android/nav/CachedFrame.cpp index 54c295d..8a05cd6 100644 --- a/WebKit/android/nav/CachedFrame.cpp +++ b/WebKit/android/nav/CachedFrame.cpp @@ -753,7 +753,7 @@ int CachedFrame::frameNodeCommon(BestData& testData, const CachedNode* test, Bes int CachedFrame::framePartCommon(BestData& testData, const CachedNode* test, BestData* bestData, const CachedNode* cursor) const { - if (cursor && testData.mNodeBounds.contains(cursor->bounds())) { + if (cursor && testData.mNodeBounds.contains(cursor->bounds()) && !test->wantsKeyEvents()) { testData.mNode->setCondition(CachedNode::NOT_ENCLOSING_CURSOR); return REJECT_TEST; } @@ -1144,7 +1144,7 @@ bool CachedFrame::BestData::setDownDirection(const CachedHistory* history) int inNavBottom = navBounds.bottom() - mNodeBounds.bottom(); setNavInclusion(testRight - navBounds.right(), navBounds.x() - testX); bool subsumes = navBounds.height() > 0 && inOrSubsumesNav(); - if (inNavTop <= 0 && inNavBottom <= 0 && subsumes) { + if (inNavTop <= 0 && inNavBottom <= 0 && subsumes && !mNode->wantsKeyEvents()) { mNode->setCondition(CachedNode::NOT_ENCLOSING_CURSOR); return REJECT_TEST; } @@ -1184,7 +1184,7 @@ bool CachedFrame::BestData::setLeftDirection(const CachedHistory* history) int inNavLeft = mNodeBounds.x() - navBounds.x(); setNavInclusion(navBounds.y() - testY, testBottom - navBounds.bottom()); bool subsumes = navBounds.width() > 0 && inOrSubsumesNav(); - if (inNavLeft <= 0 && inNavRight <= 0 && subsumes) { + if (inNavLeft <= 0 && inNavRight <= 0 && subsumes && !mNode->wantsKeyEvents()) { mNode->setCondition(CachedNode::NOT_ENCLOSING_CURSOR); return REJECT_TEST; } @@ -1224,7 +1224,7 @@ bool CachedFrame::BestData::setRightDirection(const CachedHistory* history) int inNavRight = navBounds.right() - mNodeBounds.right(); setNavInclusion(testBottom - navBounds.bottom(), navBounds.y() - testY); bool subsumes = navBounds.width() > 0 && inOrSubsumesNav(); - if (inNavLeft <= 0 && inNavRight <= 0 && subsumes) { + if (inNavLeft <= 0 && inNavRight <= 0 && subsumes && !mNode->wantsKeyEvents()) { mNode->setCondition(CachedNode::NOT_ENCLOSING_CURSOR); return REJECT_TEST; } @@ -1264,7 +1264,7 @@ bool CachedFrame::BestData::setUpDirection(const CachedHistory* history) int inNavTop = mNodeBounds.y() - navBounds.y(); setNavInclusion(navBounds.x() - testX, testRight - navBounds.right()); bool subsumes = navBounds.height() > 0 && inOrSubsumesNav(); - if (inNavTop <= 0 && inNavBottom <= 0 && subsumes) { + if (inNavTop <= 0 && inNavBottom <= 0 && subsumes && !mNode->wantsKeyEvents()) { mNode->setCondition(CachedNode::NOT_ENCLOSING_CURSOR); return REJECT_TEST; } -- cgit v1.1