Closed
Bug 1130992
Opened 10 years ago
Closed 10 years ago
height calculation in box model in dev tools shows one pixel too much
Categories
(DevTools :: Inspector, defect)
Tracking
(Not tracked)
RESOLVED
WORKSFORME
People
(Reporter: lamotte.cyril, Unassigned)
Details
Attachments
(1 file)
|
1.97 MB,
application/x-zip-compressed
|
Details |
User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36
Steps to reproduce:
I am calculating div's height and apply by JS a min-height
Actual results:
In the dev tools, the box model show 255 (height) + 3 (border-bottom).
Whereas the overlay indicate 259.
Expected results:
Overlay should indicate 258 (255 + 3) OR box model should indicate
It is not coherent
I join the mockup
Updated•10 years ago
|
Summary: height calculation → height calculation in box model in dev tools shows one pixel too much
Updated•10 years ago
|
Component: Untriaged → Developer Tools: Inspector
What version of Firefox did you test with here?
Flags: needinfo?(lamotte.cyril)
(In reply to lamotte.cyril from comment #2)
> Hi,
>
> The current stable : 37.01
Can check in the latest Developer Edition[1] (Fx 39)? A fix for this was recently made in bug 1113761 for Firefox 39, currently in Dev. Edition.
[1]: https://www.mozilla.org/en-US/firefox/channel/#developer
Flags: needinfo?(lamotte.cyril)
| Reporter | ||
Comment 4•10 years ago
|
||
Hi,
Same result with : Dev Edition : 39.0a2 (2015-04-07)
Flags: needinfo?(lamotte.cyril)
| Reporter | ||
Comment 5•10 years ago
|
||
Actually, there is a 0.317px difference. Div is 258.317px, height calculation return 255 (258 - 3 of border).
Maybe the height calculation does not care about subpixels ? (I use the jquery "height()" method)
(In reply to lamotte.cyril from comment #5)
> Actually, there is a 0.317px difference. Div is 258.317px, height
> calculation return 255 (258 - 3 of border).
>
> Maybe the height calculation does not care about subpixels ? (I use the
> jquery "height()" method)
Yes, it seems that way. Many older methods round to integers.
You can use something like element.getClientRects() to receive the true size.
I believe this means the tools are now working correctly, but please reopen if you disagree!
Status: UNCONFIRMED → RESOLVED
Closed: 10 years ago
Resolution: --- → WORKSFORME
| Reporter | ||
Comment 7•10 years ago
|
||
Ok for me
Thanks a lot
Updated•7 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•