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

Unified Diff: third_party/WebKit/LayoutTests/editing/spelling/spellcheck-remove-markers.html

Issue 2650183002: Remove spelling markers when element is not editable (Closed)
Patch Set: Add missing comment Created 3 years, 11 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/editing/spelling/spellcheck-remove-markers.html
diff --git a/third_party/WebKit/LayoutTests/editing/spelling/spellcheck-remove-markers.html b/third_party/WebKit/LayoutTests/editing/spelling/spellcheck-remove-markers.html
new file mode 100644
index 0000000000000000000000000000000000000000..43badd1fffd9810d17b2a4ecfe7cc72b0f6c7b99
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/editing/spelling/spellcheck-remove-markers.html
@@ -0,0 +1,99 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="../assert_selection.js"></script>
+<script src="spellcheck_test.js"></script>
+
+<script>
+ spellcheck_test(
+ '<div contenteditable>|zz. I have a issue.</div>',
+ '',
+ '<div contenteditable>#zz#. I have ~a~ issue.</div>',
+ {
+ title: 'Setup for the initial markers.',
Xiaocheng 2017/02/01 05:20:28 nit: Could you number the setup test cases?
Manuel Rego 2017/02/01 14:50:25 Sure.
+ callback: sample => spellcheck_test(
+ sample,
+ document => document.querySelector('div').removeAttribute('contenteditable'),
+ '<div>zz. I have a issue.</div>',
+ 'Removing "contenteditable" attribute removes spelling markers.')
+ });
+
+ spellcheck_test(
+ '<div contenteditable>|zz. I have a issue.</div>',
+ '',
+ '<div contenteditable>#zz#. I have ~a~ issue.</div>',
+ {
+ title: 'Setup for the initial markers.',
+ callback: sample => spellcheck_test(
+ sample,
+ document => document.querySelector('div').setAttribute('contenteditable', 'false'),
+ '<div contenteditable="false">zz. I have a issue.</div>',
+ 'Setting "contenteditable" attribute to "false" removes spelling markers.')
+ });
+
+ spellcheck_test(
+ '<div contenteditable id="parent">zz.<div>|zz.</div>zz.</div>',
+ '',
+ '<div contenteditable id="parent">#zz#.<div>#zz#.</div>#zz#.</div>',
+ {
+ title: 'Setup for the initial markers.',
+ callback: sample => spellcheck_test(
+ sample,
+ document => document.getElementById('parent').removeAttribute('contenteditable'),
+ '<div id="parent">zz.<div>zz.</div>zz.</div>',
+ 'Removing "contenteditable" attribute from parent removes spelling markers.')
+ });
+
+ spellcheck_test(
+ '<div contenteditable id="parent">zz.<div>|zz.</div>zz.</div>',
+ '',
+ '<div contenteditable id="parent">#zz#.<div>#zz#.</div>#zz#.</div>',
+ {
+ title: 'Setup for the initial markers.',
+ callback: sample => spellcheck_test(
+ sample,
+ document => document.getElementById('parent').setAttribute('contenteditable', 'false'),
+ '<div contenteditable="false" id="parent">zz.<div>zz.</div>zz.</div>',
+ 'Setting "contenteditable" attribute to "false" on parent removes spelling markers.')
+ });
+
+ spellcheck_test(
+ '<div contenteditable>zz.<div id="child">|zz.</div>zz.</div>',
+ '',
+ '<div contenteditable>#zz#.<div id="child">#zz#.</div>#zz#.</div>',
+ {
+ title: 'Setup for the initial markers.',
+ callback: sample => spellcheck_test(
+ sample,
+ document => document.getElementById('child').setAttribute('contenteditable', 'false'),
+ '<div contenteditable>#zz#.<div contenteditable="false" id="child">zz.</div>#zz#.</div>',
+ 'Setting "contenteditable" attribute to "false" on child removes spelling markers.')
+ });
+
+ spellcheck_test(
+ '<div contenteditable id="parent">zz.<div contenteditable>|zz.</div>zz.</div>',
+ '',
+ '<div contenteditable id="parent">#zz#.<div contenteditable>#zz#.</div>#zz#.</div>',
+ {
+ title: 'Setup for the initial markers.',
+ callback: sample => spellcheck_test(
+ sample,
+ document => document.getElementById('parent').removeAttribute('contenteditable'),
+ '<div id="parent">zz.<div contenteditable>#zz#.</div>zz.</div>',
+ 'Removing "contenteditable" attribute on parent still keeps the spelling markers on child.')
+ });
+
+ spellcheck_test(
+ '<div contenteditable>zz.<div contenteditable id="child">|zz.</div>zz.</div>',
+ '',
+ '<div contenteditable>#zz#.<div contenteditable id="child">#zz#.</div>#zz#.</div>',
+ {
+ title: 'Setup for the initial markers.',
+ callback: sample => spellcheck_test(
+ sample,
+ document => document.getElementById('child').removeAttribute('contenteditable'),
+ '<div contenteditable>#zz#.<div id="child">#zz#.</div>#zz#.</div>',
+ 'Removing "contenteditable" attribute on child still keeps the spelling markers.')
+ });
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698