Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / pasteboard / style-from-rules.html
blobba7dd0e81828e10dcb43ff6f978ae15e72d27ec2
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <style type="text/css">
5 div { border: solid 1px; padding: 5px; margin: 5px; width: 20ex; }
6 .red { color: red; font-size: x-large; }
7 blockquote { margin: 0px; padding: 0px 0px 0px 2ex; border-left: solid 2px #06f; }
8 #copy em { font-style: normal; font-weight: bold; color: yellow; }
9 #container p { padding: 0px; margin: 1em 0px 1em 0px; background-color: blue;}
10 </style>
11 </head>
12 <body>
13 <p>This test ensures WebKit does not duplicate styles from matched rules in inline style declarations when copying and pasting contents.
14 To manually test, copy "hello world WebKit" and paste it in the box blow.
15 Each element should have exact properties stated in its title attribute</p>
16 <section id="container">
17 <div id="copy" contenteditable><blockquote title="none">hello</blockquote>
18 <p title="none"><span class="red" style="font-size: 1em; font-weight: bold;" title="font-size: 1em; font-weight: bold;">world</span>
19 <em style="color: blue;" title="font-weight: bold; color: blue;">WebKit</em></p></div>
20 <div id="paste" contenteditable></div>
21 </section>
22 <script src="../../resources/dump-as-markup.js"></script>
23 <script>
25 Markup.description(document.getElementsByTagName('p')[0].textContent);
26 Markup.dump('copy', 'Original');
28 document.getElementById('copy').focus();
29 document.execCommand('SelectAll', false, null);
31 function dump() { Markup.dump('paste', 'Pasted'); }
33 if (window.testRunner) {
34 document.execCommand('Copy', false, null);
35 document.getElementById('paste').focus();
36 document.execCommand('Paste', false, null);
37 dump();
38 document.getElementById('container').style.display = 'none';
39 } else
40 document.getElementById('paste').addEventListener('paste', function () { setTimeout(dump, 0); }, false);
42 </script>
43 </body>
44 </html>