|
773 | 773 | </script> |
774 | 774 | </dom-module> |
775 | 775 |
|
| 776 | +<dom-module id="x-inherit"> |
| 777 | + <template> |
| 778 | + <style> |
| 779 | + :host { |
| 780 | + --border: inherit; |
| 781 | + border: var(--border, 10px solid black); |
| 782 | + } |
| 783 | + </style> |
| 784 | + </template> |
| 785 | + <script> |
| 786 | + HTMLImports.whenReady(function() { |
| 787 | + Polymer({ |
| 788 | + is: 'x-inherit' |
| 789 | + }) |
| 790 | + }); |
| 791 | + </script> |
| 792 | +</dom-module> |
| 793 | + |
| 794 | +<dom-module id="x-inherit-parent"> |
| 795 | + <template> |
| 796 | + <style> |
| 797 | + #child { |
| 798 | + --border: 5px solid blue; |
| 799 | + } |
| 800 | + </style> |
| 801 | + <x-inherit id="child"></x-inherit> |
| 802 | + </template> |
| 803 | + <script> |
| 804 | + HTMLImports.whenReady(function() { |
| 805 | + Polymer({ |
| 806 | + is: 'x-inherit-parent' |
| 807 | + }) |
| 808 | + }); |
| 809 | + </script> |
| 810 | +</dom-module> |
| 811 | + |
| 812 | +<dom-module id="x-initial"> |
| 813 | + <template> |
| 814 | + <style> |
| 815 | + :host { |
| 816 | + --border: initial; |
| 817 | + border: var(--border, 10px solid black); |
| 818 | + } |
| 819 | + </style> |
| 820 | + </template> |
| 821 | + <script> |
| 822 | + HTMLImports.whenReady(function() { |
| 823 | + Polymer({ |
| 824 | + is: 'x-initial' |
| 825 | + }) |
| 826 | + }); |
| 827 | + </script> |
| 828 | +</dom-module> |
| 829 | + |
776 | 830 | <script> |
777 | 831 | suite('scoped-styling-var', function() { |
778 | 832 |
|
|
1190 | 1244 | assertComputed(e, 'rgb(255, 0, 0)', null, 'background-color'); |
1191 | 1245 | assertComputed(e, '6px'); |
1192 | 1246 | }); |
| 1247 | + |
| 1248 | + test('"initial" as a custom property value works as expected', function() { |
| 1249 | + if (Polymer.Settings.useNativeCSSProperties) { |
| 1250 | + this.skip(); |
| 1251 | + } |
| 1252 | + var e = document.createElement('x-initial'); |
| 1253 | + document.body.appendChild(e); |
| 1254 | + CustomElements.takeRecords(); |
| 1255 | + assertComputed(e, '10px'); |
| 1256 | + }); |
| 1257 | + |
| 1258 | + test('"inherit" as a custom property value works as expected', function() { |
| 1259 | + if (Polymer.Settings.useNativeCSSProperties) { |
| 1260 | + this.skip(); |
| 1261 | + } |
| 1262 | + var e = document.createElement('x-inherit'); |
| 1263 | + document.body.appendChild(e); |
| 1264 | + CustomElements.takeRecords(); |
| 1265 | + assertComputed(e, '10px'); |
| 1266 | + |
| 1267 | + e = document.createElement('x-inherit-parent'); |
| 1268 | + document.body.appendChild(e); |
| 1269 | + CustomElements.takeRecords(); |
| 1270 | + assertComputed(e.$.child, '5px'); |
| 1271 | + }); |
1193 | 1272 | }); |
1194 | 1273 |
|
1195 | 1274 | </script> |
|
0 commit comments