<commit_before>DOM4
====

[![build status](https://travis-ci.org/WebReflection/dom4.svg)](https://travis-ci.org/WebReflection/dom4)

#### Via cdnJS
Many thanks to [cdnjs](http://www.cdnjs.com) for hosting this script. Following an example on how to include it.
```html
<script
  src="//cdnjs.cloudflare.com/ajax/libs/dom4/1.4.3/dom4.js"
>/* DOM4 */</script>
```

#### Features
This is a [fully tested](http://webreflection.github.io/dom4/test/) and covered polyfill for both [new DOM Level 4 parentNode entries](https://dom.spec.whatwg.org/#parentnode):

  * Element#prepend()
  * Element#append()

And for [new DOM Level 4 childNode entries](https://dom.spec.whatwg.org/#childnode):

  * Element#before()
  * Element#after()
  * Element#replaceWith() ( **warning** Element#replace() has been recently deprecated )
  * Element#remove()

The [implemented test](test/dom4.js) is conform to current specifications.

Other fixes/standardized behaviors include:

  * **new** [Elements as Array subclass](http://www.w3.org/TR/2015/WD-dom-20150428/#elements), so that `el.query` is same as `el.querySelector` but `el.queryAll` replaces `Array.prototype.slice.call(el.querySelectorAll(css))`
  * [classList](http://www.w3.org/TR/dom/#domtokenlist), with forced fixes for iOS 5.1 and Nokia ASHA Xpress Browser and early implementations
  * [CustomEvent](http://www.w3.org/TR/dom/#customevent) constructor for all browsers down to IE8
  * [Element#matches](http://www.w3.org/TR/dom/#dom-element-matches) utility to test elements against CSS selectors
  * [Element#closest](https://dom.spec.whatwg.org/#dom-element-closest) utility to find element inclusive ancestor via CSS selectors

The **DOM4** license is Mit Style.

If you need other polyfills too [have a look at another DOM-shim repo](https://github.com/Raynos/DOM-shim).

### Compatibility
Theoretically compatible with all browsers you know that are truly used these days, here a list:

  * Android 2.1+
  * Safari Mobile since iOS 3.0 and Desktop
  * Opera Mobile, Mini, and Desktop
  * Blackberry 7.1 and higher
  * Samsung Bada 2 native Browser
  * Midori and most likely all other WebKit based
  * Chrome Mobile and Desktop
  * Firefox Mobile and Desktop
  * IE8+ for Desktop and IE Mobile 9 or greater.
  * Nokia Xpress Browser for ASHA Platform
  * Silk Browser - Fire OS 3.0<commit_msg>better eplanation of query and queryAll<commit_after>DOM4
====

[![build status](https://travis-ci.org/WebReflection/dom4.svg)](https://travis-ci.org/WebReflection/dom4)

#### Via cdnJS
Many thanks to [cdnjs](http://www.cdnjs.com) for hosting this script. Following an example on how to include it.
```html
<script
  src="//cdnjs.cloudflare.com/ajax/libs/dom4/1.4.3/dom4.js"
>/* DOM4 */</script>
```

#### Features
This is a [fully tested](http://webreflection.github.io/dom4/test/) and covered polyfill for both [new DOM Level 4 parentNode entries](https://dom.spec.whatwg.org/#parentnode):

  * Element#prepend()
  * Element#append()

And for [new DOM Level 4 childNode entries](https://dom.spec.whatwg.org/#childnode):

  * Element#before()
  * Element#after()
  * Element#replaceWith() ( **warning** Element#replace() has been recently deprecated )
  * Element#remove()

The [implemented test](test/dom4.js) is conform to current specifications.

Other fixes/standardized behaviors include:

  * **new** [Elements as Array subclass](http://www.w3.org/TR/2015/WD-dom-20150428/#elements), so that `el.query` is the relative equivalent of `el.querySelector` and `el.queryAll` is the relative equivalent of `Array.prototype.slice.call(el.querySelectorAll(css))`. Relative means `node.query('body p')` won't return any `p` element contained in `node`, while old `querySelector` would.
  * [classList](http://www.w3.org/TR/dom/#domtokenlist), with forced fixes for iOS 5.1 and Nokia ASHA Xpress Browser and early implementations
  * [CustomEvent](http://www.w3.org/TR/dom/#customevent) constructor for all browsers down to IE8
  * [Element#matches](http://www.w3.org/TR/dom/#dom-element-matches) utility to test elements against CSS selectors
  * [Element#closest](https://dom.spec.whatwg.org/#dom-element-closest) utility to find element inclusive ancestor via CSS selectors

The **DOM4** license is Mit Style.

If you need other polyfills too [have a look at another DOM-shim repo](https://github.com/Raynos/DOM-shim).

### Compatibility
Theoretically compatible with all browsers you know that are truly used these days, here a list:

  * Android 2.1+
  * Safari Mobile since iOS 3.0 and Desktop
  * Opera Mobile, Mini, and Desktop
  * Blackberry 7.1 and higher
  * Samsung Bada 2 native Browser
  * Midori and most likely all other WebKit based
  * Chrome Mobile and Desktop
  * Firefox Mobile and Desktop
  * IE8+ for Desktop and IE Mobile 9 or greater.
  * Nokia Xpress Browser for ASHA Platform
  * Silk Browser - Fire OS 3.0
{'fraction_non_alphanumeric': 0.12992610837438423, 'fraction_numerical': 0.0180623973727422, 'mean_word_length': 4.384530386740331, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 12, 'lorem ipsum': 0, 'www.': 10, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2156142', 'n_tokens_mistral': 1600, 'n_tokens_neox': 1489, 'n_words': 480}