Changeset 153366 in webkit


Ignore:
Timestamp:
Jul 25, 2013 8:59:22 PM (11 years ago)
Author:
rniwa@webkit.org
Message:

Fix document leak when selection is created inside the document
https://bugs.webkit.org/show_bug.cgi?id=119122

Reviewed by Andreas Kling.

Source/WebCore:

Merge https://chromium.googlesource.com/chromium/blink/+/b908cb4c8da93316d787de31c93f2a43de332a10

The bug was caused by FrameSelection::m_previousCaretNode holding onto a Node, leaking its document.
Fixed the bug by explicitly clearing it in FrameSelection::prepareForDestruction.

Test: editing/selection/leak-document-with-selection-inside.html

  • editing/FrameSelection.cpp:

(WebCore::FrameSelection::prepareForDestruction):

LayoutTests:

Added a regression test.

  • editing/selection/leak-document-with-selection-inside-expected.txt: Added.
  • editing/selection/leak-document-with-selection-inside.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r153362 r153366  
     12013-07-25  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Fix document leak when selection is created inside the document
     4        https://bugs.webkit.org/show_bug.cgi?id=119122
     5
     6        Reviewed by Andreas Kling.
     7
     8        Added a regression test.
     9
     10        * editing/selection/leak-document-with-selection-inside-expected.txt: Added.
     11        * editing/selection/leak-document-with-selection-inside.html: Added.
     12
    1132013-07-25  Bem Jones-Bey  <bjonesbe@adobe.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r153356 r153366  
     12013-07-25  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Fix document leak when selection is created inside the document
     4        https://bugs.webkit.org/show_bug.cgi?id=119122
     5
     6        Reviewed by Andreas Kling.
     7
     8        Merge https://chromium.googlesource.com/chromium/blink/+/b908cb4c8da93316d787de31c93f2a43de332a10
     9
     10        The bug was caused by FrameSelection::m_previousCaretNode holding onto a Node, leaking its document.
     11        Fixed the bug by explicitly clearing it in FrameSelection::prepareForDestruction.
     12
     13        Test: editing/selection/leak-document-with-selection-inside.html
     14
     15        * editing/FrameSelection.cpp:
     16        (WebCore::FrameSelection::prepareForDestruction):
     17
    1182013-07-25  Andreas Kling  <akling@apple.com>
    219
  • trunk/Source/WebCore/editing/FrameSelection.cpp

    r152889 r153366  
    12101210
    12111211    setSelection(VisibleSelection(), CloseTyping | ClearTypingStyle | DoNotUpdateAppearance);
     1212    m_previousCaretNode.clear();
    12121213}
    12131214
Note: See TracChangeset for help on using the changeset viewer.