Kaynağa Gözat

moved function from DocUtil to Util

Gildas 7 yıl önce
ebeveyn
işleme
cbc592f2cc

+ 0 - 11
lib/single-file/single-file-browser.js

@@ -214,17 +214,6 @@ this.SingleFileBrowser = this.SingleFileBrowser || (() => {
 			return doc;
 		}
 
-		static getOnEventAttributeNames(doc) {
-			const element = doc.createElement("div");
-			const attributeNames = [];
-			for (const propertyName in element) {
-				if (propertyName.startsWith("on")) {
-					attributeNames.push(propertyName);
-				}
-			}
-			return attributeNames;
-		}
-
 		static getParser() {
 			return DOMParser;
 		}

+ 12 - 1
lib/single-file/single-file-core.js

@@ -332,7 +332,7 @@ this.SingleFileCore = this.SingleFileCore || (() => {
 				this.baseURI = this.options.url = resourceURL;
 			}
 			this.doc = DocUtil.createDoc(pageContent, this.baseURI);
-			this.onEventAttributeNames = DocUtil.getOnEventAttributeNames(this.doc);
+			this.onEventAttributeNames = Util.getOnEventAttributeNames(this.doc);
 		}
 
 		async getPageData() {
@@ -1487,6 +1487,17 @@ this.SingleFileCore = this.SingleFileCore || (() => {
 			return result;
 		}
 
+		static getOnEventAttributeNames(doc) {
+			const element = doc.createElement("div");
+			const attributeNames = [];
+			for (const propertyName in element) {
+				if (propertyName.startsWith("on")) {
+					attributeNames.push(propertyName);
+				}
+			}
+			return attributeNames;
+		}
+
 		static async evalTemplateVariable(template, variableName, valueGetter, dontReplaceSlash) {
 			const replaceRegExp = new RegExp("{\\s*" + variableName + "\\s*}", "g");
 			if (template.match(replaceRegExp)) {