Skip to content

Commit

Permalink
When running on PhantomJS, the Object.defineProperty method doesn't w…
Browse files Browse the repository at this point in the history
…ork for every element, prints a log on console and doesn't throw an exception. So now it checks for the change, and forces an exception.
  • Loading branch information
pedrolauro committed Sep 20, 2017
1 parent c69e141 commit 72b7ed9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
"karma-sauce-launcher": "~0.2.3",
"grunt-checkrepo": "~0.1.0",
"grunt-saucelabs": "~4.0.2",
"grunt-checkrepo": "~0.1.0",
"grunt-git-status": "~1.0.0",
"grunt-template": "~0.2.3",
"source-map": "~0.1.40"
Expand Down
5 changes: 5 additions & 0 deletions src/apply-preserving-inline-style.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,11 @@
var animatedStyle = new AnimatedCSSStyleDeclaration(element);
try {
configureProperty(element, 'style', { get: function() { return animatedStyle; } });

if (!element.style._set || !element.style._clear) {
throw 'Couldnt configure property style.';
}

} catch (_) {
// iOS and older versions of Safari (pre v7) do not support overriding an element's
// style object. Animations will clobber any inline styles as a result.
Expand Down

0 comments on commit 72b7ed9

Please sign in to comment.