Changeset 21387 in webkit


Ignore:
Timestamp:
May 10, 2007, 5:26:12 PM (18 years ago)
Author:
adele
Message:

LayoutTests:

Reviewed by Hyatt.

Test for <rdar://problem/4100616> Doing a "find" in RSS doesn't scroll to result

  • fast/overflow/scroll-nested-positioned-layer-in-overflow-expected.checksum: Added.
  • fast/overflow/scroll-nested-positioned-layer-in-overflow-expected.png: Added.
  • fast/overflow/scroll-nested-positioned-layer-in-overflow-expected.txt: Added.
  • fast/overflow/scroll-nested-positioned-layer-in-overflow.html: Added.

WebCore:

Reviewed by Hyatt.

WebCore part of fix for <rdar://problem/4100616> Doing a "find" in RSS doesn't scroll to result

Test: fast/overflow/scroll-nested-positioned-layer-in-overflow.html

Merged visibleSelectionRect into selectionRect. selectionRect() now takes an argument to determine
whether or not to return a rect that clips to the visible content. This change makes all of the implementations of selectionRect
consistent by having them all consider the repaint rect when clipping to visible content.

  • page/Frame.cpp: (WebCore::Frame::revealSelection): Call selectionRect with clipToVisibleContent = false, so we can get a rect that's not visible to reveal. (WebCore::Frame::selectionRect): Added clipToVisibleContent argument, and merged visibleSelectionRect into this method. (WebCore::Frame::setIsActive): Use selectionRect instead of visibleSelectionRect.
  • page/Frame.h:
  • page/mac/FrameMac.mm: (WebCore::Frame::selectionImage): Update layout before creating the image. Use selectionRect instead of visibleSelectionRect.
  • page/DragController.cpp: (WebCore::dragLocForSelectionDrag): Use selectionRect instead of visibleSelectionRect.
  • rendering/RenderBR.h: (WebCore::RenderBR::selectionRect): Updated argument.
  • rendering/RenderBlock.h: (WebCore::RenderBlock::selectionRect): ditto.
  • rendering/RenderSVGInlineText.cpp: (WebCore::RenderSVGInlineText::selectionRect): ditto.
  • rendering/RenderSVGInlineText.h: ditto.
  • rendering/RenderObject.h: (WebCore::RenderObject::selectionRect): ditto. (WebCore::RenderObject::SelectionInfo::SelectionInfo): ditto.
  • rendering/RenderView.cpp: (WebCore::RenderView::selectionRect): ditto. (WebCore::RenderView::setSelection): ditto.
  • rendering/RenderView.h:
  • rendering/RenderText.h:
  • rendering/RenderText.cpp: (WebCore::RenderText::selectionRect): Only call computeAbsoluteRepaintRect when clipping to visible content. Otherwise, just adjust the rect to the correct position.
  • rendering/RenderListMarker.h:
  • rendering/RenderListMarker.cpp: (WebCore::RenderListMarker::selectionRect): To match what we do in RenderText, if we're trying to clip to visible content, just call computeAbsoluteRepaintRect.
  • rendering/RenderReplaced.h:
  • rendering/RenderReplaced.cpp: (WebCore::RenderReplaced::selectionRect): ditto.
  • rendering/RenderLayer.cpp: (WebCore::RenderLayer::scrollRectToVisible): Check for a parent layer at the beginning, so we can try to scroll all of our parent layers first, before trying to scroll the top level view. Also, don't try to scroll overflow layers that have -webkit-line-clamp restricting the height. This will prevent us from revealing text hidden by the slider in Safari RSS.
  • WebCore.exp: Update symbols for WebKit.

WebKit:

Reviewed by Hyatt.

WebKit part of fix for <rdar://problem/4100616> Doing a "find" in RSS doesn't scroll to result

Updated to use selectionRect instead of visibleSelectionRect. selectionRect() now returns the visible rect by default.

  • WebView/WebHTMLView.mm: (-[WebHTMLView _lookUpInDictionaryFromMenu:]): (-[WebHTMLView selectionImageRect]):
Location:
trunk
Files:
4 added
24 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r21367 r21387  
     12007-05-10  Adele Peterson  <adele@apple.com>
     2
     3        Reviewed by Hyatt.
     4
     5        Test for <rdar://problem/4100616> Doing a "find" in RSS doesn't scroll to result
     6
     7        * fast/overflow/scroll-nested-positioned-layer-in-overflow-expected.checksum: Added.
     8        * fast/overflow/scroll-nested-positioned-layer-in-overflow-expected.png: Added.
     9        * fast/overflow/scroll-nested-positioned-layer-in-overflow-expected.txt: Added.
     10        * fast/overflow/scroll-nested-positioned-layer-in-overflow.html: Added.
     11
    1122007-05-08  Maciej Stachowiak  <mjs@apple.com>
    213
  • trunk/WebCore/ChangeLog

    r21385 r21387  
     12007-05-10  Adele Peterson  <adele@apple.com>
     2
     3        Reviewed by Hyatt.
     4
     5        WebCore part of fix for <rdar://problem/4100616> Doing a "find" in RSS doesn't scroll to result
     6
     7        Test: fast/overflow/scroll-nested-positioned-layer-in-overflow.html
     8
     9        Merged visibleSelectionRect into selectionRect.  selectionRect() now takes an argument to determine
     10        whether or not to return a rect that clips to the visible content.  This change makes all of the implementations of selectionRect
     11        consistent by having them all consider the repaint rect when clipping to visible content.
     12
     13        * page/Frame.cpp:
     14        (WebCore::Frame::revealSelection): Call selectionRect with clipToVisibleContent = false, so we can get a rect that's not visible to reveal.
     15        (WebCore::Frame::selectionRect): Added clipToVisibleContent argument, and merged visibleSelectionRect into this method.
     16        (WebCore::Frame::setIsActive): Use selectionRect instead of visibleSelectionRect.
     17        * page/Frame.h:
     18        * page/mac/FrameMac.mm: (WebCore::Frame::selectionImage): Update layout before creating the image.  Use selectionRect instead of visibleSelectionRect.
     19        * page/DragController.cpp: (WebCore::dragLocForSelectionDrag): Use selectionRect instead of visibleSelectionRect.
     20
     21        * rendering/RenderBR.h: (WebCore::RenderBR::selectionRect): Updated argument.
     22        * rendering/RenderBlock.h: (WebCore::RenderBlock::selectionRect): ditto.
     23        * rendering/RenderSVGInlineText.cpp: (WebCore::RenderSVGInlineText::selectionRect): ditto.
     24        * rendering/RenderSVGInlineText.h: ditto.
     25        * rendering/RenderObject.h:
     26        (WebCore::RenderObject::selectionRect): ditto.
     27        (WebCore::RenderObject::SelectionInfo::SelectionInfo): ditto.
     28        * rendering/RenderView.cpp:
     29        (WebCore::RenderView::selectionRect): ditto.
     30        (WebCore::RenderView::setSelection): ditto.
     31        * rendering/RenderView.h:
     32
     33        * rendering/RenderText.h:
     34        * rendering/RenderText.cpp: (WebCore::RenderText::selectionRect): Only call computeAbsoluteRepaintRect when clipping to visible content.
     35        Otherwise, just adjust the rect to the correct position.
     36        * rendering/RenderListMarker.h:
     37        * rendering/RenderListMarker.cpp: (WebCore::RenderListMarker::selectionRect):
     38          To match what we do in RenderText, if we're trying to clip to visible content, just call computeAbsoluteRepaintRect.
     39        * rendering/RenderReplaced.h:
     40        * rendering/RenderReplaced.cpp: (WebCore::RenderReplaced::selectionRect): ditto.
     41
     42        * rendering/RenderLayer.cpp: (WebCore::RenderLayer::scrollRectToVisible): Check for a parent layer at the beginning, so we can try to scroll all of our parent layers
     43          first, before trying to scroll the top level view.  Also, don't try to scroll overflow layers that have -webkit-line-clamp restricting the height.
     44          This will prevent us from revealing text hidden by the slider in Safari RSS.
     45
     46        * WebCore.exp: Update symbols for WebKit.
     47
    1482007-05-10  David Hyatt  <hyatt@apple.com>
    249
  • trunk/WebCore/WebCore.exp

    r21367 r21387  
    574574__ZNK7WebCore5Frame12eventHandlerEv
    575575__ZNK7WebCore5Frame12ownerElementEv
    576 __ZNK7WebCore5Frame13selectionRectEv
     576__ZNK7WebCore5Frame13selectionRectEb
    577577__ZNK7WebCore5Frame14selectionImageEb
    578578__ZNK7WebCore5Frame15revealSelectionERKNS_11RenderLayer15ScrollAlignmentE
     
    580580__ZNK7WebCore5Frame19selectionControllerEv
    581581__ZNK7WebCore5Frame19setInViewSourceModeEb
    582 __ZNK7WebCore5Frame20visibleSelectionRectEv
    583582__ZNK7WebCore5Frame30applyEditingStyleToBodyElementEv
    584583__ZNK7WebCore5Frame31fontAttributesForSelectionStartEv
  • trunk/WebCore/page/DragController.cpp

    r21185 r21387  
    530530static IntPoint dragLocForSelectionDrag(Frame* src)
    531531{
    532     IntRect draggingRect = enclosingIntRect(src->visibleSelectionRect());
     532    IntRect draggingRect = enclosingIntRect(src->selectionRect());
    533533    int xpos = draggingRect.right();
    534534    xpos = draggingRect.x() < xpos ? draggingRect.x() : xpos;
  • trunk/WebCore/page/Frame.cpp

    r21367 r21387  
    11801180}
    11811181
    1182 IntRect Frame::selectionRect() const
     1182// returns FloatRect because going through IntRect would truncate any floats
     1183FloatRect Frame::selectionRect(bool clipToVisibleContent) const
    11831184{
    11841185    RenderView *root = static_cast<RenderView*>(renderer());
    11851186    if (!root)
    11861187        return IntRect();
    1187 
    1188     return root->selectionRect();
    1189 }
    1190 
    1191 // returns FloatRect because going through IntRect would truncate any floats
    1192 FloatRect Frame::visibleSelectionRect() const
    1193 {
    1194     if (!d->m_view)
    1195         return FloatRect();
    1196    
    1197     return intersection(selectionRect(), d->m_view->visibleContentRect());
     1188   
     1189    IntRect selectionRect = root->selectionRect(clipToVisibleContent);
     1190    return clipToVisibleContent ? intersection(selectionRect, d->m_view->visibleContentRect()) : selectionRect;
    11981191}
    11991192
     
    12611254           
    12621255        case Selection::RANGE:
    1263             rect = selectionRect();
     1256            rect = enclosingIntRect(selectionRect(false));
    12641257            break;
    12651258    }
     
    15051498    // we have to update places those colors were painted.
    15061499    if (d->m_view)
    1507         d->m_view->updateContents(enclosingIntRect(visibleSelectionRect()));
     1500        d->m_view->updateContents(enclosingIntRect(selectionRect()));
    15081501
    15091502    // Caret appears in the active frame.
  • trunk/WebCore/page/Frame.h

    r21367 r21387  
    323323    void clearTypingStyle();
    324324
    325     IntRect selectionRect() const;
    326     FloatRect visibleSelectionRect() const;
     325    FloatRect selectionRect(bool clipToVisibleContent = true) const;
    327326
    328327    HTMLFormElement* currentForm() const;
  • trunk/WebCore/page/mac/FrameMac.mm

    r21354 r21387  
    373373{
    374374    d->m_paintRestriction = forceWhiteText ? PaintRestrictionSelectionOnlyWhiteText : PaintRestrictionSelectionOnly;
    375     NSImage* result = imageFromRect(visibleSelectionRect());
     375    d->m_doc->updateLayout();
     376    NSImage* result = imageFromRect(selectionRect());
    376377    d->m_paintRestriction = PaintRestrictionNone;
    377378    return result;
  • trunk/WebCore/rendering/RenderBR.h

    r19027 r21387  
    4141    virtual const char* renderName() const { return "RenderBR"; }
    4242 
    43     virtual IntRect selectionRect() { return IntRect(); }
     43    virtual IntRect selectionRect(bool) { return IntRect(); }
    4444
    4545    virtual unsigned width(unsigned /*from*/, unsigned /*len*/, const Font&, int /*xpos*/) const { return 0; }
  • trunk/WebCore/rendering/RenderBlock.h

    r21183 r21387  
    250250    };
    251251
    252     virtual IntRect selectionRect() { return selectionGapRects(); }
     252    virtual IntRect selectionRect(bool) { return selectionGapRects(); }
    253253    GapRects selectionGapRects();
    254254    virtual bool shouldPaintSelectionGaps() const;
  • trunk/WebCore/rendering/RenderLayer.cpp

    r21276 r21387  
    708708    if (frameView)
    709709        frameView->pauseScheduledEvents();
    710    
    711     if (m_object->hasOverflowClip()) {
     710
     711    bool restrictedByLineClamp = false;
     712    if (m_object->parent()) {
     713        parentLayer = m_object->parent()->enclosingLayer();
     714        restrictedByLineClamp = m_object->parent()->style()->lineClamp() >= 0;
     715    }
     716
     717    if (m_object->hasOverflowClip() && !restrictedByLineClamp) {
     718        // Don't scroll to reveal an overflow layer that is restricted by the -webkit-line-clamp property.
     719        // This will prevent us from revealing text hidden by the slider in Safari RSS.
    712720        int x, y;
    713721        m_object->absolutePosition(x, y);
     
    732740            newRect.setY(rect.y() - diffY);
    733741        }
    734    
    735         if (m_object->parent())
    736             parentLayer = m_object->parent()->enclosingLayer();
    737     } else {
     742    } else if (!parentLayer) {
    738743        if (frameView) {
    739744            if (m_object->document() && m_object->document()->ownerElement() && m_object->document()->ownerElement()->renderer()) {
  • trunk/WebCore/rendering/RenderListMarker.cpp

    r21166 r21387  
    879879}
    880880
    881 IntRect RenderListMarker::selectionRect()
     881IntRect RenderListMarker::selectionRect(bool clipToVisibleContent)
    882882{
    883883    ASSERT(!needsLayout());
     
    886886        return IntRect();
    887887
    888     int absx, absy;
    889     RenderBlock* cb = containingBlock();
    890     cb->absolutePosition(absx, absy);
    891     if (cb->hasOverflowClip())
    892         cb->layer()->subtractScrollOffset(absx, absy);
    893 
    894888    RootInlineBox* root = inlineBoxWrapper()->root();
    895     return IntRect(absx + xPos(), absy + root->selectionTop(), width(), root->selectionHeight());
     889    IntRect rect(xPos(), root->selectionTop(), width(), root->selectionHeight());
     890           
     891    if (clipToVisibleContent)
     892        computeAbsoluteRepaintRect(rect);
     893    else {
     894        int absx, absy;
     895        RenderBlock* cb = containingBlock();
     896        cb->absolutePosition(absx, absy);
     897        if (cb->hasOverflowClip())
     898            cb->layer()->subtractScrollOffset(absx, absy);
     899        rect.move(absx, absy);
     900    }
     901   
     902    return rect;
    896903}
    897904
  • trunk/WebCore/rendering/RenderListMarker.h

    r21094 r21387  
    6565    virtual SelectionState selectionState() const { return m_selectionState; }
    6666    virtual void setSelectionState(SelectionState);
    67     virtual IntRect selectionRect();
     67    virtual IntRect selectionRect(bool clipToVisibleContent = true);
    6868    virtual bool canBeSelectionLeaf() const { return true; }
    6969
  • trunk/WebCore/rendering/RenderObject.h

    r21211 r21387  
    747747    // A single rectangle that encompasses all of the selected objects within this object.  Used to determine the tightest
    748748    // possible bounding box for the selection.
    749     virtual IntRect selectionRect() { return IntRect(); }
     749    virtual IntRect selectionRect(bool) { return IntRect(); }
    750750
    751751    // Whether or not an object can be part of the leaf elements of the selection.
     
    777777        }
    778778
    779         SelectionInfo(RenderObject* o)
     779        SelectionInfo(RenderObject* o, bool clipToVisibleContent)
    780780            : m_object(o)
    781             , m_rect(o->needsLayout() ? IntRect() : o->selectionRect())
     781            , m_rect(o->needsLayout() ? IntRect() : o->selectionRect(clipToVisibleContent))
    782782            , m_state(o->selectionState())
    783783        {
  • trunk/WebCore/rendering/RenderReplaced.cpp

    r21215 r21387  
    153153}
    154154
    155 IntRect RenderReplaced::selectionRect()
     155IntRect RenderReplaced::selectionRect(bool clipToVisibleContent)
    156156{
    157157    ASSERT(!needsLayout());
     
    173173    int selectionRight = xPos() + width();
    174174   
    175     int absx, absy;
    176     cb->absolutePositionForContent(absx, absy);
    177     if (cb->hasOverflowClip())
    178         cb->layer()->subtractScrollOffset(absx, absy);
    179 
    180     return IntRect(selectionLeft + absx, selectionTop + absy, selectionRight - selectionLeft, selectionHeight);
     175    IntRect rect(selectionLeft, selectionTop, selectionRight - selectionLeft, selectionHeight);
     176   
     177    if (clipToVisibleContent)
     178        computeAbsoluteRepaintRect(rect);
     179    else {
     180        int absx, absy;
     181        cb->absolutePositionForContent(absx, absy);
     182        if (cb->hasOverflowClip())
     183            cb->layer()->subtractScrollOffset(absx, absy);
     184        rect.move(absx, absy);
     185    }
     186   
     187    return rect;
    181188}
    182189
  • trunk/WebCore/rendering/RenderReplaced.h

    r21211 r21387  
    5151    virtual SelectionState selectionState() const { return static_cast<SelectionState>(m_selectionState); }
    5252    virtual void setSelectionState(SelectionState);
    53     virtual IntRect selectionRect();
     53    virtual IntRect selectionRect(bool clipToVisibleContent = true);
    5454
    5555    bool isSelected() const;
  • trunk/WebCore/rendering/RenderSVGInlineText.cpp

    r19855 r21387  
    4646}
    4747
    48 IntRect RenderSVGInlineText::selectionRect()
     48IntRect RenderSVGInlineText::selectionRect(bool clipToVisibleContent)
    4949{
    50     IntRect rect = RenderText::selectionRect();
     50    IntRect rect = RenderText::selectionRect(clipToVisibleContent);
    5151    rect = parent()->absoluteTransform().mapRect(rect);
    5252    return rect;
  • trunk/WebCore/rendering/RenderSVGInlineText.h

    r19855 r21387  
    3636    virtual void absoluteRects(Vector<IntRect>& rects, int tx, int ty);
    3737    virtual bool requiresLayer() { return false; }
    38     virtual IntRect selectionRect();
     38    virtual IntRect selectionRect(bool clipToVisibleContent = true);
    3939    virtual bool isSVGText() const { return true; }
    4040    virtual InlineTextBox* createInlineTextBox();
  • trunk/WebCore/rendering/RenderText.cpp

    r21384 r21387  
    10271027}
    10281028
    1029 IntRect RenderText::selectionRect()
     1029IntRect RenderText::selectionRect(bool clipToVisibleContent)
    10301030{
    10311031    ASSERT(!needsLayout());
     
    10651065        int x = rect.x();
    10661066        int y = rect.y();
    1067         IntRect boxRect(0, 0, cb->layer()->width(), cb->layer()->height());
    10681067        cb->layer()->subtractScrollOffset(x, y);
    1069         IntRect repaintRect(x, y, rect.width(), rect.height());
    1070         rect = intersection(repaintRect, boxRect);
    1071     }
    1072     cb->computeAbsoluteRepaintRect(rect);
     1068        if (clipToVisibleContent) {
     1069            IntRect boxRect(0, 0, cb->layer()->width(), cb->layer()->height());
     1070            IntRect repaintRect(x, y, rect.width(), rect.height());
     1071            rect = intersection(repaintRect, boxRect);
     1072        }
     1073    }
     1074
     1075    if (clipToVisibleContent)
     1076        cb->computeAbsoluteRepaintRect(rect);
     1077    else {
     1078        int absx, absy;
     1079        cb->absolutePosition(absx, absy);
     1080        rect.move(absx, absy);
     1081    }
    10731082
    10741083    return rect;
  • trunk/WebCore/rendering/RenderText.h

    r21093 r21387  
    101101    virtual SelectionState selectionState() const { return static_cast<SelectionState>(m_selectionState); }
    102102    virtual void setSelectionState(SelectionState s);
    103     virtual IntRect selectionRect();
     103    virtual IntRect selectionRect(bool clipToVisibleContent = true);
    104104    virtual IntRect caretRect(int offset, EAffinity, int* extraWidthToEndOfLine = 0);
    105105
  • trunk/WebCore/rendering/RenderView.cpp

    r21183 r21387  
    229229}
    230230
    231 IntRect RenderView::selectionRect() const
     231IntRect RenderView::selectionRect(bool clipToVisibleContent) const
    232232{
    233233    document()->updateRendering();
     
    241241        if ((os->canBeSelectionLeaf() || os == m_selectionStart || os == m_selectionEnd) && os->selectionState() != SelectionNone) {
    242242            // Blocks are responsible for painting line gaps and margin gaps. They must be examined as well.
    243             selectedObjects.set(os, new SelectionInfo(os));
     243            selectedObjects.set(os, new SelectionInfo(os, clipToVisibleContent));
    244244            RenderBlock* cb = os->containingBlock();
    245245            while (cb && !cb->isRenderView()) {
     
    247247                if (blockInfo)
    248248                    break;
    249                 selectedObjects.set(cb, new SelectionInfo(cb));
     249                selectedObjects.set(cb, new SelectionInfo(cb, clipToVisibleContent));
    250250                cb = cb->containingBlock();
    251251            }
     
    300300        if ((os->canBeSelectionLeaf() || os == m_selectionStart || os == m_selectionEnd) && os->selectionState() != SelectionNone) {
    301301            // Blocks are responsible for painting line gaps and margin gaps.  They must be examined as well.
    302             oldSelectedObjects.set(os, new SelectionInfo(os));
     302            oldSelectedObjects.set(os, new SelectionInfo(os, false));
    303303            RenderBlock* cb = os->containingBlock();
    304304            while (cb && !cb->isRenderView()) {
     
    349349    while (o && o != stop) {
    350350        if ((o->canBeSelectionLeaf() || o == start || o == end) && o->selectionState() != SelectionNone) {
    351             newSelectedObjects.set(o, new SelectionInfo(o));
     351            newSelectedObjects.set(o, new SelectionInfo(o, false));
    352352            RenderBlock* cb = o->containingBlock();
    353353            while (cb && !cb->isRenderView()) {
  • trunk/WebCore/rendering/RenderView.h

    r21183 r21387  
    7575    virtual void absoluteRects(Vector<IntRect>&, int tx, int ty);
    7676
    77     IntRect selectionRect() const;
     77    IntRect selectionRect(bool clipToVisibleContent = true) const;
    7878
    7979    void setMaximalOutlineSize(int o) { m_maximalOutlineSize = o; }
  • trunk/WebKit/ChangeLog

    r21377 r21387  
     12007-05-10  Adele Peterson  <adele@apple.com>
     2
     3        Reviewed by Hyatt.
     4
     5        WebKit part of fix for <rdar://problem/4100616> Doing a "find" in RSS doesn't scroll to result
     6
     7        Updated to use selectionRect instead of visibleSelectionRect.  selectionRect() now returns the visible rect by default.
     8
     9        * WebView/WebHTMLView.mm:
     10        (-[WebHTMLView _lookUpInDictionaryFromMenu:]):
     11        (-[WebHTMLView selectionImageRect]):
     12
    1132007-05-10  dethbakin  <bdakin@apple.com>
    214
  • trunk/WebKit/WebKit.xcodeproj/project.pbxproj

    r21289 r21387  
    13251325                        isa = PBXProject;
    13261326                        buildConfigurationList = 149C283208902B0F008A9EFC /* Build configuration list for PBXProject "WebKit" */;
    1327                         compatibilityVersion = "Xcode 2.4";
    13281327                        hasScannedForEncodings = 1;
    13291328                        knownRegions = (
     
    13401339                        projectDirPath = "";
    13411340                        projectRoot = "";
    1342                         shouldCheckCompatibility = 1;
    13431341                        targets = (
    13441342                                9398100A0824BF01008DF038 /* WebKit */,
  • trunk/WebKit/WebView/WebHTMLView.mm

    r21349 r21387  
    52385238    // the rect for the entire selection, as we do here, positions the pop-up window near
    52395239    // the bottom of the selection rather than at the selected word.
    5240     NSRect rect = [self convertRect:core([self _frame])->visibleSelectionRect() toView:nil];
     5240    NSRect rect = [self convertRect:core([self _frame])->selectionRect() toView:nil];
    52415241    rect.origin = [[self window] convertBaseToScreen:rect.origin];
    52425242    NSData *data = [attrString RTFFromRange:NSMakeRange(0, [attrString length]) documentAttributes:nil];
     
    52465246    // FIXME 4945808: We approximate this in a way that works well when a single word is selected, and less well in some other cases
    52475247    // (but no worse than we did in Tiger)
    5248     NSRect rect = core([self _frame])->visibleSelectionRect();
     5248    NSRect rect = core([self _frame])->selectionRect();
    52495249
    52505250    NSDictionary *attributes = [attrString fontAttributesInRange:NSMakeRange(0,1)];
     
    59475947{
    59485948    if ([self _hasSelection])
    5949         return core([self _frame])->visibleSelectionRect();
     5949        return core([self _frame])->selectionRect();
    59505950    return NSZeroRect;
    59515951}
Note: See TracChangeset for help on using the changeset viewer.