Diff
Modified: branches/subpixellayout/Source/WebCore/rendering/InlineTextBox.cpp (111853 => 111854)
--- branches/subpixellayout/Source/WebCore/rendering/InlineTextBox.cpp 2012-03-23 13:01:35 UTC (rev 111853)
+++ branches/subpixellayout/Source/WebCore/rendering/InlineTextBox.cpp 2012-03-23 13:10:55 UTC (rev 111854)
@@ -174,19 +174,19 @@
length += hyphenString.length();
}
-IntRect InlineTextBox::localSelectionRect(int startPos, int endPos)
+LayoutRect InlineTextBox::localSelectionRect(int startPos, int endPos)
{
int sPos = max(startPos - m_start, 0);
int ePos = min(endPos - m_start, (int)m_len);
if (sPos > ePos)
- return IntRect();
+ return LayoutRect();
FontCachePurgePreventer fontCachePurgePreventer;
RenderText* textObj = textRenderer();
- int selTop = selectionTop();
- int selHeight = selectionHeight();
+ LayoutUnit selTop = selectionTop();
+ LayoutUnit selHeight = selectionHeight();
RenderStyle* styleToUse = textObj->style(m_firstLine);
const Font& font = styleToUse->font();
@@ -196,19 +196,19 @@
if (respectHyphen)
endPos = textRun.length();
- IntRect r = enclosingIntRect(font.selectionRectForText(textRun, FloatPoint(logicalLeft(), selTop), selHeight, sPos, ePos));
+ LayoutRect r = enclosingIntRect(font.selectionRectForText(textRun, FloatPoint(logicalLeft(), selTop), selHeight, sPos, ePos));
- int logicalWidth = r.width();
+ LayoutUnit logicalWidth = r.width();
if (r.x() > logicalRight())
logicalWidth = 0;
else if (r.maxX() > logicalRight())
logicalWidth = logicalRight() - r.x();
- IntPoint topPoint = isHorizontal() ? IntPoint(r.x(), selTop) : IntPoint(selTop, r.x());
- int width = isHorizontal() ? logicalWidth : selHeight;
- int height = isHorizontal() ? selHeight : logicalWidth;
+ LayoutPoint topPoint = isHorizontal() ? LayoutPoint(r.x(), selTop) : LayoutPoint(selTop, r.x());
+ LayoutUnit width = isHorizontal() ? logicalWidth : selHeight;
+ LayoutUnit height = isHorizontal() ? selHeight : logicalWidth;
- return IntRect(topPoint, IntSize(width, height));
+ return LayoutRect(topPoint, LayoutSize(width, height));
}
void InlineTextBox::deleteLine(RenderArena* arena)
Modified: branches/subpixellayout/Source/WebCore/rendering/InlineTextBox.h (111853 => 111854)
--- branches/subpixellayout/Source/WebCore/rendering/InlineTextBox.h 2012-03-23 13:01:35 UTC (rev 111853)
+++ branches/subpixellayout/Source/WebCore/rendering/InlineTextBox.h 2012-03-23 13:10:55 UTC (rev 111854)
@@ -110,7 +110,7 @@
public:
virtual FloatRect calculateBoundaries() const { return FloatRect(x(), y(), width(), height()); }
- virtual IntRect localSelectionRect(int startPos, int endPos);
+ virtual LayoutRect localSelectionRect(int startPos, int endPos);
bool isSelected(int startPos, int endPos) const;
void selectionStartEnd(int& sPos, int& ePos);
Modified: branches/subpixellayout/Source/WebCore/rendering/RenderListMarker.cpp (111853 => 111854)
--- branches/subpixellayout/Source/WebCore/rendering/RenderListMarker.cpp 2012-03-23 13:01:35 UTC (rev 111853)
+++ branches/subpixellayout/Source/WebCore/rendering/RenderListMarker.cpp 2012-03-23 13:10:55 UTC (rev 111854)
@@ -1090,16 +1090,16 @@
return m_image && !m_image->errorOccurred();
}
-IntRect RenderListMarker::localSelectionRect()
+LayoutRect RenderListMarker::localSelectionRect()
{
InlineBox* box = inlineBoxWrapper();
if (!box)
- return IntRect(IntPoint(), frameRect().pixelSnappedSize());
+ return LayoutRect(LayoutPoint(), size());
RootInlineBox* root = m_inlineBoxWrapper->root();
- int newLogicalTop = root->block()->style()->isFlippedBlocksWritingMode() ? m_inlineBoxWrapper->logicalBottom() - root->selectionBottom() : root->selectionTop() - m_inlineBoxWrapper->logicalTop();
+ LayoutUnit newLogicalTop = root->block()->style()->isFlippedBlocksWritingMode() ? m_inlineBoxWrapper->logicalBottom() - root->selectionBottom() : root->selectionTop() - m_inlineBoxWrapper->logicalTop();
if (root->block()->style()->isHorizontalWritingMode())
- return IntRect(0, newLogicalTop, width(), root->selectionHeight());
- return IntRect(newLogicalTop, 0, root->selectionHeight(), height());
+ return LayoutRect(0, newLogicalTop, width(), root->selectionHeight());
+ return LayoutRect(newLogicalTop, 0, root->selectionHeight(), height());
}
void RenderListMarker::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
@@ -1134,7 +1134,7 @@
if (selectionState() != SelectionNone) {
LayoutRect selRect = localSelectionRect();
selRect.moveBy(boxOrigin);
- context->fillRect(selRect, selectionBackgroundColor(), style()->colorSpace());
+ context->fillRect(pixelSnappedIntRect(selRect), selectionBackgroundColor(), style()->colorSpace());
}
return;
}
@@ -1146,9 +1146,9 @@
#endif
if (selectionState() != SelectionNone) {
- IntRect selRect = localSelectionRect();
+ LayoutRect selRect = localSelectionRect();
selRect.moveBy(boxOrigin);
- context->fillRect(selRect, selectionBackgroundColor(), style()->colorSpace());
+ context->fillRect(pixelSnappedIntRect(selRect), selectionBackgroundColor(), style()->colorSpace());
}
const Color color(style()->visitedDependentColor(CSSPropertyColor));
Modified: branches/subpixellayout/Source/WebCore/rendering/RenderListMarker.h (111853 => 111854)
--- branches/subpixellayout/Source/WebCore/rendering/RenderListMarker.h 2012-03-23 13:01:35 UTC (rev 111853)
+++ branches/subpixellayout/Source/WebCore/rendering/RenderListMarker.h 2012-03-23 13:10:55 UTC (rev 111854)
@@ -74,7 +74,7 @@
virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
IntRect getRelativeMarkerRect();
- IntRect localSelectionRect();
+ LayoutRect localSelectionRect();
String m_text;
RefPtr<StyleImage> m_image;
Modified: branches/subpixellayout/Source/WebCore/rendering/RenderReplaced.cpp (111853 => 111854)
--- branches/subpixellayout/Source/WebCore/rendering/RenderReplaced.cpp 2012-03-23 13:01:35 UTC (rev 111853)
+++ branches/subpixellayout/Source/WebCore/rendering/RenderReplaced.cpp 2012-03-23 13:10:55 UTC (rev 111854)
@@ -162,7 +162,7 @@
if (drawSelectionTint) {
LayoutRect selectionPaintingRect = localSelectionRect();
selectionPaintingRect.moveBy(adjustedPaintOffset);
- paintInfo.context->fillRect(selectionPaintingRect, selectionBackgroundColor(), style()->colorSpace());
+ paintInfo.context->fillRect(pixelSnappedIntRect(selectionPaintingRect), selectionBackgroundColor(), style()->colorSpace());
}
}
@@ -488,20 +488,20 @@
return rect;
}
-IntRect RenderReplaced::localSelectionRect(bool checkWhetherSelected) const
+LayoutRect RenderReplaced::localSelectionRect(bool checkWhetherSelected) const
{
if (checkWhetherSelected && !isSelected())
- return IntRect();
+ return LayoutRect();
if (!m_inlineBoxWrapper)
// We're a block-level replaced element. Just return our own dimensions.
- return pixelSnappedIntRect(IntPoint(), size());
+ return LayoutRect(LayoutPoint(), size());
RootInlineBox* root = m_inlineBoxWrapper->root();
- int newLogicalTop = root->block()->style()->isFlippedBlocksWritingMode() ? m_inlineBoxWrapper->logicalBottom() - root->selectionBottom() : root->selectionTop() - m_inlineBoxWrapper->logicalTop();
+ LayoutUnit newLogicalTop = root->block()->style()->isFlippedBlocksWritingMode() ? m_inlineBoxWrapper->logicalBottom() - root->selectionBottom() : root->selectionTop() - m_inlineBoxWrapper->logicalTop();
if (root->block()->style()->isHorizontalWritingMode())
- return IntRect(0, newLogicalTop, width(), root->selectionHeight());
- return IntRect(newLogicalTop, 0, root->selectionHeight(), height());
+ return LayoutRect(0, newLogicalTop, width(), root->selectionHeight());
+ return LayoutRect(newLogicalTop, 0, root->selectionHeight(), height());
}
void RenderReplaced::setSelectionState(SelectionState state)
@@ -569,7 +569,7 @@
r.inflate(style()->outlineSize());
}
computeRectForRepaint(repaintContainer, r);
- return LayoutRect(r.location(), roundedIntSize(r.size()));
+ return pixelSnappedIntRect(r);
}
}
Modified: branches/subpixellayout/Source/WebCore/rendering/RenderReplaced.h (111853 => 111854)
--- branches/subpixellayout/Source/WebCore/rendering/RenderReplaced.h 2012-03-23 13:01:35 UTC (rev 111853)
+++ branches/subpixellayout/Source/WebCore/rendering/RenderReplaced.h 2012-03-23 13:10:55 UTC (rev 111854)
@@ -59,7 +59,7 @@
virtual void paint(PaintInfo&, const LayoutPoint&);
bool shouldPaint(PaintInfo&, const LayoutPoint&);
- IntRect localSelectionRect(bool checkWhetherSelected = true) const; // This is in local coordinates, but it's a physical rect (so the top left corner is physical top left).
+ LayoutRect localSelectionRect(bool checkWhetherSelected = true) const; // This is in local coordinates, but it's a physical rect (so the top left corner is physical top left).
private:
virtual RenderBox* embeddedContentBox() const { return 0; }
Modified: branches/subpixellayout/Source/WebCore/rendering/RenderText.cpp (111853 => 111854)
--- branches/subpixellayout/Source/WebCore/rendering/RenderText.cpp 2012-03-23 13:01:35 UTC (rev 111853)
+++ branches/subpixellayout/Source/WebCore/rendering/RenderText.cpp 2012-03-23 13:10:55 UTC (rev 111854)
@@ -312,7 +312,7 @@
static FloatRect localQuadForTextBox(InlineTextBox* box, unsigned start, unsigned end, bool useSelectionHeight)
{
unsigned realEnd = min(box->end() + 1, end);
- IntRect r = box->localSelectionRect(start, realEnd);
+ LayoutRect r = box->localSelectionRect(start, realEnd);
if (r.height()) {
if (!useSelectionHeight) {
// Change the height and y position (or width and x for vertical text)
@@ -347,7 +347,7 @@
if (start <= box->start() && box->end() < end) {
FloatRect r = box->calculateBoundaries();
if (useSelectionHeight) {
- IntRect selectionRect = box->localSelectionRect(start, end);
+ LayoutRect selectionRect = box->localSelectionRect(start, end);
if (box->isHorizontal()) {
r.setHeight(selectionRect.height());
r.setY(selectionRect.y());
@@ -430,8 +430,7 @@
if (start <= box->start() && box->end() < end) {
FloatRect r = box->calculateBoundaries();
if (useSelectionHeight) {
- // FIXME: localSelectionRect should switch to return FloatRect soon with the subpixellayout branch.
- IntRect selectionRect = box->localSelectionRect(start, end);
+ LayoutRect selectionRect = box->localSelectionRect(start, end);
if (box->isHorizontal()) {
r.setHeight(selectionRect.height());
r.setY(selectionRect.y());
Modified: branches/subpixellayout/Source/WebCore/rendering/RenderTreeAsText.cpp (111853 => 111854)
--- branches/subpixellayout/Source/WebCore/rendering/RenderTreeAsText.cpp 2012-03-23 13:01:35 UTC (rev 111853)
+++ branches/subpixellayout/Source/WebCore/rendering/RenderTreeAsText.cpp 2012-03-23 13:10:55 UTC (rev 111854)
@@ -252,14 +252,14 @@
// FIXME: Would be better to dump the bounding box x and y rather than the first run's x and y, but that would involve updating
// many test results.
const RenderText& text = *toRenderText(&o);
- LayoutRect linesBox = text.linesBoundingBox();
- r = LayoutRect(text.firstRunX(), text.firstRunY(), linesBox.width(), linesBox.height());
+ IntRect linesBox = text.linesBoundingBox();
+ r = IntRect(text.firstRunX(), text.firstRunY(), linesBox.width(), linesBox.height());
if (adjustForTableCells && !text.firstTextBox())
adjustForTableCells = false;
} else if (o.isRenderInline()) {
// FIXME: Would be better not to just dump 0, 0 as the x and y here.
const RenderInline& inlineFlow = *toRenderInline(&o);
- r = LayoutRect(0, 0, inlineFlow.linesBoundingBox().width(), inlineFlow.linesBoundingBox().height());
+ r = IntRect(0, 0, inlineFlow.linesBoundingBox().width(), inlineFlow.linesBoundingBox().height());
adjustForTableCells = false;
} else if (o.isTableCell()) {
// FIXME: Deliberately dump the "inner" box of table cells, since that is what current results reflect. We'd like
Modified: branches/subpixellayout/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp (111853 => 111854)
--- branches/subpixellayout/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp 2012-03-23 13:01:35 UTC (rev 111853)
+++ branches/subpixellayout/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp 2012-03-23 13:10:55 UTC (rev 111854)
@@ -147,13 +147,13 @@
// Use the edge of the selection rect to determine the caret rect.
if (static_cast<unsigned>(caretOffset) < textBox->start() + textBox->len()) {
- IntRect rect = textBox->localSelectionRect(caretOffset, caretOffset + 1);
- int x = box->isLeftToRightDirection() ? rect.x() : rect.maxX();
+ LayoutRect rect = textBox->localSelectionRect(caretOffset, caretOffset + 1);
+ LayoutUnit x = box->isLeftToRightDirection() ? rect.x() : rect.maxX();
return LayoutRect(x, rect.y(), caretWidth, rect.height());
}
- IntRect rect = textBox->localSelectionRect(caretOffset - 1, caretOffset);
- int x = box->isLeftToRightDirection() ? rect.maxX() : rect.x();
+ LayoutRect rect = textBox->localSelectionRect(caretOffset - 1, caretOffset);
+ LayoutUnit x = box->isLeftToRightDirection() ? rect.maxX() : rect.x();
return LayoutRect(x, rect.y(), caretWidth, rect.height());
}
Modified: branches/subpixellayout/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp (111853 => 111854)
--- branches/subpixellayout/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp 2012-03-23 13:01:35 UTC (rev 111853)
+++ branches/subpixellayout/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp 2012-03-23 13:10:55 UTC (rev 111854)
@@ -128,13 +128,13 @@
return selectionRect;
}
-IntRect SVGInlineTextBox::localSelectionRect(int startPosition, int endPosition)
+LayoutRect SVGInlineTextBox::localSelectionRect(int startPosition, int endPosition)
{
int boxStart = start();
startPosition = max(startPosition - boxStart, 0);
endPosition = min(endPosition - boxStart, static_cast<int>(len()));
if (startPosition >= endPosition)
- return IntRect();
+ return LayoutRect();
RenderText* text = textRenderer();
ASSERT(text);
Modified: branches/subpixellayout/Source/WebCore/rendering/svg/SVGInlineTextBox.h (111853 => 111854)
--- branches/subpixellayout/Source/WebCore/rendering/svg/SVGInlineTextBox.h 2012-03-23 13:01:35 UTC (rev 111853)
+++ branches/subpixellayout/Source/WebCore/rendering/svg/SVGInlineTextBox.h 2012-03-23 13:10:55 UTC (rev 111854)
@@ -47,7 +47,7 @@
void paintSelectionBackground(PaintInfo&);
virtual void paint(PaintInfo&, const LayoutPoint&, LayoutUnit lineTop, LayoutUnit lineBottom);
- virtual IntRect localSelectionRect(int startPosition, int endPosition);
+ virtual LayoutRect localSelectionRect(int startPosition, int endPosition);
bool mapStartEndPositionsIntoFragmentCoordinates(const SVGTextFragment&, int& startPosition, int& endPosition) const;