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

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

Issue 2437873008: Get rid of flat tree version of createVisibleSelection() taking two VisiblePosition (Closed)
Patch Set: 2016-10-21T16:03:11 Created 4 years, 1 month 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2006 Apple Computer, 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 DCHECK(!needsLayoutTreeUpdate(extent)); 91 DCHECK(!needsLayoutTreeUpdate(extent));
92 // TODO(yosin): We should use |Builder::setBaseAndExtent()| once we get rid 92 // TODO(yosin): We should use |Builder::setBaseAndExtent()| once we get rid
93 // of callers passing |base.istNull()| but |extent.isNotNull()|. 93 // of callers passing |base.istNull()| but |extent.isNotNull()|.
94 SelectionInDOMTree::Builder builder; 94 SelectionInDOMTree::Builder builder;
95 builder.setBaseAndExtentDeprecated(base, extent) 95 builder.setBaseAndExtentDeprecated(base, extent)
96 .setAffinity(affinity) 96 .setAffinity(affinity)
97 .setIsDirectional(isDirectional); 97 .setIsDirectional(isDirectional);
98 return createVisibleSelection(builder.build()); 98 return createVisibleSelection(builder.build());
99 } 99 }
100 100
101 VisibleSelection createVisibleSelection(const VisiblePosition& base,
102 const VisiblePosition& extent,
103 bool isDirectional) {
104 DCHECK(base.isValid());
105 DCHECK(extent.isValid());
106 return createVisibleSelection(base.deepEquivalent(), extent.deepEquivalent(),
107 base.affinity(), isDirectional);
108 }
109
110 VisibleSelectionInFlatTree createVisibleSelection( 101 VisibleSelectionInFlatTree createVisibleSelection(
111 const SelectionInFlatTree& selection) { 102 const SelectionInFlatTree& selection) {
112 return VisibleSelectionInFlatTree::create(selection); 103 return VisibleSelectionInFlatTree::create(selection);
113 } 104 }
114 105
115 template <typename Strategy> 106 template <typename Strategy>
116 static SelectionType computeSelectionType( 107 static SelectionType computeSelectionType(
117 const PositionTemplate<Strategy>& start, 108 const PositionTemplate<Strategy>& start,
118 const PositionTemplate<Strategy>& end) { 109 const PositionTemplate<Strategy>& end) {
119 if (start.isNull()) { 110 if (start.isNull()) {
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after
869 860
870 void showTree(const blink::VisibleSelectionInFlatTree& sel) { 861 void showTree(const blink::VisibleSelectionInFlatTree& sel) {
871 sel.showTreeForThis(); 862 sel.showTreeForThis();
872 } 863 }
873 864
874 void showTree(const blink::VisibleSelectionInFlatTree* sel) { 865 void showTree(const blink::VisibleSelectionInFlatTree* sel) {
875 if (sel) 866 if (sel)
876 sel->showTreeForThis(); 867 sel->showTreeForThis();
877 } 868 }
878 #endif 869 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698