diff options
author | Cary Clark <cary@android.com> | 2009-06-04 13:21:34 -0400 |
---|---|---|
committer | Cary Clark <cary@android.com> | 2009-06-04 13:59:10 -0400 |
commit | 08ccebc1045cc42af60d01c19ce6ce27ca616604 (patch) | |
tree | 3fba95c4645e48a417164f59ac29c85a1225e6b2 | |
parent | f886bc57020d37942e84b74ff878bdc1498a09c7 (diff) | |
download | external_webkit-08ccebc1045cc42af60d01c19ce6ce27ca616604.zip external_webkit-08ccebc1045cc42af60d01c19ce6ce27ca616604.tar.gz external_webkit-08ccebc1045cc42af60d01c19ce6ce27ca616604.tar.bz2 |
use absolute bounds, not node bounds, for all webkit nodes
Several years ago, the absolute bounds reported by webkit
for nodes other than anchors were sometimes wildly different
than the node bounds. Nowadays, the absolute bounds are used
by iPhone to show hot spots and are more accurate.
When nodes are added on the fly, their node bounds may be
uncomputed, so the added nodes may not show up in the
nav cache. Using the absolute bounds instead makes these
nodes visible.
Also, removed a special case for Bank of America, tied to
the node bounds (not absolute bounds) since it is no longer
applicable.
Remove unused local min focusable width and height.
-rw-r--r-- | WebKit/android/nav/CacheBuilder.cpp | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/WebKit/android/nav/CacheBuilder.cpp b/WebKit/android/nav/CacheBuilder.cpp index 08c1f11..d9b3125 100644 --- a/WebKit/android/nav/CacheBuilder.cpp +++ b/WebKit/android/nav/CacheBuilder.cpp @@ -1007,8 +1007,6 @@ void CacheBuilder::BuildFrame(Frame* root, Frame* frame, IntRect bounds; IntRect absBounds; WTF::Vector<IntRect>* columns = NULL; - int minimumFocusableWidth = MINIMUM_FOCUSABLE_WIDTH; - int minimumFocusableHeight = MINIMUM_FOCUSABLE_HEIGHT; if (isArea) { HTMLAreaElement* area = static_cast<HTMLAreaElement*>(node); bounds = getAreaRect(area); @@ -1141,13 +1139,10 @@ void CacheBuilder::BuildFrame(Frame* root, Frame* frame, style->textAlign() == WebCore::RIGHT || style->textAlign() == WebCore::WEBKIT_RIGHT; } - minimumFocusableWidth += 4; - minimumFocusableHeight += 4; } takesFocus = true; - if (isAnchor) { - bounds = absBounds; - } else { + bounds = absBounds; + if (!isAnchor) { bool isFocusable = node->isKeyboardFocusable(NULL) || node->isMouseFocusable() || node->isFocusable(); if (isFocusable == false) { @@ -1159,23 +1154,6 @@ void CacheBuilder::BuildFrame(Frame* root, Frame* frame, continue; takesFocus = hasTrigger; } - bounds = node->getRect(); - // For Bank of America site - if (isTextField && ((RenderBox*)nodeRenderer)->paddingLeft() > 100) { - int paddingLeft = ((RenderBox*)nodeRenderer)->paddingLeft(); - int paddingTop = ((RenderBox*)nodeRenderer)->paddingTop(); - int x = bounds.x() + paddingLeft; - int y = bounds.y() + paddingTop; - int width = bounds.width() - paddingLeft - ((RenderBox*)nodeRenderer)->paddingRight(); - int height = bounds.height() - paddingTop - ((RenderBox*)nodeRenderer)->paddingBottom(); - bounds.setLocation(IntPoint(x, y)); - bounds.setSize(IntSize(width, height)); - } - if (bounds.width() < minimumFocusableWidth) - continue; - if (bounds.height() < minimumFocusableHeight) - continue; - bounds.move(globalOffsetX, globalOffsetY); } computeCursorRings = true; keepNode: |