OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 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 * Copyright (C) 2009 Igalia S.L. | 4 * Copyright (C) 2009 Igalia S.L. |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 1771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1782 | 1782 |
1783 static bool ExecuteSelectToMark(LocalFrame& frame, | 1783 static bool ExecuteSelectToMark(LocalFrame& frame, |
1784 Event*, | 1784 Event*, |
1785 EditorCommandSource, | 1785 EditorCommandSource, |
1786 const String&) { | 1786 const String&) { |
1787 const EphemeralRange mark = | 1787 const EphemeralRange mark = |
1788 frame.GetEditor().Mark().ToNormalizedEphemeralRange(); | 1788 frame.GetEditor().Mark().ToNormalizedEphemeralRange(); |
1789 EphemeralRange selection = frame.GetEditor().SelectedRange(); | 1789 EphemeralRange selection = frame.GetEditor().SelectedRange(); |
1790 if (mark.IsNull() || selection.IsNull()) | 1790 if (mark.IsNull() || selection.IsNull()) |
1791 return false; | 1791 return false; |
1792 frame.Selection().SetSelectedRange( | 1792 frame.Selection().SetSelection( |
1793 UnionEphemeralRanges(mark, selection), TextAffinity::kDownstream, | 1793 SelectionInDOMTree::Builder() |
1794 SelectionDirectionalMode::kNonDirectional, FrameSelection::kCloseTyping); | 1794 .SetBaseAndExtent(UnionEphemeralRanges(mark, selection)) |
| 1795 .Build(), |
| 1796 FrameSelection::kCloseTyping); |
1795 return true; | 1797 return true; |
1796 } | 1798 } |
1797 | 1799 |
1798 static bool ExecuteSelectWord(LocalFrame& frame, | 1800 static bool ExecuteSelectWord(LocalFrame& frame, |
1799 Event*, | 1801 Event*, |
1800 EditorCommandSource, | 1802 EditorCommandSource, |
1801 const String&) { | 1803 const String&) { |
1802 return ExpandSelectionToGranularity(frame, kWordGranularity); | 1804 return ExpandSelectionToGranularity(frame, kWordGranularity); |
1803 } | 1805 } |
1804 | 1806 |
(...skipping 1223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3028 *frame_, kDirectionBackward, kWordGranularity); | 3030 *frame_, kDirectionBackward, kWordGranularity); |
3029 case WebEditingCommandType::kDeleteWordForward: | 3031 case WebEditingCommandType::kDeleteWordForward: |
3030 return RangesFromCurrentSelectionOrExtendCaret(*frame_, kDirectionForward, | 3032 return RangesFromCurrentSelectionOrExtendCaret(*frame_, kDirectionForward, |
3031 kWordGranularity); | 3033 kWordGranularity); |
3032 default: | 3034 default: |
3033 return TargetRangesForInputEvent(*target); | 3035 return TargetRangesForInputEvent(*target); |
3034 } | 3036 } |
3035 } | 3037 } |
3036 | 3038 |
3037 } // namespace blink | 3039 } // namespace blink |
OLD | NEW |