Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

CSS property object-fit : contain is not working in phantomjs #14321

Closed
sbsomya opened this issue May 27, 2016 · 12 comments
Closed

CSS property object-fit : contain is not working in phantomjs #14321

sbsomya opened this issue May 27, 2016 · 12 comments

Comments

@sbsomya
Copy link

sbsomya commented May 27, 2016

No description provided.

@vitallium
Copy link
Collaborator

Ok.

@kjantzer
Copy link

Why was this closed? Still looks broken on 2.1.1

@jorchg
Copy link

jorchg commented Sep 26, 2016

Any alternative to this?

@kjantzer
Copy link

@jorchg The alternative I went with was using background-image and background-size instead of an <img> and object-fit

@Ugoku
Copy link

Ugoku commented Feb 28, 2017

Can I ask again why this was closed? This is a very useful CSS property and it would be great if PhantomJS supported it.

@vitallium
Copy link
Collaborator

@Ugoku because this issue has only title and zero useful info.

@kjantzer
Copy link

kjantzer commented Feb 28, 2017

@vitallium The title seems pretty self explanatory to me. The css object-fit: contain doesn't function like it should.

@vitallium
Copy link
Collaborator

@kjantzer we have a template to report issue. This template helps us a lot in fixing problems. Plus, writing a a simple example that reproduces a problem helps a lot.

And I think this problem is fixed in 2.5 beta version.

@kjantzer
Copy link

kjantzer commented Feb 28, 2017

@vitallium I understand. It's hard to expect an outside user to use your "template to report" though when there doesn't seem to be documentation on it. Couldn't you have just tagged it with the "Unclear" or "Need more information" label?

@vitallium
Copy link
Collaborator

vitallium commented Feb 28, 2017

@kjantzer our template uses the GitHub reporting system: when you click on "Create a new issue", this template will be in your text field.

Couldn't you have just tagged it with the "Unclear" or "Need more information" label?

I think I'll tag it as probably fixed in 2.5 milestone. And I'll check it later.

@vitallium vitallium added this to the Release 2.5 milestone Feb 28, 2017
@Ugoku
Copy link

Ugoku commented Feb 28, 2017

Thanks for the update!

@Ugoku
Copy link

Ugoku commented Mar 3, 2017

Plus, writing a a simple example that reproduces a problem helps a lot.

Here's my situation:

HTML:
<img src="http://lorempixel.com/900/450/">

CSS:

img {
    height: 450px;
    object-fit: contain;
    width: 600px;
}

The loaded image is the same height as the height assigned to the img tag, but it is wider than the tag. Without object-fit, it is stretched to fit the tag. With object-fit, it will fit the container with the top and bottom empty.

Attached is a test case: objectfit.txt (as .txt because GitHub doesn't allow .html upload)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants