Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Orvell committed Feb 22, 2017
1 parent 2315547 commit 20de928
Show file tree
Hide file tree
Showing 5 changed files with 1,101 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/lib/style-util.html
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
for (var i=0, s; i < styles.length; i++) {
s = styles[i];
s.parentNode.insertBefore(
this._includesToFragment(s.getAttribute('include')), s.nextSibling);
this._includesToFragment(s.getAttribute('include')), s);
}
},

Expand All @@ -248,13 +248,14 @@
var s$ = source.querySelectorAll('style');
for (var i=0, s; i < s$.length; i++) {
s = s$[i];
if (s.textContent) {
frag.appendChild(s.cloneNode(true));
}
var include = s.getAttribute('include');
if (include) {
frag.appendChild(this._includesToFragment(include));
}
if (s.textContent) {
frag.appendChild(s.cloneNode(true));
}

}
},

Expand Down
1 change: 1 addition & 0 deletions test/runner.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
'unit/resolveurl.html',
'unit/css-parse.html',
'unit/styling-scoped.html',
'unit/preserve-style-include/styling-scoped.html',
'unit/styling-extends.html',
'unit/styling-remote.html',
'unit/styling-cross-scope-var.html',
Expand Down
4 changes: 4 additions & 0 deletions test/smoke/preserve-include.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
<style>
:host {
color: red;
--mixin: {
border: 2px solid tomato;
}
}
</style>
<style></style>
Expand Down Expand Up @@ -50,6 +53,7 @@
:host {
display: block;
background: green;
@apply --mixin;
}

</style>
Expand Down
Loading

0 comments on commit 20de928

Please sign in to comment.