Переглянути джерело

removed markBackdropBackground

Gildas 7 роки тому
батько
коміт
c4d1a47ef0
1 змінених файлів з 0 додано та 20 видалено
  1. 0 20
      lib/single-file/doc-helper.js

+ 0 - 20
lib/single-file/doc-helper.js

@@ -74,7 +74,6 @@ this.docHelper = this.docHelper || (() => {
 					}
 					markHiddenCandidates(win, doc.body, styles, false, markerRemovedContent, new Set(), ignoredTags);
 					markHiddenElements(win, doc.body, markerRemovedContent);
-					markBackdropBackground(doc, win, markerRemovedContent);
 					doc.querySelectorAll("iframe").forEach(element => {
 						const boundingRect = element.getBoundingClientRect();
 						if (element.hidden || element.style.display == "none" || boundingRect.width <= 1 && boundingRect.height <= 1) {
@@ -121,25 +120,6 @@ this.docHelper = this.docHelper || (() => {
 		});
 	}
 
-	function markBackdropBackground(doc, win, markerRemovedContent) {
-		const threshold = BACKDROP_THRESHOLD_SIZE;
-		let elements = getCandidateElements();
-		let fullScreen = true;
-		while (elements.length > 1 && fullScreen) {
-			elements = getCandidateElements();
-			const element = elements[0];
-			const style = win.getComputedStyle(element);
-			fullScreen = (element.clientWidth >= win.innerWidth * threshold) && (element.clientHeight >= win.innerHeight * threshold) && (style && style.getPropertyValue("z-index") >= BACKDROP_THRESHOLD_ZINDEX);
-			if (fullScreen) {
-				element.setAttribute(markerRemovedContent, "");
-			}
-		}
-
-		function getCandidateElements() {
-			return Array.from(doc.elementsFromPoint(win.innerWidth / 2, win.innerHeight / 2)).filter(element => element.tagName.toLowerCase() != MASK_TAGNAME && element.getAttribute(markerRemovedContent) == null);
-		}
-	}
-
 	function getStyles(win, element, styles = new Map()) {
 		const elements = Array.from(element.childNodes).filter(node => node instanceof win.HTMLElement);
 		elements.forEach(element => {