diff --git a/resources/tester/helper_202_1_fill_below.cjs b/resources/tester/helper_202_1_fill_below.cjs index 73fd59feb..190b7517c 100644 --- a/resources/tester/helper_202_1_fill_below.cjs +++ b/resources/tester/helper_202_1_fill_below.cjs @@ -44,17 +44,19 @@ const sty = (n) => ({ paddingBottom: n.css.paddingBottom ?? "0px", borderBottomWidth: n.css.borderBottomWidth ?? "0px", marginBottom: n.css.marginBottom ?? "0px", + position: n.css.position ?? "static", }); const box = { exports: {} }; -new Function("exports", "module", "require", "window", "document", "getComputedStyle", "ResizeObserver", js)( - box.exports, - box, - (p) => (p.endsWith(".css") ? {} : require(p)), - win, - { body: null }, - sty, - RO, -); +new Function( + "exports", + "module", + "require", + "window", + "document", + "getComputedStyle", + "ResizeObserver", + js, +)(box.exports, box, (p) => (p.endsWith(".css") ? {} : require(p)), win, { body: null }, sty, RO); const m = box.exports; // 문서: body(padding-bottom 8) > card(padding-bottom 12 · gap 8) > [root][avg 20][info 30][hint 40] @@ -81,4 +83,9 @@ hint.height = 60; observers.forEach((o) => o.fn()); out.afterHintGrow = parseFloat(root.style.maxHeight); out.firstMinusGrow = out.first - 20; + +// 열린 창 가림막(body 끝 · position fixed · 창 높이) = 아래 자리에 안 셈(707-5) +link(body, card, el("backdrop", { position: "fixed" }, 900)); +out.belowWithModal = m.spaceBelow(root); +out.belowAfterGrow = 3 * 8 + 20 + 30 + 60 + 12 + 8; console.log(JSON.stringify(out)); diff --git a/resources/tester/test_202_1_table_hint_bottom.py b/resources/tester/test_202_1_table_hint_bottom.py index 5d89460f6..f79393036 100644 --- a/resources/tester/test_202_1_table_hint_bottom.py +++ b/resources/tester/test_202_1_table_hint_bottom.py @@ -177,3 +177,4 @@ def test_창_끝까지_셈에_아래_안내_줄_포함(): assert r["below"] == r["belowExpected"] == 134 # 아래 줄 · 안내 줄 둘 + 여백 assert r["bottom"] == r["viewport"] # 문서 맨 아래 = 창 끝 → 페이지 스크롤 0 assert r["afterHintGrow"] == r["firstMinusGrow"] # 안내 줄이 늘면 표 칸이 그만큼 줄어듦 + assert r["belowWithModal"] == r["belowAfterGrow"] # 열린 창 가림막(fixed) = 아래 자리 아님 diff --git a/ui_template/ui_template_data_table.ts b/ui_template/ui_template_data_table.ts index 6fd8c5c2d..7ffe3a975 100644 --- a/ui_template/ui_template_data_table.ts +++ b/ui_template/ui_template_data_table.ts @@ -410,7 +410,8 @@ export function spaceBelow(el: HTMLElement): number { for (let s = node.nextElementSibling; s; s = s.nextElementSibling) { const h = s.getBoundingClientRect().height; const m = getComputedStyle(s); // 203 형제 위아래 바깥 여백도(B09 안내 글 margin-top) - if (h) sum += h + gap + px(m.marginTop) + px(m.marginBottom); + const out = m.position === "fixed" || m.position === "absolute"; // 열린 창 가림막 · 알림 = 자리 안 씀 + if (h && !out) sum += h + gap + px(m.marginTop) + px(m.marginBottom); } sum += px(own.marginBottom) + px(around.paddingBottom) + px(around.borderBottomWidth); }