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

Side by Side Diff: third_party/WebKit/Source/web/WebViewImpl.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
« no previous file with comments | « third_party/WebKit/Source/web/WebLocalFrameImpl.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 2338 matching lines...) Expand 10 before | Expand all | Expand 10 after
2349 // well. This code needs to be refactored (http://crbug.com/629721). 2349 // well. This code needs to be refactored (http://crbug.com/629721).
2350 bool WebViewImpl::selectionBounds(WebRect& anchor, WebRect& focus) const { 2350 bool WebViewImpl::selectionBounds(WebRect& anchor, WebRect& focus) const {
2351 const Frame* frame = focusedCoreFrame(); 2351 const Frame* frame = focusedCoreFrame();
2352 if (!frame || !frame->isLocalFrame()) 2352 if (!frame || !frame->isLocalFrame())
2353 return false; 2353 return false;
2354 2354
2355 const LocalFrame* localFrame = toLocalFrame(frame); 2355 const LocalFrame* localFrame = toLocalFrame(frame);
2356 if (!localFrame) 2356 if (!localFrame)
2357 return false; 2357 return false;
2358 FrameSelection& selection = localFrame->selection(); 2358 FrameSelection& selection = localFrame->selection();
2359 if (!selection.isAvailable() || selection.isNone()) { 2359 if (!selection.isAvailable() ||
2360 selection.computeVisibleSelectionInDOMTreeDeprecated().isNone()) {
2360 // plugins/mouse-capture-inside-shadow.html reaches here. 2361 // plugins/mouse-capture-inside-shadow.html reaches here.
2361 return false; 2362 return false;
2362 } 2363 }
2363 2364
2364 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets 2365 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
2365 // needs to be audited. See http://crbug.com/590369 for more details. 2366 // needs to be audited. See http://crbug.com/590369 for more details.
2366 localFrame->document()->updateStyleAndLayoutIgnorePendingStylesheets(); 2367 localFrame->document()->updateStyleAndLayoutIgnorePendingStylesheets();
2367 2368
2368 DocumentLifecycle::DisallowTransitionScope disallowTransition( 2369 DocumentLifecycle::DisallowTransitionScope disallowTransition(
2369 localFrame->document()->lifecycle()); 2370 localFrame->document()->lifecycle());
(...skipping 1791 matching lines...) Expand 10 before | Expand all | Expand 10 after
4161 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame()) 4162 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame())
4162 return nullptr; 4163 return nullptr;
4163 return focusedFrame; 4164 return focusedFrame;
4164 } 4165 }
4165 4166
4166 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const { 4167 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const {
4167 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr; 4168 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr;
4168 } 4169 }
4169 4170
4170 } // namespace blink 4171 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebLocalFrameImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698