I am experiencing what seems like an error in rendering the width of the floating elements in WebKit when they have fields.
In Firefox (3.6) and WebKit (Chromium 5.0), the following values โโare displayed:
<div style="width: 100%; background-color: green;"> <div style="background-color: red; float: left; width: 50%;">n</div> <div style="background-color: red; float: left; width: 50%;">n</div> <div style="clear: both;"></div> </div>
That is, like a completely red box, without a green background.
Now try the following:
<div style="width: 100%; background-color: green;"> <div style="background-color: red; float: left; width: 40%; margin-left: 10%;">n</div> <div style="background-color: red; float: left; width: 50%;">n</div> <div style="clear: both;"></div> </div>
It is expected the same as before, except that 10% of the window on the left is green. This is what is seen on Firefox.
However, in WebKit browsers, one green pixel remains in the right part of the window: floating elements no longer fill it completely.
The problem seems complicated when more floats and fields are used, as a result of which a larger number is not recorded.
This is mistake? Rounding error? This, of course, is not what I expected. And more importantly, what can I do to get around this?
EDIT: after a long search, I found this error message; probably rounding error as expected: https://bugs.webkit.org/show_bug.cgi?id=5531
My most important question still stands: is there any way around the error?