|
656 | 656 | </script>
|
657 | 657 | </dom-module>
|
658 | 658 |
|
| 659 | +<style is="custom-style"> |
| 660 | +:root { |
| 661 | + /*--build: { |
| 662 | + color: inherit; |
| 663 | + }*/ |
| 664 | + --build_-_color: apply-shim-inherit; |
| 665 | +} |
| 666 | +x-built { |
| 667 | + color: rgb(123, 123, 123); |
| 668 | +} |
| 669 | +</style> |
| 670 | +<dom-module id="x-built"> |
| 671 | + <template> |
| 672 | + <style> |
| 673 | + #child { |
| 674 | + color: rgb(0, 0, 0); |
| 675 | + /* @apply --build */ |
| 676 | + color: var(--build_-_color, rgb(0, 0, 0)); |
| 677 | + } |
| 678 | + </style> |
| 679 | + <div id="child"></div> |
| 680 | + </template> |
| 681 | + <script> |
| 682 | + HTMLImports.whenReady(function() { |
| 683 | + Polymer({ |
| 684 | + is: 'x-built' |
| 685 | + }) |
| 686 | + }); |
| 687 | + </script> |
| 688 | +</dom-module> |
| 689 | + |
659 | 690 | <script>
|
660 | 691 | suite('scoped-styling-apply', function() {
|
661 | 692 | function assertComputed(element, value, property) {
|
|
851 | 882 | assertComputed(parent2.$.child, '0px');
|
852 | 883 | assertComputed(parent3.$.child, 'rgb(255, 0, 0)', 'color');
|
853 | 884 | assertComputed(parent3.$.child, '0px');
|
854 |
| - if (Polymer.Settings.useNativeCSSProperties && Polymer.Settings.useNativeShadow) { |
| 885 | + if (!stylesBuilt && Polymer.Settings.useNativeCSSProperties && Polymer.Settings.useNativeShadow) { |
| 886 | + // disable test if css build ran |
| 887 | + // the styles will have been preprocessed with all properties for the mixin |
855 | 888 | var parent1Text = getStyleText(parent1.$.child);
|
856 | 889 | var parent2Text = getStyleText(parent2.$.child);
|
857 | 890 | var parent3Text = getStyleText(parent3.$.child);
|
|
907 | 940 | assertComputed(e.$.child, 'rgb(0, 0, 0)', 'color');
|
908 | 941 | assertComputed(e.$.child, '0px');
|
909 | 942 | });
|
| 943 | + |
| 944 | + test('styleProperties can handle builds processed with applyShim w.r.t "inherit"', function() { |
| 945 | + if (navigator.userAgent.match(/Trident/)) { |
| 946 | + this.skip(); |
| 947 | + } |
| 948 | + var e = document.createElement('x-built'); |
| 949 | + document.body.appendChild(e); |
| 950 | + CustomElements.takeRecords(); |
| 951 | + assertComputed(e.$.child, 'rgb(123, 123, 123)', 'color'); |
| 952 | + }); |
910 | 953 | });
|
911 | 954 |
|
912 | 955 | </script>
|
|
0 commit comments