Title: [87964] trunk/Source/WebCore
Revision
87964
Author
[email protected]
Date
2011-06-02 16:49:08 -0700 (Thu, 02 Jun 2011)

Log Message

2011-06-02  Levi Weintraub  <[email protected]>

        Reviewed by Eric Seidel.

        Teach InlineBox about FloatPoint
        https://bugs.webkit.org/show_bug.cgi?id=44412

        Original patch by Eric Seidel. Updated by me.

        This is another step towards more point/size
        usage throughout the rendering tree.

        Added left(), right(), top(), and bottom() methods
        to InlineBox. Removed m_x, and m_y and replaced them
        with a single m_topLeft member.

        No new tests since this is just a refactoring.

        * rendering/EllipsisBox.cpp:
        (WebCore::EllipsisBox::paint):
        (WebCore::EllipsisBox::selectionRect):
        (WebCore::EllipsisBox::paintSelection):
        (WebCore::EllipsisBox::nodeAtPoint):
        * rendering/EllipsisBox.h:
        (WebCore::EllipsisBox::EllipsisBox):
        * rendering/InlineBox.cpp:
        (WebCore::InlineBox::adjustPosition):
        (WebCore::InlineBox::canAccommodateEllipsis):
        * rendering/InlineBox.h:
        (WebCore::InlineBox::InlineBox):
        (WebCore::InlineBox::setX):
        (WebCore::InlineBox::x):
        (WebCore::InlineBox::left):
        (WebCore::InlineBox::setY):
        (WebCore::InlineBox::y):
        (WebCore::InlineBox::top):
        (WebCore::InlineBox::topLeft):
        (WebCore::InlineBox::right):
        (WebCore::InlineBox::bottom):
        (WebCore::InlineBox::logicalLeft):
        (WebCore::InlineBox::setLogicalLeft):
        (WebCore::InlineBox::logicalTop):
        (WebCore::InlineBox::setLogicalTop):
        (WebCore::InlineBox::logicalFrameRect):
        * rendering/InlineFlowBox.h:
        (WebCore::InlineFlowBox::frameRectIncludingLineHeight):
        * rendering/InlineTextBox.cpp:
        (WebCore::InlineTextBox::placeEllipsisBox):
        (WebCore::InlineTextBox::paintTextMatchMarker):
        (WebCore::InlineTextBox::computeRectForReplacementMarker):
        * rendering/RenderText.cpp:
        (WebCore::RenderText::firstRunX):
        (WebCore::RenderText::firstRunY):
        * rendering/RenderTreeAsText.cpp:
        (WebCore::writeTextRun):
        * rendering/RootInlineBox.cpp:
        (WebCore::RootInlineBox::placeEllipsis):
        * rendering/svg/RenderSVGText.cpp:
        (WebCore::RenderSVGText::positionForPoint):
        * rendering/svg/SVGInlineTextBox.h:
        (WebCore::SVGInlineTextBox::selectionTop):
        * rendering/svg/SVGRootInlineBox.cpp:
        (WebCore::SVGRootInlineBox::closestLeafChildForPosition):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (87963 => 87964)


--- trunk/Source/WebCore/ChangeLog	2011-06-02 23:45:48 UTC (rev 87963)
+++ trunk/Source/WebCore/ChangeLog	2011-06-02 23:49:08 UTC (rev 87964)
@@ -1,3 +1,67 @@
+2011-06-02  Levi Weintraub  <[email protected]>
+
+        Reviewed by Eric Seidel.
+
+        Teach InlineBox about FloatPoint
+        https://bugs.webkit.org/show_bug.cgi?id=44412
+
+        Original patch by Eric Seidel. Updated by me.
+
+        This is another step towards more point/size
+        usage throughout the rendering tree.
+
+        Added left(), right(), top(), and bottom() methods
+        to InlineBox. Removed m_x, and m_y and replaced them
+        with a single m_topLeft member.
+
+        No new tests since this is just a refactoring.
+
+        * rendering/EllipsisBox.cpp:
+        (WebCore::EllipsisBox::paint):
+        (WebCore::EllipsisBox::selectionRect):
+        (WebCore::EllipsisBox::paintSelection):
+        (WebCore::EllipsisBox::nodeAtPoint):
+        * rendering/EllipsisBox.h:
+        (WebCore::EllipsisBox::EllipsisBox):
+        * rendering/InlineBox.cpp:
+        (WebCore::InlineBox::adjustPosition):
+        (WebCore::InlineBox::canAccommodateEllipsis):
+        * rendering/InlineBox.h:
+        (WebCore::InlineBox::InlineBox):
+        (WebCore::InlineBox::setX):
+        (WebCore::InlineBox::x):
+        (WebCore::InlineBox::left):
+        (WebCore::InlineBox::setY):
+        (WebCore::InlineBox::y):
+        (WebCore::InlineBox::top):
+        (WebCore::InlineBox::topLeft):
+        (WebCore::InlineBox::right):
+        (WebCore::InlineBox::bottom):
+        (WebCore::InlineBox::logicalLeft):
+        (WebCore::InlineBox::setLogicalLeft):
+        (WebCore::InlineBox::logicalTop):
+        (WebCore::InlineBox::setLogicalTop):
+        (WebCore::InlineBox::logicalFrameRect):
+        * rendering/InlineFlowBox.h:
+        (WebCore::InlineFlowBox::frameRectIncludingLineHeight):
+        * rendering/InlineTextBox.cpp:
+        (WebCore::InlineTextBox::placeEllipsisBox):
+        (WebCore::InlineTextBox::paintTextMatchMarker):
+        (WebCore::InlineTextBox::computeRectForReplacementMarker):
+        * rendering/RenderText.cpp:
+        (WebCore::RenderText::firstRunX):
+        (WebCore::RenderText::firstRunY):
+        * rendering/RenderTreeAsText.cpp:
+        (WebCore::writeTextRun):
+        * rendering/RootInlineBox.cpp:
+        (WebCore::RootInlineBox::placeEllipsis):
+        * rendering/svg/RenderSVGText.cpp:
+        (WebCore::RenderSVGText::positionForPoint):
+        * rendering/svg/SVGInlineTextBox.h:
+        (WebCore::SVGInlineTextBox::selectionTop):
+        * rendering/svg/SVGRootInlineBox.cpp:
+        (WebCore::SVGRootInlineBox::closestLeafChildForPosition):
+
 2011-06-02  Jian Li  <[email protected]>
 
         Reviewed by David Levin.

Modified: trunk/Source/WebCore/rendering/EllipsisBox.cpp (87963 => 87964)


--- trunk/Source/WebCore/rendering/EllipsisBox.cpp	2011-06-02 23:45:48 UTC (rev 87963)
+++ trunk/Source/WebCore/rendering/EllipsisBox.cpp	2011-06-02 23:49:08 UTC (rev 87964)
@@ -55,7 +55,7 @@
     }
 
     // FIXME: Why is this always LTR? Fix by passing correct text run flags below.
-    context->drawText(font, RenderBlock::constructTextRun(renderer(), font, m_str, style, TextRun::AllowTrailingExpansion), IntPoint(m_x + paintOffset.x(), m_y + paintOffset.y() + style->fontMetrics().ascent()));
+    context->drawText(font, RenderBlock::constructTextRun(renderer(), font, m_str, style, TextRun::AllowTrailingExpansion), IntPoint(x() + paintOffset.x(), y() + paintOffset.y() + style->fontMetrics().ascent()));
 
     // Restore the regular fill color.
     if (textColor != context->fillColor())
@@ -67,8 +67,8 @@
     if (m_markupBox) {
         // Paint the markup box
         IntPoint adjustedPaintOffset = paintOffset;
-        adjustedPaintOffset.move(m_x + m_logicalWidth - m_markupBox->x(),
-            m_y + style->fontMetrics().ascent() - (m_markupBox->y() + m_markupBox->renderer()->style(m_firstLine)->fontMetrics().ascent()));
+        adjustedPaintOffset.move(x() + m_logicalWidth - m_markupBox->x(),
+            y() + style->fontMetrics().ascent() - (m_markupBox->y() + m_markupBox->renderer()->style(m_firstLine)->fontMetrics().ascent()));
         m_markupBox->paint(paintInfo, adjustedPaintOffset, lineTop, lineBottom);
     }
 }
@@ -78,7 +78,7 @@
     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(m_x + tx, m_y + ty + root()->selectionTop()), root()->selectionHeight()));
+    return enclosingIntRect(font.selectionRectForText(RenderBlock::constructTextRun(renderer(), font, m_str, style, TextRun::AllowTrailingExpansion), IntPoint(x() + tx, y() + ty + root()->selectionTop()), root()->selectionHeight()));
 }
 
 void EllipsisBox::paintSelection(GraphicsContext* context, int tx, int ty, RenderStyle* style, const Font& font)
@@ -94,17 +94,17 @@
         c = Color(0xff - c.red(), 0xff - c.green(), 0xff - c.blue());
 
     GraphicsContextStateSaver stateSaver(*context);
-    int y = root()->selectionTop();
+    int top = root()->selectionTop();
     int h = root()->selectionHeight();
-    context->clip(IntRect(m_x + tx, y + ty, m_logicalWidth, h));
+    context->clip(IntRect(x() + tx, top + ty, m_logicalWidth, h));
     // FIXME: Why is this always LTR? Fix by passing correct text run flags below.
-    context->drawHighlightForText(font, RenderBlock::constructTextRun(renderer(), font, m_str, style, TextRun::AllowTrailingExpansion), IntPoint(m_x + tx, m_y + ty + y), h, c, style->colorSpace());
+    context->drawHighlightForText(font, RenderBlock::constructTextRun(renderer(), font, m_str, style, TextRun::AllowTrailingExpansion), IntPoint(x() + tx, y() + ty + top), h, c, style->colorSpace());
 }
 
 bool EllipsisBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, int lineTop, int lineBottom)
 {
-    tx += m_x;
-    ty += m_y;
+    tx += x();
+    ty += y();
 
     // Hit test the markup box.
     if (m_markupBox) {

Modified: trunk/Source/WebCore/rendering/EllipsisBox.h (87963 => 87964)


--- trunk/Source/WebCore/rendering/EllipsisBox.h	2011-06-02 23:45:48 UTC (rev 87963)
+++ trunk/Source/WebCore/rendering/EllipsisBox.h	2011-06-02 23:49:08 UTC (rev 87964)
@@ -31,7 +31,7 @@
 public:
     EllipsisBox(RenderObject* obj, const AtomicString& ellipsisStr, InlineFlowBox* parent,
                 int width, int height, int y, bool firstLine, bool isVertical, InlineBox* markupBox)
-        : InlineBox(obj, 0, y, width, firstLine, true, false, false, isVertical, 0, 0, parent)
+        : InlineBox(obj, FloatPoint(0, y), width, firstLine, true, false, false, isVertical, 0, 0, parent)
         , m_height(height)
         , m_str(ellipsisStr)
         , m_markupBox(markupBox)

Modified: trunk/Source/WebCore/rendering/InlineBox.cpp (87963 => 87964)


--- trunk/Source/WebCore/rendering/InlineBox.cpp	2011-06-02 23:45:48 UTC (rev 87963)
+++ trunk/Source/WebCore/rendering/InlineBox.cpp	2011-06-02 23:49:08 UTC (rev 87964)
@@ -186,8 +186,7 @@
 
 void InlineBox::adjustPosition(float dx, float dy)
 {
-    m_x += dx;
-    m_y += dy;
+    m_topLeft.move(dx, dy);
 
     if (m_renderer->isReplaced()) 
         toRenderBox(m_renderer)->move(dx, dy); 
@@ -306,7 +305,7 @@
     if (!m_renderer || !m_renderer->isReplaced())
         return true;
     
-    IntRect boxRect(m_x, 0, m_logicalWidth, 10);
+    IntRect boxRect(left(), 0, m_logicalWidth, 10);
     IntRect ellipsisRect(ltr ? blockEdge - ellipsisWidth : blockEdge, 0, ellipsisWidth, 10);
     return !(boxRect.intersects(ellipsisRect));
 }

Modified: trunk/Source/WebCore/rendering/InlineBox.h (87963 => 87964)


--- trunk/Source/WebCore/rendering/InlineBox.h	2011-06-02 23:45:48 UTC (rev 87963)
+++ trunk/Source/WebCore/rendering/InlineBox.h	2011-06-02 23:49:08 UTC (rev 87964)
@@ -39,8 +39,6 @@
         , m_prev(0)
         , m_parent(0)
         , m_renderer(obj)
-        , m_x(0)
-        , m_y(0)
         , m_logicalWidth(0)
         , m_firstLine(false)
         , m_constructed(false)
@@ -68,14 +66,13 @@
     {
     }
 
-    InlineBox(RenderObject* obj, float x, float y, float logicalWidth, bool firstLine, bool constructed,
+    InlineBox(RenderObject* obj, FloatPoint topLeft, float logicalWidth, bool firstLine, bool constructed,
               bool dirty, bool extracted, bool isHorizontal, InlineBox* next, InlineBox* prev, InlineFlowBox* parent)
         : m_next(next)
         , m_prev(prev)
         , m_parent(parent)
         , m_renderer(obj)
-        , m_x(x)
-        , m_y(y)
+        , m_topLeft(topLeft)
         , m_logicalWidth(logicalWidth)
         , m_firstLine(firstLine)
         , m_constructed(constructed)
@@ -226,38 +223,44 @@
     RootInlineBox* root();
 
     // x() is the left side of the box in the containing block's coordinate system.
-    void setX(float x) { m_x = x; }
-    float x() const { return m_x; }
+    void setX(float x) { m_topLeft.setX(x); }
+    float x() const { return m_topLeft.x(); }
+    float left() const { return m_topLeft.x(); }
 
     // y() is the top side of the box in the containing block's coordinate system.
-    void setY(float y) { m_y = y; }
-    float y() const { return m_y; }
+    void setY(float y) { m_topLeft.setY(y); }
+    float y() const { return m_topLeft.y(); }
+    float top() const { return m_topLeft.y(); }
 
+    const FloatPoint& topLeft() const { return m_topLeft; }
+
     float width() const { return isHorizontal() ? logicalWidth() : logicalHeight(); }
     float height() const { return isHorizontal() ? logicalHeight() : logicalWidth(); }
+    float right() const { return left() + width(); }
+    float bottom() const { return top() + height(); }
 
     // The logicalLeft position is the left edge of the line box in a horizontal line and the top edge in a vertical line.
-    float logicalLeft() const { return isHorizontal() ? m_x : m_y; }
+    float logicalLeft() const { return isHorizontal() ? m_topLeft.x() : m_topLeft.y(); }
     float logicalRight() const { return logicalLeft() + logicalWidth(); }
     void setLogicalLeft(float left)
     {
         if (isHorizontal())
-            m_x = left;
+            setX(left);
         else
-            m_y = left;
+            setY(left);
     }
     int pixelSnappedLogicalLeft() const { return logicalLeft(); }
     int pixelSnappedLogicalRight() const { return ceilf(logicalRight()); }
 
     // The logicalTop[ position is the top edge of the line box in a horizontal line and the left edge in a vertical line.
-    int logicalTop() const { return isHorizontal() ? m_y : m_x; }
+    int logicalTop() const { return isHorizontal() ? m_topLeft.y() : m_topLeft.x(); }
     int logicalBottom() const { return logicalTop() + logicalHeight(); }
     void setLogicalTop(int top)
     {
         if (isHorizontal())
-            m_y = top;
+            setY(top);
         else
-            m_x = top;
+            setX(top);
     }
 
     // The logical width is our extent in the line's overall inline direction, i.e., width for horizontal text and height for vertical text.
@@ -267,7 +270,7 @@
     // The logical height is our extent in the block flow direction, i.e., height for horizontal text and width for vertical text.
     int logicalHeight() const;
 
-    FloatRect logicalFrameRect() const { return isHorizontal() ? IntRect(m_x, m_y, m_logicalWidth, logicalHeight()) : IntRect(m_y, m_x, m_logicalWidth, logicalHeight()); }
+    FloatRect logicalFrameRect() const { return isHorizontal() ? IntRect(m_topLeft.x(), m_topLeft.y(), m_logicalWidth, logicalHeight()) : IntRect(m_topLeft.y(), m_topLeft.x(), m_logicalWidth, logicalHeight()); }
 
     virtual int baselinePosition(FontBaseline baselineType) const { return boxModelObject()->baselinePosition(baselineType, m_firstLine, isHorizontal() ? HorizontalLine : VerticalLine, PositionOnContainingLine); }
     virtual int lineHeight() const { return boxModelObject()->lineHeight(m_firstLine, isHorizontal() ? HorizontalLine : VerticalLine, PositionOnContainingLine); }
@@ -330,8 +333,7 @@
 public:
     RenderObject* m_renderer;
 
-    float m_x;
-    float m_y;
+    FloatPoint m_topLeft;
     float m_logicalWidth;
     
     // Some of these bits are actually for subclasses and moved here to compact the structures.

Modified: trunk/Source/WebCore/rendering/InlineFlowBox.h (87963 => 87964)


--- trunk/Source/WebCore/rendering/InlineFlowBox.h	2011-06-02 23:45:48 UTC (rev 87963)
+++ trunk/Source/WebCore/rendering/InlineFlowBox.h	2011-06-02 23:49:08 UTC (rev 87964)
@@ -255,8 +255,8 @@
     FloatRect frameRectIncludingLineHeight(int lineTop, int lineBottom) const
     {
         if (isHorizontal())
-            return FloatRect(m_x, lineTop, width(), lineBottom - lineTop);
-        return FloatRect(lineTop, m_y, lineBottom - lineTop, height());
+            return FloatRect(m_topLeft.x(), lineTop, width(), lineBottom - lineTop);
+        return FloatRect(lineTop, m_topLeft.y(), lineBottom - lineTop, height());
     }
     
     FloatRect logicalFrameRectIncludingLineHeight(int lineTop, int lineBottom) const

Modified: trunk/Source/WebCore/rendering/InlineTextBox.cpp (87963 => 87964)


--- trunk/Source/WebCore/rendering/InlineTextBox.cpp	2011-06-02 23:45:48 UTC (rev 87963)
+++ trunk/Source/WebCore/rendering/InlineTextBox.cpp	2011-06-02 23:49:08 UTC (rev 87964)
@@ -242,8 +242,8 @@
     // Criteria for full truncation:
     // LTR: the left edge of the ellipsis is to the left of our text run.
     // RTL: the right edge of the ellipsis is to the right of our text run.
-    bool ltrFullTruncation = flowIsLTR && ellipsisX <= m_x;
-    bool rtlFullTruncation = !flowIsLTR && ellipsisX >= (m_x + m_logicalWidth);
+    bool ltrFullTruncation = flowIsLTR && ellipsisX <= left();
+    bool rtlFullTruncation = !flowIsLTR && ellipsisX >= left() + logicalWidth();
     if (ltrFullTruncation || rtlFullTruncation) {
         // Too far.  Just set full truncation, but return -1 and let the ellipsis just be placed at the edge of the box.
         m_truncation = cFullTruncation;
@@ -251,8 +251,8 @@
         return -1;
     }
 
-    bool ltrEllipsisWithinBox = flowIsLTR && (ellipsisX < m_x + m_logicalWidth);
-    bool rtlEllipsisWithinBox = !flowIsLTR && (ellipsisX > m_x);
+    bool ltrEllipsisWithinBox = flowIsLTR && (ellipsisX < right());
+    bool rtlEllipsisWithinBox = !flowIsLTR && (ellipsisX > left());
     if (ltrEllipsisWithinBox || rtlEllipsisWithinBox) {
         foundBox = true;
 
@@ -263,7 +263,7 @@
         if (ltr != flowIsLTR) {
           // Width in pixels of the visible portion of the box, excluding the ellipsis.
           int visibleBoxWidth = visibleRightEdge - visibleLeftEdge  - ellipsisWidth;
-          ellipsisX = ltr ? m_x + visibleBoxWidth : m_x + m_logicalWidth - visibleBoxWidth;
+          ellipsisX = ltr ? left() + visibleBoxWidth : right() - visibleBoxWidth;
         }
 
         int offset = offsetForPosition(ellipsisX, false);
@@ -271,7 +271,7 @@
             // No characters should be rendered.  Set ourselves to full truncation and place the ellipsis at the min of our start
             // and the ellipsis edge.
             m_truncation = cFullTruncation;
-            return min(ellipsisX, m_x);
+            return min(ellipsisX, x());
         }
 
         // Set the truncation index on the text run.
@@ -287,9 +287,9 @@
         // e.g. In the case of an LTR inline box truncated in an RTL flow then we can
         // have a situation such as |Hello| -> |...He|
         if (flowIsLTR)
-            return m_x + widthOfVisibleText;
+            return left() + widthOfVisibleText;
         else
-            return (m_x + m_logicalWidth) - widthOfVisibleText - ellipsisWidth;
+            return right() - widthOfVisibleText - ellipsisWidth;
     }
     return -1;
 }
@@ -1051,7 +1051,7 @@
     TextRun run = constructTextRun(style, font);
 
     // Always compute and store the rect associated with this marker. The computed rect is in absolute coordinates.
-    IntRect markerRect = enclosingIntRect(font.selectionRectForText(run, IntPoint(m_x, selectionTop()), selHeight, sPos, ePos));
+    IntRect markerRect = enclosingIntRect(font.selectionRectForText(run, IntPoint(x(), selectionTop()), selHeight, sPos, ePos));
     markerRect = renderer()->localToAbsoluteQuad(FloatRect(markerRect)).enclosingBoundingBox();
     toRenderedDocumentMarker(marker)->setRenderedRect(markerRect);
     
@@ -1070,13 +1070,13 @@
 void InlineTextBox::computeRectForReplacementMarker(DocumentMarker* marker, RenderStyle* style, const Font& font)
 {
     // Replacement markers are not actually drawn, but their rects need to be computed for hit testing.
-    int y = selectionTop();
+    int top = selectionTop();
     int h = selectionHeight();
     
     int sPos = max(marker->startOffset() - m_start, (unsigned)0);
     int ePos = min(marker->endOffset() - m_start, (unsigned)m_len);
     TextRun run = constructTextRun(style, font);
-    IntPoint startPoint = IntPoint(m_x, y);
+    IntPoint startPoint = IntPoint(x(), top);
     
     // Compute and store the rect associated with this marker.
     IntRect markerRect = enclosingIntRect(font.selectionRectForText(run, startPoint, h, sPos, ePos));

Modified: trunk/Source/WebCore/rendering/RenderText.cpp (87963 => 87964)


--- trunk/Source/WebCore/rendering/RenderText.cpp	2011-06-02 23:45:48 UTC (rev 87963)
+++ trunk/Source/WebCore/rendering/RenderText.cpp	2011-06-02 23:49:08 UTC (rev 87964)
@@ -980,12 +980,12 @@
 
 float RenderText::firstRunX() const
 {
-    return m_firstTextBox ? m_firstTextBox->m_x : 0;
+    return m_firstTextBox ? m_firstTextBox->x() : 0;
 }
 
 float RenderText::firstRunY() const
 {
-    return m_firstTextBox ? m_firstTextBox->m_y : 0;
+    return m_firstTextBox ? m_firstTextBox->y() : 0;
 }
     
 void RenderText::setSelectionState(SelectionState state)

Modified: trunk/Source/WebCore/rendering/RenderTreeAsText.cpp (87963 => 87964)


--- trunk/Source/WebCore/rendering/RenderTreeAsText.cpp	2011-06-02 23:45:48 UTC (rev 87963)
+++ trunk/Source/WebCore/rendering/RenderTreeAsText.cpp	2011-06-02 23:49:08 UTC (rev 87964)
@@ -494,9 +494,9 @@
 {
     // FIXME: For now use an "enclosingIntRect" model for x, y and logicalWidth, although this makes it harder
     // to detect any changes caused by the conversion to floating point. :(
-    int x = run.m_x;
-    int y = run.m_y;
-    int logicalWidth = ceilf(run.m_x + run.m_logicalWidth) - x;
+    int x = run.x();
+    int y = run.y();
+    int logicalWidth = ceilf(run.left() + run.logicalWidth()) - x;
 
     // FIXME: Table cell adjustment is temporary until results can be updated.
     if (o.containingBlock()->isTableCell())

Modified: trunk/Source/WebCore/rendering/RootInlineBox.cpp (87963 => 87964)


--- trunk/Source/WebCore/rendering/RootInlineBox.cpp	2011-06-02 23:45:48 UTC (rev 87963)
+++ trunk/Source/WebCore/rendering/RootInlineBox.cpp	2011-06-02 23:49:08 UTC (rev 87964)
@@ -114,7 +114,7 @@
 
     // FIXME: Do we need an RTL version of this?
     if (ltr && (x() + logicalWidth() + ellipsisWidth) <= blockRightEdge) {
-        ellipsisBox->m_x = x() + logicalWidth();
+        ellipsisBox->setX(x() + logicalWidth());
         return;
     }
 
@@ -122,7 +122,7 @@
     // of that glyph.  Mark all of the objects that intersect the ellipsis box as not painting (as being
     // truncated).
     bool foundBox = false;
-    ellipsisBox->m_x = placeEllipsisBox(ltr, blockLeftEdge, blockRightEdge, ellipsisWidth, foundBox);
+    ellipsisBox->setX(placeEllipsisBox(ltr, blockLeftEdge, blockRightEdge, ellipsisWidth, foundBox));
 }
 
 float RootInlineBox::placeEllipsisBox(bool ltr, float blockLeftEdge, float blockRightEdge, float ellipsisWidth, bool& foundBox)

Modified: trunk/Source/WebCore/rendering/svg/RenderSVGText.cpp (87963 => 87964)


--- trunk/Source/WebCore/rendering/svg/RenderSVGText.cpp	2011-06-02 23:45:48 UTC (rev 87963)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGText.cpp	2011-06-02 23:49:08 UTC (rev 87964)
@@ -221,7 +221,7 @@
     if (!closestBox)
         return createVisiblePosition(0, DOWNSTREAM);
 
-    return closestBox->renderer()->positionForPoint(IntPoint(pointInContents.x(), closestBox->m_y));
+    return closestBox->renderer()->positionForPoint(IntPoint(pointInContents.x(), closestBox->y()));
 }
 
 void RenderSVGText::absoluteQuads(Vector<FloatQuad>& quads)

Modified: trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.h (87963 => 87964)


--- trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.h	2011-06-02 23:45:48 UTC (rev 87963)
+++ trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.h	2011-06-02 23:49:08 UTC (rev 87964)
@@ -40,7 +40,7 @@
     virtual int virtualLogicalHeight() const { return m_logicalHeight; }
     void setLogicalHeight(int height) { m_logicalHeight = height; }
 
-    virtual int selectionTop() { return m_y; }
+    virtual int selectionTop() { return top(); }
     virtual int selectionHeight() { return m_logicalHeight; }
     virtual int offsetForPosition(float x, bool includePartialGlyphs = true) const;
     virtual float positionForOffset(int offset) const;

Modified: trunk/Source/WebCore/rendering/svg/SVGRootInlineBox.cpp (87963 => 87964)


--- trunk/Source/WebCore/rendering/svg/SVGRootInlineBox.cpp	2011-06-02 23:45:48 UTC (rev 87963)
+++ trunk/Source/WebCore/rendering/svg/SVGRootInlineBox.cpp	2011-06-02 23:49:08 UTC (rev 87964)
@@ -209,13 +209,13 @@
     for (InlineBox* leaf = firstLeaf; leaf; leaf = leaf->nextLeafChild()) {
         if (!leaf->isSVGInlineTextBox())
             continue;
-        if (point.y() < leaf->m_y)
+        if (point.y() < leaf->y())
             continue;
-        if (point.y() > leaf->m_y + leaf->virtualLogicalHeight())
+        if (point.y() > leaf->y() + leaf->virtualLogicalHeight())
             continue;
 
         closestLeaf = leaf;
-        if (point.x() < leaf->m_x + leaf->m_logicalWidth)
+        if (point.x() < leaf->left() + leaf->logicalWidth())
             return leaf;
     }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to