Index: third_party/WebKit/LayoutTests/fast/dom/inert/inert-node-is-uneditable.html |
diff --git a/third_party/WebKit/LayoutTests/fast/dom/inert/inert-node-is-uneditable.html b/third_party/WebKit/LayoutTests/fast/dom/inert/inert-node-is-uneditable.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..19460ac1086b50af42445774a2e7eab55a752a99 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/fast/dom/inert/inert-node-is-uneditable.html |
@@ -0,0 +1,50 @@ |
+<!DOCTYPE html> |
+<html> |
+<head> |
+<script src="../../../resources/testharness.js"></script> |
+<script src="../../../resources/testharnessreport.js"></script> |
+</head> |
+<body> |
+<span inert id="not-editable" contenteditable>I'm not editable.</span> |
+<span id="editable" contenteditable>I'm editable.</span> |
+<script> |
+function clickOn(element) |
+{ |
+ if (!window.eventSender) |
+ return; |
+ |
+ var absoluteTop = 0; |
+ var absoluteLeft = 0; |
+ for (var parentNode = element; parentNode; parentNode = parentNode.offsetParent) { |
+ absoluteLeft += parentNode.offsetLeft; |
+ absoluteTop += parentNode.offsetTop; |
+ } |
+ |
+ var x = absoluteLeft + element.offsetWidth / 2; |
+ var y = absoluteTop + element.offsetHeight / 2; |
+ eventSender.mouseMoveTo(x, y); |
+ eventSender.mouseDown(); |
+ eventSender.mouseUp(); |
+ eventSender.mouseMoveTo(0, 0); |
+} |
+ |
+notEditable = document.querySelector('#not-editable'); |
+editable = document.querySelector('#editable'); |
+ |
+test(function() { |
+ clickOn(notEditable); |
+ oldValue = notEditable.textContent; |
+ eventSender.keyDown('a'); |
+ assert_equals(notEditable.textContent, oldValue); |
+}, "Can't edit inert contenteditable"); |
+ |
+test(function() { |
+ clickOn(editable); |
+ oldValue = editable.textContent; |
+ eventSender.keyDown('a'); |
+ assert_not_equals(editable.textContent, oldValue); |
+}, "Can edit non-inert contenteditable"); |
+ |
+</script> |
+</body> |
+</html> |