diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /dom/html/test/test_bug674927.html | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'dom/html/test/test_bug674927.html')
-rw-r--r-- | dom/html/test/test_bug674927.html | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/dom/html/test/test_bug674927.html b/dom/html/test/test_bug674927.html new file mode 100644 index 000000000..92af59453 --- /dev/null +++ b/dom/html/test/test_bug674927.html @@ -0,0 +1,55 @@ +<!DOCTYPE html> +<!-- +https://bugzilla.mozilla.org/show_bug.cgi?id=674927 +--> +<title>Test for Bug 674927</title> +<script src="/tests/SimpleTest/SimpleTest.js"></script> +<link rel="stylesheet" href="/tests/SimpleTest/test.css"/> +<p><span>Hello</span></p> +<div contenteditable>Contenteditable <i>is</i> splelchecked by default</div> +<textarea>Textareas are spellchekced by default</textarea> +<input value="Inputs are not spellcheckde by default"> +<script> +// Test the effect of setting spellcheck on various elements +[ + "html", + "body", + "p", + "span", + "div", + "i", + "textarea", + "input", +].forEach(function(query) { + var element = document.querySelector(query); + + // First check what happens if no attributes are set + var defaultSpellcheck; + if (element.isContentEditable || element.tagName == "TEXTAREA") { + defaultSpellcheck = true; + } else { + defaultSpellcheck = false; + } + is(element.spellcheck, defaultSpellcheck, + "Default spellcheck for <" + element.tagName.toLowerCase() + ">"); + + // Now try setting spellcheck on ancestors + var ancestor = element; + do { + testSpellcheck(ancestor, element); + ancestor = ancestor.parentNode; + } while (ancestor.nodeType == Node.ELEMENT_NODE); +}); + +function testSpellcheck(ancestor, element) { + ancestor.spellcheck = true; + is(element.spellcheck, true, + ".spellcheck on <" + element.tagName.toLowerCase() + "> with " + + "spellcheck=true on <" + ancestor.tagName.toLowerCase() + ">"); + ancestor.spellcheck = false; + is(element.spellcheck, false, + ".spellcheck on <" + element.tagName.toLowerCase() + "> with " + + "spellcheck=false on <" + ancestor.tagName.toLowerCase() + ">"); + ancestor.removeAttribute("spellcheck"); +} +</script> |