Diff
Modified: trunk/Source/WebCore/ChangeLog (88187 => 88188)
--- trunk/Source/WebCore/ChangeLog 2011-06-06 21:15:45 UTC (rev 88187)
+++ trunk/Source/WebCore/ChangeLog 2011-06-06 21:26:24 UTC (rev 88188)
@@ -1,3 +1,31 @@
+2011-06-06 Levi Weintraub <[email protected]>
+
+ Reviewed by Eric Seidel.
+
+ Remove tx/ty offset from selectionRect
+ https://bugs.webkit.org/show_bug.cgi?id=62146
+
+ Removing unused offset parameters from selectionRect.
+
+ No new tests since this is just cleanup.
+
+ * rendering/EllipsisBox.cpp:
+ (WebCore::EllipsisBox::selectionRect):
+ * rendering/EllipsisBox.h:
+ * rendering/InlineTextBox.cpp:
+ (WebCore::InlineTextBox::selectionRect):
+ * rendering/InlineTextBox.h:
+ * rendering/RenderText.cpp:
+ (WebCore::RenderText::absoluteRectsForRange):
+ (WebCore::ellipsisRectForBox):
+ (WebCore::RenderText::absoluteQuadsForRange):
+ (WebCore::RenderText::selectionRectForRepaint):
+ * rendering/svg/RenderSVGInlineText.cpp:
+ (WebCore::RenderSVGInlineText::localCaretRect):
+ * rendering/svg/SVGInlineTextBox.cpp:
+ (WebCore::SVGInlineTextBox::selectionRect):
+ * rendering/svg/SVGInlineTextBox.h:
+
2011-06-06 Paul Kinlan <[email protected]>
Reviewed by Jeremy Orlow.
Modified: trunk/Source/WebCore/rendering/EllipsisBox.cpp (88187 => 88188)
--- trunk/Source/WebCore/rendering/EllipsisBox.cpp 2011-06-06 21:15:45 UTC (rev 88187)
+++ trunk/Source/WebCore/rendering/EllipsisBox.cpp 2011-06-06 21:26:24 UTC (rev 88188)
@@ -73,12 +73,12 @@
}
}
-IntRect EllipsisBox::selectionRect(int tx, int ty)
+IntRect EllipsisBox::selectionRect()
{
RenderStyle* style = m_renderer->style(m_firstLine);
const Font& font = style->font();
// FIXME: Why is this always LTR? Fix by passing correct text run flags below.
- return enclosingIntRect(font.selectionRectForText(RenderBlock::constructTextRun(renderer(), font, m_str, style, TextRun::AllowTrailingExpansion), IntPoint(x() + tx, y() + ty + root()->selectionTop()), root()->selectionHeight()));
+ return enclosingIntRect(font.selectionRectForText(RenderBlock::constructTextRun(renderer(), font, m_str, style, TextRun::AllowTrailingExpansion), IntPoint(x(), y() + root()->selectionTop()), root()->selectionHeight()));
}
void EllipsisBox::paintSelection(GraphicsContext* context, const IntPoint& paintOffset, RenderStyle* style, const Font& font)
Modified: trunk/Source/WebCore/rendering/EllipsisBox.h (88187 => 88188)
--- trunk/Source/WebCore/rendering/EllipsisBox.h 2011-06-06 21:15:45 UTC (rev 88187)
+++ trunk/Source/WebCore/rendering/EllipsisBox.h 2011-06-06 21:26:24 UTC (rev 88188)
@@ -42,7 +42,7 @@
virtual void paint(PaintInfo&, const IntPoint&, int lineTop, int lineBottom);
virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, int lineTop, int lineBottom);
void setSelectionState(RenderObject::SelectionState s) { m_selectionState = s; }
- IntRect selectionRect(int tx, int ty);
+ IntRect selectionRect();
private:
virtual int height() const { return m_height; }
Modified: trunk/Source/WebCore/rendering/InlineTextBox.cpp (88187 => 88188)
--- trunk/Source/WebCore/rendering/InlineTextBox.cpp 2011-06-06 21:15:45 UTC (rev 88187)
+++ trunk/Source/WebCore/rendering/InlineTextBox.cpp 2011-06-06 21:26:24 UTC (rev 88188)
@@ -172,7 +172,7 @@
length += hyphenString.length();
}
-IntRect InlineTextBox::selectionRect(int tx, int ty, int startPos, int endPos)
+IntRect InlineTextBox::selectionRect(int startPos, int endPos)
{
int sPos = max(startPos - m_start, 0);
int ePos = min(endPos - m_start, (int)m_len);
@@ -200,7 +200,7 @@
else if (r.maxX() > logicalRight())
logicalWidth = logicalRight() - r.x();
- IntPoint topPoint = isHorizontal() ? IntPoint(r.x(), ty + selTop) : IntPoint(tx + selTop, r.x());
+ IntPoint topPoint = isHorizontal() ? IntPoint(r.x(), selTop) : IntPoint(selTop, r.x());
int width = isHorizontal() ? logicalWidth : selHeight;
int height = isHorizontal() ? selHeight : logicalWidth;
Modified: trunk/Source/WebCore/rendering/InlineTextBox.h (88187 => 88188)
--- trunk/Source/WebCore/rendering/InlineTextBox.h 2011-06-06 21:15:45 UTC (rev 88187)
+++ trunk/Source/WebCore/rendering/InlineTextBox.h 2011-06-06 21:26:24 UTC (rev 88188)
@@ -105,7 +105,7 @@
public:
virtual IntRect calculateBoundaries() const { return IntRect(x(), y(), width(), height()); }
- virtual IntRect selectionRect(int absx, int absy, int startPos, int endPos);
+ virtual IntRect selectionRect(int startPos, int endPos);
bool isSelected(int startPos, int endPos) const;
void selectionStartEnd(int& sPos, int& ePos);
Modified: trunk/Source/WebCore/rendering/RenderText.cpp (88187 => 88188)
--- trunk/Source/WebCore/rendering/RenderText.cpp 2011-06-06 21:15:45 UTC (rev 88187)
+++ trunk/Source/WebCore/rendering/RenderText.cpp 2011-06-06 21:26:24 UTC (rev 88188)
@@ -292,7 +292,7 @@
if (start <= box->start() && box->end() < end) {
IntRect r = box->calculateBoundaries();
if (useSelectionHeight) {
- IntRect selectionRect = box->selectionRect(0, 0, start, end);
+ IntRect selectionRect = box->selectionRect(start, end);
if (box->isHorizontal()) {
r.setHeight(selectionRect.height());
r.setY(selectionRect.y());
@@ -304,7 +304,7 @@
rects.append(localToAbsoluteQuad(FloatQuad(r)).enclosingBoundingBox());
} else {
unsigned realEnd = min(box->end() + 1, end);
- IntRect r = box->selectionRect(0, 0, start, realEnd);
+ IntRect r = box->selectionRect(start, realEnd);
if (!r.isEmpty()) {
if (!useSelectionHeight) {
// change the height and y position because selectionRect uses selection-specific values
@@ -340,7 +340,7 @@
// the selection is past the beginning of the truncation and the
// beginning of the selection is before or at the beginning of the truncation.
if (ellipsisEndPosition >= truncation && ellipsisStartPosition <= truncation)
- return ellipsis->selectionRect(0, 0);
+ return ellipsis->selectionRect();
}
return IntRect();
@@ -385,7 +385,7 @@
if (start <= box->start() && box->end() < end) {
IntRect r(box->calculateBoundaries());
if (useSelectionHeight) {
- IntRect selectionRect = box->selectionRect(0, 0, start, end);
+ IntRect selectionRect = box->selectionRect(start, end);
if (box->isHorizontal()) {
r.setHeight(selectionRect.height());
r.setY(selectionRect.y());
@@ -397,7 +397,7 @@
quads.append(localToAbsoluteQuad(FloatRect(r)));
} else {
unsigned realEnd = min(box->end() + 1, end);
- IntRect r = box->selectionRect(0, 0, start, realEnd);
+ IntRect r = box->selectionRect(start, realEnd);
if (r.height()) {
if (!useSelectionHeight) {
// change the height and y position because selectionRect uses selection-specific values
@@ -1397,7 +1397,7 @@
IntRect rect;
for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) {
- rect.unite(box->selectionRect(0, 0, startPos, endPos));
+ rect.unite(box->selectionRect(startPos, endPos));
rect.unite(ellipsisRectForBox(box, startPos, endPos));
}
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp (88187 => 88188)
--- trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp 2011-06-06 21:15:45 UTC (rev 88187)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp 2011-06-06 21:26:24 UTC (rev 88188)
@@ -117,12 +117,12 @@
// Use the edge of the selection rect to determine the caret rect.
if (static_cast<unsigned>(caretOffset) < textBox->start() + textBox->len()) {
- IntRect rect = textBox->selectionRect(0, 0, caretOffset, caretOffset + 1);
+ IntRect rect = textBox->selectionRect(caretOffset, caretOffset + 1);
int x = box->isLeftToRightDirection() ? rect.x() : rect.maxX();
return IntRect(x, rect.y(), caretWidth, rect.height());
}
- IntRect rect = textBox->selectionRect(0, 0, caretOffset - 1, caretOffset);
+ IntRect rect = textBox->selectionRect(caretOffset - 1, caretOffset);
int x = box->isLeftToRightDirection() ? rect.maxX() : rect.x();
return IntRect(x, rect.y(), caretWidth, rect.height());
}
Modified: trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp (88187 => 88188)
--- trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp 2011-06-06 21:15:45 UTC (rev 88187)
+++ trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp 2011-06-06 21:26:24 UTC (rev 88188)
@@ -112,7 +112,7 @@
return selectionRect;
}
-IntRect SVGInlineTextBox::selectionRect(int, int, int startPosition, int endPosition)
+IntRect SVGInlineTextBox::selectionRect(int startPosition, int endPosition)
{
int boxStart = start();
startPosition = max(startPosition - boxStart, 0);
Modified: trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.h (88187 => 88188)
--- trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.h 2011-06-06 21:15:45 UTC (rev 88187)
+++ trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.h 2011-06-06 21:26:24 UTC (rev 88188)
@@ -47,7 +47,7 @@
void paintSelectionBackground(PaintInfo&);
virtual void paint(PaintInfo&, const IntPoint&, int lineTop, int lineBottom);
- virtual IntRect selectionRect(int absx, int absy, int startPosition, int endPosition);
+ virtual IntRect selectionRect(int startPosition, int endPosition);
bool mapStartEndPositionsIntoFragmentCoordinates(const SVGTextFragment&, int& startPosition, int& endPosition) const;