Changeset 84459 in webkit


Ignore:
Timestamp:
Apr 20, 2011 8:02:28 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-04-20 Jia Pu <jpu@apple.com>

Reviewed by Maciej Stachowiak.

[Mac] Correction panel shows up at incorrect location after webpage is scrolled.
https://bugs.webkit.org/show_bug.cgi?id=59052
<rdar://problem/9312513>

Fixed a regression caused by interaction between patch for bug 57353 and patch for bug 55571.
See bug webpage for detail.

  • editing/Editor.cpp: (WebCore::Editor::selectionStartHasMarkerFor):
  • editing/SpellingCorrectionController.cpp: (WebCore::SpellingCorrectionController::windowRectForRange):
Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r84457 r84459  
     12011-04-20  Jia Pu  <jpu@apple.com>
     2
     3        Reviewed by Maciej Stachowiak.
     4
     5        [Mac] Correction panel shows up at incorrect location after webpage is scrolled.
     6        https://bugs.webkit.org/show_bug.cgi?id=59052
     7        <rdar://problem/9312513>
     8       
     9        Fixed a regression caused by interaction between patch for bug 57353 and patch for bug 55571.
     10        See bug webpage for detail.
     11
     12        * editing/Editor.cpp:
     13        (WebCore::Editor::selectionStartHasMarkerFor):
     14        * editing/SpellingCorrectionController.cpp:
     15        (WebCore::SpellingCorrectionController::windowRectForRange):
     16
    1172011-04-20  Adam Barth  <abarth@webkit.org>
    218
  • trunk/Source/WebCore/editing/Editor.cpp

    r84448 r84459  
    32283228
    32293229    return false;
    3230 }
    3231 
    3232 FloatRect Editor::windowRectForRange(const Range* range) const
    3233 {
    3234     FrameView* view = frame()->view();
    3235     if (!view)
    3236         return FloatRect();
    3237     Vector<FloatQuad> textQuads;
    3238     range->textQuads(textQuads);
    3239     FloatRect boundingRect;
    3240     size_t size = textQuads.size();
    3241     for (size_t i = 0; i < size; ++i)
    3242         boundingRect.unite(textQuads[i].boundingBox());
    3243     return view->contentsToWindow(IntRect(boundingRect));
    3244 }       
     3230}       
    32453231
    32463232TextCheckingTypeMask Editor::textCheckingTypeMaskFor(TextCheckingOptions textCheckingOptions)
  • trunk/Source/WebCore/editing/Editor.h

    r84311 r84459  
    434434    // Return true if correction was applied, false otherwise.
    435435    bool applyAutocorrectionBeforeTypingIfAppropriate();
    436     FloatRect windowRectForRange(const Range*) const;
    437436};
    438437
  • trunk/Source/WebCore/editing/SpellingCorrectionController.cpp

    r84433 r84459  
    362362{
    363363    FrameView* view = m_frame->view();
    364     return view ? view->contentsToWindow(IntRect(range->boundingRect())) : FloatRect();
     364    if (!view)
     365        return FloatRect();
     366    Vector<FloatQuad> textQuads;
     367    range->textQuads(textQuads);
     368    FloatRect boundingRect;
     369    size_t size = textQuads.size();
     370    for (size_t i = 0; i < size; ++i)
     371        boundingRect.unite(textQuads[i].boundingBox());
     372    return view->contentsToWindow(IntRect(boundingRect));
    365373}       
    366374
Note: See TracChangeset for help on using the changeset viewer.