Closed
Bug 989802
Opened 10 years ago
Closed 10 years ago
rounding of viewport units sometimes rounds up, leading to things expected to fit not fitting in a container
Categories
(Core :: CSS Parsing and Computation, defect)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
FIXED
mozilla32
People
(Reporter: marek.raida, Assigned: dbaron)
References
()
Details
Attachments
(2 files, 1 obsolete file)
1.00 KB,
text/html
|
Details | |
17.38 KB,
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0 (Beta/Release) Build ID: 20140330030202 Steps to reproduce: Basic HTML page with layout using box-sizing: border-box, display: inline-block and vw units. The only remotely (perhaps) related and open issues to this I was able to find are: 176237 and 935850 Actual results: If you try to resize window with four boxes side-by-side to several window's widths, sometimes, the last box in line drops to the beginning of next floating row, which is not wanted and not logical at all; it happens probably because of some computation/math rounding related problem. For me, from approx. 20 tested width sizes, some fit 13 and some 7 not. Discovered by my colleague Robin and demonstrated here http://codepen.io/robinpokorny/full/iFemu + I'm enclosing reduced testcase as attachment to this issue as well. BTW changing anything in .wrapper class fixes/affects the broken behavior. It is broken in both current stable Firefox release and latest nightly build. Expected results: All four boxes should stay in one line on all occasions.
Reporter | ||
Updated•10 years ago
|
Assignee | ||
Comment 1•10 years ago
|
||
I think I see the underlying bug, which is specific to viewport units and not to box-sizing.
Assignee: nobody → dbaron
Status: UNCONFIRMED → ASSIGNED
Component: Layout → CSS Parsing and Computation
Ever confirmed: true
OS: Windows 7 → All
Hardware: x86_64 → All
Summary: Box-sizing math rounding issue → rounding of viewport units sometimes rounds up, leading to things expected to fit not fitting in a container
Version: 31 Branch → Trunk
Assignee | ||
Comment 2•10 years ago
|
||
Untested work-in-progress patch: https://hg.mozilla.org/users/dbaron_mozilla.com/patches/raw-file/2a40e7a0a2b0/round-viewport-units I'll test this (and write an automated test) later; have other things to do on a nice Sunday afternoon.
Assignee | ||
Comment 3•10 years ago
|
||
(Though technically I think what I want is round-towards-zero rather than floor; that'll be a little more trouble since we don't have a method for that already.)
Reporter | ||
Comment 4•10 years ago
|
||
Thx David a lot for diving into the issue so quickly, we appreciate it a lot...
Assignee | ||
Comment 5•10 years ago
|
||
Sorry for the delay getting back to this; finally got a chance to finish it up this morning. Try push: https://tbpl.mozilla.org/?tree=Try&rev=c7716cca08da
Assignee | ||
Comment 6•10 years ago
|
||
viewport-units-rounding-1.html fails without the patch and passes with the patch. viewport-units-rounding-2.html fails with an early version of the patch but not without the patch or with the final version.
Attachment #8427880 -
Flags: review?(roc)
Reporter | ||
Comment 7•10 years ago
|
||
Oh, do not apologize for delay, it is still great that you've reprioritized and get to this. Thank you...
Assignee | ||
Comment 8•10 years ago
|
||
From the try run, it looks like I need to fix two tests in layout/reftests/css-valuesandunits/.
Attachment #8427880 -
Flags: review?(roc) → review+
Assignee | ||
Comment 9•10 years ago
|
||
https://tbpl.mozilla.org/?tree=Try&rev=7670542545c9
Assignee | ||
Comment 10•10 years ago
|
||
There turned out not to be a reasonable way to fix he test, but fixing the code to divide by 100.0f (which can be exactly represented as a float) rather than multiplying (earlier) by 0.01f (which can't be represented exactly) fixes the test failures, so I'm inclined to do just that.
Attachment #8427880 -
Attachment is obsolete: true
Attachment #8430445 -
Flags: review?(roc)
Assignee | ||
Updated•10 years ago
|
Attachment #8430445 -
Attachment is patch: true
Attachment #8430445 -
Attachment mime type: message/rfc822 → text/plain
Attachment #8430445 -
Flags: review?(roc) → review+
Assignee | ||
Comment 11•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/68736e0362c3
Flags: in-testsuite+
Comment 12•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/68736e0362c3
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla32
You need to log in
before you can comment on or make changes to this bug.
Description
•