Skip to content

Commit 3e609b1

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 3e609b1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/apply-preserving-inline-style.js

+6
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
removeProperty: 1,
5656
setProperty: 1,
5757
};
58+
5859

5960
function configureProperty(object, property, descriptor) {
6061
descriptor.enumerable = true;
@@ -205,6 +206,11 @@
205206
var animatedStyle = new AnimatedCSSStyleDeclaration(element);
206207
try {
207208
configureProperty(element, 'style', { get: function() { return animatedStyle; } });
209+
210+
if (!element.style._set || !element.style._clear) {
211+
throw 'Couldnt configure property style.';
212+
}
213+
208214
} catch (_) {
209215
// iOS and older versions of Safari (pre v7) do not support overriding an element's
210216
// style object. Animations will clobber any inline styles as a result.

0 commit comments

Comments
 (0)