All Projects → WebReflection → Dom4

WebReflection / Dom4

Licence: mit
Modern DOM functionalities for every browser

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Dom4

smart-custom-element
Smart a lightweight web component library that provides capabilities for web components, such as data binding, using es6 native class inheritance. This library is focused for providing the developer the ability to write robust and native web components without the need of dependencies and an overhead of a framework.
Stars: ✭ 17 (-98.12%)
Mutual labels:  polyfill, dom
parsed-html-rewriter
A DOM-based implementation of Cloudflare Worker's HTMLRewriter.
Stars: ✭ 34 (-96.23%)
Mutual labels:  polyfill, dom
Webappsec Trusted Types
A browser API to prevent DOM-Based Cross Site Scripting in modern web applications.
Stars: ✭ 424 (-53.05%)
Mutual labels:  polyfill, dom
Hyperform
Capture form validation back from the browser
Stars: ✭ 729 (-19.27%)
Mutual labels:  polyfill
Sinuous
🧬 Light, fast, reactive UI library
Stars: ✭ 740 (-18.05%)
Mutual labels:  dom
Docker Host
A docker sidecar container to forward all traffic to local docker host or any other host
Stars: ✭ 769 (-14.84%)
Mutual labels:  polyfill
Is countable Polyfill
A trivial but working polyfill for PHP 7.3 is_countable function. Supports PHP versions >= 5.3
Stars: ✭ 16 (-98.23%)
Mutual labels:  polyfill
Arrive
Watch for DOM elements creation and removal
Stars: ✭ 703 (-22.15%)
Mutual labels:  dom
Choo
🚂🚋 - sturdy 4kb frontend framework
Stars: ✭ 6,637 (+634.99%)
Mutual labels:  dom
Etree
parse and generate XML easily in go
Stars: ✭ 763 (-15.5%)
Mutual labels:  dom
Url Search Params
Simple polyfill for URLSearchParams standard
Stars: ✭ 765 (-15.28%)
Mutual labels:  polyfill
Clipboard Polyfill
📋 Simple copying on the web, with maximum browser compatibility.
Stars: ✭ 748 (-17.17%)
Mutual labels:  polyfill
Slim.js
Fast & Robust Front-End Micro-framework based on modern standards
Stars: ✭ 789 (-12.62%)
Mutual labels:  dom
Maquette
Pure and simple virtual DOM library
Stars: ✭ 729 (-19.27%)
Mutual labels:  dom
Zeroclipboard
The ZeroClipboard library provides an easy way to copy text to the clipboard using an invisible Adobe Flash movie and a JavaScript interface.
Stars: ✭ 6,650 (+636.43%)
Mutual labels:  dom
Native Promise Only
A polyfill for native ES6 Promises as close as possible (no extensions) to the strict spec definitions.
Stars: ✭ 708 (-21.59%)
Mutual labels:  polyfill
Scroll Into View If Needed
Element.scrollIntoView ponyfills for things like "if-needed" and "smooth"
Stars: ✭ 811 (-10.19%)
Mutual labels:  polyfill
Domtastic
Small, fast, and modular DOM and event library for modern browsers.
Stars: ✭ 763 (-15.5%)
Mutual labels:  dom
Js Leakage Patterns
🎯这是关于JavaScript内存泄露和CSS优化相关序列文章,相信你读完会有所收获的✈️
Stars: ✭ 756 (-16.28%)
Mutual labels:  dom
Ie11customproperties
CSS variables (Custom Properties) polyfill for IE11
Stars: ✭ 765 (-15.28%)
Mutual labels:  polyfill

DOM4

build status donate

A fully tested and covered polyfill for new DOM Level 4 entries

Via cdnJS

Many thanks to cdnjs for hosting this script. Following an example on how to include it.

<script
  src="//cdnjs.cloudflare.com/ajax/libs/dom4/2.0.0/dom4.js"
>/* DOM4 */</script>

New v2

Both query and queryAll have been removed, while CSS :scope selector has been added.

Features

This is a fully tested and covered polyfill for both new DOM Level 4 parentNode entries:

  • Element#prepend()
  • Element#append()

And for new DOM Level 4 childNode entries:

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

The implemented test is conform to current specifications.

Other fixes/standardized behaviors include:

  • toggleAttribute
  • DOM Listener: capture, passive, and once
  • fully normalized KeyboardEvent, MouseEvent and the latest way to create new Event('type')
  • CSS :scope selector for any HTML Element (no document since useless, sorry)
  • classList, with forced fixes for iOS 5.1 and Nokia ASHA Xpress Browser and early implementations
  • CustomEvent constructor for all browsers down to IE8
  • Element#matches utility to test elements against CSS selectors
  • Element#closest utility to find element inclusive ancestor via CSS selectors
  • Node#contains utility to know if another node is inside the current one
  • requestAnimationFrame and cancelAnimationFrame are polyfilled too but the least legacy fallback to setTimeout does not support accurate timing and doesn't slow down execution with that logic. Feel free to load upfront other polyfills if needed.

If you need other polyfills too, have a look at another DOM-shim repo.

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
  • PhantomJS can benefit from DOM4 too

It's way easier if you tell me which browser in a current relevant market share is not supported :-)

For IE8 only it's recommended to include ie8 script before dom4 or CustomEvent, addEventListener, and dispatchEvent won't work as expected.

Which File

The minified version is here, while the max one here. If you want to test directly try this page, it should be green.

Want to contribute?

If you found a bug, want to contribute or have any questions feel free to fill an issue or pull request, and help us to improve the Dom4

License

Dom4 Code released under the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].