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

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

Issue 2710883002: Expand FrameSeleciton::isNone() to increase chances of hoisting update layout (Closed)
Patch Set: 2017-02-23T16:27:43 rebase to resolve conflict with DOMSelection in r452402 Created 3 years, 9 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) 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() || 1152 if (selection.computeVisibleSelectionInDOMTreeDeprecated().isNone() ||
1153 selection.computeVisibleSelectionInDOMTreeDeprecated().isRange()) 1153 selection.computeVisibleSelectionInDOMTreeDeprecated().isRange())
1154 return false; 1154 return false;
1155 1155
1156 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets 1156 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
1157 // 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.
1158 frame()->document()->updateStyleAndLayoutIgnorePendingStylesheets(); 1158 frame()->document()->updateStyleAndLayoutIgnorePendingStylesheets();
1159 1159
1160 return frame()->selection().selectWordAroundPosition( 1160 return frame()->selection().selectWordAroundPosition(
1161 selection.computeVisibleSelectionInDOMTreeDeprecated().visibleStart()); 1161 selection.computeVisibleSelectionInDOMTreeDeprecated().visibleStart());
1162 } 1162 }
(...skipping 1275 matching lines...) Expand 10 before | Expand all | Expand 10 after
2438 createMarkup(startPosition, endPosition, AnnotateForInterchange, 2438 createMarkup(startPosition, endPosition, AnnotateForInterchange,
2439 ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs); 2439 ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs);
2440 } else { 2440 } else {
2441 clipHtml = 2441 clipHtml =
2442 createMarkup(endPosition, startPosition, AnnotateForInterchange, 2442 createMarkup(endPosition, startPosition, AnnotateForInterchange,
2443 ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs); 2443 ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs);
2444 } 2444 }
2445 } 2445 }
2446 2446
2447 } // namespace blink 2447 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp ('k') | third_party/WebKit/Source/web/WebViewImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698