Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(282)

Side by Side Diff: third_party/WebKit/LayoutTests/imported/wpt/custom-elements/reactions/Selection.html

Issue 2446483002: Import wpt@c5a14f553cba5f197743b9af605a84eddd8692a2 (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698