@@ -66,7 +66,6 @@ import {validateProperties as validateUnknownProperties} from '../shared/ReactDO
6666import sanitizeURL from '../shared/sanitizeURL' ;
6767
6868import {
69- disableIEWorkarounds ,
7069 enableTrustedTypesIntegration ,
7170 enableFilterEmptyStringAttributesDOM ,
7271} from 'shared/ReactFeatureFlags' ;
@@ -83,19 +82,8 @@ let didWarnFormActionTarget = false;
8382let didWarnFormActionMethod = false ;
8483let didWarnForNewBooleanPropsWithEmptyValue : { [ string ] : boolean } ;
8584let didWarnPopoverTargetObject = false ;
86- let canDiffStyleForHydrationWarning ;
8785if ( __DEV__ ) {
8886 didWarnForNewBooleanPropsWithEmptyValue = { } ;
89- // IE 11 parses & normalizes the style attribute as opposed to other
90- // browsers. It adds spaces and sorts the properties in some
91- // non-alphabetical order. Handling that would require sorting CSS
92- // properties in the client & server versions or applying
93- // `expectedStyle` to a temporary DOM node to read its `style` attribute
94- // normalized. Since it only affects IE, we're skipping style warnings
95- // in that browser completely in favor of doing all that work.
96- // See https://github.com/facebook/react/issues/11807
97- canDiffStyleForHydrationWarning =
98- disableIEWorkarounds || ( canUseDOM && ! document . documentMode ) ;
9987}
10088
10189function validatePropertiesInDevelopment ( type : string , props : any ) {
@@ -579,11 +567,7 @@ function setProp(
579567 'Can only set one of `children` or `props.dangerouslySetInnerHTML`.' ,
580568 ) ;
581569 }
582- if ( disableIEWorkarounds ) {
583- domElement . innerHTML = nextHtml ;
584- } else {
585- setInnerHTML ( domElement , nextHtml ) ;
586- }
570+ domElement . innerHTML = nextHtml ;
587571 }
588572 }
589573 break ;
@@ -939,11 +923,7 @@ function setPropOnCustomElement(
939923 'Can only set one of `children` or `props.dangerouslySetInnerHTML`.' ,
940924 ) ;
941925 }
942- if ( disableIEWorkarounds ) {
943- domElement . innerHTML = nextHtml ;
944- } else {
945- setInnerHTML ( domElement , nextHtml ) ;
946- }
926+ domElement . innerHTML = nextHtml ;
947927 }
948928 }
949929 break ;
@@ -1931,27 +1911,23 @@ function diffHydratedStyles(
19311911 }
19321912 return ;
19331913 }
1934- if ( canDiffStyleForHydrationWarning ) {
1935- // First we compare the string form and see if it's equivalent.
1936- // This lets us bail out on anything that used to pass in this form.
1937- // It also lets us compare anything that's not parsed by this browser.
1938- const clientValue = createDangerousStringForStyles ( value ) ;
1939- const serverValue = domElement . getAttribute ( 'style' ) ;
1914+ // First we compare the string form and see if it's equivalent.
1915+ // This lets us bail out on anything that used to pass in this form.
1916+ // It also lets us compare anything that's not parsed by this browser.
1917+ const clientValue = createDangerousStringForStyles ( value ) ;
1918+ const serverValue = domElement . getAttribute ( 'style' ) ;
19401919
1941- if ( serverValue === clientValue ) {
1942- return ;
1943- }
1944- const normalizedClientValue =
1945- normalizeMarkupForTextOrAttribute ( clientValue ) ;
1946- const normalizedServerValue =
1947- normalizeMarkupForTextOrAttribute ( serverValue ) ;
1948- if ( normalizedServerValue === normalizedClientValue ) {
1949- return ;
1950- }
1951-
1952- // Otherwise, we create the object from the DOM for the diff view.
1953- serverDifferences . style = getStylesObjectFromElement ( domElement ) ;
1920+ if ( serverValue === clientValue ) {
1921+ return ;
1922+ }
1923+ const normalizedClientValue = normalizeMarkupForTextOrAttribute ( clientValue ) ;
1924+ const normalizedServerValue = normalizeMarkupForTextOrAttribute ( serverValue ) ;
1925+ if ( normalizedServerValue === normalizedClientValue ) {
1926+ return ;
19541927 }
1928+
1929+ // Otherwise, we create the object from the DOM for the diff view.
1930+ serverDifferences . style = getStylesObjectFromElement ( domElement ) ;
19551931}
19561932
19571933function hydrateAttribute (
0 commit comments