Skip to content

Commit

Permalink
Merge pull request #1992 from Polymer/1786-kschaaf-domif-comments
Browse files Browse the repository at this point in the history
Ensure style exists. Fixes #1786.
  • Loading branch information
Steve Orvell committed Jul 6, 2015
2 parents 2c6c334 + 7886a62 commit ef82dbc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/template/dom-if.html
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@
var c$ = this._instance._children;
for (var i=0; i<c$.length; i++) {
var c = c$[i];
c.style.display = hidden ? 'none' : '';
if (c.style) {
c.style.display = hidden ? 'none' : '';
}
c._hideTemplateChildren = hidden;
}
}
Expand Down
6 changes: 6 additions & 0 deletions test/unit/dom-if-elements.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,19 @@
<dom-module id="x-nested-if">
<template>
<template is="dom-if" id="if-1" if="{{shouldStamp}}" on-dom-change="domUpdateHandler">
<!-- Comments should be good -->
<x-foo on-test1="testHandler1"
prop="{{prop}}"
item-prop="{{item.prop}}">
</x-foo>
<template is="dom-if" id="if-2" if="{{shouldStamp}}">
<!-- Comments should be good -->
<x-foo on-test2="testHandler2"
prop="{{prop}}"
item-prop="{{item.prop}}">
</x-foo>
<template is="dom-if" id="if-3" if="{{shouldStamp}}">
<!-- Comments should be good -->
<x-foo on-test3="testHandler3"
prop="{{prop}}"
item-prop="{{item.prop}}">
Expand Down Expand Up @@ -81,14 +84,17 @@
<dom-module id="x-nested-if-configured">
<template>
<template is="dom-if" id="if-1" if="{{shouldStamp}}">
<!-- Comments should be good -->
<x-foo prop="{{prop}}"
item-prop="{{item.prop}}">
</x-foo>
<template is="dom-if" id="if-2" if="{{shouldStamp}}">
<!-- Comments should be good -->
<x-foo prop="{{prop}}"
item-prop="{{item.prop}}">
</x-foo>
<template is="dom-if" id="if-3" if="{{shouldStamp}}">
<!-- Comments should be good -->
<x-foo prop="{{prop}}"
item-prop="{{item.prop}}">
</x-foo>
Expand Down

0 comments on commit ef82dbc

Please sign in to comment.