Skip to content

Commit

Permalink
add reduced test case
Browse files Browse the repository at this point in the history
  • Loading branch information
dfreedm committed Jun 21, 2016
1 parent 4ebec15 commit 26fe9b9
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/smoke/css-gradient-var.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<title>CSS Gradient in variable</title>
<script>Polymer={useNativeCSSProperties: true, lazyRegister: true}</script>
<!-- <script>Polymer={useNativeCSSProperties: true, lazyRegister: true}</script> -->
<link rel="import" href="../../polymer.html">
</head>
<body>
Expand All @@ -18,10 +18,13 @@
<template>
<style>
:host {
--color1: 123;
--color2: 321;
--color3: 231;
display: block;
height: 100px;
width: 100px;
color: var(--undefined, rgb(123, 321, 231));
color: var(--undefined, rgb(var(--color1), var(--color2), var(--color3)));
background: var(--fx-webkit-background, -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,0,0,.65)), color-stop(100%,rgba(0,0,255,.65))));
border-width: calc(var(--a) + var(--b));
border-color: brown;
Expand Down
27 changes: 27 additions & 0 deletions test/unit/styling-cross-scope-var.html
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,28 @@
</script>
</dom-module>

<dom-module id="x-super-complex">
<template>
<style>
:host {
--color1: 102;
--color2: 205;
--color3: 170;
display: block;
color: var(--undefined, rgb(var(--color1), var(--color2), var(--color3)));
}
</style>
<div>Should be mediumaquamarine</div>
</template>
<script>
HTMLImports.whenReady(function() {
Polymer({
is: 'x-super-complex'
});
});
</script>
</dom-module>

<script>
suite('scoped-styling-var', function() {

Expand Down Expand Up @@ -1060,6 +1082,11 @@
assertComputed(e, '0px');
});

test('complex fallback for variables work as expected', function() {
var e = document.createElement('x-super-complex');
document.body.appendChild(e);
assertComputed(e, 'rgb(102, 205, 170)', null, 'color');
});
});

</script>
Expand Down

0 comments on commit 26fe9b9

Please sign in to comment.