Microdata-JS icon indicating copy to clipboard operation
Microdata-JS copied to clipboard

Being shim agnostic

Open Raynos opened this issue 13 years ago • 6 comments

It would be nice if it could be documented what you need to emulate for full support here.

For example would it work in IE8+ if you threw the DOM-shim in? If not what is missing?

We really need a better way of documenting what DOM features need to be shimmed rather then saying "using this specific shim"

Raynos avatar Jan 25 '12 09:01 Raynos

I am thinking about it. I need to learn documentation markup

termi avatar Jan 25 '12 09:01 termi

I just finished feature. This will allow you to define what features are needed. Something like

if (window.features && [
  "DOM.Element.getAttribute",
  "DOM.Document.createElement",
  ...
].every(function (n) { return window.features[n]; })) {
  /* run shim code as all the features necessary are present */
}

If you don't want to add it to the code you can add it in the documentation and reference feature.

Raynos avatar Jan 28 '12 21:01 Raynos

Great work! I'll add Microdata items in features, after I'll get some rest.

termi avatar Jan 28 '12 21:01 termi

Note: for now, this lib incompatible with you shim, only because of require of DOMSettableList object ( or rather because of my implimentation of this interface ).

I am think about replacement native implementation for allow developer create instances of this class. Is this a bad idea?

termi avatar Jan 28 '12 21:01 termi

If there is no good alternative then it's a good idea. I need to do my own research to tell whether there are alternatives.

Raynos avatar Jan 28 '12 22:01 Raynos