test(browser): Firefox의 Pretendard name 표 경고 한 줄만 받아들인다
Firefox는 번들된 pretendard 1.3.9 가변 폰트를 열 때마다 콘솔에
「downloadable font: name: name records are not sorted」 경고를 낸다.
브라우저 시험의 공용 fixture(strict-browser-test.ts)는 경고도 실패로
세므로, Firefox에서는 폰트를 쓰는 거의 모든 시험이 떨어진다.
2026-11-12 main(7853ff1d) 기준으로 FE-GATE-008 e2e의 Firefox 실패
143건 중 118건, capability 19건 전부, FE-GATE-009의 29건이 이것
하나뿐이었다.
경고는 폰트 파일 안 name 레코드의 순서를 말한다. Firefox의 폰트 검사기
(OTS)가 순서를 고치고 폰트를 그대로 쓴다. Chromium과 WebKit은 아무것도
내지 않는다. 그래서 이 경고 한 줄만 fixture에서 무시한다. 폰트 이름,
가중치 범위, 파일 이름까지 맞는 문장만 받는다. 폰트가 거부되면
「rejected by sanitizer」 같은 다른 문장이 나오고, 그것은 여전히 실패다.
버린 대안: 폰트를 다시 써서(fonttools로 저장) 정렬된 파일을 repo에 두기.
npm 패키지 대신 고친 바이너리를 직접 관리하게 되고, 패키지를 올릴 때마다
다시 만들어야 한다.
위험: Pretendard를 다른 판으로 바꿔 경고 문장이 달라지면 이 정규식이
맞지 않아 다시 실패한다. 그때는 그 문장을 보고 판단한다.
검증 (desktop, Playwright 1.62, CI env):
- Firefox에서 빌드한 앱: Pretendard Variable status "loaded",
document.fonts.check('16px "Pretendard Variable"') true, h1 글꼴
Pretendard Variable. 경고는 그대로 한 줄 나온다.
- test:browser-capabilities: Firefox 실패 19건 → 0건.
This commit is contained in:
@@ -5,10 +5,22 @@ import {
|
||||
type Page,
|
||||
} from "@playwright/test";
|
||||
|
||||
/**
|
||||
* Firefox's font sanitizer (OTS) reports that the `name` table of the bundled
|
||||
* `pretendard` 1.3.9 variable font lists its records out of order. It sorts
|
||||
* them itself and the font still loads (`document.fonts.check` is true in
|
||||
* Firefox); Chromium and WebKit say nothing. The file is the npm package's, not
|
||||
* ours. Only this exact warning for this font is ignored: a font the sanitizer
|
||||
* rejects logs a different line and still fails.
|
||||
*/
|
||||
const FIREFOX_PRETENDARD_NAME_ORDER =
|
||||
/^\[JavaScript Warning: "downloadable font: name: name records are not sorted\. \(font-family: "Pretendard Variable" style:normal weight:45\.\.920 stretch:100 src index:0\) source: http:\/\/127\.0\.0\.1:\d+\/[\w./@-]*PretendardVariable(?:-[\w-]+)?\.woff2"\]$/u;
|
||||
|
||||
function ignoredConsole(message: ConsoleMessage) {
|
||||
return (
|
||||
message.type() === "warning" &&
|
||||
message.text().includes("NO_COLOR")
|
||||
(message.text().includes("NO_COLOR") ||
|
||||
FIREFOX_PRETENDARD_NAME_ORDER.test(message.text()))
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user