Changeset 144400 in webkit
- Timestamp:
- Feb 28, 2013 5:24:47 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r144396 r144400 1 2013-02-28 Levi Weintraub <leviw@chromium.org> 2 3 Stale FrameSelection in removed iframe causes crash 4 https://bugs.webkit.org/show_bug.cgi?id=108696 5 6 Reviewed by Ryosuke Niwa. 7 8 * editing/selection/selection-in-iframe-removed-crash-expected.txt: Added. 9 * editing/selection/selection-in-iframe-removed-crash.html: Added. 10 1 11 2013-02-28 Stephen Chenney <schenney@chromium.org> 2 12 -
trunk/Source/WebCore/ChangeLog
r144399 r144400 1 2013-02-28 Levi Weintraub <leviw@chromium.org> 2 3 Stale FrameSelection in removed iframe causes crash 4 https://bugs.webkit.org/show_bug.cgi?id=108696 5 6 Reviewed by Ryosuke Niwa. 7 8 Catching a specific issue where selectFrameElementInParentIfFullySelected in a nested 9 iFrame that is removed can leave the outer frame's selection referencing stale nodes. 10 Instead, in this case, we keep the frame alive long enough to check for this condition 11 and clear our selection if we hit it. 12 13 Test: editing/selection/selection-in-iframe-removed-crash.html 14 15 * editing/FrameSelection.cpp: 16 (WebCore::FrameSelection::setSelection): 17 1 18 2013-02-28 Conrad Shultz <conrad_shultz@apple.com> 2 19 -
trunk/Source/WebCore/editing/FrameSelection.cpp
r143926 r144400 281 281 Document* document = s.base().anchorNode()->document(); 282 282 if (document && document->frame() && document->frame() != m_frame && document != m_frame->document()) { 283 RefPtr<Frame> guard = document->frame(); 283 284 document->frame()->selection()->setSelection(s, options, align, granularity); 285 // It's possible that during the above set selection, this FrameSelection has been modified by 286 // selectFrameElementInParentIfFullySelected, but that the selection is no longer valid since 287 // the frame is about to be destroyed. If this is the case, clear our selection. 288 if (guard->hasOneRef() && !m_selection.isNonOrphanedCaretOrRange()) 289 clear(); 284 290 return; 285 291 }
Note: See TracChangeset
for help on using the changeset viewer.