Changeset 92625 in webkit


Ignore:
Timestamp:
Aug 8, 2011 1:11:22 PM (13 years ago)
Author:
eae@chromium.org
Message:

Rename absoluteQuadsForRange and InlineTextBox::selectionRect to local*
https://bugs.webkit.org/show_bug.cgi?id=65722

Reviewed by Simon Fraser.

No new tests, no new functionality.

  • rendering/InlineTextBox.cpp:

(WebCore::InlineTextBox::localSelectionRect):
Rename InlineTextBox::selectionRect to localSelectionRect to reflect that
it, unlike RenderObject::selectionRect returns a rect in the local
coordinate space.

  • rendering/InlineTextBox.h:
  • rendering/RenderText.cpp:

(WebCore::localQuadForTextBox):
(WebCore::RenderText::absoluteRectsForRange):
(WebCore::RenderText::absoluteQuadsForRange):
(WebCore::RenderText::selectionRectForRepaint):
Rename absoluteQuadForTextBox to localQuadForTextBox to reflect that it
returns a quad in the local coordinate space.

  • rendering/svg/RenderSVGInlineText.cpp:

(WebCore::RenderSVGInlineText::localCaretRect):

  • rendering/svg/SVGInlineTextBox.cpp:

(WebCore::SVGInlineTextBox::localSelectionRect):

  • rendering/svg/SVGInlineTextBox.h:
Location:
trunk/Source/WebCore
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r92623 r92625  
     12011-08-08  Emil A Eklund  <eae@chromium.org>
     2
     3        Rename absoluteQuadsForRange and InlineTextBox::selectionRect to local*
     4        https://bugs.webkit.org/show_bug.cgi?id=65722
     5
     6        Reviewed by Simon Fraser.
     7
     8        No new tests, no new functionality.
     9
     10        * rendering/InlineTextBox.cpp:
     11        (WebCore::InlineTextBox::localSelectionRect):
     12        Rename InlineTextBox::selectionRect to localSelectionRect to reflect that
     13        it, unlike RenderObject::selectionRect returns a rect in the local
     14        coordinate space.
     15
     16        * rendering/InlineTextBox.h:
     17        * rendering/RenderText.cpp:
     18        (WebCore::localQuadForTextBox):
     19        (WebCore::RenderText::absoluteRectsForRange):
     20        (WebCore::RenderText::absoluteQuadsForRange):
     21        (WebCore::RenderText::selectionRectForRepaint):
     22        Rename absoluteQuadForTextBox to localQuadForTextBox to reflect that it
     23        returns a quad in the local coordinate space.
     24       
     25        * rendering/svg/RenderSVGInlineText.cpp:
     26        (WebCore::RenderSVGInlineText::localCaretRect):
     27        * rendering/svg/SVGInlineTextBox.cpp:
     28        (WebCore::SVGInlineTextBox::localSelectionRect):
     29        * rendering/svg/SVGInlineTextBox.h:
     30
    1312011-08-08  Jochen Eisinger  <jochen@chromium.org>
    232
  • trunk/Source/WebCore/rendering/InlineTextBox.cpp

    r90908 r92625  
    174174}
    175175
    176 IntRect InlineTextBox::selectionRect(int startPos, int endPos)
     176IntRect InlineTextBox::localSelectionRect(int startPos, int endPos)
    177177{
    178178    int sPos = max(startPos - m_start, 0);
  • trunk/Source/WebCore/rendering/InlineTextBox.h

    r90901 r92625  
    106106    virtual IntRect calculateBoundaries() const { return IntRect(x(), y(), width(), height()); }
    107107
    108     virtual IntRect selectionRect(int startPos, int endPos);
     108    virtual IntRect localSelectionRect(int startPos, int endPos);
    109109    bool isSelected(int startPos, int endPos) const;
    110110    void selectionStartEnd(int& sPos, int& ePos);
  • trunk/Source/WebCore/rendering/RenderText.cpp

    r92438 r92625  
    273273}
    274274
    275 static FloatRect absoluteQuadForTextBox(InlineTextBox* box, unsigned start, unsigned end, bool useSelectionHeight)
     275static FloatRect localQuadForTextBox(InlineTextBox* box, unsigned start, unsigned end, bool useSelectionHeight)
    276276{
    277277    unsigned realEnd = min(box->end() + 1, end);
    278     IntRect r = box->selectionRect(start, realEnd);
     278    IntRect r = box->localSelectionRect(start, realEnd);
    279279    if (r.height()) {
    280280        if (!useSelectionHeight) {
     
    311311            IntRect r = box->calculateBoundaries();
    312312            if (useSelectionHeight) {
    313                 IntRect selectionRect = box->selectionRect(start, end);
     313                IntRect selectionRect = box->localSelectionRect(start, end);
    314314                if (box->isHorizontal()) {
    315315                    r.setHeight(selectionRect.height());
     
    323323        } else {
    324324            // FIXME: This code is wrong. It's converting local to absolute twice. http://webkit.org/b/65722
    325             FloatRect rect = absoluteQuadForTextBox(box, start, end, useSelectionHeight);
     325            FloatRect rect = localQuadForTextBox(box, start, end, useSelectionHeight);
    326326            if (!rect.isZero())
    327327                rects.append(localToAbsoluteQuad(rect, false, wasFixed).enclosingBoundingBox());
     
    393393            IntRect r(box->calculateBoundaries());
    394394            if (useSelectionHeight) {
    395                 IntRect selectionRect = box->selectionRect(start, end);
     395                IntRect selectionRect = box->localSelectionRect(start, end);
    396396                if (box->isHorizontal()) {
    397397                    r.setHeight(selectionRect.height());
     
    404404            quads.append(localToAbsoluteQuad(FloatRect(r), false, wasFixed));
    405405        } else {
    406             FloatRect rect = absoluteQuadForTextBox(box, start, end, useSelectionHeight);
     406            FloatRect rect = localQuadForTextBox(box, start, end, useSelectionHeight);
    407407            if (!rect.isZero())
    408408                quads.append(localToAbsoluteQuad(rect, false, wasFixed));
     
    14071407    LayoutRect rect;
    14081408    for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) {
    1409         rect.unite(box->selectionRect(startPos, endPos));
     1409        rect.unite(box->localSelectionRect(startPos, endPos));
    14101410        rect.unite(ellipsisRectForBox(box, startPos, endPos));
    14111411    }
  • trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp

    r90675 r92625  
    118118    // Use the edge of the selection rect to determine the caret rect.
    119119    if (static_cast<unsigned>(caretOffset) < textBox->start() + textBox->len()) {
    120         IntRect rect = textBox->selectionRect(caretOffset, caretOffset + 1);
     120        IntRect rect = textBox->localSelectionRect(caretOffset, caretOffset + 1);
    121121        int x = box->isLeftToRightDirection() ? rect.x() : rect.maxX();
    122122        return IntRect(x, rect.y(), caretWidth, rect.height());
    123123    }
    124124
    125     IntRect rect = textBox->selectionRect(caretOffset - 1, caretOffset);
     125    IntRect rect = textBox->localSelectionRect(caretOffset - 1, caretOffset);
    126126    int x = box->isLeftToRightDirection() ? rect.maxX() : rect.x();
    127127    return IntRect(x, rect.y(), caretWidth, rect.height());
  • trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp

    r90791 r92625  
    118118}
    119119
    120 IntRect SVGInlineTextBox::selectionRect(int startPosition, int endPosition)
     120IntRect SVGInlineTextBox::localSelectionRect(int startPosition, int endPosition)
    121121{
    122122    int boxStart = start();
  • trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.h

    r90791 r92625  
    4848    void paintSelectionBackground(PaintInfo&);
    4949    virtual void paint(PaintInfo&, const LayoutPoint&, LayoutUnit lineTop, LayoutUnit lineBottom);
    50     virtual IntRect selectionRect(int startPosition, int endPosition);
     50    virtual IntRect localSelectionRect(int startPosition, int endPosition);
    5151
    5252    bool mapStartEndPositionsIntoFragmentCoordinates(const SVGTextFragment&, int& startPosition, int& endPosition) const;
Note: See TracChangeset for help on using the changeset viewer.