Fractional border-spacing truncated to integer pixels

#577461552 Assigned · P3 S3 CL 8663339 · CL 8666562

Before / After

Before — 0.5px computed as 0px

before fix: 0.5px and 1.5px border-spacing truncated

After — fractional values preserved

after fix: 0.5px and 1.5px correctly computed

Root cause

-webkit-border-horizontal/vertical-spacing stored as short (int16_t). ConvertComputedLength<short> truncated sub-pixel values before they reached computed style. Fix: change field type to LayoutUnit (1/64 px precision).

// css_properties.json5 -- before
type_name: "short",
converter: "ConvertComputedLength<short>",

// after
type_name: "LayoutUnit",
converter: "ConvertLayoutUnit",

Links

Issue 577461552 CL 8663339 (fix) CL 8666562 (WPT)