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 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 frame.Selection() | 401 frame.Selection() |
402 .ComputeVisibleSelectionInDOMTreeDeprecated() | 402 .ComputeVisibleSelectionInDOMTreeDeprecated() |
403 .Extent()) | 403 .Extent()) |
404 .SetGranularity(granularity) | 404 .SetGranularity(granularity) |
405 .Build()); | 405 .Build()); |
406 const EphemeralRange new_range = selection.ToNormalizedEphemeralRange(); | 406 const EphemeralRange new_range = selection.ToNormalizedEphemeralRange(); |
407 if (new_range.IsNull()) | 407 if (new_range.IsNull()) |
408 return false; | 408 return false; |
409 if (new_range.IsCollapsed()) | 409 if (new_range.IsCollapsed()) |
410 return false; | 410 return false; |
411 TextAffinity affinity = frame.Selection().GetSelectionInDOMTree().Affinity(); | 411 frame.Selection().SetSelection( |
412 frame.Selection().SetSelectedRange(new_range, affinity, | 412 SelectionInDOMTree::Builder().SetBaseAndExtent(new_range).Build(), |
413 SelectionDirectionalMode::kNonDirectional, | 413 FrameSelection::kCloseTyping); |
414 FrameSelection::kCloseTyping); | |
415 return true; | 414 return true; |
416 } | 415 } |
417 | 416 |
418 static bool HasChildTags(Element& element, const QualifiedName& tag_name) { | 417 static bool HasChildTags(Element& element, const QualifiedName& tag_name) { |
419 return !element.getElementsByTagName(tag_name.LocalName())->IsEmpty(); | 418 return !element.getElementsByTagName(tag_name.LocalName())->IsEmpty(); |
420 } | 419 } |
421 | 420 |
422 static TriState SelectionListState(const FrameSelection& selection, | 421 static TriState SelectionListState(const FrameSelection& selection, |
423 const QualifiedName& tag_name) { | 422 const QualifiedName& tag_name) { |
424 if (selection.ComputeVisibleSelectionInDOMTreeDeprecated().IsCaret()) { | 423 if (selection.ComputeVisibleSelectionInDOMTreeDeprecated().IsCaret()) { |
(...skipping 2603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3028 *frame_, kDirectionBackward, kWordGranularity); | 3027 *frame_, kDirectionBackward, kWordGranularity); |
3029 case WebEditingCommandType::kDeleteWordForward: | 3028 case WebEditingCommandType::kDeleteWordForward: |
3030 return RangesFromCurrentSelectionOrExtendCaret(*frame_, kDirectionForward, | 3029 return RangesFromCurrentSelectionOrExtendCaret(*frame_, kDirectionForward, |
3031 kWordGranularity); | 3030 kWordGranularity); |
3032 default: | 3031 default: |
3033 return TargetRangesForInputEvent(*target); | 3032 return TargetRangesForInputEvent(*target); |
3034 } | 3033 } |
3035 } | 3034 } |
3036 | 3035 |
3037 } // namespace blink | 3036 } // namespace blink |
OLD | NEW |