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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/forms/legend/legend-form.html

Issue 1528823002: Move tests related to <fieldset> and <legend> to fast/forms/fieldset. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
OLDNEW
(Empty)
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <script>
8 description("This test checks the form attribute of the legend element.");
9
10 var container = document.createElement('div');
11 document.body.appendChild(container);
12
13 debug('');
14 debug('- Ensures that the form attribute of legend element depends on whether it s parent is a fieldset element or not.');
15 container.innerHTML = '<form id=owner>' +
16 ' <fieldset><legend id=legendElement1 name=victim /></fieldset>' +
17 ' <legend id=legendElement2 name=victim />' +
18 ' <fieldset><div><legend id=legendElement3 name=victim /></div></fieldset >' +
19 '</form>';
20 owner = document.getElementById('owner');
21 var legendElement1 = document.getElementById('legendElement1');
22 var legendElement2 = document.getElementById('legendElement2');
23 shouldBe('legendElement1.form', 'owner');
24 shouldBe('legendElement2.form', 'null');
25 shouldBe('legendElement3.form', 'null');
26
27 debug('');
28 debug('- Ensures that the legend\'s form attribute points its parent fieldset\'s form owner even if the element is within another form element.');
29 container.innerHTML = '<form id=owner></form>' +
30 '<form id=shouldNotBeOwner>' +
31 ' <fieldset id=fieldsetElement name=victim form=owner>' +
32 ' <legend id=legendElement name=victim />' +
33 ' </fieldset>' +
34 '</form>';
35 owner = document.getElementById('owner');
36 var inputElement = document.getElementById('fieldsetElement');
37 var labelElement = document.getElementById('legendElement');
38 shouldBe('fieldsetElement.form', 'owner');
39 shouldBe('legendElement.form', 'owner');
40
41 debug('');
42 debug('- Ensures whether the form owner is set correctly for the legend when the value of form attribute of its parent fieldset changed.');
43 container.innerHTML = '<form id=form1></form>' +
44 '<form id=form2></form>' +
45 '<fieldset id=fieldsetElement name=victim form=form1>' +
46 ' <legend id=legendElement />' +
47 '</fieldset>';
48 var form1 = document.getElementById('form1');
49 var form2 = document.getElementById('form2');
50 fieldsetElement = document.getElementById('fieldsetElement');
51 legendElement = document.getElementById('legendElement');
52 shouldBe('fieldsetElement.form', 'form1');
53 shouldBe('legendElement.form', 'form1');
54 fieldsetElement.attributes['form'].value = 'form2';
55 shouldBe('fieldsetElement.form', 'form2');
56 shouldBe('legendElement.form', 'form2');
57
58 </script>
59 </body>
60 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698