зеркало из https://github.com/mozilla/pjs.git
Bug 604737 - nsHTMLFieldSetElement::RemoveChildAt should update mFirstLegend. r=smaug a=blocking
This commit is contained in:
Родитель
d709a4ea24
Коммит
fd132db439
|
@ -216,13 +216,15 @@ nsHTMLFieldSetElement::RemoveChildAt(PRUint32 aIndex, PRBool aNotify,
|
|||
{
|
||||
bool firstLegendHasChanged = false;
|
||||
|
||||
if (GetChildAt(aIndex) == mFirstLegend) {
|
||||
if (mFirstLegend && (GetChildAt(aIndex) == mFirstLegend)) {
|
||||
// If we are removing the first legend we have to found another one.
|
||||
for (nsIContent* child = mFirstLegend; child;
|
||||
child = child->GetNextSibling()) {
|
||||
nsIContent* child = mFirstLegend->GetNextSibling();
|
||||
mFirstLegend = nsnull;
|
||||
firstLegendHasChanged = true;
|
||||
|
||||
for (; child; child = child->GetNextSibling()) {
|
||||
if (child->IsHTML(nsGkAtoms::legend)) {
|
||||
mFirstLegend = child;
|
||||
firstLegendHasChanged = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<fieldset disabled>
|
||||
<legend>
|
||||
<input>
|
||||
</legend>
|
||||
</fieldset>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,14 @@
|
|||
<!DOCTYPE html>
|
||||
<html class='reftest-wait'>
|
||||
<body onload="document.getElementsByTagName('fieldset')[0].removeChild(document.getElementById('l'));
|
||||
document.documentElement.className = '';">
|
||||
<fieldset disabled>
|
||||
<legend id='l'>
|
||||
<input>
|
||||
</legend>
|
||||
<legend>
|
||||
<input>
|
||||
</legend>
|
||||
</fieldset>
|
||||
</body>
|
||||
</html>
|
|
@ -1519,6 +1519,7 @@ fails-if(!haveTestPlugin) == 599476.html 599476-ref.html
|
|||
== 600045-1.html 600045-1-ref.html
|
||||
== 600803-1.html 600803-1-ref.html
|
||||
== 600974-1.html 600974-1-ref.html
|
||||
== 604737.html 604737-ref.html
|
||||
== 600974-2.html 600974-1-ref.html
|
||||
== 600974-3.html 600974-1-ref.html
|
||||
== 605157-1.xhtml 605157-1-ref.xhtml
|
||||
|
|
Загрузка…
Ссылка в новой задаче