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

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

Issue 2709943004: Expand FrameSeleciton::extent() to increase chances of hoisting update layout (Closed)
Patch Set: 2017-02-23T18:48:11 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 959 matching lines...) Expand 10 before | Expand all | Expand 10 after
970 970
971 LayoutRect rect; 971 LayoutRect rect;
972 972
973 switch (computeVisibleSelectionInDOMTree().getSelectionType()) { 973 switch (computeVisibleSelectionInDOMTree().getSelectionType()) {
974 case NoSelection: 974 case NoSelection:
975 return; 975 return;
976 case CaretSelection: 976 case CaretSelection:
977 rect = LayoutRect(absoluteCaretBounds()); 977 rect = LayoutRect(absoluteCaretBounds());
978 break; 978 break;
979 case RangeSelection: 979 case RangeSelection:
980 rect = LayoutRect( 980 rect = LayoutRect(revealExtentOption == RevealExtent
981 revealExtentOption == RevealExtent 981 ? absoluteCaretBoundsOf(createVisiblePosition(
982 ? absoluteCaretBoundsOf(createVisiblePosition(extent())) 982 computeVisibleSelectionInDOMTree().extent()))
983 : enclosingIntRect(unclippedBounds())); 983 : enclosingIntRect(unclippedBounds()));
984 break; 984 break;
985 } 985 }
986 986
987 Position start = computeVisibleSelectionInDOMTreeDeprecated().start(); 987 Position start = computeVisibleSelectionInDOMTreeDeprecated().start();
988 DCHECK(start.anchorNode()); 988 DCHECK(start.anchorNode());
989 if (start.anchorNode() && start.anchorNode()->layoutObject()) { 989 if (start.anchorNode() && start.anchorNode()->layoutObject()) {
990 // FIXME: This code only handles scrolling the startContainer's layer, but 990 // FIXME: This code only handles scrolling the startContainer's layer, but
991 // the selection rect could intersect more than just that. 991 // the selection rect could intersect more than just that.
992 if (DocumentLoader* documentLoader = m_frame->loader().documentLoader()) 992 if (DocumentLoader* documentLoader = m_frame->loader().documentLoader())
993 documentLoader->initialScrollState().wasScrolledByUser = true; 993 documentLoader->initialScrollState().wasScrolledByUser = true;
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
1176 } 1176 }
1177 1177
1178 void showTree(const blink::FrameSelection* sel) { 1178 void showTree(const blink::FrameSelection* sel) {
1179 if (sel) 1179 if (sel)
1180 sel->showTreeForThis(); 1180 sel->showTreeForThis();
1181 else 1181 else
1182 LOG(INFO) << "Cannot showTree for <null> FrameSelection."; 1182 LOG(INFO) << "Cannot showTree for <null> FrameSelection.";
1183 } 1183 }
1184 1184
1185 #endif 1185 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698