Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
correct test to work under native HTMLImports.
Browse files Browse the repository at this point in the history
  • Loading branch information
sorvell committed Jan 27, 2014
1 parent c6b006b commit b74b02c
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions test/html/styling/combinators.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,18 @@
chai.assert.equal(getComputedStyle(zot).color, 'rgb(255, 255, 255)',
'^^ styles are applied (color)');

var fooDiv = foo.shadowRoot.querySelector('.foo');
chai.assert.equal(getComputedStyle(fooDiv).backgroundColor, 'rgb(255, 165, 0)',
'combinators applied via style in main document');
if (window.ShadowDOMPolyfill) {
// NOTE: native import styles not shimmed under SD polyfill
if (window.ShadowDOMPolyfill && !HTMLImports.useNative) {
var fooDiv = foo.shadowRoot.querySelector('.foo');
var zotDiv = xZot.shadowRoot.querySelector('.zot-inner');
var fooDiv2 = foo.shadowRoot.querySelector('.foo2');
chai.assert.equal(getComputedStyle(fooDiv2).backgroundColor, 'rgb(0, 128, 0)',
'combinators applied via stylesheet in import');
chai.assert.equal(getComputedStyle(fooDiv).backgroundColor, 'rgb(255, 165, 0)',
'combinators applied via style in main document');
chai.assert.equal(getComputedStyle(zotDiv).backgroundColor, 'rgb(0, 0, 255)',
'combinators applied via stylesheet in main document');
}
var zotDiv = xZot.shadowRoot.querySelector('.zot-inner');
chai.assert.equal(getComputedStyle(zotDiv).backgroundColor, 'rgb(0, 0, 255)',
'combinators applied via stylesheet in main document');
done();
});
</script>
Expand Down

0 comments on commit b74b02c

Please sign in to comment.