Advise on resolving pseudo-class compatibility for IE8 - internet-explorer-8

I have used pseudo-classes in the project, that i am currently working on, and since it is already javascript heavy I am trying to avoid using selectivizr. Is there are way making psedoclass compatible with IE8? Is it possible to use Modernizr to resolve this issue?
Any advise would be much appreciated.

You could check for css-lastchild with Modernizr (you'll find it in the Non-core detects section) and customize your styles if the browser doesn't support css-lastchild - which would mean it doesn't support any other of the CSS3 selectors either, which are:
:root
:nth-child()
:nth-last-child()
nth-of-type
nth-last-of-type()
:last-child
:first-of-type
:last-of-type
:only-child
:only-of-type
:empty
:target
:enabled
:disabled
:checked
:not().

Related

Can I use Modernizr to detect ES6 module support?

I've browsed the Modernizr docs for a property that tells whether Ecmascript 6' support for module scripts is available in the client or not, as Firefox currently doesn't. I found none. Am I missing something obvious or could I deduce this from a property that regards something else?
Yes,
but that's not available as built-in test in Modernizr as far as I know (Modernizr 3.5.0). So, you could use:
Modernizr.addTest('es6module', function(){
return 'noModule' in document.createElement('script')
});
In order for Modernizr.addTest to work, of course, you have to add addTest option to your build.
Testing script nomodule feature should be fine. That means, false positives and negatives are imaginable to happen.

Susy 2 IE8 Fallback

I need to add support for IE8 and possible previous versions using Susy 2 but there is very limited documentation that described how to do this.
I know in Susy 1 there was a lt-ie9 fallback tag to use against breakpoint declarations but that doesn't seem to work for Susy 2.
Is there any documentation for IE8 support or other way this can be achieved?
Susy doesn't exactly "support" specific browsers — since that would be determined feature-by-feature. I think media-queries are the only place you may need a fallback for IE8, and fallback options still exist for that. You can find all the docs inline with other information about media handling. We have some basic media-query tools built in, and additional support for the Breakpoint plugin. The built-in mixin is now called susy-breakpoint() and accepts a $no-query argument for managing your fallback.

Main usaged of modernizr & HTML5shiv library

I've never used HTML5 or CSS3. I am just learning and planning to use them later in a web project. If we just include modernizr js file in page that does not help us to detect which feature works or not rather we need to write code for modernizr fallback system and from there we take decision how to handle situation if any HTML5 feature is not supported by the browser. Here is one modernizr fallback example
Modernizr.load({
test: Modernizr.canvas,
nope: 'http://flashcanvas.net/bin/flashcanvas.js'
});
If Modernizr can handle for any browser then why should i use HTML5shiv library?
Why HTML5shiv needs to be included when Modernizr is already used on the page?
How HTML5shiv library works? does it solve all IE issues just by including it?
Does HTML5shiv provide any fallback system?
How to conditionally load HTML5shiv library if the browser is IE?
Please provide your answer with code samples.
looking forward for discussion. thanks
If Modernizr can handle for any browser then why should i use HTML5shiv library?
Why HTML5shiv needs to be included when Modernizr is already used on the page?
You don't need to separately include html5shiv, because Modernizr includes it. As of Modernizr 1.5, this script is identical to what is used in the popular html5shim/html5shiv library
How HTML5shiv library works? does it solve all IE issues just by including it?
html5shiv only allows IE to recognize and style HTML5 elements. Nothing more.
Does HTML5shiv provide any fallback system?
No, feature detection is only supported by Modernizr. Note that Modernizr by itself doesn't give you fallbacks. You could use yep/nope to provide polyfills or fallbacks to the feature you want to support
How to conditionally load HTML5shiv library if the browser is IE?
using conditional HTML comments, this will load html5shim on IE versions below 9
<!--[if lt IE 9]>
<script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

Display #font-face Fonts in Capybara-Webkit

When I test my website using capybara-webkit and I take a screenshot, #font-face declarations in CSS are ignored.
This is especially bad because I am using FontAwesome, so there will be major differences to how the page is displayed in a real browser.
How to reproduce: https://gist.github.com/anonymous/4948827
Output: http://i.imgur.com/5lsrleY.jpg
Is there any way to fix this?
Some research shows that it is entirely possible to render custom fonts in Capybara-Webkit, the same as with PhantomJS. This PhantomJS Forum Post identifies the trouble issues. A quick summary:
SVG Fonts work best.
OTF fonts tend not to work.
It should be fixed with Qt5, so check what version of Qt you've built against.
Depending on the version of qt that capybara-webkit is built against, webkit needs non-localhost urls whitelisted. That includes meta references to external assets such as fonts.
To make that happen globally, add this to spec_helper.rb in the rspec configuration block:
config.before(:each) do
page.driver.allow_url("the-domain-name.com")
end
If you have a before :each already, just throw it in there instead. allow_url also accepts an array of strings.
I've placed a comment in your gist to this effect.

npapi - javascript doesnt load the content of a plugin

I wrote a firefox plugin using C++ and used the <EMBED> to load it to html.
In javascript I got the embedded plugin by using document.getElementByID,
but when I tried to call a plugin function, the function was undefined. Moreover,
plugins constructors did not run while loading the page.
The same html file and plugin seems to work on some computers, while it doesnt work on others.
Does anyone have an idea what might by wrong?
How can I debug such an issue?
Can you reproduce it on your computer at first? If not, then try to figure out what systems, browsers, architecture, versions, they are using.
I recall, there are many GECKOSDK's, and each one has a specific version it works for. https://developer.mozilla.org/en/gecko_sdk For example, different SDK's for Firefox 1.5-2.0, FireFox 3.0, Firefox 3.5, and Firefox 3.5
For different browers, make sure you are exposing the right DLL Exports, browsers can vary: http://git.webvm.net/?p=npsimple is a good starting point. You can use firebreath.googlecode.com too as an alternative.
My suggestion would be to use an object tag instead of <embed>. In my experience, doesn't seem to work as reliably.
If I had more information on how your plugin is structured (are you using XPCOM or npruntime?), I might be able to help more.

Resources