summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2011-05-18 18:46:52 +0100
committerSteve Block <steveblock@google.com>2011-05-25 12:25:50 +0100
commit1ed8c4d16ac986307f1c0589a3a720a37e60f313 (patch)
treefc36f1aa9c4389b3d03a6fc2e2623e2a1a267150
parent09b60ab8488b362c96df8f268613aafaeebfcfa1 (diff)
downloadexternal_webkit-1ed8c4d16ac986307f1c0589a3a720a37e60f313.zip
external_webkit-1ed8c4d16ac986307f1c0589a3a720a37e60f313.tar.gz
external_webkit-1ed8c4d16ac986307f1c0589a3a720a37e60f313.tar.bz2
Merge WebKit at r78450: IntRect::bottom()/right() renamed
See http://trac.webkit.org/changeset/77286 and http://trac.webkit.org/changeset/77398 Change-Id: I0ae670bff327fb981e037f5394c55bfb4aeb81eb
-rw-r--r--Source/WebCore/platform/graphics/android/GLWebViewState.cpp2
-rw-r--r--Source/WebCore/platform/graphics/android/ImageBufferAndroid.cpp6
-rw-r--r--Source/WebCore/platform/graphics/android/PlatformGraphicsContext.h2
-rw-r--r--Source/WebCore/platform/graphics/android/TiledPage.cpp6
-rw-r--r--Source/WebCore/rendering/InlineTextBox.cpp2
-rw-r--r--Source/WebKit/android/jni/WebViewCore.cpp24
-rw-r--r--Source/WebKit/android/nav/CacheBuilder.cpp15
-rw-r--r--Source/WebKit/android/nav/CachedFrame.cpp89
-rw-r--r--Source/WebKit/android/nav/CachedFrame.h4
-rw-r--r--Source/WebKit/android/nav/CachedHistory.cpp20
-rw-r--r--Source/WebKit/android/nav/CachedNode.cpp20
-rw-r--r--Source/WebKit/android/nav/CachedRoot.cpp38
-rw-r--r--Source/WebKit/android/nav/WebView.cpp34
13 files changed, 136 insertions, 126 deletions
diff --git a/Source/WebCore/platform/graphics/android/GLWebViewState.cpp b/Source/WebCore/platform/graphics/android/GLWebViewState.cpp
index f46d335..966670d 100644
--- a/Source/WebCore/platform/graphics/android/GLWebViewState.cpp
+++ b/Source/WebCore/platform/graphics/android/GLWebViewState.cpp
@@ -229,7 +229,7 @@ void GLWebViewState::inval(const IntRect& rect)
rect.x(), rect.y(), rect.right(), rect.bottom());
}
} else {
- m_invalidateRegion.op(rect.x(), rect.y(), rect.right(), rect.bottom(), SkRegion::kUnion_Op);
+ m_invalidateRegion.op(rect.x(), rect.y(), rect.maxX(), rect.maxY(), SkRegion::kUnion_Op);
}
}
diff --git a/Source/WebCore/platform/graphics/android/ImageBufferAndroid.cpp b/Source/WebCore/platform/graphics/android/ImageBufferAndroid.cpp
index 0a36051..5807f87 100644
--- a/Source/WebCore/platform/graphics/android/ImageBufferAndroid.cpp
+++ b/Source/WebCore/platform/graphics/android/ImageBufferAndroid.cpp
@@ -120,7 +120,7 @@ PassRefPtr<ByteArray> ImageBuffer::getUnmultipliedImageData(const IntRect& rect)
RefPtr<ByteArray> result = ByteArray::create(rect.width() * rect.height() * 4);
unsigned char* data = result->data();
- if (rect.x() < 0 || rect.y() < 0 || rect.right() > m_size.width() || rect.bottom() > m_size.height())
+ if (rect.x() < 0 || rect.y() < 0 || rect.maxX() > m_size.width() || rect.maxY() > m_size.height())
memset(data, 0, result->length());
int originx = rect.x();
@@ -189,7 +189,7 @@ void ImageBuffer::putUnmultipliedImageData(ByteArray* source, const IntSize& sou
ASSERT(originx >= 0);
ASSERT(originx <= sourceRect.right());
- int endx = destPoint.x() + sourceRect.right();
+ int endx = destPoint.x() + sourceRect.maxX();
ASSERT(endx <= m_size.width());
int numColumns = endx - destx;
@@ -201,7 +201,7 @@ void ImageBuffer::putUnmultipliedImageData(ByteArray* source, const IntSize& sou
ASSERT(originy >= 0);
ASSERT(originy <= sourceRect.bottom());
- int endy = destPoint.y() + sourceRect.bottom();
+ int endy = destPoint.y() + sourceRect.maxY();
ASSERT(endy <= m_size.height());
int numRows = endy - desty;
diff --git a/Source/WebCore/platform/graphics/android/PlatformGraphicsContext.h b/Source/WebCore/platform/graphics/android/PlatformGraphicsContext.h
index 0ce86d2..98fcc49 100644
--- a/Source/WebCore/platform/graphics/android/PlatformGraphicsContext.h
+++ b/Source/WebCore/platform/graphics/android/PlatformGraphicsContext.h
@@ -118,7 +118,7 @@ public:
state == WebCore::RenderSkinAndroid::kFocused)
return;
m_state = state;
- SkCanvas* canvas = m_picture->beginRecording(m_rect.right(), m_rect.bottom());
+ SkCanvas* canvas = m_picture->beginRecording(m_rect.maxX(), m_rect.maxY());
buttonSkin->draw(canvas, m_rect, state);
m_picture->endRecording();
}
diff --git a/Source/WebCore/platform/graphics/android/TiledPage.cpp b/Source/WebCore/platform/graphics/android/TiledPage.cpp
index 5212871..0e1e947 100644
--- a/Source/WebCore/platform/graphics/android/TiledPage.cpp
+++ b/Source/WebCore/platform/graphics/android/TiledPage.cpp
@@ -122,14 +122,14 @@ void TiledPage::invalidateRect(const IntRect& inval, const unsigned int pictureC
const int firstDirtyTileX = static_cast<int>(floorf(inval.x() * invTileContentWidth));
const int firstDirtyTileY = static_cast<int>(floorf(inval.y() * invTileContentHeight));
- const int lastDirtyTileX = static_cast<int>(ceilf(inval.right() * invTileContentWidth));
- const int lastDirtyTileY = static_cast<int>(ceilf(inval.bottom() * invTileContentHeight));
+ const int lastDirtyTileX = static_cast<int>(ceilf(inval.maxX() * invTileContentWidth));
+ const int lastDirtyTileY = static_cast<int>(ceilf(inval.maxY() * invTileContentHeight));
XLOG("Marking X %d-%d and Y %d-%d dirty", firstDirtyTileX, lastDirtyTileX, firstDirtyTileY, lastDirtyTileY);
// We defer marking the tile as dirty until the next time we need to prepare
// to draw.
m_invalRegion.op(firstDirtyTileX, firstDirtyTileY, lastDirtyTileX, lastDirtyTileY, SkRegion::kUnion_Op);
- m_invalTilesRegion.op(inval.x(), inval.y(), inval.right(), inval.bottom(), SkRegion::kUnion_Op);
+ m_invalTilesRegion.op(inval.x(), inval.y(), inval.maxX(), inval.maxY(), SkRegion::kUnion_Op);
m_latestPictureInval = pictureCount;
}
diff --git a/Source/WebCore/rendering/InlineTextBox.cpp b/Source/WebCore/rendering/InlineTextBox.cpp
index 37f7eff..4802f02 100644
--- a/Source/WebCore/rendering/InlineTextBox.cpp
+++ b/Source/WebCore/rendering/InlineTextBox.cpp
@@ -1259,7 +1259,7 @@ int InlineTextBox::positionForOffset(int offset) const
TextRun textRun = TextRun(text->text()->characters() + m_start, m_len, textRenderer()->allowTabs(), textPos(), m_expansion, trailingExpansionBehavior(), !isLeftToRightDirection(), m_dirOverride);
if (m_disableRoundingHacks)
textRun.disableRoundingHacks();
- return enclosingIntRect(f.selectionRectForText(textRun, IntPoint(logicalLeft(), 0), 0, from, to)).right();
+ return enclosingIntRect(f.selectionRectForText(textRun, IntPoint(logicalLeft(), 0), 0, from, to)).maxX();
#else
return enclosingIntRect(f.selectionRectForText(TextRun(text->text()->characters() + m_start, m_len, textRenderer()->allowTabs(), textPos(), m_expansion, trailingExpansionBehavior(), !isLeftToRightDirection(), m_dirOverride),
IntPoint(logicalLeft(), 0), 0, from, to)).maxX();
diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp
index d7f60d3..09626d1 100644
--- a/Source/WebKit/android/jni/WebViewCore.cpp
+++ b/Source/WebKit/android/jni/WebViewCore.cpp
@@ -974,7 +974,7 @@ void WebViewCore::viewInvalidate(const WebCore::IntRect& rect)
JNIEnv* env = JSC::Bindings::getJNIEnv();
env->CallVoidMethod(m_javaGlue->object(env).get(),
m_javaGlue->m_sendViewInvalidate,
- rect.x(), rect.y(), rect.right(), rect.bottom());
+ rect.x(), rect.y(), rect.maxX(), rect.maxY());
checkException(env);
}
@@ -1767,32 +1767,32 @@ Vector<IntRect> WebViewCore::getTouchHighlightRects(int x, int y, int slop)
inside = true;
continue;
}
- if (x >= rects[i].x() && x < rects[i].right()) {
+ if (x >= rects[i].x() && x < rects[i].maxX()) {
if (y < rects[i].y()) {
if (rects[i].y() - y < distance) {
newx = x;
newy = rects[i].y();
distance = rects[i].y() - y;
}
- } else if (y >= rects[i].bottom()) {
- if (y - rects[i].bottom() + 1 < distance) {
+ } else if (y >= rects[i].maxY()) {
+ if (y - rects[i].maxY() + 1 < distance) {
newx = x;
- newy = rects[i].bottom() - 1;
- distance = y - rects[i].bottom() + 1;
+ newy = rects[i].maxY() - 1;
+ distance = y - rects[i].maxY() + 1;
}
}
- } else if (y >= rects[i].y() && y < rects[i].bottom()) {
+ } else if (y >= rects[i].y() && y < rects[i].maxY()) {
if (x < rects[i].x()) {
if (rects[i].x() - x < distance) {
newx = rects[i].x();
newy = y;
distance = rects[i].x() - x;
}
- } else if (x >= rects[i].right()) {
- if (x - rects[i].right() + 1 < distance) {
- newx = rects[i].right() - 1;
+ } else if (x >= rects[i].maxX()) {
+ if (x - rects[i].maxX() + 1 < distance) {
+ newx = rects[i].maxX() - 1;
newy = y;
- distance = x - rects[i].right() + 1;
+ distance = x - rects[i].maxX() + 1;
}
}
}
@@ -4387,7 +4387,7 @@ static jobject GetTouchHighlightRects(JNIEnv* env, jobject obj, jint x, jint y,
for (size_t i = 0; i < rects.size(); i++) {
jobject rect = env->NewObject(rectClass, rectinit, rects[i].x(),
- rects[i].y(), rects[i].right(), rects[i].bottom());
+ rects[i].y(), rects[i].maxX(), rects[i].maxY());
if (rect) {
env->CallBooleanMethod(array, add, rect);
env->DeleteLocalRef(rect);
diff --git a/Source/WebKit/android/nav/CacheBuilder.cpp b/Source/WebKit/android/nav/CacheBuilder.cpp
index e7691d7..de59626 100644
--- a/Source/WebKit/android/nav/CacheBuilder.cpp
+++ b/Source/WebKit/android/nav/CacheBuilder.cpp
@@ -2998,7 +2998,7 @@ bool CacheBuilder::AddPartRect(IntRect& bounds, int x, int y,
if (bounds.isEmpty())
return true;
bounds.move(x, y);
- if (bounds.right() <= 0 || bounds.bottom() <= 0)
+ if (bounds.maxX() <= 0 || bounds.maxY() <= 0)
return true;
IntRect* work = result->begin() - 1;
IntRect* end = result->end();
@@ -3090,14 +3090,11 @@ bool CacheBuilder::ConstructPartRects(Node* node, const IntRect& bounds,
if (hasClip == false) {
if (nodeIsAnchor && test->hasTagName(HTMLNames::divTag)) {
IntRect bounds = renderer->absoluteBoundingBoxRect(); // x, y fixup done by AddPartRect
- int left = bounds.x() + ((RenderBox*)renderer)->paddingLeft()
- + ((RenderBox*)renderer)->borderLeft();
- int top = bounds.y() + ((RenderBox*)renderer)->paddingTop()
- + ((RenderBox*)renderer)->borderTop();
- int right = bounds.right() - ((RenderBox*)renderer)->paddingRight()
- - ((RenderBox*)renderer)->borderRight();
- int bottom = bounds.bottom() - ((RenderBox*)renderer)->paddingBottom()
- - ((RenderBox*)renderer)->borderBottom();
+ 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);
diff --git a/Source/WebKit/android/nav/CachedFrame.cpp b/Source/WebKit/android/nav/CachedFrame.cpp
index b26e24b..4d245d2 100644
--- a/Source/WebKit/android/nav/CachedFrame.cpp
+++ b/Source/WebKit/android/nav/CachedFrame.cpp
@@ -70,7 +70,7 @@ bool CachedFrame::CheckBetween(Direction direction, const WebCore::IntRect& best
{
int left, top, width, height;
if (direction & UP_DOWN) {
- top = direction == UP ? bestRect.bottom() : prior.bottom();
+ top = direction == UP ? bestRect.maxY() : prior.maxY();
int bottom = direction == UP ? prior.y() : bestRect.y();
height = bottom - top;
if (height < 0)
@@ -79,13 +79,13 @@ bool CachedFrame::CheckBetween(Direction direction, const WebCore::IntRect& best
int testLeft = bestRect.x();
if (left > testLeft)
left = testLeft;
- int right = prior.right();
- int testRight = bestRect.right();
+ int right = prior.maxX();
+ int testRight = bestRect.maxX();
if (right < testRight)
right = testRight;
width = right - left;
} else {
- left = direction == LEFT ? bestRect.right() : prior.right();
+ left = direction == LEFT ? bestRect.maxX() : prior.maxX();
int right = direction == LEFT ? prior.x() : bestRect.x();
width = right - left;
if (width < 0)
@@ -94,8 +94,8 @@ bool CachedFrame::CheckBetween(Direction direction, const WebCore::IntRect& best
int testTop = bestRect.y();
if (top > testTop)
top = testTop;
- int bottom = prior.bottom();
- int testBottom = bestRect.bottom();
+ int bottom = prior.maxY();
+ int testBottom = bestRect.maxY();
if (bottom < testBottom)
bottom = testBottom;
height = bottom - top;
@@ -590,18 +590,35 @@ void CachedFrame::findClosest(BestData* bestData, Direction originalDirection,
// clip bottom' -- keep the old code but try this instead
switch (direction) {
#if 0
- case LEFT: distance = testBounds.x() - clip->x(); break;
- case RIGHT: distance = clip->right() - testBounds.right(); break;
- case UP: distance = testBounds.y() - clip->y(); break;
- case DOWN: distance = clip->bottom() - testBounds.bottom(); break;
+ case LEFT:
+ distance = testBounds.x() - clip->x();
+ break;
+ case RIGHT:
+ distance = clip->right() - testBounds.right();
+ break;
+ case UP:
+ distance = testBounds.y() - clip->y();
+ break;
+ case DOWN:
+ distance = clip->bottom() - testBounds.bottom();
+ break;
#else
- case LEFT: distance = clip->right() - testBounds.x(); break;
- case RIGHT: distance = testBounds.right() - clip->x(); break;
- case UP: distance = clip->bottom() - testBounds.y(); break;
- case DOWN: distance = testBounds.bottom() - clip->y(); break;
+ case LEFT:
+ distance = clip->maxX() - testBounds.x();
+ break;
+ case RIGHT:
+ distance = testBounds.maxX() - clip->x();
+ break;
+ case UP:
+ distance = clip->maxY() - testBounds.y();
+ break;
+ case DOWN:
+ distance = testBounds.maxY() - clip->y();
+ break;
#endif
- default:
- distance = 0; ASSERT(0);
+ default:
+ distance = 0;
+ ASSERT(false);
}
if (distance < bestData->mDistance) {
bestData->mNode = test;
@@ -1227,10 +1244,10 @@ void CachedFrame::BestData::setDistances()
bool CachedFrame::BestData::setDownDirection(const CachedHistory* history)
{
const WebCore::IntRect& navBounds = history->navBounds();
- mMajorButt = mNodeBounds.y() - navBounds.bottom();
+ mMajorButt = mNodeBounds.y() - navBounds.maxY();
int testX = mNodeBounds.x();
- int testRight = mNodeBounds.right();
- setNavOverlap(navBounds.width(), navBounds.right() - testX,
+ int testRight = mNodeBounds.maxX();
+ setNavOverlap(navBounds.width(), navBounds.maxX() - testX,
testRight - navBounds.x());
if (canBeReachedByAnotherDirection()) {
mNode->setCondition(CachedNode::BEST_DIRECTION);
@@ -1244,8 +1261,8 @@ bool CachedFrame::BestData::setDownDirection(const CachedHistory* history)
mNode->setCondition(CachedNode::CENTER_FURTHER); // never move up or sideways
return REJECT_TEST;
}
- int inNavBottom = navBounds.bottom() - mNodeBounds.bottom();
- setNavInclusion(testRight - navBounds.right(), navBounds.x() - testX);
+ int inNavBottom = navBounds.maxY() - mNodeBounds.maxY();
+ setNavInclusion(testRight - navBounds.maxX(), navBounds.x() - testX);
bool subsumes = navBounds.height() > 0 && inOrSubsumesNav();
if (inNavTop <= 0 && inNavBottom <= 0 && subsumes && !mNode->wantsKeyEvents()) {
mNode->setCondition(CachedNode::NOT_ENCLOSING_CURSOR);
@@ -1267,16 +1284,16 @@ bool CachedFrame::BestData::setDownDirection(const CachedHistory* history)
bool CachedFrame::BestData::setLeftDirection(const CachedHistory* history)
{
const WebCore::IntRect& navBounds = history->navBounds();
- mMajorButt = navBounds.x() - mNodeBounds.right();
+ mMajorButt = navBounds.x() - mNodeBounds.maxX();
int testY = mNodeBounds.y();
- int testBottom = mNodeBounds.bottom();
- setNavOverlap(navBounds.height(), navBounds.bottom() - testY,
+ int testBottom = mNodeBounds.maxY();
+ setNavOverlap(navBounds.height(), navBounds.maxY() - testY,
testBottom - navBounds.y());
if (canBeReachedByAnotherDirection()) {
mNode->setCondition(CachedNode::BEST_DIRECTION);
return REJECT_TEST;
}
- int inNavRight = navBounds.right() - mNodeBounds.right();
+ int inNavRight = navBounds.maxX() - mNodeBounds.maxX();
mMajorDelta2 = inNavRight;
mMajorDelta = mMajorDelta2 - ((navBounds.width() -
mNodeBounds.width()) >> 1);
@@ -1285,7 +1302,7 @@ bool CachedFrame::BestData::setLeftDirection(const CachedHistory* history)
return REJECT_TEST;
}
int inNavLeft = mNodeBounds.x() - navBounds.x();
- setNavInclusion(navBounds.y() - testY, testBottom - navBounds.bottom());
+ setNavInclusion(navBounds.y() - testY, testBottom - navBounds.maxY());
bool subsumes = navBounds.width() > 0 && inOrSubsumesNav();
if (inNavLeft <= 0 && inNavRight <= 0 && subsumes && !mNode->wantsKeyEvents()) {
mNode->setCondition(CachedNode::NOT_ENCLOSING_CURSOR);
@@ -1307,10 +1324,10 @@ bool CachedFrame::BestData::setLeftDirection(const CachedHistory* history)
bool CachedFrame::BestData::setRightDirection(const CachedHistory* history)
{
const WebCore::IntRect& navBounds = history->navBounds();
- mMajorButt = mNodeBounds.x() - navBounds.right();
+ mMajorButt = mNodeBounds.x() - navBounds.maxX();
int testY = mNodeBounds.y();
- int testBottom = mNodeBounds.bottom();
- setNavOverlap(navBounds.height(), navBounds.bottom() - testY,
+ int testBottom = mNodeBounds.maxY();
+ setNavOverlap(navBounds.height(), navBounds.maxY() - testY,
testBottom - navBounds.y());
if (canBeReachedByAnotherDirection()) {
mNode->setCondition(CachedNode::BEST_DIRECTION);
@@ -1324,8 +1341,8 @@ bool CachedFrame::BestData::setRightDirection(const CachedHistory* history)
mNode->setCondition(CachedNode::CENTER_FURTHER); // never move left or sideways
return REJECT_TEST;
}
- int inNavRight = navBounds.right() - mNodeBounds.right();
- setNavInclusion(testBottom - navBounds.bottom(), navBounds.y() - testY);
+ int inNavRight = navBounds.maxX() - mNodeBounds.maxX();
+ setNavInclusion(testBottom - navBounds.maxY(), navBounds.y() - testY);
bool subsumes = navBounds.width() > 0 && inOrSubsumesNav();
if (inNavLeft <= 0 && inNavRight <= 0 && subsumes && !mNode->wantsKeyEvents()) {
mNode->setCondition(CachedNode::NOT_ENCLOSING_CURSOR);
@@ -1347,16 +1364,16 @@ bool CachedFrame::BestData::setRightDirection(const CachedHistory* history)
bool CachedFrame::BestData::setUpDirection(const CachedHistory* history)
{
const WebCore::IntRect& navBounds = history->navBounds();
- mMajorButt = navBounds.y() - mNodeBounds.bottom();
+ mMajorButt = navBounds.y() - mNodeBounds.maxY();
int testX = mNodeBounds.x();
- int testRight = mNodeBounds.right();
- setNavOverlap(navBounds.width(), navBounds.right() - testX,
+ int testRight = mNodeBounds.maxX();
+ setNavOverlap(navBounds.width(), navBounds.maxX() - testX,
testRight - navBounds.x());
if (canBeReachedByAnotherDirection()) {
mNode->setCondition(CachedNode::BEST_DIRECTION);
return REJECT_TEST;
}
- int inNavBottom = navBounds.bottom() - mNodeBounds.bottom();
+ int inNavBottom = navBounds.maxY() - mNodeBounds.maxY();
mMajorDelta2 = inNavBottom;
mMajorDelta = mMajorDelta2 - ((navBounds.height() -
mNodeBounds.height()) >> 1);
@@ -1365,7 +1382,7 @@ bool CachedFrame::BestData::setUpDirection(const CachedHistory* history)
return REJECT_TEST;
}
int inNavTop = mNodeBounds.y() - navBounds.y();
- setNavInclusion(navBounds.x() - testX, testRight - navBounds.right());
+ setNavInclusion(navBounds.x() - testX, testRight - navBounds.maxX());
bool subsumes = navBounds.height() > 0 && inOrSubsumesNav();
if (inNavTop <= 0 && inNavBottom <= 0 && subsumes && !mNode->wantsKeyEvents()) {
mNode->setCondition(CachedNode::NOT_ENCLOSING_CURSOR);
diff --git a/Source/WebKit/android/nav/CachedFrame.h b/Source/WebKit/android/nav/CachedFrame.h
index 039a0ee..5802e36 100644
--- a/Source/WebKit/android/nav/CachedFrame.h
+++ b/Source/WebKit/android/nav/CachedFrame.h
@@ -173,7 +173,7 @@ protected:
bool mInNav;
bool mNavOutside;
bool mWorkingOutside;
- int bottom() const { return bounds().bottom(); }
+ int bottom() const { return bounds().maxY(); }
const WebCore::IntRect& bounds() const { return mNodeBounds; }
bool canBeReachedByAnotherDirection();
int height() const { return bounds().height(); }
@@ -183,7 +183,7 @@ protected:
const WebCore::IntRect& mouseBounds() const { return mMouseBounds; }
static SkFixed Overlap(int span, int left, int right);
void reset() { mNode = NULL; }
- int right() const { return bounds().right(); }
+ int right() const { return bounds().maxX(); }
void setMouseBounds(const WebCore::IntRect& b) { mMouseBounds = b; }
void setNodeBounds(const WebCore::IntRect& b) { mNodeBounds = b; }
void setDistances();
diff --git a/Source/WebKit/android/nav/CachedHistory.cpp b/Source/WebKit/android/nav/CachedHistory.cpp
index 9066412..d132cc3 100644
--- a/Source/WebKit/android/nav/CachedHistory.cpp
+++ b/Source/WebKit/android/nav/CachedHistory.cpp
@@ -64,18 +64,14 @@ bool CachedHistory::checkVisited(const CachedNode* node, CachedFrame::Direction
void CachedHistory::pinMaxMin(const WebCore::IntRect& viewBounds)
{
- if (mMinWorkingHorizontal < viewBounds.y() ||
- mMinWorkingHorizontal >= viewBounds.bottom())
+ if (mMinWorkingHorizontal < viewBounds.y() || mMinWorkingHorizontal >= viewBounds.maxY())
mMinWorkingHorizontal = viewBounds.y();
- if (mMaxWorkingHorizontal > viewBounds.bottom() ||
- mMaxWorkingHorizontal <= viewBounds.y())
- mMaxWorkingHorizontal = viewBounds.bottom();
- if (mMinWorkingVertical < viewBounds.x() ||
- mMinWorkingVertical >= viewBounds.right())
+ if (mMaxWorkingHorizontal > viewBounds.maxY() || mMaxWorkingHorizontal <= viewBounds.y())
+ mMaxWorkingHorizontal = viewBounds.maxY();
+ if (mMinWorkingVertical < viewBounds.x() || mMinWorkingVertical >= viewBounds.maxX())
mMinWorkingVertical = viewBounds.x();
- if (mMaxWorkingVertical > viewBounds.right() ||
- mMaxWorkingVertical <= viewBounds.x())
- mMaxWorkingVertical = viewBounds.right();
+ if (mMaxWorkingVertical > viewBounds.maxX() || mMaxWorkingVertical <= viewBounds.x())
+ mMaxWorkingVertical = viewBounds.maxX();
}
void CachedHistory::reset()
@@ -111,11 +107,11 @@ void CachedHistory::setWorking(CachedFrame::Direction newMove,
if (change) { // uninitialized or change in direction
if (lastAxis != CachedFrame::LEFT && navBounds->height() > 0) {
mMinWorkingHorizontal = navBounds->y();
- mMaxWorkingHorizontal = navBounds->bottom();
+ mMaxWorkingHorizontal = navBounds->maxY();
}
if (lastAxis != CachedFrame::UP && navBounds->width() > 0) {
mMinWorkingVertical = navBounds->x();
- mMaxWorkingVertical = navBounds->right();
+ mMaxWorkingVertical = navBounds->maxX();
}
}
pinMaxMin(viewBounds);
diff --git a/Source/WebKit/android/nav/CachedNode.cpp b/Source/WebKit/android/nav/CachedNode.cpp
index e3ba34d..86c2a38 100644
--- a/Source/WebKit/android/nav/CachedNode.cpp
+++ b/Source/WebKit/android/nav/CachedNode.cpp
@@ -147,17 +147,17 @@ void CachedNode::fixUpCursorRects(const CachedFrame* frame)
while (++unitBoundsPtr < unitBoundsEnd) {
// any other unitBounds to the left or right of this one?
int unitTop = unitBoundsPtr->y();
- int unitBottom = unitBoundsPtr->bottom();
+ int unitBottom = unitBoundsPtr->maxY();
int unitLeft = unitBoundsPtr->x();
- int unitRight = unitBoundsPtr->right();
+ int unitRight = unitBoundsPtr->maxX();
WebCore::IntRect* testBoundsPtr = mCursorRing.begin() - 1;
while (++testBoundsPtr < unitBoundsEnd) {
if (unitBoundsPtr == testBoundsPtr)
continue;
int testTop = testBoundsPtr->y();
- int testBottom = testBoundsPtr->bottom();
+ int testBottom = testBoundsPtr->maxY();
int testLeft = testBoundsPtr->x();
- int testRight = testBoundsPtr->right();
+ int testRight = testBoundsPtr->maxX();
int candidateTop = unitTop > testTop ? unitTop : testTop;
int candidateBottom = unitBottom < testBottom ? unitBottom : testBottom;
int candidateLeft = unitRight < testLeft ? unitRight : testRight;
@@ -184,19 +184,19 @@ void CachedNode::fixUpCursorRects(const CachedFrame* frame)
continue;
if (leftRight) {
if (candidateTop >= checkBoundsPtr->y() &&
- candidateBottom > checkBoundsPtr->bottom())
- candidateTop = checkBoundsPtr->bottom();
+ candidateBottom > checkBoundsPtr->maxY())
+ candidateTop = checkBoundsPtr->maxY();
else if (candidateTop < checkBoundsPtr->y() &&
- candidateBottom <= checkBoundsPtr->bottom())
+ candidateBottom <= checkBoundsPtr->maxY())
candidateBottom = checkBoundsPtr->y();
else
goto nextCheck;
} else {
if (candidateLeft >= checkBoundsPtr->x() &&
- candidateRight > checkBoundsPtr->right())
- candidateLeft = checkBoundsPtr->right();
+ candidateRight > checkBoundsPtr->maxX())
+ candidateLeft = checkBoundsPtr->maxX();
else if (candidateLeft < checkBoundsPtr->x() &&
- candidateRight <= checkBoundsPtr->right())
+ candidateRight <= checkBoundsPtr->maxX())
candidateRight = checkBoundsPtr->x();
else
goto nextCheck;
diff --git a/Source/WebKit/android/nav/CachedRoot.cpp b/Source/WebKit/android/nav/CachedRoot.cpp
index 64bf19a..e841683 100644
--- a/Source/WebKit/android/nav/CachedRoot.cpp
+++ b/Source/WebKit/android/nav/CachedRoot.cpp
@@ -589,7 +589,7 @@ public:
{
const WebCore::IntRect* r;
for (r = rings.begin(); r != rings.end(); r++) {
- SkIRect fatter = {r->x(), r->y(), r->right(), r->bottom()};
+ SkIRect fatter = {r->x(), r->y(), r->maxX(), r->maxY()};
fatter.inset(-CURSOR_RING_HIT_TEST_RADIUS, -CURSOR_RING_HIT_TEST_RADIUS);
DBG_NAV_LOGD("RingCheck fat=(%d,%d,r=%d,b=%d)", fatter.fLeft, fatter.fTop,
fatter.fRight, fatter.fBottom);
@@ -1285,15 +1285,15 @@ bool CachedRoot::innerDown(const CachedNode* test, BestData* bestData) const
// (line up)
mScrolledBounds.setHeight(mScrolledBounds.height() + mMaxYScroll);
int testTop = mScrolledBounds.y();
- int viewBottom = mViewBounds.bottom();
+ int viewBottom = mViewBounds.maxY();
const WebCore::IntRect& navBounds = mHistory->mNavBounds;
if (navBounds.isEmpty() == false &&
- navBounds.bottom() > viewBottom && viewBottom < mContents.height())
+ navBounds.maxY() > viewBottom && viewBottom < mContents.height())
return false;
if (navBounds.isEmpty() == false) {
int navTop = navBounds.y();
int scrollBottom;
- if (testTop < navTop && navTop < (scrollBottom = mScrolledBounds.bottom())) {
+ if (testTop < navTop && navTop < (scrollBottom = mScrolledBounds.maxY())) {
mScrolledBounds.setHeight(scrollBottom - navTop);
mScrolledBounds.setY(navTop);
}
@@ -1310,14 +1310,14 @@ bool CachedRoot::innerLeft(const CachedNode* test, BestData* bestData) const
setupScrolledBounds();
mScrolledBounds.setX(mScrolledBounds.x() - mMaxXScroll);
mScrolledBounds.setWidth(mScrolledBounds.width() + mMaxXScroll);
- int testRight = mScrolledBounds.right();
+ int testRight = mScrolledBounds.maxX();
int viewLeft = mViewBounds.x();
const WebCore::IntRect& navBounds = mHistory->mNavBounds;
if (navBounds.isEmpty() == false &&
navBounds.x() < viewLeft && viewLeft > mContents.x())
return false;
if (navBounds.isEmpty() == false) {
- int navRight = navBounds.right();
+ int navRight = navBounds.maxX();
int scrollLeft;
if (testRight > navRight && navRight > (scrollLeft = mScrolledBounds.x()))
mScrolledBounds.setWidth(navRight - scrollLeft);
@@ -1347,7 +1347,7 @@ void CachedRoot::innerMove(const CachedNode* node, BestData* bestData,
switch (direction) {
case LEFT:
if (outOfCursor)
- mHistory->mNavBounds = WebCore::IntRect(mViewBounds.right(),
+ mHistory->mNavBounds = WebCore::IntRect(mViewBounds.maxX(),
mViewBounds.y(), 1, mViewBounds.height());
findClosest = innerLeft(node, bestData);
break;
@@ -1360,7 +1360,7 @@ void CachedRoot::innerMove(const CachedNode* node, BestData* bestData,
case UP:
if (outOfCursor)
mHistory->mNavBounds = WebCore::IntRect(mViewBounds.x(),
- mViewBounds.bottom(), mViewBounds.width(), 1);
+ mViewBounds.maxY(), mViewBounds.width(), 1);
findClosest = innerUp(node, bestData);
break;
case DOWN:
@@ -1390,12 +1390,12 @@ void CachedRoot::innerMove(const CachedNode* node, BestData* bestData,
newBounds.move(offsetX, offsetY);
if (mViewBounds.x() > newBounds.x())
offsetX = mViewBounds.x() - mHistory->mNavBounds.x();
- else if (mViewBounds.right() < newBounds.right())
- offsetX = mViewBounds.right() - mHistory->mNavBounds.right();
+ else if (mViewBounds.maxX() < newBounds.maxX())
+ offsetX = mViewBounds.maxX() - mHistory->mNavBounds.maxX();
if (mViewBounds.y() > newBounds.y())
offsetY = mViewBounds.y() - mHistory->mNavBounds.y();
- else if (mViewBounds.bottom() < newBounds.bottom())
- offsetY = mViewBounds.bottom() - mHistory->mNavBounds.bottom();
+ else if (mViewBounds.maxY() < newBounds.maxY())
+ offsetY = mViewBounds.maxY() - mHistory->mNavBounds.maxY();
mHistory->mNavBounds.move(offsetX, offsetY);
}
mHistory->setDidFirstLayout(false);
@@ -1409,15 +1409,15 @@ bool CachedRoot::innerRight(const CachedNode* test, BestData* bestData) const
// (align)
mScrolledBounds.setWidth(mScrolledBounds.width() + mMaxXScroll);
int testLeft = mScrolledBounds.x();
- int viewRight = mViewBounds.right();
+ int viewRight = mViewBounds.maxX();
const WebCore::IntRect& navBounds = mHistory->mNavBounds;
if (navBounds.isEmpty() == false &&
- navBounds.right() > viewRight && viewRight < mContents.width())
+ navBounds.maxX() > viewRight && viewRight < mContents.width())
return false;
if (navBounds.isEmpty() == false) {
int navLeft = navBounds.x();
int scrollRight;
- if (testLeft < navLeft && navLeft < (scrollRight = mScrolledBounds.right())) {
+ if (testLeft < navLeft && navLeft < (scrollRight = mScrolledBounds.maxX())) {
mScrolledBounds.setWidth(scrollRight - navLeft);
mScrolledBounds.setX(navLeft);
}
@@ -1434,14 +1434,14 @@ bool CachedRoot::innerUp(const CachedNode* test, BestData* bestData) const
setupScrolledBounds();
mScrolledBounds.setY(mScrolledBounds.y() - mMaxYScroll);
mScrolledBounds.setHeight(mScrolledBounds.height() + mMaxYScroll);
- int testBottom = mScrolledBounds.bottom();
+ int testBottom = mScrolledBounds.maxY();
int viewTop = mViewBounds.y();
const WebCore::IntRect& navBounds = mHistory->mNavBounds;
if (navBounds.isEmpty() == false &&
navBounds.y() < viewTop && viewTop > mContents.y())
return false;
if (navBounds.isEmpty() == false) {
- int navBottom = navBounds.bottom();
+ int navBottom = navBounds.maxY();
int scrollTop;
if (testBottom > navBottom && navBottom > (scrollTop = mScrolledBounds.y()))
mScrolledBounds.setHeight(navBottom - scrollTop);
@@ -1657,13 +1657,13 @@ bool CachedRoot::scrollDelta(WebCore::IntRect& newOutset, Direction direction, i
return newOutset.x() >= mViewBounds.x();
case RIGHT:
*delta = mMaxXScroll;
- return newOutset.right() <= mViewBounds.right();
+ return newOutset.maxX() <= mViewBounds.maxX();
case UP:
*delta = -mMaxYScroll;
return newOutset.y() >= mViewBounds.y();
case DOWN:
*delta = mMaxYScroll;
- return newOutset.bottom() <= mViewBounds.bottom();
+ return newOutset.maxY() <= mViewBounds.maxY();
default:
*delta = 0;
ASSERT(0);
diff --git a/Source/WebKit/android/nav/WebView.cpp b/Source/WebKit/android/nav/WebView.cpp
index ff5d73d..f56cd69 100644
--- a/Source/WebKit/android/nav/WebView.cpp
+++ b/Source/WebKit/android/nav/WebView.cpp
@@ -321,7 +321,7 @@ void nativeRecordButtons(bool hasFocus, bool pressed, bool invalidate)
m_viewImpl->gButtonMutex.unlock();
if (invalidate && cachedCursor && cursorIsOnButton) {
const WebCore::IntRect& b = cachedCursor->bounds(cachedFrame);
- viewInvalidateRect(b.x(), b.y(), b.right(), b.bottom());
+ viewInvalidateRect(b.x(), b.y(), b.maxX(), b.maxY());
}
}
@@ -335,7 +335,7 @@ void scrollRectOnScreen(const IntRect& rect)
calcOurContentVisibleRect(&visible);
int dx = 0;
int left = rect.x();
- int right = rect.right();
+ int right = rect.maxX();
if (left < visible.fLeft) {
dx = left - visible.fLeft;
// Only scroll right if the entire width can fit on screen.
@@ -344,7 +344,7 @@ void scrollRectOnScreen(const IntRect& rect)
}
int dy = 0;
int top = rect.y();
- int bottom = rect.bottom();
+ int bottom = rect.maxY();
if (top < visible.fTop) {
dy = top - visible.fTop;
// Only scroll down if the entire height can fit on screen
@@ -649,9 +649,9 @@ void fixCursor()
return;
if (abs(bounds.y() - newBounds.y()) > 4)
return;
- if (abs(bounds.right() - newBounds.right()) > 4)
+ if (abs(bounds.maxX() - newBounds.maxX()) > 4)
return;
- if (abs(bounds.bottom() - newBounds.bottom()) > 4)
+ if (abs(bounds.maxY() - newBounds.maxY()) > 4)
return;
DBG_NAV_LOGD("node=%p frame=%p x=%d y=%d bounds=(%d,%d,w=%d,h=%d)",
node, frame, x, y, bounds.x(), bounds.y(), bounds.width(),
@@ -882,12 +882,12 @@ bool moveCursor(int keyCode, int count, bool ignoreScroll)
} else {
int docHeight = root->documentHeight();
int docWidth = root->documentWidth();
- if (visibleRect.bottom() + dy > docHeight)
- dy = docHeight - visibleRect.bottom();
+ if (visibleRect.maxY() + dy > docHeight)
+ dy = docHeight - visibleRect.maxY();
else if (visibleRect.y() + dy < 0)
dy = -visibleRect.y();
- if (visibleRect.right() + dx > docWidth)
- dx = docWidth - visibleRect.right();
+ if (visibleRect.maxX() + dx > docWidth)
+ dx = docWidth - visibleRect.maxX();
else if (visibleRect.x() < 0)
dx = -visibleRect.x();
result = direction == CachedFrame::LEFT ? dx >= 0 :
@@ -1345,7 +1345,7 @@ void postInvalidateDelayed(int64_t delay, const WebCore::IntRect& bounds)
{
JNIEnv* env = JSC::Bindings::getJNIEnv();
env->CallVoidMethod(m_javaGlue.object(env).get(), m_javaGlue.m_postInvalidateDelayed,
- delay, bounds.x(), bounds.y(), bounds.right(), bounds.bottom());
+ delay, bounds.x(), bounds.y(), bounds.maxX(), bounds.maxY());
checkException(env);
}
@@ -1520,8 +1520,8 @@ class GLDrawFunctor : Functor {
}
info->dirtyLeft = finalInval.x();
info->dirtyTop = finalInval.y();
- info->dirtyRight = finalInval.right();
- info->dirtyBottom = finalInval.bottom();
+ info->dirtyRight = finalInval.maxX();
+ info->dirtyBottom = finalInval.maxY();
}
// return 1 if invalidation needed, 0 otherwise
return retVal ? 1 : 0;
@@ -1557,7 +1557,7 @@ static jobject nativeCacheHitNodeBounds(JNIEnv *env, jobject obj)
jclass rectClass = env->FindClass("android/graphics/Rect");
jmethodID init = env->GetMethodID(rectClass, "<init>", "(IIII)V");
jobject rect = env->NewObject(rectClass, init, bounds.x(),
- bounds.y(), bounds.right(), bounds.bottom());
+ bounds.y(), bounds.maxX(), bounds.maxY());
env->DeleteLocalRef(rectClass);
return rect;
}
@@ -1692,7 +1692,7 @@ static jobject nativeCursorNodeBounds(JNIEnv *env, jobject obj)
jclass rectClass = env->FindClass("android/graphics/Rect");
jmethodID init = env->GetMethodID(rectClass, "<init>", "(IIII)V");
jobject rect = env->NewObject(rectClass, init, bounds.x(),
- bounds.y(), bounds.right(), bounds.bottom());
+ bounds.y(), bounds.maxX(), bounds.maxY());
env->DeleteLocalRef(rectClass);
return rect;
}
@@ -1930,7 +1930,7 @@ static jobject nativeFocusCandidateNodeBounds(JNIEnv *env, jobject obj)
const CachedNode* node = getFocusCandidate(env, obj, &frame);
WebCore::IntRect bounds = node ? node->bounds(frame)
: WebCore::IntRect(0, 0, 0, 0);
- return createJavaRect(env, bounds.x(), bounds.y(), bounds.right(), bounds.bottom());
+ return createJavaRect(env, bounds.x(), bounds.y(), bounds.maxX(), bounds.maxY());
}
static jobject nativeFocusCandidatePaddingRect(JNIEnv *env, jobject obj)
@@ -1998,7 +1998,7 @@ static jobject nativeFocusNodeBounds(JNIEnv *env, jobject obj)
jclass rectClass = env->FindClass("android/graphics/Rect");
jmethodID init = env->GetMethodID(rectClass, "<init>", "(IIII)V");
jobject rect = env->NewObject(rectClass, init, bounds.x(),
- bounds.y(), bounds.right(), bounds.bottom());
+ bounds.y(), bounds.maxX(), bounds.maxY());
env->DeleteLocalRef(rectClass);
return rect;
}
@@ -2169,7 +2169,7 @@ static jobject nativeGetCursorRingBounds(JNIEnv *env, jobject obj)
WebCore::IntRect webRect;
view->cursorRingBounds(&webRect);
jobject rect = env->NewObject(rectClass, init, webRect.x(),
- webRect.y(), webRect.right(), webRect.bottom());
+ webRect.y(), webRect.maxX(), webRect.maxY());
env->DeleteLocalRef(rectClass);
return rect;
}