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

Side by Side Diff: third_party/WebKit/LayoutTests/custom-elements/clone-contenteditable.html

Issue 2097463002: Add backup element queue to CustomElementReactionStack (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: dominicc review Created 4 years, 5 months 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 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script>
4 <div id=editor contenteditable><x-x>aa</x-x></div>
5 <script>
6 'use strict';
7
8 promise_test(function () {
9 let constructCount = 0;
10 customElements.define('x-x', class extends HTMLElement {
11 constructor() {
12 super();
13 constructCount++;
14 }
15 });
16
17 assert_equals(constructCount, 1, 'define() should run constructor');
18
19 let element = editor.firstElementChild;
20 element.focus();
21 let selection = getSelection();
22 selection.collapse(element.firstChild, 1);
23
24 eventSender.keyDown('\r');
25
26 // Backup queue runs in a microtask, so schedule the assertions after that.
27 return new Promise(resolve => {
28 resolve();
29 }).then(() => {
30 assert_equals(document.getElementsByTagName('x-x').length, 2, 'Enter key sho uld clone the element');
31 assert_equals(constructCount, 2, 'clone should run constructor');
32 });
33 }, 'clone-a-node in contentedtiable');
dominicc (has gone to gerrit) 2016/06/29 07:19:54 spelling, editable
34 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698