Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / forms / textarea-set-defaultvalue-after-value.html
blobf85200252f28dda8bbeaa65cdc3ebc6f11bbf614
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <p id="description">Tests to check behaviors of dirty flag and defaultValue change.</p>
8 <div id="console"></div>
9 <form id=form>
10 <textarea name=textarea id=textarea>
11 default
12 </textarea>
13 </form>
15 <script>
16 var form = document.getElementById('form');
17 var textarea = document.getElementById('textarea');
19 // Dirty by execCommand(), then setDefaultValue().
20 textarea.focus();
21 textarea.select();
22 shouldBe('document.execCommand("InsertText", false, "user-updated"); textarea.value', '"user-updated"');
23 shouldBe('textarea.defaultValue = "default 2"; textarea.value', '"user-updated"');
24 shouldBe('form.reset(); textarea.value', '"default 2"');
25 shouldBe('textarea.defaultValue = "default 3"; textarea.value', '"default 3"');
27 // Dirty by setValue(), then setDefaultValue().
28 shouldBe('textarea.value = "script-updated"; textarea.value', '"script-updated"');
29 shouldBe('textarea.defaultValue = "default 4"; textarea.value', '"script-updated"');
30 shouldBe('form.reset(); textarea.value', '"default 4"');
32 // Dirty by setValue(), then update defaultValue by innerHTML.
33 shouldBe('textarea.value = "script-updated"; textarea.value', '"script-updated"');
34 shouldBe('textarea.innerHTML = "default 5"; textarea.value', '"script-updated"');
35 shouldBe('form.reset(); textarea.value', '"default 5"');
36 shouldBe('textarea.innerHTML = "default 6"; textarea.value', '"default 6"');
38 // Dirty by setValue(), then update defaultValue by DOM tree operations.
39 shouldBe('textarea.value = "script-updated"; textarea.value', '"script-updated"');
40 shouldBe('textarea.removeChild(textarea.firstChild); textarea.appendChild(document.createTextNode("default 5")); textarea.value', '"script-updated"');
41 shouldBe('form.reset(); textarea.value', '"default 5"');
42 shouldBe('textarea.removeChild(textarea.firstChild); textarea.appendChild(document.createTextNode("default 6")); textarea.value', '"default 6"');
43 form.innerHTML = '';
44 </script>
46 </body>
47 </html>