Skip to content

Commit 72b7ed9

Browse files
committed
When running on PhantomJS, the Object.defineProperty method doesn't work 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.
1 parent c69e141 commit 72b7ed9

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
"karma-sauce-launcher": "~0.2.3",
3838
"grunt-checkrepo": "~0.1.0",
3939
"grunt-saucelabs": "~4.0.2",
40-
"grunt-checkrepo": "~0.1.0",
4140
"grunt-git-status": "~1.0.0",
4241
"grunt-template": "~0.2.3",
4342
"source-map": "~0.1.40"

src/apply-preserving-inline-style.js

+5
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,11 @@
205205
var animatedStyle = new AnimatedCSSStyleDeclaration(element);
206206
try {
207207
configureProperty(element, 'style', { get: function() { return animatedStyle; } });
208+
209+
if (!element.style._set || !element.style._clear) {
210+
throw 'Couldnt configure property style.';
211+
}
212+
208213
} catch (_) {
209214
// iOS and older versions of Safari (pre v7) do not support overriding an element's
210215
// style object. Animations will clobber any inline styles as a result.

0 commit comments

Comments
 (0)