• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<!doctype html>
2<!--
3@license
4Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
5This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
6The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
7The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
8Code distributed by Google as part of the polymer project is also
9subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
10-->
11<script src="./test-flags.js"></script>
12<script src="https://unpkg.com/@webcomponents/webcomponentsjs@1/webcomponents-lite.js"></script>
13<script src="../custom-style-interface.min.js"></script>
14<script src="../node_modules/wct-browser-legacy/browser.js"></script>
15<script src="module/generated/make-element.js"></script>
16<script src="module/generated/custom-style-element.js"></script>
17<template id="my-element">
18  <style>
19    :host {
20      display: block;
21      --foo: rgb(255, 0, 0);
22    }
23    div {
24      color: var(--foo);
25    }
26  </style>
27  <div>Hi!</div>
28</template>
29<script>
30  suite('WC v1 compat', function() {
31    suiteSetup(function() {
32      makeElement('my-element');
33    });
34    test('element renders correctly', function() {
35      const el = document.createElement('my-element');
36      document.body.appendChild(el);
37      const color = getComputedStyle(el.shadowRoot.querySelector('div')).getPropertyValue('color').trim();
38      assert.equal(color, 'rgb(255, 0, 0)');
39      document.body.removeChild(el);
40    });
41  });
42</script>