Index: third_party/WebKit/LayoutTests/fast/forms/form-attribute.html |
diff --git a/third_party/WebKit/LayoutTests/fast/forms/form-attribute.html b/third_party/WebKit/LayoutTests/fast/forms/form-attribute.html |
index cfe8bc142c0deae895f8478db3da96e2b055bdbb..d9fb65ad6b900e05d7ca3dc5c7de5e9e5bcf0afa 100644 |
--- a/third_party/WebKit/LayoutTests/fast/forms/form-attribute.html |
+++ b/third_party/WebKit/LayoutTests/fast/forms/form-attribute.html |
@@ -18,7 +18,7 @@ container.innerHTML = '<form id=owner></form>' + |
'<fieldset name=victim form=owner />' + |
'<input name=victim form=owner />' + |
'<keygen name=victim form=owner />' + |
- '<label name=victim form=owner />' + |
+ '<label name=victim form=owner></label>' + |
'<object name=victim form=owner></object>' + |
'<output name=victim form=owner />' + |
'<select name=victim form=owner />' + |
@@ -29,7 +29,7 @@ shouldBe('document.getElementsByTagName("button")[0].form', 'owner'); |
shouldBe('document.getElementsByTagName("fieldset")[0].form', 'owner'); |
shouldBe('document.getElementsByTagName("input")[0].form', 'owner'); |
shouldBe('document.getElementsByTagName("keygen")[0].form', 'owner'); |
-shouldBe('document.getElementsByTagName("label")[0].form', 'owner'); |
+shouldBeNull('document.getElementsByTagName("label")[0].form'); |
shouldBe('document.getElementsByTagName("object")[0].form', 'owner'); |
shouldBe('document.getElementsByTagName("output")[0].form', 'owner'); |
shouldBe('document.getElementsByTagName("select")[0].form', 'owner'); |
@@ -40,7 +40,7 @@ debug('- Ensures that the form attribute points the form owner even if the eleme |
container.innerHTML = '<form id=owner></form>' + |
'<form id=shouldNotBeOwner>' + |
' <input id=inputElement name=victim form=owner />' + |
- ' <label id=labelElement name=victim form=owner />' + |
+ ' <label id=labelElement name=victim for=inputElement />' + |
'</form>'; |
owner = document.getElementById('owner'); |
var inputElement = document.getElementById('inputElement'); |
@@ -69,9 +69,9 @@ var labelElement3 = document.getElementById('labelElement3'); |
shouldBe('inputElement1.form', 'owner'); |
shouldBe('inputElement2.form', 'owner'); |
shouldBe('inputElement3.form', 'owner'); |
-shouldBe('labelElement1.form', 'owner'); |
-shouldBe('labelElement2.form', 'owner'); |
-shouldBe('labelElement3.form', 'owner'); |
+shouldBeNull('labelElement1.form'); |
+shouldBeNull('labelElement2.form'); |
+shouldBeNull('labelElement3.form'); |
debug(''); |
debug('- Ensures that the form attribute points the form owner even if the form element is nested another form element.'); |
@@ -96,16 +96,15 @@ labelElement3 = document.getElementById('labelElement3'); |
shouldBe('inputElement1.form', 'owner'); |
shouldBe('inputElement2.form', 'owner'); |
shouldBe('inputElement3.form', 'owner'); |
-shouldBe('labelElement1.form', 'owner'); |
-shouldBe('labelElement2.form', 'owner'); |
-shouldBe('labelElement3.form', 'owner'); |
+shouldBeNull('labelElement1.form'); |
+shouldBeNull('labelElement2.form'); |
+shouldBeNull('labelElement3.form'); |
debug(''); |
debug('- Ensures whether the form owner is set correctly when the value of form attribute of a form-associated element changed.'); |
container.innerHTML = '<form id=form1></form>' + |
'<form id=form2></form>' + |
'<input id=inputElement name=victim form=form1 />' + |
- '<label id=labelElement name=victim form=form1 />' + |
'<object id=objectElement name=victim form=form1></object>'; |
var form1 = document.getElementById('form1'); |
var form2 = document.getElementById('form2'); |
@@ -114,12 +113,6 @@ shouldBe('inputElement.form', 'form1'); |
inputElement.attributes['form'].value = 'form2'; |
shouldBe('inputElement.form', 'form2'); |
-// HTMLabelElement has its own implementation of formAttr processing and so needs its own test. |
-labelElement = document.getElementById('labelElement'); |
-shouldBe('labelElement.form', 'form1'); |
-labelElement.attributes['form'].value = 'form2'; |
-shouldBe('labelElement.form', 'form2'); |
- |
// HTMLObjectElement has its own implementation of formAttr processing and so needs its own test. |
objectElement = document.getElementById('objectElement'); |
shouldBe('objectElement.form', 'form1'); |
@@ -130,7 +123,6 @@ debug(''); |
debug('- Ensures whether the form owner is set correctly when the value of form attribute is added/removed.'); |
container.innerHTML = '<form id=owner name=firstOwner></form>' + |
'<input id=inputElement name=victim />' + |
- '<label id=labelElement name=victim />' + |
'<object id=objectElement name=victim></object>'; |
owner = document.getElementById('owner'); |
inputElement = document.getElementById('inputElement'); |
@@ -141,14 +133,6 @@ shouldBe('inputElement.form', 'owner'); |
inputElement.removeAttribute('form'); |
shouldBe('inputElement.form', 'null'); |
-// HTMLLabelElement has its own implementation of formAttr processing and so needs its own test. |
-labelElement = document.getElementById('labelElement'); |
-shouldBe('labelElement.form', 'null'); |
-labelElement.setAttribute('form', 'owner'); |
-shouldBe('labelElement.form', 'owner'); |
-labelElement.removeAttribute('form'); |
-shouldBe('labelElement.form', 'null'); |
- |
// HTMLObjectElement has its own implementation of formAttr processing and so needs its own test. |
objectElement = document.getElementById('objectElement'); |
shouldBe('objectElement.form', 'null'); |
@@ -161,23 +145,18 @@ debug(''); |
debug('- Ensures whether the form owner is set correctly when the form owner is added/removed.'); |
container.innerHTML = '<form id=owner name=firstOwner></form>' + |
'<form id=owner name=secondOwner></form>' + |
- '<input id=inputElement name=victim form=owner />' + |
- '<label id=labelElement name=victim form=owner />'; |
+ '<input id=inputElement name=victim form=owner />'; |
owner = document.getElementById('owner'); |
shouldBeEqualToString('owner.name', 'firstOwner'); |
inputElement = document.getElementById('inputElement'); |
-labelElement = document.getElementById('labelElement'); |
container.removeChild(owner); |
owner = document.getElementById('owner'); |
shouldBeEqualToString('owner.name', 'secondOwner'); |
shouldBe('inputElement.form', 'owner'); |
-shouldBe('labelElement.form', 'owner'); |
container.removeChild(owner); |
shouldBe('inputElement.form', 'null'); |
-shouldBe('labelElement.form', 'null'); |
container.appendChild(owner); |
shouldBe('inputElement.form', 'owner'); |
-shouldBe('labelElement.form', 'owner'); |
debug(''); |
debug('- Check if a form and a control are disassociated when they are removed from the document together.'); |