|
131 | 131 | </template>
|
132 | 132 | </test-fixture>
|
133 | 133 |
|
| 134 | + <script> |
| 135 | + addEventListener('WebComponentsReady', () => { |
| 136 | + class OtherElement extends Polymer.Element {} |
| 137 | + customElements.define('other-element', OtherElement); |
| 138 | + }); |
| 139 | + </script> |
| 140 | + |
| 141 | + <dom-module id="x-complicated"> |
| 142 | + <template> |
| 143 | + <style> |
| 144 | + #direct:dir(rtl) { |
| 145 | + border: 10px solid black; |
| 146 | + } |
| 147 | + :dir(rtl) #indirect { |
| 148 | + border: 9px solid black; |
| 149 | + } |
| 150 | + other-element:dir(rtl) { |
| 151 | + border: 8px solid black; |
| 152 | + } |
| 153 | + #container:dir(rtl) ::slotted(*) { |
| 154 | + border: 7px solid black; |
| 155 | + } |
| 156 | + </style> |
| 157 | + <div id="direct"></div> |
| 158 | + <div id="indirect"></div> |
| 159 | + <other-element id="other"></other-element> |
| 160 | + <div id="container"> |
| 161 | + <slot></slot> |
| 162 | + </div> |
| 163 | + </template> |
| 164 | + <script> |
| 165 | + addEventListener('WebComponentsReady', () => { |
| 166 | + class XComplicated extends Polymer.DirMixin(Polymer.Element) { |
| 167 | + static get is() {return 'x-complicated'} |
| 168 | + } |
| 169 | + customElements.define(XComplicated.is, XComplicated); |
| 170 | + }) |
| 171 | + </script> |
| 172 | + </dom-module> |
| 173 | + |
| 174 | + <test-fixture id="complicated"> |
| 175 | + <template> |
| 176 | + <x-complicated> |
| 177 | + <div></div> |
| 178 | + </x-complicated> |
| 179 | + </template> |
| 180 | + </test-fixture> |
| 181 | + |
134 | 182 | <script>
|
135 | 183 | function assertComputed(node, expected, property = 'border-top-width') {
|
136 | 184 | let actual = getComputedStyle(node).getPropertyValue(property).trim();
|
|
195 | 243 | let el = fixture('legacy');
|
196 | 244 | assertComputed(el, '2px');
|
197 | 245 | });
|
| 246 | + |
| 247 | + test('complicated setup', function() { |
| 248 | + let el = fixture('complicated'); |
| 249 | + assertComputed(el.$.direct, '10px'); |
| 250 | + assertComputed(el.$.indirect, '9px'); |
| 251 | + assertComputed(el.$.other, '8px'); |
| 252 | + assertComputed(el.firstElementChild, '7px'); |
| 253 | + }); |
198 | 254 | });
|
199 | 255 | </script>
|
200 | 256 | </body>
|
|
0 commit comments