@@ -16,7 +16,6 @@ import {
16
16
possibleRegistrationNames ,
17
17
} from '../events/EventRegistry' ;
18
18
19
- import { canUseDOM } from 'shared/ExecutionEnvironment' ;
20
19
import { checkHtmlStringCoercion } from 'shared/CheckStringCoercion' ;
21
20
import { checkAttributeStringCoercion } from 'shared/CheckStringCoercion' ;
22
21
import { checkControlledValueProps } from '../shared/ReactControlledValuePropTypes' ;
@@ -50,7 +49,6 @@ import {
50
49
} from './ReactDOMTextarea' ;
51
50
import { validateTextNesting } from './validateDOMNesting' ;
52
51
import { track } from './inputValueTracking' ;
53
- import setInnerHTML from './setInnerHTML' ;
54
52
import setTextContent from './setTextContent' ;
55
53
import {
56
54
createDangerousStringForStyles ,
@@ -66,7 +64,6 @@ import {validateProperties as validateUnknownProperties} from '../shared/ReactDO
66
64
import sanitizeURL from '../shared/sanitizeURL' ;
67
65
68
66
import {
69
- disableIEWorkarounds ,
70
67
enableTrustedTypesIntegration ,
71
68
enableFilterEmptyStringAttributesDOM ,
72
69
} from 'shared/ReactFeatureFlags' ;
@@ -83,19 +80,8 @@ let didWarnFormActionTarget = false;
83
80
let didWarnFormActionMethod = false ;
84
81
let didWarnForNewBooleanPropsWithEmptyValue : { [ string ] : boolean } ;
85
82
let didWarnPopoverTargetObject = false ;
86
- let canDiffStyleForHydrationWarning ;
87
83
if ( __DEV__ ) {
88
84
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 ) ;
99
85
}
100
86
101
87
function validatePropertiesInDevelopment ( type : string , props : any ) {
@@ -579,11 +565,7 @@ function setProp(
579
565
'Can only set one of `children` or `props.dangerouslySetInnerHTML`.' ,
580
566
) ;
581
567
}
582
- if ( disableIEWorkarounds ) {
583
- domElement . innerHTML = nextHtml ;
584
- } else {
585
- setInnerHTML ( domElement , nextHtml ) ;
586
- }
568
+ domElement . innerHTML = nextHtml ;
587
569
}
588
570
}
589
571
break ;
@@ -939,11 +921,7 @@ function setPropOnCustomElement(
939
921
'Can only set one of `children` or `props.dangerouslySetInnerHTML`.' ,
940
922
) ;
941
923
}
942
- if ( disableIEWorkarounds ) {
943
- domElement . innerHTML = nextHtml ;
944
- } else {
945
- setInnerHTML ( domElement , nextHtml ) ;
946
- }
924
+ domElement . innerHTML = nextHtml ;
947
925
}
948
926
}
949
927
break ;
@@ -1931,27 +1909,23 @@ function diffHydratedStyles(
1931
1909
}
1932
1910
return ;
1933
1911
}
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' ) ;
1912
+ // First we compare the string form and see if it's equivalent.
1913
+ // This lets us bail out on anything that used to pass in this form.
1914
+ // It also lets us compare anything that's not parsed by this browser.
1915
+ const clientValue = createDangerousStringForStyles ( value ) ;
1916
+ const serverValue = domElement . getAttribute ( 'style' ) ;
1940
1917
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 ) ;
1918
+ if ( serverValue === clientValue ) {
1919
+ return ;
1920
+ }
1921
+ const normalizedClientValue = normalizeMarkupForTextOrAttribute ( clientValue ) ;
1922
+ const normalizedServerValue = normalizeMarkupForTextOrAttribute ( serverValue ) ;
1923
+ if ( normalizedServerValue === normalizedClientValue ) {
1924
+ return ;
1954
1925
}
1926
+
1927
+ // Otherwise, we create the object from the DOM for the diff view.
1928
+ serverDifferences . style = getStylesObjectFromElement ( domElement ) ;
1955
1929
}
1956
1930
1957
1931
function hydrateAttribute (
0 commit comments