summaryrefslogtreecommitdiffstats
path: root/layout/reftests/bugs/236539-1-ref.html
blob: 50b65d74a1c86698fce15a84b06d092a9baa304a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<html>
<head>
<script type="text/javascript">
var NumLine = 0

function maj(IDLine)
{

var newtr = document.createElement("tr")
newtr.setAttribute("id","tr"+IDLine)


var newtdselect = document.createElement("td")
var newselect = document.createElement("select")
newselect.setAttribute("id","HypothRank_"+IDLine)
newselect.setAttribute("name","HypothRank_"+IDLine)

for (i=1;i<=IDLine;i++)
 {

 var newoption = document.createElement("option")
 newoption.setAttribute("id",i)
 newoption.setAttribute("class","classoption1")
 if (i == IDLine)
  {
   newoption.setAttribute("selected","selected")
  }
 var newtxt = document.createTextNode(i)
 newoption.appendChild(newtxt)

 newselect.appendChild(newoption)
 }

if (i>2)
 { 
   for (j=1;j<=i-2;j++)
    {
     var newoption = document.createElement("option")
     newoption.setAttribute("class","classoption1")
     newoption.setAttribute("id",IDLine)
     var newtxt = document.createTextNode(i-1)
     newoption.appendChild(newtxt)
     document.getElementById("HypothRank_"+j).appendChild(newoption)
    }
 }

newtdselect.appendChild(newselect)
newtr.appendChild(newtdselect)

document.getElementById('letbody').appendChild(newtr)

NumLine++
}



function DeleteLine(IDLine)
{
for (i=1;i<=NumLine;i++)

 {
  if (i != IDLine)
    {
     noeud = document.getElementById("HypothRank_"+i)[IDLine-1]
     document.getElementById("HypothRank_"+i).removeChild(noeud)
     for (j=0;j<=NumLine-2;j++)
      {
       noeud = document.getElementById("HypothRank_"+i)[j]

       k=j+1
       noeud.setAttribute("id",k)

       if (k == NumLine)
         {
          noeud.setAttribute("selected","selected")
         }
       depart = 0
       taille = noeud.firstChild.nodeValue.length
       document.getElementById("HypothRank_"+i)[j].firstChild.replaceData(depart,taille,j+1)
      }
    }
 }


noeud = document.getElementById('tr'+IDLine)
document.getElementById('letbody').removeChild(noeud)

NumLine--

for (i=IDLine;i<=NumLine;i++)
 {
 k=i+1
 noeud = document.getElementById("tr"+k)
 noeud.setAttribute("id","tr"+i)

 noeud = document.getElementById("HypothRank_"+k)
 noeud.setAttribute("id","HypothRank_"+i)
 noeud.setAttribute("name","HypothRank_"+i) 

 noeud = document.getElementById("Hypoth_"+k)
 noeud.setAttribute("name","Hypoth_"+i)
 noeud.setAttribute("id","Hypoth_"+i)
 }


}

</script>
</head>

<body>
<form>
 <table border="1" id="latable">
  <thead></thead>
  <tfoot></tfoot>
  <tbody id="letbody"></tbody>
 </table>
</form>

<script>
  document.body.offsetWidth;
  maj(NumLine+1);
  document.body.offsetWidth;
  maj(NumLine+1);
  document.body.offsetWidth;
</script>

</body>
</html>