Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle object-fit gracefully for older browsers. #12

Merged
merged 1 commit into from
Nov 30, 2018

Conversation

sparhami
Copy link

This fixes an Error being thrown in IE since it does not support object-fit.

This fixes an Error being thrown in IE since it does not support object-fit.
case null:
// For browsers that do not support `object-fit`, default to `fill`
// behavior.
return getDimensionsForObjectFitFill(containerSize);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this just also be the default case?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed off-line, we do not want a default case as the error throwing can be useful if a new object-fit property is added that we do not support.

@sparhami sparhami merged commit 6475017 into ampproject:master Nov 30, 2018
@sparhami sparhami deleted the ie branch November 30, 2018 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants