Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | <!DOCTYPE HTML> |
michael@0 | 2 | <html><head> |
michael@0 | 3 | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
michael@0 | 4 | <title>Testcase for bug 448329</title> |
michael@0 | 5 | </head> |
michael@0 | 6 | <body> |
michael@0 | 7 | |
michael@0 | 8 | <iframe id="frame448329"></iframe> |
michael@0 | 9 | |
michael@0 | 10 | <script> |
michael@0 | 11 | |
michael@0 | 12 | function test448329(id,cmd) { |
michael@0 | 13 | |
michael@0 | 14 | var elm = document.getElementById(id); |
michael@0 | 15 | var doc = elm.contentDocument; |
michael@0 | 16 | doc.designMode = "On"; |
michael@0 | 17 | |
michael@0 | 18 | // Work around getSelection depending on a presshell but not flushing to get |
michael@0 | 19 | // one. |
michael@0 | 20 | doc.body.offsetWidth; |
michael@0 | 21 | var s = doc.defaultView.getSelection(); |
michael@0 | 22 | |
michael@0 | 23 | // Test document node |
michael@0 | 24 | if (s.rangeCount > 0) |
michael@0 | 25 | s.removeAllRanges(); |
michael@0 | 26 | var range = doc.createRange(); |
michael@0 | 27 | range.setStart(doc, 0); |
michael@0 | 28 | range.setEnd(doc, 0); |
michael@0 | 29 | s.addRange(range); |
michael@0 | 30 | doc.queryCommandIndeterm(cmd); |
michael@0 | 31 | |
michael@0 | 32 | // Test HTML node |
michael@0 | 33 | if (s.rangeCount > 0) |
michael@0 | 34 | s.removeAllRanges(); |
michael@0 | 35 | range = doc.createRange(); |
michael@0 | 36 | range.setStart(doc.documentElement, 0); |
michael@0 | 37 | range.setEnd(doc.documentElement, 0); |
michael@0 | 38 | s.addRange(range); |
michael@0 | 39 | doc.queryCommandIndeterm(cmd); |
michael@0 | 40 | |
michael@0 | 41 | // Test BODY node |
michael@0 | 42 | if (s.rangeCount > 0) |
michael@0 | 43 | s.removeAllRanges(); |
michael@0 | 44 | range = doc.createRange(); |
michael@0 | 45 | var body = doc.documentElement.childNodes[1]; |
michael@0 | 46 | range.setStart(body, 0); |
michael@0 | 47 | range.setEnd(body, 0); |
michael@0 | 48 | s.addRange(range); |
michael@0 | 49 | doc.queryCommandIndeterm(cmd); |
michael@0 | 50 | |
michael@0 | 51 | var text = doc.createTextNode("Hello Kitty"); |
michael@0 | 52 | body.insertBefore(text, null) |
michael@0 | 53 | |
michael@0 | 54 | // Test TEXT node |
michael@0 | 55 | if (s.rangeCount > 0) |
michael@0 | 56 | s.removeAllRanges(); |
michael@0 | 57 | range = doc.createRange(); |
michael@0 | 58 | range.setStart(text, 0); |
michael@0 | 59 | range.setEnd(text, 1); |
michael@0 | 60 | s.addRange(range); |
michael@0 | 61 | doc.queryCommandIndeterm(cmd); |
michael@0 | 62 | |
michael@0 | 63 | } |
michael@0 | 64 | |
michael@0 | 65 | test448329("frame448329", "backcolor") |
michael@0 | 66 | test448329("frame448329", "hilitecolor") |
michael@0 | 67 | |
michael@0 | 68 | </script> |
michael@0 | 69 | |
michael@0 | 70 | |
michael@0 | 71 | </body> |
michael@0 | 72 | </html> |