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

Unified Diff: third_party/WebKit/Source/core/testing/Internals.cpp

Issue 2709473003: Add internals.textAffinity (Closed)
Patch Set: update 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
Index: third_party/WebKit/Source/core/testing/Internals.cpp
diff --git a/third_party/WebKit/Source/core/testing/Internals.cpp b/third_party/WebKit/Source/core/testing/Internals.cpp
index dc9440c2e30d3484e279a8c4a977016f5c3e3e2e..c13b7b919ecaf60e10933212f232a8481f64116a 100644
--- a/third_party/WebKit/Source/core/testing/Internals.cpp
+++ b/third_party/WebKit/Source/core/testing/Internals.cpp
@@ -913,6 +913,19 @@ ClientRect* Internals::absoluteCaretBounds(ExceptionState& exceptionState) {
return ClientRect::create(frame()->selection().absoluteCaretBounds());
}
+String Internals::textAffinity() {
+ if (frame()
+ ->page()
+ ->focusController()
+ .focusedFrame()
+ ->selection()
+ .selectionInDOMTree()
+ .affinity() == TextAffinity::Upstream) {
+ return "Upstream";
+ }
+ return "Downstream";
+}
+
ClientRect* Internals::boundingBox(Element* element) {
DCHECK(element);
« no previous file with comments | « third_party/WebKit/Source/core/testing/Internals.h ('k') | third_party/WebKit/Source/core/testing/Internals.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698