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
+ html , body : not ([foo ]) * {
25
+ padding-left : 10px ;
26
+ }
27
+ </ style >
28
+ </ body >
29
+ < dom-module id ="x-styled ">
30
+ < template >
31
+ < style >
32
+ : host {
33
+ dis play: block;
34
+ }
35
+ </ style >
36
+ < div id ="target "> </ div >
37
+ </ template >
38
+ </ dom-module >
39
+
40
+ < x-styled id ="target "> </ x-styled >
41
+
42
+ < script >
43
+ HTMLImports . whenReady ( function ( ) {
44
+ Polymer ( { is : 'x-styled' } ) ;
45
+ } ) ;
46
+ suite ( 'complicated custom style' , function ( ) {
47
+ var el , target ;
48
+ suiteSetup ( function ( ) {
49
+ el = document . querySelector ( 'x-styled#target' ) ;
50
+ target = el . $ . target ;
51
+ } ) ;
52
+ test ( 'complex selector' , function ( ) {
53
+ assert . equal ( getComputedStyle ( el ) . getPropertyValue ( 'border-top-width' ) . trim ( ) , '10px' ) ;
54
+ assert . equal ( getComputedStyle ( target ) . getPropertyValue ( 'border-top-width' ) . trim ( ) , '0px' ) ;
55
+ assert . equal ( getComputedStyle ( target ) . getPropertyValue ( 'color' ) . trim ( ) , 'rgb(123, 123, 123)' ) ;
56
+ } ) ;
57
+ test ( 'list of complex selectors' , function ( ) {
58
+ assert . equal ( getComputedStyle ( el ) . getPropertyValue ( 'padding-left' ) . trim ( ) , '10px' ) ;
59
+ assert . equal ( getComputedStyle ( target ) . getPropertyValue ( 'padding-left' ) . trim ( ) , '0px' ) ;
60
+ } ) ;
61
+ } )
62
+ </ script >
0 commit comments