| 1 |
<!DOCTYPE html> |
| 2 |
<html class="reftest-wait"> |
| 3 |
<head> |
| 4 |
<title>Dynamic tests involving adding and removing elements</title> |
| 5 |
<meta charset="utf-8"/> |
| 6 |
<link rel="match" href="tablespacing-4-ref.html"/> |
| 7 |
</head> |
| 8 |
<body> |
| 9 |
<math> |
| 10 |
<mtable columnspacing="5em 7em" id="mtable0a"> |
| 11 |
<mtr id="mtr0"> |
| 12 |
<mtd> |
| 13 |
<mn>x</mn> |
| 14 |
</mtd> |
| 15 |
<mtd> |
| 16 |
<mn>y</mn> |
| 17 |
</mtd> |
| 18 |
</mtr> |
| 19 |
</mtable> |
| 20 |
</math> |
| 21 |
<p> |
| 22 |
<math> |
| 23 |
<mtable columnspacing="5em 7em"> |
| 24 |
<mtr id="mtr0a"> |
| 25 |
<mtd> |
| 26 |
<mn>x</mn> |
| 27 |
</mtd> |
| 28 |
<mtd id="mtd0"> |
| 29 |
<mn>y</mn> |
| 30 |
</mtd> |
| 31 |
<mtd> |
| 32 |
<mn>z</mn> |
| 33 |
</mtd> |
| 34 |
</mtr> |
| 35 |
</mtable> |
| 36 |
</math> |
| 37 |
<p> |
| 38 |
<math> |
| 39 |
<mtable rowspacing="2ex 4ex" id="mtable0"> |
| 40 |
<mtr> |
| 41 |
<mtd> |
| 42 |
<mn>x</mn> |
| 43 |
</mtd> |
| 44 |
</mtr> |
| 45 |
<mtr> |
| 46 |
<mtd> |
| 47 |
<mn>y</mn> |
| 48 |
</mtd> |
| 49 |
</mtr> |
| 50 |
</mtable> |
| 51 |
</math> |
| 52 |
<p> |
| 53 |
<math> |
| 54 |
<mtable rowspacing="2ex 4ex" id="mtable1"> |
| 55 |
<mtr> |
| 56 |
<mtd> |
| 57 |
<mn>x</mn> |
| 58 |
</mtd> |
| 59 |
</mtr> |
| 60 |
<mtr id="mtr1"> |
| 61 |
<mtd> |
| 62 |
<mn>y</mn> |
| 63 |
</mtd> |
| 64 |
</mtr> |
| 65 |
<mtr> |
| 66 |
<mtd> |
| 67 |
<mn>z</mn> |
| 68 |
</mtd> |
| 69 |
</mtr> |
| 70 |
</mtable> |
| 71 |
</math> |
| 72 |
<p> |
| 73 |
<math> |
| 74 |
<mtable rowspacing="2ex 4ex" columnspacing="4em"> |
| 75 |
<mtr id="mtr2"> |
| 76 |
<mtd> |
| 77 |
<mn>x</mn> |
| 78 |
</mtd> |
| 79 |
</mtr> |
| 80 |
<mtr> |
| 81 |
<mtd> |
| 82 |
<mn>y</mn> |
| 83 |
</mtd> |
| 84 |
</mtr> |
| 85 |
<mtr> |
| 86 |
<mtd> |
| 87 |
<mn>z</mn> |
| 88 |
</mtd> |
| 89 |
</mtr> |
| 90 |
</mtable> |
| 91 |
</math> |
| 92 |
<script> |
| 93 |
function doTest() { |
| 94 |
// Add a table cell |
| 95 |
var mn0 = document.createElementNS("http://www.w3.org/1998/Math/MathML", "mn"); |
| 96 |
mn0.innerHTML = 'z'; |
| 97 |
var mtd0 = document.createElementNS("http://www.w3.org/1998/Math/MathML", "mtd"); |
| 98 |
mtd0.appendChild(mn0); |
| 99 |
document.getElementById("mtr0").appendChild(mtd0); |
| 100 |
// Remove a table cell |
| 101 |
document.getElementById("mtr0a").removeChild(document.getElementById("mtd0")); |
| 102 |
// Add a table row |
| 103 |
var mn1 = document.createElementNS("http://www.w3.org/1998/Math/MathML", "mn"); |
| 104 |
mn1.innerHTML = 'z'; |
| 105 |
var mtd1 = document.createElementNS("http://www.w3.org/1998/Math/MathML", "mtd"); |
| 106 |
mtd1.appendChild(mn1); |
| 107 |
var mtr1 = document.createElementNS("http://www.w3.org/1998/Math/MathML", "mtr"); |
| 108 |
mtr1.appendChild(mtd1); |
| 109 |
document.getElementById("mtable0").appendChild(mtr1); |
| 110 |
// Remove a table row |
| 111 |
document.getElementById("mtable1").removeChild(document.getElementById("mtr1")); |
| 112 |
// Add a table cell to a table containing several rows |
| 113 |
var mn2 = document.createElementNS("http://www.w3.org/1998/Math/MathML", "mn"); |
| 114 |
mn2.innerHTML = 'w'; |
| 115 |
var mtd2 = document.createElementNS("http://www.w3.org/1998/Math/MathML", "mtd"); |
| 116 |
mtd2.appendChild(mn2); |
| 117 |
document.getElementById("mtr2").appendChild(mtd2); |
| 118 |
|
| 119 |
document.documentElement.removeAttribute("class"); |
| 120 |
} |
| 121 |
document.documentElement.addEventListener("TestRendered", doTest); |
| 122 |
</script> |
| 123 |
</body> |
| 124 |
</html> |