[Webkit-unassigned] [Bug 48640] Add layout test that check getBoundingClientRect w/ zooming

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Nov 1 12:23:34 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=48640





--- Comment #4 from Cosmin Truta <ctruta at chromium.org>  2010-11-01 12:23:34 PST ---
(In reply to comment #3)
> I was confused what you mean with rounding problems. I thought you wanted to solve it in the code, rather than in the tests :-)

I did that as an interim workaround, because developing the actual fix was taking too long, and I wasn't even sure that I can do it properly. Even now, after submitting the patch for bug 48110, I can say it's a good solution, but not that it's the best solution. I had to modify enclosingIntRect(), in a way that you might or might not find acceptable ;-)

Here is the trouble I'm running into:
float scale = 1.2f;  // 1.20000005
float orig_x = 30.0f;  // 30.0
float scaled_x = orig_x * scale;  // 36.0
float adjusted_x = scaled_x / scale;  // 29.9999981

Here, the original enclosingIntRect() is taking floatf(29.9999981), which is 29, and I'm expecting 30. There is no way to recover this loss, except by making the compromise of introducing an epsilon inside enclosingIntRect (or inside an other new function, named enclosingIntRectRoundedForImprecise, if you don't agree with modifying enclosingIntRect).

See my patch, and my detailed comments, in bug 48110.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list