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

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

Issue 2702403004: Expand FrameSeleciton::start() to increase chances of hoisting update layout (Closed)
Patch Set: 2017-02-22T12:32:36 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) 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 1068 matching lines...) Expand 10 before | Expand all | Expand 10 after
1079 void WebLocalFrameImpl::removeSpellingMarkers() { 1079 void WebLocalFrameImpl::removeSpellingMarkers() {
1080 frame()->spellChecker().removeSpellingMarkers(); 1080 frame()->spellChecker().removeSpellingMarkers();
1081 } 1081 }
1082 1082
1083 bool WebLocalFrameImpl::hasSelection() const { 1083 bool WebLocalFrameImpl::hasSelection() const {
1084 WebPluginContainerImpl* pluginContainer = pluginContainerFromFrame(frame()); 1084 WebPluginContainerImpl* pluginContainer = pluginContainerFromFrame(frame());
1085 if (pluginContainer) 1085 if (pluginContainer)
1086 return pluginContainer->plugin()->hasSelection(); 1086 return pluginContainer->plugin()->hasSelection();
1087 1087
1088 // frame()->selection()->isNone() never returns true. 1088 // frame()->selection()->isNone() never returns true.
1089 return frame()->selection().start() != 1089 return frame()
1090 ->selection()
1091 .computeVisibleSelectionInDOMTreeDeprecated()
1092 .start() !=
1090 frame() 1093 frame()
1091 ->selection() 1094 ->selection()
1092 .computeVisibleSelectionInDOMTreeDeprecated() 1095 .computeVisibleSelectionInDOMTreeDeprecated()
1093 .end(); 1096 .end();
1094 } 1097 }
1095 1098
1096 WebRange WebLocalFrameImpl::selectionRange() const { 1099 WebRange WebLocalFrameImpl::selectionRange() const {
1097 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets 1100 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
1098 // needs to be audited. See http://crbug.com/590369 for more details. 1101 // needs to be audited. See http://crbug.com/590369 for more details.
1099 frame()->document()->updateStyleAndLayoutIgnorePendingStylesheets(); 1102 frame()->document()->updateStyleAndLayoutIgnorePendingStylesheets();
(...skipping 1340 matching lines...) Expand 10 before | Expand all | Expand 10 after
2440 createMarkup(startPosition, endPosition, AnnotateForInterchange, 2443 createMarkup(startPosition, endPosition, AnnotateForInterchange,
2441 ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs); 2444 ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs);
2442 } else { 2445 } else {
2443 clipHtml = 2446 clipHtml =
2444 createMarkup(endPosition, startPosition, AnnotateForInterchange, 2447 createMarkup(endPosition, startPosition, AnnotateForInterchange,
2445 ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs); 2448 ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs);
2446 } 2449 }
2447 } 2450 }
2448 2451
2449 } // namespace blink 2452 } // 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