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

Side by Side Diff: third_party/WebKit/LayoutTests/shadow-dom/attach-shadow-safelist.html

Issue 2092703002: Support Custom Elements v1 in attachShadow (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Element.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src='../resources/testharness.js'></script> 2 <script src='../resources/testharness.js'></script>
3 <script src='../resources/testharnessreport.js'></script> 3 <script src='../resources/testharnessreport.js'></script>
4 <script> 4 <script>
5 'use strict'; 5 'use strict';
6 6
7 const safelist = ['custom-element', 7 const safelist = ['custom-element',
8 'article', 'aside', 'blockquote', 'body', 'div', 'footer', 8 'article', 'aside', 'blockquote', 'body', 'div', 'footer',
9 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 9 'h1', 'h2', 'h3', 'h4', 'h5', 'h6',
10 'header', 'nav', 'p', 'section', 'span']; 10 'header', 'nav', 'p', 'section', 'span'];
(...skipping 23 matching lines...) Expand all
34 // Okay to ignore when document.createElement fails 34 // Okay to ignore when document.createElement fails
35 return; 35 return;
36 } 36 }
37 ['open', 'closed'].forEach((mode) => { 37 ['open', 'closed'].forEach((mode) => {
38 assert_throws({name: 'NotSupportedError'}, () => { 38 assert_throws({name: 'NotSupportedError'}, () => {
39 element.attachShadow({mode: mode}); 39 element.attachShadow({mode: mode});
40 }), 'attachShadow should throw NotSupportdeError for ' + maybeTagName; 40 }), 'attachShadow should throw NotSupportdeError for ' + maybeTagName;
41 }); 41 });
42 }); 42 });
43 }, 'attachShadow should throw an exception for an element which is not in the sa felist'); 43 }, 'attachShadow should throw an exception for an element which is not in the sa felist');
44
45 test(() => {
46 class XFoo extends HTMLElement {
47 constructor() {
48 super();
49 }
50 }
51 window.customElements.define('x-foo', XFoo);
52 assert_true(new XFoo().attachShadow({mode: 'open'}) instanceof ShadowRoot);
53 }, 'attachShadow should not fail for Custom Elements v1.');
44 </script> 54 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698