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

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

Issue 2706013005: Expand FrameSeleciton::getSelectionType() to increase chances of hoisting update layout (Closed)
Patch Set: 2017-02-22T21:26:37 rebase Created 3 years, 10 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
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 957 matching lines...) Expand 10 before | Expand all | Expand 10 after
968 RevealExtentOption revealExtentOption) { 968 RevealExtentOption revealExtentOption) {
969 DCHECK(isAvailable()); 969 DCHECK(isAvailable());
970 970
971 // TODO(editing-dev): The use of updateStyleAndLayoutIgnorePendingStylesheets 971 // TODO(editing-dev): The use of updateStyleAndLayoutIgnorePendingStylesheets
972 // needs to be audited. See http://crbug.com/590369 for more details. 972 // needs to be audited. See http://crbug.com/590369 for more details.
973 // Calculation of absolute caret bounds requires clean layout. 973 // Calculation of absolute caret bounds requires clean layout.
974 document().updateStyleAndLayoutIgnorePendingStylesheets(); 974 document().updateStyleAndLayoutIgnorePendingStylesheets();
975 975
976 LayoutRect rect; 976 LayoutRect rect;
977 977
978 switch (getSelectionType()) { 978 switch (computeVisibleSelectionInDOMTree().getSelectionType()) {
979 case NoSelection: 979 case NoSelection:
980 return; 980 return;
981 case CaretSelection: 981 case CaretSelection:
982 rect = LayoutRect(absoluteCaretBounds()); 982 rect = LayoutRect(absoluteCaretBounds());
983 break; 983 break;
984 case RangeSelection: 984 case RangeSelection:
985 rect = LayoutRect( 985 rect = LayoutRect(
986 revealExtentOption == RevealExtent 986 revealExtentOption == RevealExtent
987 ? absoluteCaretBoundsOf(createVisiblePosition(extent())) 987 ? absoluteCaretBoundsOf(createVisiblePosition(extent()))
988 : enclosingIntRect(unclippedBounds())); 988 : enclosingIntRect(unclippedBounds()));
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
1180 } 1180 }
1181 1181
1182 void showTree(const blink::FrameSelection* sel) { 1182 void showTree(const blink::FrameSelection* sel) {
1183 if (sel) 1183 if (sel)
1184 sel->showTreeForThis(); 1184 sel->showTreeForThis();
1185 else 1185 else
1186 LOG(INFO) << "Cannot showTree for <null> FrameSelection."; 1186 LOG(INFO) << "Cannot showTree for <null> FrameSelection.";
1187 } 1187 }
1188 1188
1189 #endif 1189 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698