Skip to content

Commit 70297de

Browse files
committed
Remove unused code
1 parent a5a1663 commit 70297de

2 files changed

Lines changed: 1 addition & 40 deletions

File tree

src/vs/base/browser/dom.ts

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -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-
879862
export 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-
961930
export 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+
}

src/vs/base/test/browser/dom.test.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,6 @@ suite('dom', () => {
8282
// }
8383
//});
8484

85-
test('removeScriptTags', function () {
86-
var input = "<div>test</div>";
87-
assert(dom.removeScriptTags(input) === input);
88-
89-
var inputWithScript = "<div>test<script>window.alert('foo');</script></div>";
90-
assert(dom.removeScriptTags(inputWithScript) === "<div>test</div>");
91-
});
92-
9385
test('safeStringify', function() {
9486
var obj1 = {
9587
friend: null

0 commit comments

Comments
 (0)