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

Commit

Permalink
- Added IE8 compatibility
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Schepp Schaefer <schaepp@gmx.de>
  • Loading branch information
Schepp committed Nov 22, 2013
1 parent f4f3689 commit 26dfbe9
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions polyfill.object-fit.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
var defaultComputedStyle = this.getComputedStyle(defaultElement, iframe.contentWindow);

for (var property in defaultComputedStyle) {
var value = defaultComputedStyle.getPropertyValue(property);
var value = defaultComputedStyle.getPropertyValue ? defaultComputedStyle.getPropertyValue(property) : defaultComputedStyle[property];
if (value !== null) {
switch (property) {
default:
Expand All @@ -66,7 +66,7 @@

objectFit.getMatchedStyle = function(element, property){
// element property has highest priority
var val = element.style.getPropertyValue(property);
var val = element.style.getPropertyValue ? element.style.getPropertyValue(property) : element.currentStyle[property];

// if it's important, we are done
if (val !== null) return val;
Expand Down
2 changes: 1 addition & 1 deletion tests/index-contain.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<style>
img {
width: 100%;
height: 35rem;
height: 35em;

margin: 10px 0;
border: 5px solid red;
Expand Down
2 changes: 1 addition & 1 deletion tests/index-cover.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<style>
img {
width: 100%;
height: 35rem;
height: 35em;

margin: 10px 0;
border: 5px solid red;
Expand Down
2 changes: 1 addition & 1 deletion tests/index-fill.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<style>
img {
width: 100%;
height: 35rem;
height: 35em;

margin: 10px 0;
border: 5px solid red;
Expand Down
2 changes: 1 addition & 1 deletion tests/index-none.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<style>
img {
width: 100%;
height: 35rem;
height: 35em;

margin: 10px 0;
border: 5px solid red;
Expand Down

0 comments on commit 26dfbe9

Please sign in to comment.