Closed Bug 1846299 Opened 1 year ago Closed 1 year ago

WPT failure in css/css-text/tab-size/tab-min-rendered-width-1.html

Categories

(Core :: Layout: Text and Fonts, defect, P3)

defect

Tracking

()

RESOLVED FIXED
118 Branch
Tracking Status
firefox118 --- fixed

People

(Reporter: twisniewski, Assigned: jfkthame)

References

()

Details

Attachments

(1 file)

We are failing this test as the 0.7625ch tab size isn't rendering as expected. WebKit 175 recently aligned with Chrome on this test, so it would be good to find out what's going on here.

Jonathan you added this test and it seems to pass in automation, mind taking a look?

Severity: -- → S3
Component: CSS Parsing and Computation → Layout: Text and Fonts
Flags: needinfo?(jfkthame)
Priority: -- → P3

Test passes locally on Linux here. Hopefully just a test bug?

The failure is on the line where the initial span on the line has width: 7.5ch, so then the effective width of the tab should be exactly 0.5ch and it shouldn't need to skip to the next tab-stop. But depending on the font in use, the computation of widths in ch units may involve floating-point inaccuracies, and this is potentially making it look as though the tab width ends up fractionally less than 0.5ch.

To avoid this, I guess we could make the testcase use a known font like Ahem, with a size where the ch unit will compute to an exact number of pixels and floating-point width computations shouldn't cause an issue.

Flags: needinfo?(jfkthame)
Assignee: nobody → jfkthame
Status: NEW → ASSIGNED

This should make the test less fragile with respect to floating-point ch-width computations.

I can reproduce the failure locally, and I confirmed the patch fixes it for me. \o/

(Interesting that it doesn't reproduce on TreeHerder; font-specific stuff I guess.)

Pushed by jkew@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/fda13e44fbdc Make tab-min-rendered-width test use 16px Ahem as the block font, to avoid floating-point inaccuracies in tab-width computation. r=dholbert
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/41606 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 118 Branch
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: