OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <title>Custom Elements: CEReactions on Selection interface</title> |
| 5 <meta name="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"> |
| 6 <meta name="assert" content="deleteFromDocument of Selection interface must have
CEReactions"> |
| 7 <meta name="help" content="http://w3c.github.io/selection-api/#selection-interfa
ce"> |
| 8 <script src="/resources/testharness.js"></script> |
| 9 <script src="/resources/testharnessreport.js"></script> |
| 10 <script src="../resources/custom-elements-helpers.js"></script> |
| 11 <script src="./resources/reactions.js"></script> |
| 12 </head> |
| 13 <body> |
| 14 <div id="log"></div> |
| 15 <script> |
| 16 |
| 17 testNodeDisconnector(function (customElement, window) { |
| 18 let selection = window.getSelection(); |
| 19 let parent = customElement.parentNode; |
| 20 |
| 21 // WebKit and Blink "normalizes" selection in selectAllChildren and not sele
ct the empty customElement. |
| 22 // Workaround this orthogonal non-standard behavior by inserting text nodes
around the custom element. |
| 23 parent.prepend(document.createTextNode('start')); |
| 24 parent.append(document.createTextNode('end')); |
| 25 |
| 26 selection.selectAllChildren(parent); |
| 27 selection.deleteFromDocument(); |
| 28 }, 'deleteFromDocument on Selection'); |
| 29 |
| 30 </script> |
| 31 </body> |
| 32 </html> |
OLD | NEW |