| 123456789101112131415161718192021222324252627282930 |
- /*!
- {
- "name": "Content Editable",
- "property": "contenteditable",
- "caniuse": "contenteditable",
- "notes": [{
- "name": "WHATWG Spec",
- "href": "https://html.spec.whatwg.org/multipage/interaction.html#contenteditable"
- }]
- }
- !*/
- /* DOC
- Detects support for the `contenteditable` attribute of elements, allowing their DOM text contents to be edited directly by the user.
- */
- define(['Modernizr', 'createElement', 'docElement'], function(Modernizr, createElement, docElement) {
- Modernizr.addTest('contenteditable', function() {
- // early bail out
- if (!('contentEditable' in docElement)) {
- return;
- }
- // some mobile browsers (android < 3.0, iOS < 5) claim to support
- // contentEditable, but but don't really. This test checks to see
- // confirms whether or not it actually supports it.
- var div = createElement('div');
- div.contentEditable = true;
- return div.contentEditable === 'true';
- });
- });
|