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

Side by Side Diff: third_party/WebKit/Source/web/WebFrameWidgetImpl.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, 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) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 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 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 541
542 // TODO(ekaramad):This method is almost duplicated in WebViewImpl as well. This 542 // TODO(ekaramad):This method is almost duplicated in WebViewImpl as well. This
543 // code needs to be refactored (http://crbug.com/629721). 543 // code needs to be refactored (http://crbug.com/629721).
544 bool WebFrameWidgetImpl::selectionBounds(WebRect& anchor, 544 bool WebFrameWidgetImpl::selectionBounds(WebRect& anchor,
545 WebRect& focus) const { 545 WebRect& focus) const {
546 const LocalFrame* localFrame = focusedLocalFrameInWidget(); 546 const LocalFrame* localFrame = focusedLocalFrameInWidget();
547 if (!localFrame) 547 if (!localFrame)
548 return false; 548 return false;
549 549
550 FrameSelection& selection = localFrame->selection(); 550 FrameSelection& selection = localFrame->selection();
551 if (selection.isNone()) 551 if (selection.computeVisibleSelectionInDOMTreeDeprecated().isNone())
552 return false; 552 return false;
553 553
554 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets 554 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
555 // needs to be audited. See http://crbug.com/590369 for more details. 555 // needs to be audited. See http://crbug.com/590369 for more details.
556 localFrame->document()->updateStyleAndLayoutIgnorePendingStylesheets(); 556 localFrame->document()->updateStyleAndLayoutIgnorePendingStylesheets();
557 557
558 DocumentLifecycle::DisallowTransitionScope disallowTransition( 558 DocumentLifecycle::DisallowTransitionScope disallowTransition(
559 localFrame->document()->lifecycle()); 559 localFrame->document()->lifecycle());
560 560
561 if (selection.computeVisibleSelectionInDOMTreeDeprecated().isCaret()) { 561 if (selection.computeVisibleSelectionInDOMTreeDeprecated().isCaret()) {
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after
1142 return nullptr; 1142 return nullptr;
1143 } 1143 }
1144 1144
1145 LocalFrame* WebFrameWidgetImpl::focusedLocalFrameAvailableForIme() const { 1145 LocalFrame* WebFrameWidgetImpl::focusedLocalFrameAvailableForIme() const {
1146 if (!m_imeAcceptEvents) 1146 if (!m_imeAcceptEvents)
1147 return nullptr; 1147 return nullptr;
1148 return focusedLocalFrameInWidget(); 1148 return focusedLocalFrameInWidget();
1149 } 1149 }
1150 1150
1151 } // namespace blink 1151 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/page/DragController.cpp ('k') | third_party/WebKit/Source/web/WebLocalFrameImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698