redact: the masking demo card keeps 14px from the card above it
The page has no gap of its own; the request list keeps its distance from the card with margin-top: 14px. The demo card, put between them incad7bbbdb, had none, so it sat flush under the card above. It gets the same 14px, and masking-demo checks the room above and below it is 14 and 14. Run at this head (origin/maincad7bbbdb+ this change), on mote: - node --test masking-demo, masking-records: 108 pass, 0 fail (Chromium and WebKit, five languages, 1100 and 640px). - Broken by hand: without the margin, the new check is red (0 for 14, WebKit en 1100px).
This commit is contained in:
@@ -255,7 +255,7 @@ body.window .msk-onebar::before { inset: -6px -16px; }
|
||||
/* How masking works (demo.js): a row that opens onto 小鹊 taking one request
|
||||
through. Her video is drawn on the card's colour, one take per theme; the
|
||||
stage is laid out at 1000×420 and scaled to the card */
|
||||
.msk-demo { flex: none; border-radius: 14px; border: 1px solid var(--line); background: var(--card); overflow: hidden; }
|
||||
.msk-demo { flex: none; margin-top: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); overflow: hidden; }
|
||||
.msk-demo[hidden], .md-body[hidden] { display: none; }
|
||||
.md-row { all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 9px 16px 9px 12px; cursor: pointer; }
|
||||
.md-row:hover { background: var(--pill-hover); }
|
||||
|
||||
@@ -88,6 +88,11 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
|
||||
assert(await page.locator("#mdBody").isHidden(), "folded at first");
|
||||
// it sits between the card and the requests
|
||||
assert.deepEqual(await page.evaluate(() => [document.querySelector("#maskDemo").previousElementSibling?.id, document.querySelector("#maskDemo").nextElementSibling?.id]), ["maskCard", "maskList"]);
|
||||
// with the same room above it as the list has below it
|
||||
assert.deepEqual(await page.evaluate(() => {
|
||||
const r = (s) => document.querySelector(s).getBoundingClientRect();
|
||||
return [Math.round(r("#maskDemo").top - r("#maskCard").bottom), Math.round(r("#maskList").top - r("#maskDemo").bottom)];
|
||||
}), [14, 14]);
|
||||
await page.waitForTimeout(300);
|
||||
assert(!fetched.some((f) => f.endsWith(".webm")), "a video fetched while folded: " + fetched);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user