Skip to content

Commit

Permalink
Merge pull request #3341 from Polymer/add-style-shim-flaw-test
Browse files Browse the repository at this point in the history
add test for 3326
  • Loading branch information
Steve Orvell committed Jan 27, 2016
2 parents 3d2cb71 + 854fdbf commit 5d17efc
Showing 1 changed file with 33 additions and 2 deletions.
35 changes: 33 additions & 2 deletions test/unit/styling-cross-scope-var.html
Original file line number Diff line number Diff line change
Expand Up @@ -474,13 +474,36 @@
</script>
</dom-module>

<style>
.variable-override {
border-top-width: 10px;
}
</style>

<dom-module id="x-variable-override">
<template>
<style>
:host {
--b: 2px solid black;
display: block;
border: var(--b);
}
</style>
</template>
<script>
Polymer({
is: 'x-variable-override'
});
</script>
</dom-module>

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

function assertComputed(element, value, pseudo) {
var name = 'border-top-width';
var computed = element.getComputedStyleValue && !pseudo ?
element.getComputedStyleValue(name) :
var computed = element.getComputedStyleValue && !pseudo ?
element.getComputedStyleValue(name) :
getComputedStyle(element, pseudo)[name];
assert.equal(computed, value, 'computed style incorrect');
}
Expand Down Expand Up @@ -675,6 +698,14 @@
assertComputed(styled.$.endTerm, '19px');
});

// skip for now, until #3326 is fixed
test.skip('custom style class overrides css variable', function() {
var d = document.createElement('x-variable-override');
d.classList.add('variable-override');
document.body.appendChild(d);
assertComputed(d, '10px');
});

// TODO(sorvell): fix for #1761 was reverted; include test once this issue is addressed
// test('var values can be overridden by subsequent concrete properties', function() {
// assertComputed(styled.$.overridesConcrete, '4px');
Expand Down

0 comments on commit 5d17efc

Please sign in to comment.