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

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

Issue 2835063002: Selection API: type attribute should return 'Range' for range-selection in text controls. (Closed)
Patch Set: . Created 3 years, 8 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 | « third_party/WebKit/Source/core/editing/SelectionTemplate.h ('k') | 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/SelectionTemplate.cpp
diff --git a/third_party/WebKit/Source/core/editing/SelectionTemplate.cpp b/third_party/WebKit/Source/core/editing/SelectionTemplate.cpp
index 8005194d116b770f463cdae42810f11c49e630b1..f7afdf5d0108d08242033f0d0bd2be0a550fd8b1 100644
--- a/third_party/WebKit/Source/core/editing/SelectionTemplate.cpp
+++ b/third_party/WebKit/Source/core/editing/SelectionTemplate.cpp
@@ -82,6 +82,18 @@ const PositionTemplate<Strategy>& SelectionTemplate<Strategy>::Extent() const {
}
template <typename Strategy>
+bool SelectionTemplate<Strategy>::IsCaret() const {
+ return base_.IsNotNull() && base_ == extent_ &&
+ granularity_ == kCharacterGranularity;
+}
+
+template <typename Strategy>
+bool SelectionTemplate<Strategy>::IsRange() const {
+ return base_ != extent_ ||
+ (base_.IsNotNull() && granularity_ != kCharacterGranularity);
+}
+
+template <typename Strategy>
bool SelectionTemplate<Strategy>::AssertValidFor(
const Document& document) const {
if (!AssertValid())
« no previous file with comments | « third_party/WebKit/Source/core/editing/SelectionTemplate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698