diff --git a/test/wpt.test.js b/test/wpt.test.js index 429fe45d..43e09444 100644 --- a/test/wpt.test.js +++ b/test/wpt.test.js @@ -110,6 +110,38 @@ describe('local wpt test cases', () => { } }); + describe('css/css-scoping/host-defined.html', () => { + it('should match', () => { + const node = document.createElement('div'); + node.id = 'host'; + document.body.appendChild(node); + const root = node.attachShadow({ mode: 'open' }); + root.innerHTML = '
'; + const res = root.firstElementChild.matches(':host > div'); + assert.isTrue(res, 'result'); + }); + + it('should match', () => { + const node = document.createElement('div'); + node.id = 'host'; + document.body.appendChild(node); + const root = node.attachShadow({ mode: 'open' }); + root.innerHTML = '
'; + const res = root.firstElementChild.matches(':not(:defined) > div'); + assert.isTrue(res, 'result'); + }); + + it('should not match', () => { + const node = document.createElement('div'); + node.id = 'host'; + document.body.appendChild(node); + const root = node.attachShadow({ mode: 'open' }); + root.innerHTML = '
'; + const res = root.firstElementChild.matches(':defined > div'); + assert.isFalse(res, 'result'); + }); + }); + describe('css/css-scoping/host-dom-001.html', () => { it('should not match', () => { const node = document.createElement('div');