Changeset 102118 in webkit


Ignore:
Timestamp:
Dec 6, 2011 3:24:03 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

https://bugs.webkit.org/show_bug.cgi?id=73889
TextCheckingParagraph::offsetTo should not have a side effect.

Patch by Shinya Kawanaka <shinyak@google.com> on 2011-12-06
Reviewed by Hajime Morita.

Since TextCheckingParagraph::offsetTo had a side effect, its cache often became inconsistent.
This is likely to cause a bug when changing SpellChecker and Editor.

No new tests. Covered by existing tests.

  • editing/TextCheckingHelper.cpp:

(WebCore::TextCheckingParagraph::offsetTo):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r102115 r102118  
     12011-12-06  Shinya Kawanaka  <shinyak@google.com>
     2
     3        https://bugs.webkit.org/show_bug.cgi?id=73889
     4        TextCheckingParagraph::offsetTo should not have a side effect.
     5
     6        Reviewed by Hajime Morita.
     7
     8        Since TextCheckingParagraph::offsetTo had a side effect, its cache often became inconsistent.
     9        This is likely to cause a bug when changing SpellChecker and Editor.
     10
     11        No new tests. Covered by existing tests.
     12
     13        * editing/TextCheckingHelper.cpp:
     14        (WebCore::TextCheckingParagraph::offsetTo):
     15
    1162011-12-06  Eric Penner  <epenner@google.com>
    217
  • trunk/Source/WebCore/editing/TextCheckingHelper.cpp

    r100050 r102118  
    158158{
    159159    ASSERT(m_checkingRange);
    160     RefPtr<Range> range = offsetAsRange();
     160    RefPtr<Range> range = offsetAsRange()->cloneRange(ASSERT_NO_EXCEPTION);
    161161    range->setEnd(position.containerNode(), position.computeOffsetInContainerNode(), ec);
    162162    if (ec)
Note: See TracChangeset for help on using the changeset viewer.