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

Unified Diff: third_party/WebKit/LayoutTests/editing/spelling/remove_spelling_markers.html

Issue 2650183002: Remove spelling markers when element is not editable (Closed)
Patch Set: Add Mac and Windows baselines 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/remove_spelling_markers.html
diff --git a/third_party/WebKit/LayoutTests/editing/spelling/remove_spelling_markers.html b/third_party/WebKit/LayoutTests/editing/spelling/remove_spelling_markers.html
new file mode 100644
index 0000000000000000000000000000000000000000..efeeda957e5f164497a4b8349bdbfd888e926f7b
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/editing/spelling/remove_spelling_markers.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
yosin_UTC9 2017/01/25 02:31:41 Could you use spellcheckTest[1] to avoid pixel ref
Xiaocheng 2017/01/25 02:56:57 Yeah, please use spellcheck_test. You may follow (
Manuel Rego 2017/01/25 08:03:10 I already tried to use spellcheck_test without suc
Xiaocheng 2017/01/25 08:28:36 Blink's spell checker works asynchronously, so spe
Manuel Rego 2017/01/25 09:10:21 @Xiaocheng: Thank you very much, this indeed fixed
+<div id="warning" style="color: red;">
+This test requires window.internals. If you use content_shell,
+"--expose-internals-for-testing" command flag enables it.
+</div>
+<script>
+ if (window.internals)
+ document.getElementById("warning").style.display = "none";
+</script>
+
+<p>
+The test checks that removing "contenteditable" from an element,
+also removes the spelling markers.
+It passes if you don't see any spelling marker in the following text.
+</p>
+<div id="wrapper" contenteditable=true>
+ <span id="grammar">some</span> <span id="spell">mispelllled</span> text.
+</div>
+<script>
+ var rangeGrammar = document.createRange();
+ var grammar = document.getElementById("grammar");
+ rangeGrammar.setStart(grammar, 0);
+ rangeGrammar.setEnd(grammar, 1);
+ var rangeSpell = document.createRange();
+ var spell = document.getElementById("spell");
+ rangeSpell.setStart(spell, 0);
+ rangeSpell.setEnd(spell, 1);
+ if (window.internals) {
+ internals.setMarker(document, rangeGrammar, 'grammar');
+ internals.setMarker(document, rangeSpell, 'spelling');
+ }
+ var wrapper = document.getElementById("wrapper");
+ wrapper.removeAttribute("contenteditable");
+</script>

Powered by Google App Engine
This is Rietveld 408576698