summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorVictoria Lease <violets@google.com>2011-12-12 16:53:54 -0800
committerVictoria Lease <violets@google.com>2011-12-12 16:53:54 -0800
commitd201a459e733cc3821fd419f83b8f0a08d8d2138 (patch)
treef0f0445853b4e1442be819ebd4efb9e023bdc864 /Source
parentaaa0eaad49fc612572a56cc22017006cf4804880 (diff)
downloadexternal_webkit-d201a459e733cc3821fd419f83b8f0a08d8d2138.zip
external_webkit-d201a459e733cc3821fd419f83b8f0a08d8d2138.tar.gz
external_webkit-d201a459e733cc3821fd419f83b8f0a08d8d2138.tar.bz2
Removed ConstructPartRects().
bug: 5688027 This function was producing incorrect bounds. WebKit's bounds are preferable. Change-Id: I2458a149bcb284b29a45972bb46e5c1cb09c0c66
Diffstat (limited to 'Source')
-rw-r--r--Source/WebKit/android/nav/CacheBuilder.cpp107
1 files changed, 3 insertions, 104 deletions
diff --git a/Source/WebKit/android/nav/CacheBuilder.cpp b/Source/WebKit/android/nav/CacheBuilder.cpp
index 940991f..e963923 100644
--- a/Source/WebKit/android/nav/CacheBuilder.cpp
+++ b/Source/WebKit/android/nav/CacheBuilder.cpp
@@ -556,9 +556,7 @@ void CacheBuilder::Debug::groups() {
continue;
} else {
IntRect nodeBounds = node->getRect();
- if (CacheBuilder::ConstructPartRects(node, nodeBounds, rectPtr,
- globalOffsetX, globalOffsetY, &rects, &imageCount) == false)
- continue;
+ continue;
}
unsigned arraySize = rects.size();
if (arraySize > 1 || (arraySize == 1 && (rectPtr->width() != rect.width())) ||
@@ -1330,13 +1328,8 @@ void CacheBuilder::BuildFrame(Frame* root, Frame* frame,
computeCursorRings = true;
keepNode:
cachedNode.init(node);
- if (computeCursorRings == false) {
- cachedNode.setBounds(bounds);
- cachedNode.mCursorRing.append(bounds);
- } else if (ConstructPartRects(node, bounds, &cachedNode.mBounds,
- globalOffsetX, globalOffsetY, &cachedNode.mCursorRing,
- &imageCount) == false)
- continue;
+ cachedNode.setBounds(bounds);
+ cachedNode.mCursorRing.append(bounds);
keepTextNode:
if (nodeRenderer) { // area tags' node->renderer() == 0
RenderStyle* style = nodeRenderer->style();
@@ -3027,100 +3020,6 @@ bool CacheBuilder::AddPartRect(IntRect& bounds, int x, int y,
return true;
}
-bool CacheBuilder::ConstructPartRects(Node* node, const IntRect& bounds,
- IntRect* focusBounds, int x, int y, WTF::Vector<IntRect>* result,
- int* imageCountPtr)
-{
- WTF::Vector<ClipColumnTracker> clipTracker(1);
- ClipColumnTracker* baseTracker = clipTracker.data(); // sentinel
- bzero(baseTracker, sizeof(ClipColumnTracker));
- if (node->hasChildNodes() && node->hasTagName(HTMLNames::buttonTag) == false
- && node->hasTagName(HTMLNames::selectTag) == false) {
- // collect all text rects from first to last child
- Node* test = node->firstChild();
- Node* last = NULL;
- Node* prior = node;
- while ((prior = prior->lastChild()) != NULL)
- last = prior;
- ASSERT(last != NULL);
- bool nodeIsAnchor = node->hasTagName(HTMLNames::aTag);
- do {
- do {
- const ClipColumnTracker* lastClip = &clipTracker.last();
- if (test != lastClip->mLastChild)
- break;
- clipTracker.removeLast();
- } while (true);
- RenderObject* renderer = test->renderer();
- if (renderer == NULL)
- continue;
- EVisibility vis = renderer->style()->visibility();
- if (vis == HIDDEN)
- continue;
- bool hasClip = renderer->hasOverflowClip();
- size_t clipIndex = clipTracker.size();
- IntRect clipBounds = IntRect(0, 0, INT_MAX, INT_MAX);
- if (hasClip || --clipIndex > 0) {
- clipBounds = hasClip ? renderer->absoluteBoundingBoxRect() :
- clipTracker.at(clipIndex).mBounds; // x, y fixup done by ConstructTextRect
- }
- if (test->isTextNode()) {
- RenderText* renderText = (RenderText*) renderer;
- InlineTextBox *textBox = renderText->firstTextBox();
- if (textBox == NULL)
- continue;
- if (ConstructTextRect((Text*) test, textBox, 0, INT_MAX,
- x, y, focusBounds, clipBounds, result) == false) {
- return false;
- }
- continue;
- }
- if (test->hasTagName(HTMLNames::imgTag)) {
- IntRect bounds = test->getRect();
- bounds.intersect(clipBounds);
- if (AddPartRect(bounds, x, y, result, focusBounds) == false)
- return false;
- *imageCountPtr += 1;
- continue;
- }
- if (hasClip == false) {
- if (nodeIsAnchor && test->hasTagName(HTMLNames::divTag)) {
- IntRect bounds = renderer->absoluteBoundingBoxRect(); // x, y fixup done by AddPartRect
- RenderBox* renderBox = static_cast<RenderBox*>(renderer);
- int left = bounds.x() + renderBox->paddingLeft() + renderBox->borderLeft();
- int top = bounds.y() + renderBox->paddingTop() + renderBox->borderTop();
- int right = bounds.maxX() - renderBox->paddingRight() - renderBox->borderRight();
- int bottom = bounds.maxY() - renderBox->paddingBottom() - renderBox->borderBottom();
- if (left >= right || top >= bottom)
- continue;
- bounds = IntRect(left, top, right - left, bottom - top);
- if (AddPartRect(bounds, x, y, result, focusBounds) == false)
- return false;
- }
- continue;
- }
- Node* lastChild = test->lastChild();
- if (lastChild == NULL)
- continue;
- clipTracker.grow(clipTracker.size() + 1);
- ClipColumnTracker& clip = clipTracker.last();
- clip.mBounds = renderer->absoluteBoundingBoxRect(); // x, y fixup done by ConstructTextRect
- clip.mLastChild = OneAfter(lastChild);
- clip.mNode = test;
- } while (test != last && (test = test->traverseNextNode()) != NULL);
- }
- if (result->size() == 0 || focusBounds->width() < MINIMUM_FOCUSABLE_WIDTH
- || focusBounds->height() < MINIMUM_FOCUSABLE_HEIGHT) {
- if (bounds.width() < MINIMUM_FOCUSABLE_WIDTH)
- return false;
- if (bounds.height() < MINIMUM_FOCUSABLE_HEIGHT)
- return false;
- result->append(bounds);
- *focusBounds = bounds;
- }
- return true;
-}
-
static inline bool isNotSpace(UChar c)
{
return c <= 0xA0 ? isUnicodeSpace(c) == false :