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

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

Issue 2727553002: Selection API: Add a UseCounter for focus change by Selection.modify(). (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/DOMSelection.cpp
diff --git a/third_party/WebKit/Source/core/editing/DOMSelection.cpp b/third_party/WebKit/Source/core/editing/DOMSelection.cpp
index 2ad77dab5d18b0d974ef531e3cb882879af0194c..5b9f4478aeffe04440a068ad91d83ed2e7a5bbb3 100644
--- a/third_party/WebKit/Source/core/editing/DOMSelection.cpp
+++ b/third_party/WebKit/Source/core/editing/DOMSelection.cpp
@@ -436,7 +436,11 @@ void DOMSelection::modify(const String& alterString,
else
return;
+ Element* focusedElement = frame()->document()->focusedElement();
frame()->selection().modify(alter, direction, granularity);
+ if (frame() && frame()->document() &&
+ focusedElement != frame()->document()->focusedElement())
+ UseCounter::count(frame(), UseCounter::SelectionFuncionsChangeFocus);
}
// https://www.w3.org/TR/selection-api/#dom-selection-extend
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698