https://bugs.webkit.org/show_bug.cgi?id=53520
Reviewed by Oliver Hunt.
Remove the physical terminology from IntRect and FloatRect.
Now that we have flipped RenderBlocks for vertical-rl and horizontal-bt writing modes,
we need to update our terminology to be more accurate.
I'm borrowing a page from AppKit here (which also supports flipped NSViews) and
renaming right() and bottom() to maxX() and maxY(). These terms remain accurate
even for flipped rectangles.
../WebCore:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::boundsForVisiblePositionRange):
* accessibility/mac/AccessibilityObjectWrapper.mm:
(-[AccessibilityObjectWrapper position]):
* dom/ClientRect.h:
(WebCore::ClientRect::right):
(WebCore::ClientRect::bottom):
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::convertLogicalToDevice):
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::normalizeRect):
* inspector/InspectorAgent.cpp:
(WebCore::InspectorAgent::drawElementTitle):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::adjustWindowRect):
* page/DragController.cpp:
(WebCore::dragLocForSelectionDrag):
* page/EventHandler.cpp:
(WebCore::EventHandler::sendContextMenuEventForKey):
* page/PrintContext.cpp:
(WebCore::PrintContext::computePageRectsWithPageSizeInternal):
(WebCore::PrintContext::pageNumberForElement):
* page/SpatialNavigation.cpp:
(WebCore::end):
(WebCore::areRectsFullyAligned):
(WebCore::areRectsMoreThanFullScreenApart):
(WebCore::below):
(WebCore::rightOf):
(WebCore::isRectInDirection):
(WebCore::entryAndExitPointsForDirection):
(WebCore::virtualRectForDirection):
* page/WindowFeatures.cpp:
(WebCore::WindowFeatures::WindowFeatures):
* platform/ScrollView.cpp:
(WebCore::ScrollView::wheelEvent):
* platform/Scrollbar.cpp:
(WebCore::Scrollbar::setFrameRect):
* platform/ScrollbarThemeComposite.cpp:
(WebCore::ScrollbarThemeComposite::splitTrack):
* platform/chromium/ScrollbarThemeChromium.cpp:
(WebCore::ScrollbarThemeChromium::paintTickmarks):
* platform/graphics/FloatQuad.h:
(WebCore::FloatQuad::FloatQuad):
* platform/graphics/FloatRect.cpp:
(WebCore::FloatRect::intersects):
(WebCore::FloatRect::contains):
(WebCore::FloatRect::intersect):
(WebCore::FloatRect::unite):
(WebCore::enclosingIntRect):
* platform/graphics/FloatRect.h:
(WebCore::FloatRect::maxX):
(WebCore::FloatRect::maxY):
(WebCore::FloatRect::contains):
* platform/graphics/IntRect.cpp:
(WebCore::IntRect::intersects):
(WebCore::IntRect::contains):
(WebCore::IntRect::intersect):
(WebCore::IntRect::unite):
* platform/graphics/IntRect.h:
(WebCore::IntRect::maxX):
(WebCore::IntRect::maxY):
(WebCore::IntRect::shiftXEdgeTo):
(WebCore::IntRect::shiftMaxXEdgeTo):
(WebCore::IntRect::shiftYEdgeTo):
(WebCore::IntRect::shiftMaxYEdgeTo):
(WebCore::IntRect::contains):
* platform/graphics/WidthIterator.cpp:
(WebCore::WidthIterator::advance):
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::drawRect):
(WebCore::GraphicsContext::fillPath):
(WebCore::GraphicsContext::fillRect):
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::getImageData):
(WebCore::putImageData):
* platform/graphics/cg/ImageCG.cpp:
(WebCore::BitmapImage::draw):
* platform/graphics/filters/FilterEffect.cpp:
(WebCore::FilterEffect::copyImageBytes):
* platform/graphics/mac/ComplexTextController.cpp:
(WebCore::ComplexTextController::adjustGlyphsAndAdvances):
* platform/graphics/mac/SimpleFontDataMac.mm:
(WebCore::SimpleFontData::platformBoundsForGlyph):
* platform/graphics/transforms/AffineTransform.cpp:
(WebCore::AffineTransform::mapRect):
* platform/graphics/win/FontCGWin.cpp:
(WebCore::drawGDIGlyphs):
* platform/graphics/win/MediaPlayerPrivateQuickTimeWin.cpp:
(WebCore::MediaPlayerPrivate::paint):
* platform/gtk/RenderThemeGtk.cpp:
(WebCore::centerRectVerticallyInParentInputElement):
* platform/mac/WidgetMac.mm:
(WebCore::Widget::paint):
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::addBoxShadowVisualOverflow):
(WebCore::InlineFlowBox::addTextBoxVisualOverflow):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::selectionRect):
(WebCore::InlineTextBox::paint):
(WebCore::InlineTextBox::positionForOffset):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::addOverflowFromChildren):
(WebCore::RenderBlock::paintChildren):
(WebCore::RenderBlock::paintEllipsisBoxes):
(WebCore::RenderBlock::inlineSelectionGaps):
(WebCore::RenderBlock::adjustPointToColumnContents):
(WebCore::RenderBlock::flipForWritingModeIncludingColumns):
(WebCore::RenderBlock::adjustForColumns):
* rendering/RenderBlock.h:
(WebCore::RenderBlock::FloatingObject::right):
(WebCore::RenderBlock::FloatingObject::bottom):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::reflectedRect):
(WebCore::RenderBox::localCaretRect):
(WebCore::RenderBox::addShadowOverflow):
(WebCore::RenderBox::addLayoutOverflow):
(WebCore::RenderBox::visualOverflowRectForPropagation):
(WebCore::RenderBox::layoutOverflowRectForPropagation):
(WebCore::RenderBox::flipForWritingMode):
* rendering/RenderFrameSet.cpp:
(WebCore::RenderFrameSet::paintColumnBorder):
(WebCore::RenderFrameSet::paintRowBorder):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::paintOutlineForLine):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::getRectToExpose):
(WebCore::cornerRect):
(WebCore::RenderLayer::positionOverflowControls):
(WebCore::RenderLayer::overflowBottom):
(WebCore::RenderLayer::overflowRight):
(WebCore::RenderLayer::paintResizer):
* rendering/RenderLineBoxList.cpp:
(WebCore::RenderLineBoxList::rangeIntersectsRect):
(WebCore::RenderLineBoxList::paint):
* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::positionListMarker):
* rendering/RenderListMarker.cpp:
(WebCore::RenderListMarker::paint):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::repaintAfterLayoutIfNeeded):
* rendering/RenderOverflow.h:
(WebCore::RenderOverflow::RenderOverflow):
(WebCore::RenderOverflow::addLayoutOverflow):
(WebCore::RenderOverflow::addVisualOverflow):
(WebCore::RenderOverflow::setLayoutOverflow):
(WebCore::RenderOverflow::setVisualOverflow):
(WebCore::RenderOverflow::resetLayoutOverflow):
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::shouldPaint):
* rendering/RenderScrollbarTheme.cpp:
(WebCore::RenderScrollbarTheme::constrainTrackRectToTrackPieces):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::paint):
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::paint):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::paintObject):
* rendering/RenderText.cpp:
(WebCore::RenderText::absoluteQuads):
* rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::forwardEvent):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintMenuListButtonGradients):
(WebCore::RenderThemeMac::paintMenuListButton):
(WebCore::RenderThemeMac::paintSliderTrack):
* rendering/RenderView.cpp:
(WebCore::RenderView::computeRectForRepaint):
(WebCore::RenderView::docBottom):
(WebCore::RenderView::docRight):
* rendering/RootInlineBox.cpp:
(WebCore::RootInlineBox::paddedLayoutOverflowRect):
* rendering/svg/RenderSVGInlineText.cpp:
(WebCore::RenderSVGInlineText::localCaretRect):
../WebKit/mac:
* WebView/WebHTMLView.mm:
(setNeedsDisplayInRect):
../WebKit2:
* Platform/Region.cpp:
(WebKit::Region::Shape::Shape):
* UIProcess/API/mac/WKPrintingView.mm:
(pageDidComputePageRects):
* UIProcess/FindIndicator.cpp:
(WebKit::FindIndicator::draw):
* UIProcess/TiledDrawingAreaProxy.cpp:
(WebKit::TiledDrawingAreaProxy::invalidate):
(WebKit::TiledDrawingAreaProxy::paint):
(WebKit::TiledDrawingAreaProxy::createTiles):
* UIProcess/mac/ChunkedUpdateDrawingAreaProxyMac.mm:
(WebKit::ChunkedUpdateDrawingAreaProxy::drawUpdateChunkIntoBackingStore):
* WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
(WebKit::NetscapePlugin::callSetWindow):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@77286 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/page/SpatialNavigation.cpp b/Source/WebCore/page/SpatialNavigation.cpp
index 7d8ede3..f66d823 100644
--- a/Source/WebCore/page/SpatialNavigation.cpp
+++ b/Source/WebCore/page/SpatialNavigation.cpp
@@ -127,7 +127,7 @@
static inline int end(FocusDirection direction, const IntRect& rect)
{
- return isHorizontalMove(direction) ? rect.bottom() : rect.right();
+ return isHorizontalMove(direction) ? rect.maxY() : rect.maxX();
}
// This method checks if rects |a| and |b| are fully aligned either vertically or
@@ -144,11 +144,11 @@
switch (direction) {
case FocusDirectionLeft:
aStart = a.x();
- bEnd = b.right();
+ bEnd = b.maxX();
break;
case FocusDirectionRight:
aStart = b.x();
- bEnd = a.right();
+ bEnd = a.maxX();
break;
case FocusDirectionUp:
aStart = a.y();
@@ -245,13 +245,13 @@
switch (direction) {
case FocusDirectionLeft:
- return curRect.x() - targetRect.right() > viewSize.width();
+ return curRect.x() - targetRect.maxX() > viewSize.width();
case FocusDirectionRight:
- return targetRect.x() - curRect.right() > viewSize.width();
+ return targetRect.x() - curRect.maxX() > viewSize.width();
case FocusDirectionUp:
- return curRect.y() - targetRect.bottom() > viewSize.height();
+ return curRect.y() - targetRect.maxY() > viewSize.height();
case FocusDirectionDown:
- return targetRect.y() - curRect.bottom() > viewSize.height();
+ return targetRect.y() - curRect.maxY() > viewSize.height();
default:
ASSERT_NOT_REACHED();
return true;
@@ -261,26 +261,26 @@
// Return true if rect |a| is below |b|. False otherwise.
static inline bool below(const IntRect& a, const IntRect& b)
{
- return a.y() > b.bottom();
+ return a.y() > b.maxY();
}
// Return true if rect |a| is on the right of |b|. False otherwise.
static inline bool rightOf(const IntRect& a, const IntRect& b)
{
- return a.x() > b.right();
+ return a.x() > b.maxX();
}
static bool isRectInDirection(FocusDirection direction, const IntRect& curRect, const IntRect& targetRect)
{
switch (direction) {
case FocusDirectionLeft:
- return targetRect.right() <= curRect.x();
+ return targetRect.maxX() <= curRect.x();
case FocusDirectionRight:
- return targetRect.x() >= curRect.right();
+ return targetRect.x() >= curRect.maxX();
case FocusDirectionUp:
- return targetRect.bottom() <= curRect.y();
+ return targetRect.maxY() <= curRect.y();
case FocusDirectionDown:
- return targetRect.y() >= curRect.bottom();
+ return targetRect.y() >= curRect.maxY();
default:
ASSERT_NOT_REACHED();
return false;
@@ -544,18 +544,18 @@
switch (direction) {
case FocusDirectionLeft:
exitPoint.setX(startingRect.x());
- entryPoint.setX(potentialRect.right());
+ entryPoint.setX(potentialRect.maxX());
break;
case FocusDirectionUp:
exitPoint.setY(startingRect.y());
- entryPoint.setY(potentialRect.bottom());
+ entryPoint.setY(potentialRect.maxY());
break;
case FocusDirectionRight:
- exitPoint.setX(startingRect.right());
+ exitPoint.setX(startingRect.maxX());
entryPoint.setX(potentialRect.x());
break;
case FocusDirectionDown:
- exitPoint.setY(startingRect.bottom());
+ exitPoint.setY(startingRect.maxY());
entryPoint.setY(potentialRect.y());
break;
default:
@@ -567,9 +567,9 @@
case FocusDirectionRight:
if (below(startingRect, potentialRect)) {
exitPoint.setY(startingRect.y());
- entryPoint.setY(potentialRect.bottom());
+ entryPoint.setY(potentialRect.maxY());
} else if (below(potentialRect, startingRect)) {
- exitPoint.setY(startingRect.bottom());
+ exitPoint.setY(startingRect.maxY());
entryPoint.setY(potentialRect.y());
} else {
exitPoint.setY(max(startingRect.y(), potentialRect.y()));
@@ -580,9 +580,9 @@
case FocusDirectionDown:
if (rightOf(startingRect, potentialRect)) {
exitPoint.setX(startingRect.x());
- entryPoint.setX(potentialRect.right());
+ entryPoint.setX(potentialRect.maxX());
} else if (rightOf(potentialRect, startingRect)) {
- exitPoint.setX(startingRect.right());
+ exitPoint.setX(startingRect.maxX());
entryPoint.setX(potentialRect.x());
} else {
exitPoint.setX(max(startingRect.x(), potentialRect.x()));
@@ -675,11 +675,11 @@
IntRect virtualStartingRect = startingRect;
switch (direction) {
case FocusDirectionLeft:
- virtualStartingRect.setX(virtualStartingRect.right() - width);
+ virtualStartingRect.setX(virtualStartingRect.maxX() - width);
virtualStartingRect.setWidth(width);
break;
case FocusDirectionUp:
- virtualStartingRect.setY(virtualStartingRect.bottom() - width);
+ virtualStartingRect.setY(virtualStartingRect.maxY() - width);
virtualStartingRect.setHeight(width);
break;
case FocusDirectionRight: