From 1e91bf151f43ad05138e862ba4a03abad6929e5f Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sat, 24 Sep 2022 16:05:19 -0400 Subject: DocumentUtil static (#2232) * Make all methods static The two non-static methods are kept for temporary compatibility * Use this instead of class name now that functions are static * Update test * Don't instantiate DocumentUtil * Remove temporary non-static methods * Remove unused global declaration --- test/test-document-util.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/test-document-util.js b/test/test-document-util.js index 34f4f8b3..ad4da269 100644 --- a/test/test-document-util.js +++ b/test/test-document-util.js @@ -166,8 +166,7 @@ async function testDocumentTextScanningFunctions(dom, {DocumentUtil, TextSourceR }; // Test docRangeFromPoint - const documentUtil = new DocumentUtil(); - const source = documentUtil.getRangeFromPoint(0, 0, { + const source = DocumentUtil.getRangeFromPoint(0, 0, { deepContentScan: false, normalizeCssZoom: true }); @@ -202,7 +201,7 @@ async function testDocumentTextScanningFunctions(dom, {DocumentUtil, TextSourceR } // Test docSentenceExtract - const sentenceActual = documentUtil.extractSentence( + const sentenceActual = DocumentUtil.extractSentence( source, false, sentenceScanExtent, -- cgit v1.2.3