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

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

Issue 2703313002: Expand FrameSeleciton::end() to increase chances of hoisting update layout (Closed)
Patch Set: 2017-02-21T12:26:29 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/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 2405 matching lines...) Expand 10 before | Expand all | Expand 10 after
2416 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets 2416 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
2417 // needs to be audited. See http://crbug.com/590369 for more details. 2417 // needs to be audited. See http://crbug.com/590369 for more details.
2418 frame->document()->updateStyleAndLayoutIgnorePendingStylesheets(); 2418 frame->document()->updateStyleAndLayoutIgnorePendingStylesheets();
2419 2419
2420 if (selection.computeVisibleSelectionInDOMTree() 2420 if (selection.computeVisibleSelectionInDOMTree()
2421 .toNormalizedEphemeralRange() 2421 .toNormalizedEphemeralRange()
2422 .isNull()) 2422 .isNull())
2423 return false; 2423 return false;
2424 start = 2424 start =
2425 toWebTextDirection(primaryDirectionOf(*selection.start().anchorNode())); 2425 toWebTextDirection(primaryDirectionOf(*selection.start().anchorNode()));
2426 end = toWebTextDirection(primaryDirectionOf(*selection.end().anchorNode())); 2426 end = toWebTextDirection(
2427 primaryDirectionOf(*selection.computeVisibleSelectionInDOMTreeDeprecated()
2428 .end()
2429 .anchorNode()));
2427 return true; 2430 return true;
2428 } 2431 }
2429 2432
2430 // TODO(ekaramad):This method is almost duplicated in WebFrameWidgetImpl as 2433 // TODO(ekaramad):This method is almost duplicated in WebFrameWidgetImpl as
2431 // well. This code needs to be refactored (http://crbug.com/629721). 2434 // well. This code needs to be refactored (http://crbug.com/629721).
2432 bool WebViewImpl::isSelectionAnchorFirst() const { 2435 bool WebViewImpl::isSelectionAnchorFirst() const {
2433 const LocalFrame* frame = focusedLocalFrameInWidget(); 2436 const LocalFrame* frame = focusedLocalFrameInWidget();
2434 if (!frame) 2437 if (!frame)
2435 return false; 2438 return false;
2436 2439
(...skipping 1705 matching lines...) Expand 10 before | Expand all | Expand 10 after
4142 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame()) 4145 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame())
4143 return nullptr; 4146 return nullptr;
4144 return focusedFrame; 4147 return focusedFrame;
4145 } 4148 }
4146 4149
4147 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const { 4150 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const {
4148 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr; 4151 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr;
4149 } 4152 }
4150 4153
4151 } // namespace blink 4154 } // 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