Closed twop closed 2 years ago
This is an inherited code base. Unless I can find directions in the spec to do this or behavior from Chrome that matches, I'm going to call this a bug.
One other observation:
From the MeasureFunc
I returned (63.75, 10.5)
but got back (63,10)
. Note the rounding of 10.5
down to 10
, which feels a bit weird
Red box is the result of the layout, note that the text goes out of bounds because of the rounding.
I also can't find an explanation on why this was implemented in the related commits
@mockersf also edited parts of that code once in this commit, maybe they know more?
Browsers round fractional pixels. Some up, some down.
http://www.simonbattersby.com/blog/browsers-and-fractional-pixels/
This lib is made to work like Chrome so it's rounding like it.
Browsers round fractional pixels. Some up, some down.
Ah, of course.
My instinct is that I'd like the ability to control whether or not we reproduce Chrome's bugs / quirks. But I'm not quite sure what design we should use for that. I'm not super keen on piping a config enum through everything, but a feature flag also seems very iffy.
Anyways, I'm going to close this out as "not a bug" for now, and we can open up a more focused issue for the "compatibility mode" question as it comes up.
Just spent an hour debugging why the leaf node I measured is set to
63.0
when my measure function returned63.375
When I looked at the sources I found the explicit rounding in the algo.rs
I couldn't find any mentions why the rounding is needed, thus I'm curious. It seems to be 100% intentional. Maybe add an explanation in the code annotations?