1
+ <!doctype html>
2
+ <!--
3
+ @license
4
+ Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
5
+ This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
6
+ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
7
+ The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
8
+ Code distributed by Google as part of the polymer project is also
9
+ subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
10
+ -->
11
+ < html >
12
+ < head >
13
+ < meta charset ="utf-8 ">
14
+ < script src ="../../../webcomponentsjs/webcomponents-lite.js "> </ script >
15
+ < script src ="../../../web-component-tester/browser.js "> </ script >
16
+ < link rel ="import " href ="../../polymer.html ">
17
+ </ head >
18
+ < body >
19
+ < style is ="custom-style ">
20
+ html : not ([foo ]) * {
21
+ color : rgb (123 , 123 , 123 );
22
+ border : 10px solid black;
23
+ }
24
+ </ style >
25
+ </ body >
26
+ < dom-module id ="x-styled ">
27
+ < template >
28
+ < style >
29
+ : host {
30
+ dis play: block;
31
+ }
32
+ </ style >
33
+ < div id ="target "> </ div >
34
+ </ template >
35
+ </ dom-module >
36
+
37
+ < x-styled id ="target "> </ x-styled >
38
+
39
+ < script >
40
+ HTMLImports . whenReady ( function ( ) {
41
+ Polymer ( { is : 'x-styled' } ) ;
42
+ } ) ;
43
+ suite ( 'complicated custom style' , function ( ) {
44
+ test ( 'complicated selector' , function ( ) {
45
+ var el = document . querySelector ( 'x-styled#target' ) ;
46
+ var target = el . $ . target ;
47
+ assert . equal ( getComputedStyle ( el ) . getPropertyValue ( 'border-top-width' ) . trim ( ) , '10px' ) ;
48
+ assert . equal ( getComputedStyle ( target ) . getPropertyValue ( 'border-top-width' ) . trim ( ) , '0px' ) ;
49
+ assert . equal ( getComputedStyle ( target ) . getPropertyValue ( 'color' ) . trim ( ) , 'rgb(123, 123, 123)' ) ;
50
+ } )
51
+ } )
52
+ </ script >
0 commit comments