content/base/test/test_copypaste.xhtml

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

michael@0 1 <?xml version="1.0"?>
michael@0 2 <!--
michael@0 3 This test is copied from test_copypaste.html, but it's XHTML instead of HTML.
michael@0 4 XHTML is encoded differently from HTML when copied; see bugs 888839 and 723163.
michael@0 5 This test is different from test_copypaste.html in two ways:
michael@0 6
michael@0 7 1. The text/html clipboard flavor isn't tested, since nsCopySupport doesn't
michael@0 8 produce it for XHTML.
michael@0 9 2. The text/unicode flavor isn't tested when the selection is in hidden
michael@0 10 elements, since nsCopySupport doesn't produce text/plain for hidden
michael@0 11 elements, and unlike HTML, neither does it produce text/_moz_htmlcontext
michael@0 12 and text/_moz_htmlinfo, which the clipboard converts to text/unicode.
michael@0 13 -->
michael@0 14 <html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
michael@0 15 <head>
michael@0 16 <title>Test for copy/paste with XHTML</title>
michael@0 17 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
michael@0 18 <script type="text/javascript" src="copypaste.js"></script>
michael@0 19 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
michael@0 20 </head>
michael@0 21 <body>
michael@0 22 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=888839">Mozilla Bug 888839</a>
michael@0 23 <p id="display"></p>
michael@0 24 <div id="content" style="display: none">
michael@0 25 </div>
michael@0 26 <pre id="test">
michael@0 27 <script class="testbody" type="text/javascript">
michael@0 28 <![CDATA[
michael@0 29
michael@0 30 function modifySelectionDiv12() {
michael@0 31 modifySelection("X<b style='display:none'>Y</b>");
michael@0 32 }
michael@0 33
michael@0 34 SimpleTest.waitForExplicitFinish();
michael@0 35 addLoadEvent(function () testCopyPaste(true));
michael@0 36
michael@0 37 ]]>
michael@0 38 </script>
michael@0 39 </pre>
michael@0 40 <div>
michael@0 41
michael@0 42 <div id="draggable" title="title to have a long HTML line">This is a <em>draggable</em> bit of text.</div>
michael@0 43 <textarea id="input" cols="40" rows="10"></textarea>
michael@0 44
michael@0 45 <div id="alist">
michael@0 46 bla
michael@0 47 <ul>
michael@0 48 <li>foo</li>
michael@0 49 <li style="display: none;">baz</li>
michael@0 50 <li>bar</li>
michael@0 51 </ul>
michael@0 52 </div>
michael@0 53
michael@0 54 <div id="blist">
michael@0 55 mozilla
michael@0 56 <ol>
michael@0 57 <li>foo</li>
michael@0 58 <li style="display: none;">baz</li>
michael@0 59 <li>bar</li>
michael@0 60 </ol>
michael@0 61 </div>
michael@0 62
michael@0 63 <div id="clist">
michael@0 64 mzla
michael@0 65 <ul>
michael@0 66 <li>foo<ul>
michael@0 67 <li>bazzinga!</li>
michael@0 68 </ul></li>
michael@0 69 <li style="display: none;">baz</li>
michael@0 70 <li>bar</li>
michael@0 71 </ul>
michael@0 72 </div>
michael@0 73
michael@0 74 <div id="div4">
michael@0 75 T<textarea>t t t</textarea>
michael@0 76 </div>
michael@0 77
michael@0 78 <div id="div5">
michael@0 79 T<textarea> </textarea>
michael@0 80 </div>
michael@0 81
michael@0 82 <div id="div6" style="display:none"></div>
michael@0 83 <script>
michael@0 84 var x = $("div6")
michael@0 85 x.appendChild(document.createTextNode('di'))
michael@0 86 x.appendChild(document.createTextNode('v6'))
michael@0 87 </script>
michael@0 88
michael@0 89 <div id="div7" style="display:none">div7</div>
michael@0 90 <div id="div8" style="visibility:hidden">div8</div>
michael@0 91 <div style="visibility:hidden"><div id="div9" style="visibility:visible">div9</div></div>
michael@0 92 <div style="visibility:hidden"><div><div><div id="div10"></div></div></div></div>
michael@0 93 <script>
michael@0 94 var x = $("div10")
michael@0 95 x.appendChild(document.createTextNode('div'))
michael@0 96 x.appendChild(document.createTextNode('10'))
michael@0 97 </script>
michael@0 98
michael@0 99 <div id="div11" oncopy="modifySelection('X')"><span>div</span>11</div>
michael@0 100 <div id="div12" oncopy="modifySelectionDiv12()"><span>div</span>12</div>
michael@0 101
michael@0 102 <div id="div13">_<noscript>FAIL</noscript>_</div>
michael@0 103
michael@0 104 <table><tr id="tr1"><td>foo</td><td>bar</td></tr></table>
michael@0 105
michael@0 106 </div>
michael@0 107 </body>
michael@0 108 </html>

mercurial