Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
Adapt to removal of ShadowDOM’s applyAuthorStyles flag.
Browse files Browse the repository at this point in the history
  • Loading branch information
sorvell committed Jan 27, 2014
1 parent 65d170c commit 67ac33e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
1 change: 0 additions & 1 deletion src/instance/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@
// make a shadow root
var root = this.createShadowRoot();
// migrate flag(s)
root.applyAuthorStyles = this.applyAuthorStyles;
root.resetStyleInheritance = this.resetStyleInheritance;
// stamp template
// which includes parsing and applying MDV bindings before being
Expand Down
9 changes: 3 additions & 6 deletions test/html/styling/apply-reset-styles.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,11 @@
<x-test></x-test>

<polymer-element name="x-test">
<template><div id="div">I should be small and green</div></template>
<template><div id="div">I should be small and black.</div></template>
<script>
Polymer('x-test', {
applyAuthorStyles: true,
resetStyleInheritance: true,
ready: function() {
this.appliedAuthorStyles = this.shadowRoot.applyAuthorStyles;
this.appliedResetStyles = this.shadowRoot.resetStyleInheritance;
}
});
Expand All @@ -46,11 +44,10 @@
return;
}
var test = document.querySelector('x-test');
chai.assert.isTrue(test.appliedAuthorStyles, 'applyAuthorStyles applied');
chai.assert.isTrue(test.appliedResetStyles, 'resetStyleInheritance applied');
chai.assert.equal(getComputedStyle(test).color, 'rgb(255, 0, 0)',
'author styles applied correctly');
chai.assert.equal(getComputedStyle(test.$.div).color, 'rgb(0, 255, 0)',
'styles properly inherited');
chai.assert.equal(getComputedStyle(test.$.div).color, 'rgb(0, 0, 0)',
'styles reset correctly');
chai.assert.notEqual(parseInt(getComputedStyle(test.$.div).fontSize), 100,
'styles reset correctly');
Expand Down

0 comments on commit 67ac33e

Please sign in to comment.