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

Is this really work in IE8 just with adding -ms-behavior? #54

Open
Metafalica opened this issue Aug 16, 2014 · 17 comments
Open

Is this really work in IE8 just with adding -ms-behavior? #54

Metafalica opened this issue Aug 16, 2014 · 17 comments

Comments

@Metafalica
Copy link

First of all, I think - when you giving example, it should be minimal, so everyone can understand what he need to make it work.

Your index.html is visually good, but not that good at explaining what I need to do to make it work.
So, I followed your instruction and created this simplest code:
Err, I don't know how to paste code here, since [code] no work and html disappears.
Look code here: http://stackoverflow.com/questions/25338009/background-size-polyfill-does-not-work-in-ie8

I made this minimal test page and background-size: contain and cover completely no work. In IE8 background acts the same way as without this thing.

@tigt
Copy link

tigt commented Aug 18, 2014

I left an answer on StackOverflow as well, but I'll answer here for posterity.

You need to place the .htaccess file inside a running Apache server. You have it placed on your Windows desktop for your local testing, so it doesn't get served at all, which precludes the requirement "served with the correct MIME type."

If you're using server software other than Apache, you don't need to include .htaccess; the server will automatically take care of that for you.

@Metafalica
Copy link
Author

But... index.html that comes in package works in that way! I also viewing it from folder by double clicking the page without any servers.

@tigt
Copy link

tigt commented Aug 18, 2014

Yeah. Frustratingly inconsistent, isn't it?

@Metafalica
Copy link
Author

I don't understand what you means. If index.html page works fine in IE8 without any servers, why my page no work as expected? What I ask is what else I must do to make it work.

@jefferyto
Copy link
Collaborator

Does your file have a standards mode DOCTYPE?

<!DOCTYPE html>

The polyfill doesn't work in quirks mode (this is a known issue).

@Metafalica
Copy link
Author

Oh it started working... Thank you.
However, I think it would be good to add this into instructions where is said about adding -ms-behavior.

@jefferyto
Copy link
Collaborator

Good to hear :-) Thanks for your suggestion - I'll add it to the Readme.

(Also thanks @tigt - having a proper localhost is IMHO best practice.)

@Metafalica
Copy link
Author

You have any ideas why it no work in quirks mode?
Actually, I use quirks on purpose to avoid table height calculation bug in IE8 - 10.
I though maybe I can make a fix for quirks mode.

@jefferyto
Copy link
Collaborator

I'm not sure why it doesn't work in quirks mode. (I'm afraid I don't have enough free time at the moment to investigate.) I would consider any fix to be for existing sites that can't convert to standards mode; every new project should really use standards mode. There will be bugs in IE either way ;-)

@Metafalica
Copy link
Author

Maybe you can tell me how to debug htc? Line by line execution and viewing variables data.

@jefferyto
Copy link
Collaborator

@Metafalica
Copy link
Author

Ok thank you very much. I will see what I can do.

@Metafalica
Copy link
Author

Looks like I found why it no work in quirks, but I don't know why that happens.
In quirks the code in htc is not executed at all.
I tried adding alert('asd'); right after script opening tag, but it alerts with doctype only.
I will try to redo all this into *.js file

@tigt
Copy link

tigt commented Aug 18, 2014

According to this http://msdn.microsoft.com/en-us/library/ie/ms530723(v=vs.85).aspx, when IE8 isn't in Standards mode, -ms-behavior is just called behavior. Does that work?

@Metafalica
Copy link
Author

Well... for some really weird reason the background simply disappears. But at least code in htc executed.

@tigt
Copy link

tigt commented Aug 18, 2014

I fear there might be methods in the .htc that IE8 doesn't support in Quirks Mode. Without a JavaScript console in IE8, that would be very hard to fix.

@Plaristote
Copy link

Hm. Interesting. I have the same issue than you Metafalica. The code is executed (I had to use behavior instead of -ms-behavior though), and the background simply disappeared. Did you ever find out what was happening ?

I also made sure that I wasn't in quirk mode, using this piece of code: mode = (document.compatMode=='CSS1Compat'?'Standards':'Quirks')

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

No branches or pull requests

4 participants