WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
Attachment #187812
testcase
text/html
2013-02-12 02:21:48 PST
1.39 KB
no flags
Details
<!doctype html> <html> <head> <title>testcase</title> <meta charset="utf-8"> <script type="text/javascript"> function findChildren() { var p = document.getElementById("p"); var t = "span elements:\n" for (var i = 0, l = p.children.length; i < l; i++) { t = t + p.children[i].textContent + ", " } t += "\n"; for (var el = p.firstElementChild; el; el = el.nextElementSibling) { t = t + el.textContent + ", " } document.getElementById("textarea").value = t; t += "\n\n"; var math = document.getElementById("math"); t += "mtext elements:\n" try { for (var i = 0, l = math.children.length; i < l; i++) { t = t + math.children[i].textContent + ", " } } catch(error) { t += error; } t += "\n"; t += "ElementChildCount=" + math.childElementCount; t += "\n"; for (var el = math.firstElementChild; el; el = el.nextElementSibling) { t = t + el.textContent + ", "; } document.getElementById("textarea").value = t; } </script> </head> <body onload="findChildren()"> <p id="p"><span>a</span><span>b</span><span>c</span><span>d</span></p> <math id="math"><mtext>e</mtext><mtext>f</mtext><mtext>g</mtext><mtext>h</mtext></math> <textarea id="textarea" cols="80" rows="10"></textarea> </body> </html>