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

Side by Side Diff: LayoutTests/fast/forms/form-attribute.html

Issue 1204353004: Fix form association behavior when a form and a control with form= are removed from a document toge… (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Don't add an assertion Created 5 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/fast/forms/form-attribute-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../../resources/js-test.js"></script> 4 <script src="../../resources/js-test.js"></script>
5 </head> 5 </head>
6 <body> 6 <body>
7 <p id="description"></p> 7 <p id="description"></p>
8 <div id="console"></div> 8 <div id="console"></div>
9 <script> 9 <script>
10 description("This test checks the form attribute of the form-associated elements ."); 10 description("This test checks the form attribute of the form-associated elements .");
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 shouldBe('inputElement.form', 'owner'); 173 shouldBe('inputElement.form', 'owner');
174 shouldBe('labelElement.form', 'owner'); 174 shouldBe('labelElement.form', 'owner');
175 container.removeChild(owner); 175 container.removeChild(owner);
176 shouldBe('inputElement.form', 'null'); 176 shouldBe('inputElement.form', 'null');
177 shouldBe('labelElement.form', 'null'); 177 shouldBe('labelElement.form', 'null');
178 container.appendChild(owner); 178 container.appendChild(owner);
179 shouldBe('inputElement.form', 'owner'); 179 shouldBe('inputElement.form', 'owner');
180 shouldBe('labelElement.form', 'owner'); 180 shouldBe('labelElement.form', 'owner');
181 181
182 debug(''); 182 debug('');
183 debug('- Check if a form and a control are disassociated when they are removed f rom the document together.');
184 container.innerHTML = '<div><input form=owner><form id=owner></form></div>';
185 owner = document.getElementById('owner');
186 shouldBe('owner.elements.length', '1');
187 container.firstChild.remove();
188 shouldBe('owner.elements.length', '0');
189
190 debug('');
183 debug('- Checks if option.form is only set if it has a &lt;select&gt; parent.'); 191 debug('- Checks if option.form is only set if it has a &lt;select&gt; parent.');
184 container.innerHTML = '<form id=firstOwner><option id=firstOption></option></for m>' + 192 container.innerHTML = '<form id=firstOwner><option id=firstOption></option></for m>' +
185 '<form id=secondOwner><optgroup><option id=secondOption></option></optgroup> </form>' + 193 '<form id=secondOwner><optgroup><option id=secondOption></option></optgroup> </form>' +
186 '<form id=thirdOwner><select><optgroup><option id=thirdOption></option></opt group></select></form>'; 194 '<form id=thirdOwner><select><optgroup><option id=thirdOption></option></opt group></select></form>';
187 var option1 = document.getElementById('firstOption'); 195 var option1 = document.getElementById('firstOption');
188 shouldBe('option1.form', 'null'); 196 shouldBe('option1.form', 'null');
189 var option2 = document.getElementById('secondOption'); 197 var option2 = document.getElementById('secondOption');
190 shouldBe('option2.form', 'null'); 198 shouldBe('option2.form', 'null');
191 owner = document.getElementById('thirdOwner'); 199 owner = document.getElementById('thirdOwner');
192 var option3 = document.getElementById('thirdOption'); 200 var option3 = document.getElementById('thirdOption');
193 shouldBe('option3.form', 'owner'); 201 shouldBe('option3.form', 'owner');
202
203 container.remove();
194 </script> 204 </script>
195 </body> 205 </body>
196 </html> 206 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/forms/form-attribute-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698