Closed Bug 67690 Opened 24 years ago Closed 24 years ago

aReflowState.mComputedWidth/Height incorrectly computed when absolutely positioned

Categories

(Core :: Layout: Form Controls, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla0.8.1

People

(Reporter: jsp, Assigned: attinasi)

Details

(Whiteboard: [fix in hand])

Attachments

(5 files)

From Bugzilla Helper: User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; m18) Gecko/20010125 BuildID: 2001012504 Checkbox and radio button controls are larger when positioned absolutely than when they are not so positioned. Size and position should not be related. Reproducible: Always Steps to Reproduce: Create a form with an absolutely positioned checkbox or radio button and another that is not absolutely positioned. See the attachment for an example. Actual Results: The positioned control is +/- 25% larger than the unpositioned control. Expected Results: Both controls should be the same size. The same behavior occurs on Macintosh build 2001020208.
Attached file Test case.
WOW, Wild. Confirming new.
Status: UNCONFIRMED → NEW
Ever confirmed: true
The label positioning may actually be right... The top of the controls lines up with the top of the text if you ignore ascenders. But the sizing issue is weird.
I think the label positioning is correct; it's the positioning of the oversized radio button that's suspect. See the new screen shot attachment.
Just as it says, I will attach an example using div. Checkboxes and radiobutton use nsLeafFrame:Reflow which eventually gets the size from aReflowState.mComputedWidth and it is there that it is already calculated incorrectly.
Assignee: rods → attinasi
Summary: Form controls sized incorrectly if positioned absolutely → aReflowState.mComputedWidth/Height incorrectly computed when absolutely positioned
Attached file testcase with divs
Interestingly, relative positioning is OK. I'm investigating this now...
Status: NEW → ASSIGNED
Problem is actually with box-sizing in absolute positioned items. I have a patch for it now, will attach. Basically, box-sizing was being ignored in nsHTMLReflowState::InitAbsoluteConstraints.
Should make two functions (one for width, one for height) that incorporate this with the code which respects the min/max width/height? (Possibly inline.) Also, how about ``apply padding and borders unless unconstrained'' instead of ``MJA - from CompueBlockBoxData''. :-)
yep, what chris said
OK - thanks. I'll consolidate the code, and there are a few other places that can use it too.
looks good to me. run them regression tests, and r=waterson
Regerssion tests are OK - one meaningful difference was found, * file:///s:/mozilla/layout/html/tests/block/bugs/55874.html The rendering is different but more correct. I'm also checking in the testcase for this bug for future regerssion testing.
Marking Mozilla 0.9 since I have a reviewed, approved patch in hand.
Keywords: patch
Whiteboard: [fix in hand]
Target Milestone: --- → mozilla0.9
Milestone shift --> Moz 0.8.1
Target Milestone: mozilla0.9 → mozilla0.8.1
sr=hyatt
Fix checked in: nsHTMLReflowState.h/cpp
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Verified build 20010724& 20010730trunk os:mac8.6/win98/linux7
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: