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

Side by Side Diff: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp

Issue 2708703003: Expand FrameSeleciton::isRange() to increase chances of hoisting update layout (Closed)
Patch Set: 2017-02-21T23:48:22 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
« no previous file with comments | « third_party/WebKit/Source/core/page/DragController.cpp ('k') | no next file » | 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) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 1131 matching lines...) Expand 10 before | Expand all | Expand 10 after
1142 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets 1142 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
1143 // needs to be audited. see http://crbug.com/590369 for more details. 1143 // needs to be audited. see http://crbug.com/590369 for more details.
1144 frame->document()->updateStyleAndLayoutIgnorePendingStylesheets(); 1144 frame->document()->updateStyleAndLayoutIgnorePendingStylesheets();
1145 1145
1146 frame->selection().selectWordAroundPosition(position); 1146 frame->selection().selectWordAroundPosition(position);
1147 } 1147 }
1148 1148
1149 bool WebLocalFrameImpl::selectWordAroundCaret() { 1149 bool WebLocalFrameImpl::selectWordAroundCaret() {
1150 TRACE_EVENT0("blink", "WebLocalFrameImpl::selectWordAroundCaret"); 1150 TRACE_EVENT0("blink", "WebLocalFrameImpl::selectWordAroundCaret");
1151 FrameSelection& selection = frame()->selection(); 1151 FrameSelection& selection = frame()->selection();
1152 if (selection.isNone() || selection.isRange()) 1152 if (selection.isNone() ||
1153 selection.computeVisibleSelectionInDOMTreeDeprecated().isRange())
1153 return false; 1154 return false;
1154 1155
1155 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets 1156 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
1156 // needs to be audited. see http://crbug.com/590369 for more details. 1157 // needs to be audited. see http://crbug.com/590369 for more details.
1157 frame()->document()->updateStyleAndLayoutIgnorePendingStylesheets(); 1158 frame()->document()->updateStyleAndLayoutIgnorePendingStylesheets();
1158 1159
1159 return frame()->selection().selectWordAroundPosition( 1160 return frame()->selection().selectWordAroundPosition(
1160 selection.computeVisibleSelectionInDOMTreeDeprecated().visibleStart()); 1161 selection.computeVisibleSelectionInDOMTreeDeprecated().visibleStart());
1161 } 1162 }
1162 1163
(...skipping 1276 matching lines...) Expand 10 before | Expand all | Expand 10 after
2439 createMarkup(startPosition, endPosition, AnnotateForInterchange, 2440 createMarkup(startPosition, endPosition, AnnotateForInterchange,
2440 ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs); 2441 ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs);
2441 } else { 2442 } else {
2442 clipHtml = 2443 clipHtml =
2443 createMarkup(endPosition, startPosition, AnnotateForInterchange, 2444 createMarkup(endPosition, startPosition, AnnotateForInterchange,
2444 ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs); 2445 ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs);
2445 } 2446 }
2446 } 2447 }
2447 2448
2448 } // namespace blink 2449 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/page/DragController.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698