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

Unified Diff: third_party/WebKit/Source/core/editing/InputMethodController.cpp

Issue 2794803002: Suppress frame requests in InputMethodController::textInputType() (Closed)
Patch Set: InputMethodController::textInputType() 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/page/PageAnimator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/InputMethodController.cpp
diff --git a/third_party/WebKit/Source/core/editing/InputMethodController.cpp b/third_party/WebKit/Source/core/editing/InputMethodController.cpp
index 5b46a96cc3e4b46234b9885ed4e2c95a28259f69..36fd3845807c24fbba7acbbffced0ab42ebf1bbe 100644
--- a/third_party/WebKit/Source/core/editing/InputMethodController.cpp
+++ b/third_party/WebKit/Source/core/editing/InputMethodController.cpp
@@ -45,6 +45,8 @@
#include "core/layout/LayoutObject.h"
#include "core/layout/LayoutTheme.h"
#include "core/page/ChromeClient.h"
+#include "core/page/Page.h"
+#include "core/page/PageAnimator.h"
namespace blink {
@@ -1182,11 +1184,19 @@ WebTextInputType InputMethodController::textInputType() const {
// It's important to preserve the equivalence of textInputInfo().type and
// textInputType(), so perform the same rootEditableElement() existence check
// here for consistency.
- if (!frame()
- .selection()
- .computeVisibleSelectionInDOMTreeDeprecated()
- .rootEditableElement())
- return WebTextInputTypeNone;
+ {
+ // TODO(alancutter): Move this frame request supression logic up into
+ // BeginMainFrame.
+ PageAnimator::FrameRequestSuppressionScope suppressFrameRequests(
+ frame().page() ? &frame().page()->animator() : nullptr);
+
+ if (!frame()
+ .selection()
+ .computeVisibleSelectionInDOMTreeDeprecated()
+ .rootEditableElement()) {
+ return WebTextInputTypeNone;
+ }
+ }
if (!isAvailable())
return WebTextInputTypeNone;
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/page/PageAnimator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698