@@ -859,23 +859,6 @@ export interface IFocusTracker {
859859 dispose ( ) : void ;
860860}
861861
862- export function selectTextInInputElement ( textArea : HTMLTextAreaElement ) : void {
863- // F12 has detected in their automated tests that selecting throws sometimes,
864- // the root cause remains a mistery. Bug #378257 filled against IE.
865- try {
866- let scrollState : number [ ] = saveParentsScrollTop ( textArea ) ;
867- textArea . select ( ) ;
868- if ( textArea . setSelectionRange ) {
869- // on iOS Safari, .select() moves caret to the end of the text instead of selecting
870- // see http://stackoverflow.com/questions/3272089/programmatically-selecting-text-in-an-input-field-on-ios-devices-mobile-safari
871- textArea . setSelectionRange ( 0 , 9999 ) ;
872- }
873- restoreParentsScrollTop ( textArea , scrollState ) ;
874- } catch ( e ) {
875- // no-op
876- }
877- }
878-
879862export function saveParentsScrollTop ( node : Element ) : number [ ] {
880863 let r : number [ ] = [ ] ;
881864 for ( let i = 0 ; node && node . nodeType === node . ELEMENT_NODE ; i ++ ) {
@@ -944,20 +927,6 @@ export function trackFocus(element: HTMLElement): IFocusTracker {
944927 return new FocusTracker ( element ) ;
945928}
946929
947- export function removeScriptTags ( html : string ) : string {
948- let div = document . createElement ( 'div' ) ;
949- div . innerHTML = html ;
950-
951- let scripts = div . getElementsByTagName ( 'script' ) ;
952- let i = scripts . length ;
953-
954- while ( i -- ) {
955- scripts [ i ] . parentNode . removeChild ( scripts [ i ] ) ;
956- }
957-
958- return div . innerHTML ;
959- } ;
960-
961930export function append < T extends Node > ( parent : HTMLElement , child : T ) : T {
962931 parent . appendChild ( child ) ;
963932 return child ;
@@ -1021,4 +990,4 @@ export function removeTabIndexAndUpdateFocus(node: HTMLElement): void {
1021990 }
1022991
1023992 node . removeAttribute ( 'tabindex' ) ;
1024- }
993+ }
0 commit comments