瀏覽代碼

getPositionedAncestor() PoC using HTMLElement.offsetParent.

Aleksander Nowodzinski 5 年之前
父節點
當前提交
ec77cf41f2
共有 1 個文件被更改,包括 16 次插入0 次删除
  1. 16 0
      packages/ckeditor5-utils/src/dom/getpositionedancestor.js

+ 16 - 0
packages/ckeditor5-utils/src/dom/getpositionedancestor.js

@@ -26,3 +26,19 @@ export default function getPositionedAncestor( element ) {
 
 	return null;
 }
+
+// export default function getPositionedAncestor( element ) {
+// 	if ( !element || !element.parentNode ) {
+// 		return null;
+// 	}
+
+// 	if ( element.style.position && element.style.position !== 'static' ) {
+// 		return element;
+// 	}
+
+// 	if ( element.offsetParent === global.document.body ) {
+// 		return null;
+// 	}
+
+// 	return element.offsetParent;
+// }