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

Side by Side Diff: third_party/WebKit/Source/web/WebFrameWidgetImpl.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
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 540 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 if (selection.isNone()) 551 if (selection.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.isCaret()) { 561 if (selection.computeVisibleSelectionInDOMTreeDeprecated().isCaret()) {
562 anchor = focus = selection.absoluteCaretBounds(); 562 anchor = focus = selection.absoluteCaretBounds();
563 } else { 563 } else {
564 const EphemeralRange selectedRange = 564 const EphemeralRange selectedRange =
565 selection.computeVisibleSelectionInDOMTree() 565 selection.computeVisibleSelectionInDOMTree()
566 .toNormalizedEphemeralRange(); 566 .toNormalizedEphemeralRange();
567 if (selectedRange.isNull()) 567 if (selectedRange.isNull())
568 return false; 568 return false;
569 anchor = localFrame->editor().firstRectForRange( 569 anchor = localFrame->editor().firstRectForRange(
570 EphemeralRange(selectedRange.startPosition())); 570 EphemeralRange(selectedRange.startPosition()));
571 focus = localFrame->editor().firstRectForRange( 571 focus = localFrame->editor().firstRectForRange(
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
1137 return nullptr; 1137 return nullptr;
1138 } 1138 }
1139 1139
1140 LocalFrame* WebFrameWidgetImpl::focusedLocalFrameAvailableForIme() const { 1140 LocalFrame* WebFrameWidgetImpl::focusedLocalFrameAvailableForIme() const {
1141 if (!m_imeAcceptEvents) 1141 if (!m_imeAcceptEvents)
1142 return nullptr; 1142 return nullptr;
1143 return focusedLocalFrameInWidget(); 1143 return focusedLocalFrameInWidget();
1144 } 1144 }
1145 1145
1146 } // namespace blink 1146 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/page/DragController.cpp ('k') | third_party/WebKit/Source/web/WebViewImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698