mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 17:55:07 +02:00
Tests: Use wider test string in FontFace arraybuffer matching test
This test relies on the width of the test font and the fallback font
being different to determine whether they matched or not. The
`offsetWidth` rounding change introduced in 51c7afdf5f caused these
widths to appear the same, meaning the test failed. This change avoids
the issue by using a longer string with a deliberately wide glyph.
This commit is contained in:
committed by
Andreas Kling
parent
7f4600f0e9
commit
2c728abd9f
Notes:
github-actions[bot]
2026-04-05 07:20:31 +00:00
Author: https://github.com/tcl3 Commit: https://github.com/LadybirdBrowser/ladybird/commit/2c728abd9fb Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8786
@@ -13,13 +13,16 @@
|
||||
const element = document.createElement("span");
|
||||
element.style.fontFamily = "TestFont, serif";
|
||||
element.style.fontSize = "20px";
|
||||
element.textContent = "test";
|
||||
// We use a deliberately long string and a wide glyph here to ensure the width of the test font and the fallback
|
||||
// font will be different.
|
||||
const testString = "WWWWWWWWWWWWWWWWWWWW"
|
||||
element.textContent = testString;
|
||||
document.body.appendChild(element);
|
||||
|
||||
const fallbackElement = document.createElement("span");
|
||||
fallbackElement.style.fontFamily = "serif";
|
||||
fallbackElement.style.fontSize = "20px";
|
||||
fallbackElement.textContent = "test";
|
||||
fallbackElement.textContent = testString;
|
||||
document.body.appendChild(fallbackElement);
|
||||
|
||||
// Force layout
|
||||
|
||||
Reference in New Issue
Block a user