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

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

Issue 2840423002: Merge "Selection API: type attribute should return 'Range' for range-selection in text controls." t… (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 231e94cf12f5cb2cd05315e4b0e661067bce0ae5..1f5ae27d5945102822f0fa2f596fcfd75d53c40e 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