Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(145)

Side by Side Diff: third_party/WebKit/Source/core/editing/FrameSelection.cpp

Issue 2642913003: Select All should show handles if they were already present (Closed)
Patch Set: added tests Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 895 matching lines...) Expand 10 before | Expand all | Expand 10 after
906 if (selectStartTarget) { 906 if (selectStartTarget) {
907 const Document& expectedDocument = document(); 907 const Document& expectedDocument = document();
908 if (selectStartTarget->dispatchEvent(Event::createCancelableBubble( 908 if (selectStartTarget->dispatchEvent(Event::createCancelableBubble(
909 EventTypeNames::selectstart)) != DispatchEventResult::NotCanceled) 909 EventTypeNames::selectstart)) != DispatchEventResult::NotCanceled)
910 return; 910 return;
911 // |root| may be detached due to selectstart event. 911 // |root| may be detached due to selectstart event.
912 if (!root->isConnected() || expectedDocument != root->document()) 912 if (!root->isConnected() || expectedDocument != root->document())
913 return; 913 return;
914 } 914 }
915 915
916 setSelection(SelectionInDOMTree::Builder().selectAllChildren(*root).build()); 916 SetSelectionOptions options = CloseTyping | ClearTypingStyle;
yosin_UTC9 2017/01/19 08:31:03 I prefer const SetSelectionOptions options = isHa
amaralp 2017/01/20 01:22:09 This has been removed.
917 if (isHandleVisible())
yosin_UTC9 2017/01/19 08:31:02 When do we not show handle if |isHandleVisbile()|?
yosin_UTC9 2017/01/19 09:36:52 [1] is another example of error prone regarding ha
amaralp 2017/01/20 01:22:09 A few cases I can think of: 1) Javascript select
918 options |= HandleVisible;
919
920 setSelection(SelectionInDOMTree::Builder().selectAllChildren(*root).build(),
921 options);
917 selectFrameElementInParentIfFullySelected(); 922 selectFrameElementInParentIfFullySelected();
918 notifyLayoutObjectOfSelectionChange(UserTriggered); 923 notifyLayoutObjectOfSelectionChange(UserTriggered);
919 } 924 }
920 925
921 bool FrameSelection::setSelectedRange(const EphemeralRange& range, 926 bool FrameSelection::setSelectedRange(const EphemeralRange& range,
922 TextAffinity affinity, 927 TextAffinity affinity,
923 SelectionDirectionalMode directional, 928 SelectionDirectionalMode directional,
924 SetSelectionOptions options) { 929 SetSelectionOptions options) {
925 if (range.isNull()) 930 if (range.isNull())
926 return false; 931 return false;
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after
1421 } 1426 }
1422 1427
1423 void showTree(const blink::FrameSelection* sel) { 1428 void showTree(const blink::FrameSelection* sel) {
1424 if (sel) 1429 if (sel)
1425 sel->showTreeForThis(); 1430 sel->showTreeForThis();
1426 else 1431 else
1427 LOG(INFO) << "Cannot showTree for <null> FrameSelection."; 1432 LOG(INFO) << "Cannot showTree for <null> FrameSelection.";
1428 } 1433 }
1429 1434
1430 #endif 1435 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698