Closed Bug 17474 Opened 25 years ago Closed 25 years ago

html and input buttons do not obey CSS width,height

Categories

(Core :: Layout: Form Controls, defect, P2)

x86
Windows NT
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: rods, Assigned: eric)

Details

Attachments

(3 files)

The HTML button minimum size is always the content, there is no way to make the
button size smaller than the content.

This is blocking me because I cannot get the comboboxes to size correctly
without this being fixed.
Part of the problem is right here:
  // if computed use the computed values.
  if (aReflowState.mComputedWidth != NS_INTRINSICSIZE && (aDesiredSize.width <
aReflowState.mComputedWidth))
    aDesiredSize.width = aReflowState.mComputedWidth;
  else
    aDesiredSize.width  += focusPadding.left + focusPadding.right;

  if (aReflowState.mComputedHeight != NS_INTRINSICSIZE && (aDesiredSize.height <
aReflowState.mComputedHeight))
    aDesiredSize.height = aReflowState.mComputedHeight;
  else
    aDesiredSize.height += focusPadding.top + focusPadding.bottom;

It should be:
  // if computed use the computed values.
  if (aReflowState.mComputedWidth != NS_INTRINSICSIZE)
    aDesiredSize.width = aReflowState.mComputedWidth;
  else
    aDesiredSize.width  += focusPadding.left + focusPadding.right;

  if (aReflowState.mComputedHeight != NS_INTRINSICSIZE)
    aDesiredSize.height = aReflowState.mComputedHeight;
  else
    aDesiredSize.height += focusPadding.top + focusPadding.bottom;

But doing this then causes a clipping problem when the text is drawn.
This could be a separate bug, but the default size for a button is too tall and
not wide enough for a given piece of text in NavQuirks mode. The new attachment
shows this.
Status: NEW → ASSIGNED
I'll take a look at this.
I have completed the code for making the GfxButton size correctly in
NavQuirks, in Standard mode it will use the nsHTMLButtonControlFrame's
reflow. The nsHTMLButtonControlFrame::Reflow still needs to obey the sizes that
are passed in so not much has chnaged with this bug.
It looks like this affect more types of <input>s than just "button".
Testcase added ("testcase - wrong CSS sizing of input text if other attributes")
showing <input type="text"> too small if sized in ems, and <input size="1">
too large whether sized in ems or in pixels. Guessing that this interaction
problem affects all <input> elements sized by CSS - but if this is a "button"
bug more than a CSS size bug I'll create a new report for <input type="text">
sizing.

Tested with 1999-11-06-08-M11 on Windows NT.
Blocks: 18471
Summary: [blocker]html and input buttons do not obey CSS width,height → html and input buttons do not obey CSS width,height
Rod, is this really blocking you from doing useful work?  If so, please put on
dogfood radar.  If not, it shouldn't be marked blocker severity. Removing
extraneous 'blocker' from whiteboard. Eric, this needs a target milestone.
Priority: P3 → P2
Target Milestone: M13
targetting m13, p2
QA Contact update.
Target Milestone: M13 → M14
Whiteboard: fixed awaiting review and checkin
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Whiteboard: fixed awaiting review and checkin
This if fixed however with nav quirks turned on the text is not vertically
centered correctly. So I'm closing out this but and opening a new one for that
bug.
The sizing of the buttons in both of the first two testcases is now matching
what is specified in the STYLE attributes in the code, and text that does
not fit inside the buttons is clipped, rather than enlarging the button.

The issues with sizing of input type=text noted in Comments From sidr@albedo.net
11/07/99 13:25 are no longer present, either.
Marking VERIFIED on:
- Win98 2000-01-24-00 bugzilla build
- Linux6 2000-01-24-01 commercial build
- MacOS86 2000-01-24-02 commercial build
Status: RESOLVED → VERIFIED
No longer blocks: 18471
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: