Changeset 158186 in webkit
- Timestamp:
- Oct 29, 2013 1:38:22 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r158184 r158186 1 2013-10-29 Santosh Mahto <santosh.ma@samsung.com> 2 3 Text selected with double-click gets unselected after DOM modification 4 https://bugs.webkit.org/show_bug.cgi?id=114227 5 6 Reviewed by Ryosuke Niwa. 7 8 New Testcase to test that selection remain intact when selection is 9 created by double-click and then dom is modified. 10 11 * editing/selection/double-click-selection-with-dom-mutation-expected.txt: Added. 12 * editing/selection/double-click-selection-with-dom-mutation.html: Added. 13 14 Rebaselined the below test cases. 15 * platform/mac/editing/deleting/smart-delete-003-expected.txt: 16 * platform/mac/editing/deleting/smart-delete-004-expected.txt: 17 1 18 2013-10-29 Mihnea Ovidenie <mihnea@adobe.com> 2 19 -
trunk/LayoutTests/platform/mac/editing/deleting/smart-delete-003-expected.txt
r96264 r158186 7 7 EDITING DELEGATE: shouldDeleteDOMRange:range from 4 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document 8 8 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 9 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 10 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 3 of #text > DIV > BODY > HTML > #document to 0 of #text > DIV > BODY > HTML > #document toDOMRange:range from 3 of #text > DIV > BODY > HTML > #document to 3 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE 9 11 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 10 12 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification -
trunk/LayoutTests/platform/mac/editing/deleting/smart-delete-004-expected.txt
r96264 r158186 7 7 EDITING DELEGATE: shouldDeleteDOMRange:range from 4 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document 8 8 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 9 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 10 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 3 of #text > DIV > BODY > HTML > #document to 0 of #text > DIV > BODY > HTML > #document toDOMRange:range from 3 of #text > DIV > BODY > HTML > #document to 3 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE 9 11 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 10 12 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification -
trunk/Source/WebCore/ChangeLog
r158184 r158186 1 2013-10-29 Santosh Mahto <santosh.ma@samsung.com> 2 3 Text selected with double-click gets unselected after DOM modification 4 https://bugs.webkit.org/show_bug.cgi?id=114227 5 6 Reviewed by Ryosuke Niwa. 7 8 Before this patch when selection is done by double-click (start and base remain 9 same) and DOM is modified then selection gets vanished. This does not 10 happen when selection is done by dragging mouse. This happens because 11 on double-click base and extent remain the same and on DOM 12 modification we update the selection with base and extent, so we loose 13 the selection. Since in double-click case start/end contain the 14 correct selection, same should be used after dom modification to 15 update selection. 16 17 Test: editing/selection/double-click-selection-with-dom-mutation.html 18 19 * editing/FrameSelection.cpp: 20 (WebCore::FrameSelection::textWasReplaced): use start/end to update 21 selection in case double click selection. Added a check for base != 22 extent, if base != extent use base/extent to update the selection 23 otherwise use start/end with directionality check. 24 1 25 2013-10-29 Mihnea Ovidenie <mihnea@adobe.com> 2 26 -
trunk/Source/WebCore/editing/FrameSelection.cpp
r158163 r158186 461 461 if (base != m_selection.base() || extent != m_selection.extent() || start != m_selection.start() || end != m_selection.end()) { 462 462 VisibleSelection newSelection; 463 newSelection.setWithoutValidation(base, extent); 463 if (base != extent) 464 newSelection.setWithoutValidation(base, extent); 465 else if (m_selection.isDirectional() && !m_selection.isBaseFirst()) 466 newSelection.setWithoutValidation(end, start); 467 else 468 newSelection.setWithoutValidation(start, end); 469 464 470 m_frame->document()->updateLayout(); 465 471 setSelection(newSelection, DoNotSetFocus);
Note: See TracChangeset
for help on using the changeset viewer.