UNPKG

motion

Version:

motion - moving development forward

208 lines (201 loc) 5.77 kB
/** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule HTMLDOMPropertyConfig */ 'use strict'; var DOMProperty = require('./DOMProperty'); var MUST_USE_PROPERTY = DOMProperty.injection.MUST_USE_PROPERTY; var HAS_BOOLEAN_VALUE = DOMProperty.injection.HAS_BOOLEAN_VALUE; var HAS_SIDE_EFFECTS = DOMProperty.injection.HAS_SIDE_EFFECTS; var HAS_NUMERIC_VALUE = DOMProperty.injection.HAS_NUMERIC_VALUE; var HAS_POSITIVE_NUMERIC_VALUE = DOMProperty.injection.HAS_POSITIVE_NUMERIC_VALUE; var HAS_OVERLOADED_BOOLEAN_VALUE = DOMProperty.injection.HAS_OVERLOADED_BOOLEAN_VALUE; var HTMLDOMPropertyConfig = { isCustomAttribute: RegExp.prototype.test.bind(new RegExp('^(data|aria)-[' + DOMProperty.ATTRIBUTE_NAME_CHAR + ']*$')), Properties: { /** * Standard Properties */ accept: null, acceptCharset: null, accessKey: null, action: null, allowFullScreen: HAS_BOOLEAN_VALUE, allowTransparency: null, alt: null, async: HAS_BOOLEAN_VALUE, autoComplete: null, // autoFocus is polyfilled/normalized by AutoFocusUtils // autoFocus: HAS_BOOLEAN_VALUE, autoPlay: HAS_BOOLEAN_VALUE, capture: HAS_BOOLEAN_VALUE, cellPadding: null, cellSpacing: null, charSet: null, challenge: null, checked: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE, classID: null, className: null, cols: HAS_POSITIVE_NUMERIC_VALUE, colSpan: null, content: null, contentEditable: null, contextMenu: null, controls: HAS_BOOLEAN_VALUE, coords: null, crossOrigin: null, data: null, // For `<object />` acts as `src`. dateTime: null, 'default': HAS_BOOLEAN_VALUE, defer: HAS_BOOLEAN_VALUE, dir: null, disabled: HAS_BOOLEAN_VALUE, download: HAS_OVERLOADED_BOOLEAN_VALUE, draggable: null, encType: null, form: null, formAction: null, formEncType: null, formMethod: null, formNoValidate: HAS_BOOLEAN_VALUE, formTarget: null, frameBorder: null, headers: null, height: null, hidden: HAS_BOOLEAN_VALUE, high: null, href: null, hrefLang: null, htmlFor: null, httpEquiv: null, icon: null, id: null, inputMode: null, integrity: null, is: null, keyParams: null, keyType: null, kind: null, label: null, lang: null, list: null, loop: HAS_BOOLEAN_VALUE, low: null, manifest: null, marginHeight: null, marginWidth: null, max: null, maxLength: null, media: null, mediaGroup: null, method: null, min: null, minLength: null, // Caution; `option.selected` is not updated if `select.multiple` is // disabled with `removeAttribute`. multiple: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE, muted: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE, name: null, nonce: null, noValidate: HAS_BOOLEAN_VALUE, open: HAS_BOOLEAN_VALUE, optimum: null, pattern: null, placeholder: null, poster: null, preload: null, profile: null, radioGroup: null, readOnly: HAS_BOOLEAN_VALUE, rel: null, required: HAS_BOOLEAN_VALUE, reversed: HAS_BOOLEAN_VALUE, role: null, rows: HAS_POSITIVE_NUMERIC_VALUE, rowSpan: HAS_NUMERIC_VALUE, sandbox: null, scope: null, scoped: HAS_BOOLEAN_VALUE, scrolling: null, seamless: HAS_BOOLEAN_VALUE, selected: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE, shape: null, size: HAS_POSITIVE_NUMERIC_VALUE, sizes: null, span: HAS_POSITIVE_NUMERIC_VALUE, spellCheck: null, src: null, srcDoc: null, srcLang: null, srcSet: null, start: HAS_NUMERIC_VALUE, step: null, style: null, summary: null, tabIndex: null, target: null, title: null, // Setting .type throws on non-<input> tags type: null, useMap: null, value: MUST_USE_PROPERTY | HAS_SIDE_EFFECTS, width: null, wmode: null, wrap: null, /** * RDFa Properties */ about: null, datatype: null, inlist: null, prefix: null, // property is also supported for OpenGraph in meta tags. property: null, resource: null, 'typeof': null, vocab: null, /** * Non-standard Properties */ // autoCapitalize and autoCorrect are supported in Mobile Safari for // keyboard hints. autoCapitalize: null, autoCorrect: null, // autoSave allows WebKit/Blink to persist values of input fields on page reloads autoSave: null, // color is for Safari mask-icon link color: null, // itemProp, itemScope, itemType are for // Microdata support. See http://schema.org/docs/gs.html itemProp: null, itemScope: HAS_BOOLEAN_VALUE, itemType: null, // itemID and itemRef are for Microdata support as well but // only specified in the WHATWG spec document. See // https://html.spec.whatwg.org/multipage/microdata.html#microdata-dom-api itemID: null, itemRef: null, // results show looking glass icon and recent searches on input // search fields in WebKit/Blink results: null, // IE-only attribute that specifies security restrictions on an iframe // as an alternative to the sandbox attribute on IE<10 security: null, // IE-only attribute that controls focus behavior unselectable: null }, DOMAttributeNames: { acceptCharset: 'accept-charset', className: 'class', htmlFor: 'for', httpEquiv: 'http-equiv' }, DOMPropertyNames: {} }; module.exports = HTMLDOMPropertyConfig;