OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. |
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 1353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1364 const VisibleSelection& newSelection, | 1364 const VisibleSelection& newSelection, |
1365 FrameSelection::SetSelectionOptions options) { | 1365 FrameSelection::SetSelectionOptions options) { |
1366 // If the new selection is orphaned, then don't update the selection. | 1366 // If the new selection is orphaned, then don't update the selection. |
1367 if (newSelection.start().isOrphan() || newSelection.end().isOrphan()) | 1367 if (newSelection.start().isOrphan() || newSelection.end().isOrphan()) |
1368 return; | 1368 return; |
1369 | 1369 |
1370 // See <rdar://problem/5729315> Some shouldChangeSelectedDOMRange contain | 1370 // See <rdar://problem/5729315> Some shouldChangeSelectedDOMRange contain |
1371 // Ranges for selections that are no longer valid | 1371 // Ranges for selections that are no longer valid |
1372 bool selectionDidNotChangeDOMPosition = | 1372 bool selectionDidNotChangeDOMPosition = |
1373 newSelection == frame().selection().selection(); | 1373 newSelection == frame().selection().selection(); |
1374 frame().selection().setSelection(newSelection, options); | 1374 frame().selection().setSelection(newSelection, HandleVisibility::NotVisible, |
| 1375 options); |
1375 | 1376 |
1376 // Some editing operations change the selection visually without affecting its | 1377 // Some editing operations change the selection visually without affecting its |
1377 // position within the DOM. For example when you press return in the following | 1378 // position within the DOM. For example when you press return in the following |
1378 // (the caret is marked by ^): | 1379 // (the caret is marked by ^): |
1379 // <div contentEditable="true"><div>^Hello</div></div> | 1380 // <div contentEditable="true"><div>^Hello</div></div> |
1380 // WebCore inserts <div><br></div> *before* the current block, which correctly | 1381 // WebCore inserts <div><br></div> *before* the current block, which correctly |
1381 // moves the paragraph down but which doesn't change the caret's DOM position | 1382 // moves the paragraph down but which doesn't change the caret's DOM position |
1382 // (["hello", 0]). In these situations the above FrameSelection::setSelection | 1383 // (["hello", 0]). In these situations the above FrameSelection::setSelection |
1383 // call does not call EditorClient::respondToChangedSelection(), which, on the | 1384 // call does not call EditorClient::respondToChangedSelection(), which, on the |
1384 // Mac, sends selection change notifications and starts a new kill ring | 1385 // Mac, sends selection change notifications and starts a new kill ring |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1699 | 1700 |
1700 DEFINE_TRACE(Editor) { | 1701 DEFINE_TRACE(Editor) { |
1701 visitor->trace(m_frame); | 1702 visitor->trace(m_frame); |
1702 visitor->trace(m_lastEditCommand); | 1703 visitor->trace(m_lastEditCommand); |
1703 visitor->trace(m_undoStack); | 1704 visitor->trace(m_undoStack); |
1704 visitor->trace(m_mark); | 1705 visitor->trace(m_mark); |
1705 visitor->trace(m_typingStyle); | 1706 visitor->trace(m_typingStyle); |
1706 } | 1707 } |
1707 | 1708 |
1708 } // namespace blink | 1709 } // namespace blink |
OLD | NEW |