/** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow */ // TODO: direct imports like some-package/src/* are bad. Fix me. import ReactDebugCurrentFiber from 'react-reconciler/src/ReactDebugCurrentFiber'; import {registrationNameModules} from 'events/EventPluginRegistry'; import emptyFunction from 'fbjs/lib/emptyFunction'; import warning from 'fbjs/lib/warning'; import * as DOMPropertyOperations from './DOMPropertyOperations'; import * as ReactDOMFiberInput from './ReactDOMFiberInput'; import * as ReactDOMFiberOption from './ReactDOMFiberOption'; import * as ReactDOMFiberSelect from './ReactDOMFiberSelect'; import * as ReactDOMFiberTextarea from './ReactDOMFiberTextarea'; import * as inputValueTracking from './inputValueTracking'; import setInnerHTML from './setInnerHTML'; import setTextContent from './setTextContent'; import {listenTo, trapBubbledEvent} from '../events/ReactBrowserEventEmitter'; import {mediaEventTypes} from '../events/BrowserEventConstants'; import * as CSSPropertyOperations from '../shared/CSSPropertyOperations'; import {Namespaces, getIntrinsicNamespace} from '../shared/DOMNamespaces'; import { getPropertyInfo, shouldIgnoreAttribute, shouldRemoveAttribute, } from '../shared/DOMProperty'; import assertValidProps from '../shared/assertValidProps'; import {DOCUMENT_NODE, DOCUMENT_FRAGMENT_NODE} from '../shared/HTMLNodeType'; import isCustomComponent from '../shared/isCustomComponent'; import possibleStandardNames from '../shared/possibleStandardNames'; import {validateProperties as validateARIAProperties} from '../shared/ReactDOMInvalidARIAHook'; import {validateProperties as validateInputProperties} from '../shared/ReactDOMNullInputValuePropHook'; import {validateProperties as validateUnknownProperties} from '../shared/ReactDOMUnknownPropertyHook'; const { getCurrentFiberOwnerName, getCurrentFiberStackAddendum, } = ReactDebugCurrentFiber; let didWarnInvalidHydration = false; let didWarnShadyDOM = false; const DANGEROUSLY_SET_INNER_HTML = 'dangerouslySetInnerHTML'; const SUPPRESS_CONTENT_EDITABLE_WARNING = 'suppressContentEditableWarning'; const SUPPRESS_HYDRATION_WARNING = 'suppressHydrationWarning'; const AUTOFOCUS = 'autoFocus'; const CHILDREN = 'children'; const STYLE = 'style'; const HTML = '__html'; const {html: HTML_NAMESPACE} = Namespaces; let getStack = emptyFunction.thatReturns(''); let warnedUnknownTags; let suppressHydrationWarning; let validatePropertiesInDevelopment; let warnForTextDifference; let warnForPropDifference; let warnForExtraAttributes; let warnForInvalidEventListener; let normalizeMarkupForTextOrAttribute; let normalizeHTML; if (__DEV__) { getStack = getCurrentFiberStackAddendum; warnedUnknownTags = { // Chrome is the only major browser not shipping