mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 604737 - nsHTMLFieldSetElement::RemoveChildAt should update mFirstLegend. r=smaug a=blocking
This commit is contained in:
parent
e157dd74d7
commit
eb0b89befa
@ -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;
|
||||
}
|
||||
}
|
||||
|
10
layout/reftests/bugs/604737-ref.html
Normal file
10
layout/reftests/bugs/604737-ref.html
Normal file
@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<fieldset disabled>
|
||||
<legend>
|
||||
<input>
|
||||
</legend>
|
||||
</fieldset>
|
||||
</body>
|
||||
</html>
|
14
layout/reftests/bugs/604737.html
Normal file
14
layout/reftests/bugs/604737.html
Normal file
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user