summaryrefslogtreecommitdiffstats
path: root/WebCore/rendering/RenderInline.cpp
diff options
context:
space:
mode:
authorTeng-Hui Zhu <ztenghui@google.com>2010-11-10 15:31:59 -0800
committerTeng-Hui Zhu <ztenghui@google.com>2010-11-17 13:35:59 -0800
commit28040489d744e0c5d475a88663056c9040ed5320 (patch)
treec463676791e4a63e452a95f0a12b2a8519730693 /WebCore/rendering/RenderInline.cpp
parenteff9be92c41913c92fb1d3b7983c071f3e718678 (diff)
downloadexternal_webkit-28040489d744e0c5d475a88663056c9040ed5320.zip
external_webkit-28040489d744e0c5d475a88663056c9040ed5320.tar.gz
external_webkit-28040489d744e0c5d475a88663056c9040ed5320.tar.bz2
Merge WebKit at r71558: Initial merge by git.
Change-Id: Ib345578fa29df7e4bc72b4f00e4a6fddcb754c4c
Diffstat (limited to 'WebCore/rendering/RenderInline.cpp')
-rw-r--r--WebCore/rendering/RenderInline.cpp43
1 files changed, 27 insertions, 16 deletions
diff --git a/WebCore/rendering/RenderInline.cpp b/WebCore/rendering/RenderInline.cpp
index 4b28268..1a792e7 100644
--- a/WebCore/rendering/RenderInline.cpp
+++ b/WebCore/rendering/RenderInline.cpp
@@ -559,18 +559,22 @@ IntRect RenderInline::linesBoundingBox() const
ASSERT(!firstLineBox() == !lastLineBox()); // Either both are null or both exist.
if (firstLineBox() && lastLineBox()) {
// Return the width of the minimal left side and the maximal right side.
- int leftSide = 0;
- int rightSide = 0;
+ int logicalLeftSide = 0;
+ int logicalRightSide = 0;
for (InlineFlowBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) {
- if (curr == firstLineBox() || curr->x() < leftSide)
- leftSide = curr->x();
- if (curr == firstLineBox() || curr->x() + curr->logicalWidth() > rightSide)
- rightSide = curr->x() + curr->logicalWidth();
+ if (curr == firstLineBox() || curr->logicalLeft() < logicalLeftSide)
+ logicalLeftSide = curr->logicalLeft();
+ if (curr == firstLineBox() || curr->logicalRight() > logicalRightSide)
+ logicalRightSide = curr->logicalRight();
}
- result.setWidth(rightSide - leftSide);
- result.setX(leftSide);
- result.setHeight(lastLineBox()->y() + lastLineBox()->logicalHeight() - firstLineBox()->y());
- result.setY(firstLineBox()->y());
+
+ bool isHorizontal = style()->isHorizontalWritingMode();
+
+ int x = isHorizontal ? logicalLeftSide : firstLineBox()->x();
+ int y = isHorizontal ? firstLineBox()->y() : logicalLeftSide;
+ int width = isHorizontal ? logicalRightSide - logicalLeftSide : lastLineBox()->logicalBottom() - x;
+ int height = isHorizontal ? lastLineBox()->logicalBottom() - y : logicalRightSide - logicalLeftSide;
+ result = IntRect(x, y, width, height);
}
return result;
@@ -582,15 +586,20 @@ IntRect RenderInline::linesVisibleOverflowBoundingBox() const
return IntRect();
// Return the width of the minimal left side and the maximal right side.
- int leftSide = numeric_limits<int>::max();
- int rightSide = numeric_limits<int>::min();
+ int logicalLeftSide = numeric_limits<int>::max();
+ int logicalRightSide = numeric_limits<int>::min();
for (InlineFlowBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) {
- leftSide = min(leftSide, curr->leftVisibleOverflow());
- rightSide = max(rightSide, curr->rightVisibleOverflow());
+ logicalLeftSide = min(logicalLeftSide, curr->logicalLeftVisibleOverflow());
+ logicalRightSide = max(logicalRightSide, curr->logicalRightVisibleOverflow());
}
- return IntRect(leftSide, firstLineBox()->topVisibleOverflow(), rightSide - leftSide,
- lastLineBox()->bottomVisibleOverflow() - firstLineBox()->topVisibleOverflow());
+ bool isHorizontal = style()->isHorizontalWritingMode();
+
+ int x = isHorizontal ? logicalLeftSide : firstLineBox()->leftVisibleOverflow();
+ int y = isHorizontal ? firstLineBox()->topVisibleOverflow() : logicalLeftSide;
+ int width = isHorizontal ? logicalRightSide - logicalLeftSide : lastLineBox()->rightVisibleOverflow() - firstLineBox()->leftVisibleOverflow();
+ int height = isHorizontal ? lastLineBox()->bottomVisibleOverflow() - firstLineBox()->topVisibleOverflow() : logicalRightSide - logicalLeftSide;
+ return IntRect(x, y, width, height);
}
IntRect RenderInline::clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer)
@@ -619,6 +628,8 @@ IntRect RenderInline::clippedOverflowRectForRepaint(RenderBoxModelObject* repain
}
IntRect r(-ow + left, -ow + top, boundingBox.width() + ow * 2, boundingBox.height() + ow * 2);
+ cb->flipForWritingMode(r);
+
if (cb->hasColumns())
cb->adjustRectForColumns(r);