summaryrefslogtreecommitdiffstats
path: root/Source/WebKit
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2011-10-14 14:04:01 -0700
committerJohn Reck <jreck@google.com>2011-10-14 14:07:07 -0700
commite95b6bbb96a1667e7f5a65cdeb9e79a2714e4563 (patch)
tree8664cd9580d1292106191443a1bc7e135271c80c /Source/WebKit
parent25b6485c2f117e2ed3dc3abfe2467f699dfe1942 (diff)
downloadexternal_webkit-e95b6bbb96a1667e7f5a65cdeb9e79a2714e4563.zip
external_webkit-e95b6bbb96a1667e7f5a65cdeb9e79a2714e4563.tar.gz
external_webkit-e95b6bbb96a1667e7f5a65cdeb9e79a2714e4563.tar.bz2
Don't cache size of cursor rings array
Bug: 4974452 Remove the unnecessary assert Prevent size of cursor rings array from getting out of sync with the cached size by eliminating the cached size Change-Id: I40ceb22f3b636e5af890607b456e76e38c615eac
Diffstat (limited to 'Source/WebKit')
-rw-r--r--Source/WebKit/android/nav/CacheBuilder.cpp2
-rw-r--r--Source/WebKit/android/nav/CachedNode.cpp15
-rw-r--r--Source/WebKit/android/nav/CachedNode.h4
3 files changed, 8 insertions, 13 deletions
diff --git a/Source/WebKit/android/nav/CacheBuilder.cpp b/Source/WebKit/android/nav/CacheBuilder.cpp
index a4bc758..623d2cb 100644
--- a/Source/WebKit/android/nav/CacheBuilder.cpp
+++ b/Source/WebKit/android/nav/CacheBuilder.cpp
@@ -1406,7 +1406,6 @@ void CacheBuilder::BuildFrame(Frame* root, Frame* frame,
else if (cachedNode.clip(clip) == false)
continue; // skip this node if outside of the clip
}
- cachedNode.setNavableRects();
cachedNode.setColorIndex(colorIndex);
cachedNode.setExport(exported);
cachedNode.setHasCursorRing(hasCursorRing);
@@ -1478,7 +1477,6 @@ bool CacheBuilder::CleanUpContainedNodes(CachedRoot* cachedRoot,
lastNode->hasTagName(HTMLNames::formTag)) {
lastCached->setBounds(IntRect(0, 0, 0, 0));
lastCached->mCursorRing.clear();
- lastCached->setNavableRects();
return false;
}
CachedNode* onlyChildCached = cachedFrame->lastNode();
diff --git a/Source/WebKit/android/nav/CachedNode.cpp b/Source/WebKit/android/nav/CachedNode.cpp
index 86c2a38..e500875 100644
--- a/Source/WebKit/android/nav/CachedNode.cpp
+++ b/Source/WebKit/android/nav/CachedNode.cpp
@@ -92,10 +92,9 @@ void CachedNode::cursorRings(const CachedFrame* frame,
WebCore::IntRect CachedNode::cursorRingBounds(const CachedFrame* frame) const
{
- int partMax = mNavableRects;
- ASSERT(partMax > 0);
- WebCore::IntRect bounds = mCursorRing[0];
- for (int partIndex = 1; partIndex < partMax; partIndex++)
+ int partMax = navableRects();
+ WebCore::IntRect bounds;
+ for (int partIndex = 0; partIndex < partMax; partIndex++)
bounds.unite(mCursorRing[partIndex]);
bounds.inflate(CURSOR_RING_HIT_TEST_RADIUS);
return mIsInLayer ? frame->adjustBounds(this, bounds) : bounds;
@@ -116,7 +115,7 @@ void CachedNode::fixUpCursorRects(const CachedFrame* frame)
mUseHitBounds = true;
return;
}
- if (mNavableRects <= 1)
+ if (navableRects() <= 1)
return;
// if there is more than 1 rect, and the bounds doesn't intersect
// any other cursor ring bounds, use it
@@ -290,8 +289,8 @@ void CachedNode::move(int x, int y)
bool CachedNode::partRectsContains(const CachedNode* other) const
{
int outerIndex = 0;
- int outerMax = mNavableRects;
- int innerMax = other->mNavableRects;
+ int outerMax = navableRects();
+ int innerMax = other->navableRects();
do {
const WebCore::IntRect& outerBounds = mCursorRing[outerIndex];
int innerIndex = 0;
@@ -403,7 +402,7 @@ void CachedNode::Debug::print() const
DUMP_NAV_LOGD("// void* mParentGroup=%p; // (%d) \n", b->mParentGroup, mParentGroupIndex);
DUMP_NAV_LOGD("// int mDataIndex=%d;\n", b->mDataIndex);
DUMP_NAV_LOGD("// int mIndex=%d;\n", b->mIndex);
- DUMP_NAV_LOGD("// int mNavableRects=%d;\n", b->mNavableRects);
+ DUMP_NAV_LOGD("// int navableRects()=%d;\n", b->navableRects());
DUMP_NAV_LOGD("// int mParentIndex=%d;\n", b->mParentIndex);
DUMP_NAV_LOGD("// int mTabIndex=%d;\n", b->mTabIndex);
DUMP_NAV_LOGD("// int mColorIndex=%d;\n", b->mColorIndex);
diff --git a/Source/WebKit/android/nav/CachedNode.h b/Source/WebKit/android/nav/CachedNode.h
index 602dda6..321b7fd 100644
--- a/Source/WebKit/android/nav/CachedNode.h
+++ b/Source/WebKit/android/nav/CachedNode.h
@@ -136,7 +136,7 @@ public:
WebCore::IntRect localHitBounds(const CachedFrame* ) const;
WebCore::IntRect localRing(const CachedFrame* , size_t part) const;
void move(int x, int y);
- int navableRects() const { return mNavableRects; }
+ int navableRects() const { return mCursorRing.size(); }
void* nodePointer() const { return mNode; }
bool noSecondChance() const { return mCondition > SECOND_CHANCE_END; }
const WebCore::IntRect& originalAbsoluteBounds() const {
@@ -169,7 +169,6 @@ public:
void setIsTransparent(bool isTransparent) { mIsTransparent = isTransparent; }
void setIsUnclipped(bool unclipped) { mIsUnclipped = unclipped; }
void setLast() { mLast = true; }
- void setNavableRects() { mNavableRects = mCursorRing.size(); }
void setParentGroup(void* group) { mParentGroup = group; }
void setParentIndex(int parent) { mParentIndex = parent; }
void setSingleImage(bool single) { mSingleImage = single; }
@@ -195,7 +194,6 @@ private:
void* mParentGroup; // WebCore::Node*, only used to match pointers
int mDataIndex; // child frame if a frame; input data index; or -1
int mIndex; // index of itself, to find first in array (document)
- int mNavableRects; // FIXME: could be bitfield once I limit max number of rects
int mParentIndex;
int mTabIndex;
int mColorIndex; // index to ring color and other stylable properties