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

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/inert/inert-node-is-uneditable.html

Issue 2088453002: Implement the inert attribute (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert histograms.xml Created 3 years, 7 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/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..15793e5335fb265926e7a57ccc55a7692d7d2099
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/dom/inert/inert-node-is-uneditable.html
@@ -0,0 +1,60 @@
+<!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)
+{
+ return new Promise(function(resolve, reject) {
+ if (!window.eventSender)
+ reject();
+
+ 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;
+ var pointerActions = [{
+ source: "mouse",
+ actions: [
+ { name: "pointerMove", x: x, y: y },
+ { name: "pointerDown", x: x, y: x },
+ { name: "pointerUp" },
+ { name: "pointerMove", x: 0, y: 0}
+ ]
+ }];
+ chrome.gpuBenchmarking.pointerActionSequence(pointerActions, resolve);
+ });
+}
+
+notEditable = document.querySelector('#not-editable');
+editable = document.querySelector('#editable');
+
+test(function() {
+ clickOn(notEditable).then(() => {
+ oldValue = notEditable.textContent;
+ eventSender.keyDown('a');
+ assert_equals(notEditable.textContent, oldValue);
+ });
+}, "Can't edit inert contenteditable");
+
+test(function() {
+ clickOn(editable).then(() => {
+ oldValue = editable.textContent;
+ eventSender.keyDown('a');
+ assert_not_equals(editable.textContent, oldValue);
+ });
+}, "Can edit non-inert contenteditable");
+
+</script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698