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 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
831 if (marker_it == markers_in_node.end()) | 831 if (marker_it == markers_in_node.end()) |
832 return; | 832 return; |
833 | 833 |
834 const DocumentMarker* found_marker = *marker_it; | 834 const DocumentMarker* found_marker = *marker_it; |
835 EphemeralRange marker_range = EphemeralRange( | 835 EphemeralRange marker_range = EphemeralRange( |
836 Position(caret_start_container, found_marker->StartOffset()), | 836 Position(caret_start_container, found_marker->StartOffset()), |
837 Position(caret_start_container, found_marker->EndOffset())); | 837 Position(caret_start_container, found_marker->EndOffset())); |
838 if (marker_range.IsNull()) | 838 if (marker_range.IsNull()) |
839 return; | 839 return; |
840 | 840 |
841 GetFrame().GetDocument()->Markers().RemoveMarkersInRange( | |
yosin_UTC9
2017/05/22 05:14:10
If we decide to remove marker explicitly, I agains
| |
842 marker_range, DocumentMarker::MisspellingMarkers()); | |
yosin_UTC9
2017/05/22 05:14:10
I'm not sure why do we need to remove marker expli
| |
843 | |
841 GetFrame().Selection().SetSelection( | 844 GetFrame().Selection().SetSelection( |
842 SelectionInDOMTree::Builder().SetBaseAndExtent(marker_range).Build()); | 845 SelectionInDOMTree::Builder().SetBaseAndExtent(marker_range).Build()); |
843 | 846 |
844 Document& current_document = *GetFrame().GetDocument(); | 847 Document& current_document = *GetFrame().GetDocument(); |
845 | 848 |
846 // Dispatch 'beforeinput'. | 849 // Dispatch 'beforeinput'. |
847 Element* const target = GetFrame().GetEditor().FindEventTargetFromSelection(); | 850 Element* const target = GetFrame().GetEditor().FindEventTargetFromSelection(); |
848 DataTransfer* const data_transfer = DataTransfer::Create( | 851 DataTransfer* const data_transfer = DataTransfer::Create( |
849 DataTransfer::DataTransferType::kInsertReplacementText, | 852 DataTransfer::DataTransferType::kInsertReplacementText, |
850 DataTransferAccessPolicy::kDataTransferReadable, | 853 DataTransferAccessPolicy::kDataTransferReadable, |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1220 if (!input.IsFocusedElementInDocument()) | 1223 if (!input.IsFocusedElementInDocument()) |
1221 return false; | 1224 return false; |
1222 } | 1225 } |
1223 } | 1226 } |
1224 HTMLElement* element = | 1227 HTMLElement* element = |
1225 Traversal<HTMLElement>::FirstAncestorOrSelf(*position.AnchorNode()); | 1228 Traversal<HTMLElement>::FirstAncestorOrSelf(*position.AnchorNode()); |
1226 return element && element->IsSpellCheckingEnabled(); | 1229 return element && element->IsSpellCheckingEnabled(); |
1227 } | 1230 } |
1228 | 1231 |
1229 } // namespace blink | 1232 } // namespace blink |
OLD | NEW |