Index: third_party/WebKit/LayoutTests/external/wpt/selection/common.js |
diff --git a/third_party/WebKit/LayoutTests/external/wpt/selection/common.js b/third_party/WebKit/LayoutTests/external/wpt/selection/common.js |
index 4b37c2632c2cc19d8b47eb0486cf78e2fb641cd9..51579e42444e3c723ed9c80283887d163bfd150d 100644 |
--- a/third_party/WebKit/LayoutTests/external/wpt/selection/common.js |
+++ b/third_party/WebKit/LayoutTests/external/wpt/selection/common.js |
@@ -977,3 +977,14 @@ function assertSelectionNoChange(func) { |
"The operation should not replace a registered Range"); |
} |
+/** |
+ * Check if the specified node can be selectable with window.getSelection() |
+ * methods. |
+ */ |
+function isSelectableNode(node) { |
+ if (!node) |
+ return false; |
+ if (node.nodeType == Node.DOCUMENT_TYPE_NODE) |
+ return false; |
+ return document.contains(node); |
+} |