Skip to content

Commit

Permalink
add test for style elements in an element declared in the main docume…
Browse files Browse the repository at this point in the history
…nt + freshen
  • Loading branch information
sorvell committed Jun 13, 2013
1 parent a246dd4 commit f741201
Show file tree
Hide file tree
Showing 8 changed files with 559 additions and 69 deletions.
10 changes: 5 additions & 5 deletions polymer.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion polymer.min.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions polymer.native.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion polymer.native.min.js.map

Large diffs are not rendered by default.

566 changes: 508 additions & 58 deletions polymer.sandbox.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion polymer.sandbox.min.js.map

Large diffs are not rendered by default.

39 changes: 39 additions & 0 deletions test/html/styling/sheet-main-doc.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!DOCTYPE html>
<!--
Copyright 2013 The Polymer Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
-->
<html>
<head>
<meta name="viewport" content="initial-scale=1.0">
<title>loading sheets in elements defined in main document</title>
<script src="../../../polymer.js"></script>
<script src="../../../tools/test/htmltest.js"></script>
<script src="../../../node_modules/chai/chai.js"></script>
</head>
<body>
<x-foo></x-foo>
<div class="red1">red</div>
<element name="x-foo">
<link rel="stylesheet" polymer-scope="global" href="sheet1.css">
<link rel="stylesheet" href="sheet1.css">
<template>
<div id="div" class="red1">Red</div>
</template>
<script>Polymer.register(this);</script>
</element>
<script>
document.addEventListener('WebComponentsReady', function() {
var foo = document.querySelector('x-foo');
var color = 'rgb(255, 0, 0)';
chai.assert.equal(getComputedStyle(foo.$.div).backgroundColor, color,
'computed color matches expected color');

chai.assert.equal(getComputedStyle(foo.$.div).backgroundColor, color,
'computed color matches expected color');
done();
});
</script>
</body>
</html>
1 change: 1 addition & 0 deletions test/js/styling.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ htmlSuite('styling', function() {
htmlTest('html/styling/sheet-order.html?shadow');
htmlTest('html/styling/polyfill-directive.html?shadow');
htmlTest('html/styling/pseudo-scoping.html?shadow');
htmlTest('html/styling/sheet-main-doc.html');
});

0 comments on commit f741201

Please sign in to comment.