Skip to content
This repository was archived by the owner on Jul 16, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/objectFitPolyfill.basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@
// TODO: Keep an eye on Edge to determine which version has full final support
var edgeVersion = window.navigator.userAgent.match(/Edge\/(\d{2})\./);
var edgePartialSupport = (edgeVersion) ? (parseInt(edgeVersion[1], 10) >= 16) : false;
var objectFitSupport = "objectFit" in document.documentElement.style !== false ||
"OObjectFit" in document.documentElement.style !== false;

// If the browser does support object-fit, we don't need to continue
if ("objectFit" in document.documentElement.style !== false && !edgePartialSupport) {
if (objectFitSupport && !edgePartialSupport) {
window.objectFitPolyfill = function() { return false };
return;
}
Expand Down
4 changes: 3 additions & 1 deletion src/objectFitPolyfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@
// TODO: Keep an eye on Edge to determine which version has full final support
var edgeVersion = window.navigator.userAgent.match(/Edge\/(\d{2})\./);
var edgePartialSupport = (edgeVersion) ? (parseInt(edgeVersion[1], 10) >= 16) : false;
var objectFitSupport = "objectFit" in document.documentElement.style !== false ||
"OObjectFit" in document.documentElement.style !== false;

// If the browser does support object-fit, we don't need to continue
if ("objectFit" in document.documentElement.style !== false && !edgePartialSupport) {
if (objectFitSupport && !edgePartialSupport) {
window.objectFitPolyfill = function() { return false };
return;
}
Expand Down