Closed Bug 1007374 Opened 11 years ago Closed 1 month ago

Showing negative value in dimensions for element with display:none

Categories

(DevTools :: Inspector: Layout, defect, P2)

defect

Tracking

(firefox136 fixed)

RESOLVED FIXED
136 Branch
Tracking Status
firefox136 --- fixed

People

(Reporter: bgrins, Assigned: xpresskaran98)

References

()

Details

Attachments

(2 files)

Go to: http://www.nerdist.com/podcasts-landing/. Open devtools, and inspect this element: $$("#div-gpt-ad-300x250-tablet-grid") Box model dimensions are showing 0x-27 or 0x-26 depending on the system. See gif at: https://twitter.com/jonathansampson/status/464137697800781824
Brian, the URL from comment 0 doesn't exist anymore, it redirects to the homepage. I tried to search the node you indicated with no luck though. I couldn't find any bug ( opened or closed ) with similar problem. I doubt you remember what was the cause of this issue, but does it rings a bell ?
Flags: needinfo?(bgrinstead)
Priority: -- → P3
I am seeing one case of this still at: https://web.archive.org/web/20140509231150/http://www.nerdist.com/podcasts-landing if you select this element in the inspector: #div-gpt-ad-300x250-tablet-grid (which appears to be hidden and should be 0x0 but instead shows up as 0x-26.984)
Flags: needinfo?(bgrinstead)
Attached file negative.html
Simpler STR : 1. Open attachment 2 [review]. Open Inspector 3. Select <div class="negative"> node 4. Open "Box Model" tab Expected Result: content box shows 0x0 (because div is "display:none;") Actual Result: content box shows -20x-20 Note that similar issue can be triggered with the "border" style applied on a none-displayed element.
Priority: P3 → P2
Product: Firefox → DevTools
Severity: normal → S3

When the element isn't displayed, we could avoid showing any content size.
For what it's worth, Chrome is showing auto x auto

Component: Inspector → Inspector: Layout
Summary: [layout view] Showing negative value in dimensions for element → Showing negative value in dimensions for element with display:none

I have successfully reproduced this bug. Can this be assigned to me ?

(In reply to Karan Yadav from comment #5)

I have successfully reproduced this bug. Can this be assigned to me ?

Sure, I just assigned it to you

Assignee: nobody → xpresskaran98
Status: NEW → ASSIGNED

(In reply to Nicolas Chevobbe [:nchevobbe] from comment #4)

When the element isn't displayed, we could avoid showing any content size.
For what it's worth, Chrome is showing auto x auto

I have implemented the patch based on this suggestion. Please review it and let me know if there are any concerns or improvements needed.

Attachment #9445691 - Attachment description: Bug 1007374 - Show Auto in box-model if width or height is less than 0. r=#devtools-reviewers → Bug 1007374 - Show Auto in box-model if width or height is less than 0 and add the test for the same. r=#devtools-reviewers
Attachment #9445691 - Attachment description: Bug 1007374 - Show Auto in box-model if width or height is less than 0 and add the test for the same. r=#devtools-reviewers → Bug 1007374 - Show "auto" in box-model if width or height is less than 0. r=#devtools-reviewers
Pushed by nchevobbe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ec29bce06ae0 Show "auto" in box-model if width or height is less than 0. r=devtools-reviewers,nchevobbe
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 136 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: