@@ -1850,28 +1850,10 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
1850
1850
1851
1851
for ( var i = 0 ; i < nodeList . length ; i ++ ) {
1852
1852
attrs = new Attributes ( ) ;
1853
- node = nodeList [ i ] ;
1854
1853
1855
1854
// Workaround for #11781 and #14924
1856
- if ( ( msie === 11 ) && ( node . nodeType === NODE_TYPE_TEXT ) ) {
1857
- var parent = node . parentNode ;
1858
- var sibling ;
1859
-
1860
- while ( true ) {
1861
- sibling = parent ? node . nextSibling : nodeList [ i + 1 ] ;
1862
- if ( ! sibling || sibling . nodeType !== NODE_TYPE_TEXT ) {
1863
- break ;
1864
- }
1865
-
1866
- node . nodeValue = node . nodeValue + sibling . nodeValue ;
1867
-
1868
- if ( sibling . parentNode ) {
1869
- sibling . parentNode . removeChild ( sibling ) ;
1870
- }
1871
- if ( notLiveList && sibling === nodeList [ i + 1 ] ) {
1872
- nodeList . splice ( i + 1 , 1 ) ;
1873
- }
1874
- }
1855
+ if ( msie === 11 ) {
1856
+ mergeConsecutiveTextNodes ( nodeList , i , notLiveList ) ;
1875
1857
}
1876
1858
1877
1859
// We must always refer to `nodeList[i]` hereafter,
@@ -1966,6 +1948,32 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
1966
1948
}
1967
1949
}
1968
1950
1951
+ function mergeConsecutiveTextNodes ( nodeList , idx , notLiveList ) {
1952
+ var node = nodeList [ idx ] ;
1953
+ var parent = node . parentNode ;
1954
+ var sibling ;
1955
+
1956
+ if ( node . nodeType !== NODE_TYPE_TEXT ) {
1957
+ return ;
1958
+ }
1959
+
1960
+ while ( true ) {
1961
+ sibling = parent ? node . nextSibling : nodeList [ i + 1 ] ;
1962
+ if ( ! sibling || sibling . nodeType !== NODE_TYPE_TEXT ) {
1963
+ break ;
1964
+ }
1965
+
1966
+ node . nodeValue = node . nodeValue + sibling . nodeValue ;
1967
+
1968
+ if ( sibling . parentNode ) {
1969
+ sibling . parentNode . removeChild ( sibling ) ;
1970
+ }
1971
+ if ( notLiveList && sibling === nodeList [ i + 1 ] ) {
1972
+ nodeList . splice ( i + 1 , 1 ) ;
1973
+ }
1974
+ }
1975
+ }
1976
+
1969
1977
function createBoundTranscludeFn ( scope , transcludeFn , previousBoundTranscludeFn ) {
1970
1978
function boundTranscludeFn ( transcludedScope , cloneFn , controllers , futureParentElement , containingScope ) {
1971
1979
0 commit comments