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

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

Issue 2704123003: Expand FrameSeleciton::isCaret() to increase chances of hoisting update layout (Closed)
Patch Set: 2017-02-21T12:50:46 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/web/WebFrameWidgetImpl.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) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 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 2349 matching lines...) Expand 10 before | Expand all | Expand 10 after
2360 return false; 2360 return false;
2361 } 2361 }
2362 2362
2363 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets 2363 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
2364 // needs to be audited. See http://crbug.com/590369 for more details. 2364 // needs to be audited. See http://crbug.com/590369 for more details.
2365 localFrame->document()->updateStyleAndLayoutIgnorePendingStylesheets(); 2365 localFrame->document()->updateStyleAndLayoutIgnorePendingStylesheets();
2366 2366
2367 DocumentLifecycle::DisallowTransitionScope disallowTransition( 2367 DocumentLifecycle::DisallowTransitionScope disallowTransition(
2368 localFrame->document()->lifecycle()); 2368 localFrame->document()->lifecycle());
2369 2369
2370 if (selection.isCaret()) { 2370 if (selection.computeVisibleSelectionInDOMTreeDeprecated().isCaret()) {
2371 anchor = focus = selection.absoluteCaretBounds(); 2371 anchor = focus = selection.absoluteCaretBounds();
2372 } else { 2372 } else {
2373 const EphemeralRange selectedRange = 2373 const EphemeralRange selectedRange =
2374 selection.computeVisibleSelectionInDOMTreeDeprecated() 2374 selection.computeVisibleSelectionInDOMTreeDeprecated()
2375 .toNormalizedEphemeralRange(); 2375 .toNormalizedEphemeralRange();
2376 if (selectedRange.isNull()) 2376 if (selectedRange.isNull())
2377 return false; 2377 return false;
2378 anchor = localFrame->editor().firstRectForRange( 2378 anchor = localFrame->editor().firstRectForRange(
2379 EphemeralRange(selectedRange.startPosition())); 2379 EphemeralRange(selectedRange.startPosition()));
2380 focus = localFrame->editor().firstRectForRange( 2380 focus = localFrame->editor().firstRectForRange(
(...skipping 1761 matching lines...) Expand 10 before | Expand all | Expand 10 after
4142 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame()) 4142 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame())
4143 return nullptr; 4143 return nullptr;
4144 return focusedFrame; 4144 return focusedFrame;
4145 } 4145 }
4146 4146
4147 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const { 4147 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const {
4148 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr; 4148 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr;
4149 } 4149 }
4150 4150
4151 } // namespace blink 4151 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698