mirror of
https://github.com/Polymer/polymer.git
synced 2024-07-07 04:43:03 -05:00
Fix Polymer.dom(el).attachShadow/shadowRoot
This commit is contained in:
parent
56756240fa
commit
2b0494a9c4
|
@ -441,7 +441,7 @@ if (window['ShadyDOM'] && window['ShadyDOM']['inUse'] && window['ShadyDOM']['noP
|
|||
forwardMethods(DomApiNative.prototype, [
|
||||
'cloneNode', 'appendChild', 'insertBefore', 'removeChild',
|
||||
'replaceChild', 'setAttribute', 'removeAttribute',
|
||||
'querySelector', 'querySelectorAll'
|
||||
'querySelector', 'querySelectorAll', 'attachShadow'
|
||||
]);
|
||||
|
||||
// Properties that should return the logical, not composed tree. Note, `classList`
|
||||
|
@ -451,7 +451,7 @@ if (window['ShadyDOM'] && window['ShadyDOM']['inUse'] && window['ShadyDOM']['noP
|
|||
'parentNode', 'firstChild', 'lastChild',
|
||||
'nextSibling', 'previousSibling', 'firstElementChild',
|
||||
'lastElementChild', 'nextElementSibling', 'previousElementSibling',
|
||||
'childNodes', 'children', 'classList'
|
||||
'childNodes', 'children', 'classList', 'shadowRoot'
|
||||
]);
|
||||
|
||||
forwardProperties(DomApiNative.prototype, [
|
||||
|
|
|
@ -415,6 +415,7 @@ suite('forwarded native api', function() {
|
|||
assert.isDefined(d.classList);
|
||||
assert.isDefined(d.textContent);
|
||||
assert.isDefined(d.innerHTML);
|
||||
assert.isDefined(d.shadowRoot);
|
||||
});
|
||||
|
||||
test('cloneNode', function() {
|
||||
|
@ -484,6 +485,12 @@ suite('forwarded native api', function() {
|
|||
assert.equal(query.length, 2);
|
||||
});
|
||||
|
||||
test('attachShadow', function() {
|
||||
const el = document.createElement('div');
|
||||
dom(el).attachShadow({mode: 'open'});
|
||||
assert.isDefined(el.shadowRoot);
|
||||
});
|
||||
|
||||
test('tree accessors', function() {
|
||||
const d1 = document.createElement('div');
|
||||
const d2 = document.createElement('div');
|
||||
|
|
Loading…
Reference in New Issue
Block a user