<button>/<legend>
David Hyatt
hyatt at apple.com
Mon Oct 20 22:25:51 CEST 2003
On Oct 20, 2003, at 4:32 PM, Dirk Mueller wrote:
>
> Hi,
>
> I was surprised to see that the display: inline-block support in your
> tree
> (v85) was incomplete. I've set the display of button and legend now to
> inline-block and it seems to work fine after some fixes.
>
> I'm assuming that this is either already in your tree, or if not, what
> was
> your reason to not do it ?
>
It is in our tree post-v85. I didn't finish it in time for v85, but
Panther's Safari (v100) and higher has support for inline-block.
> Oh I also replaced this hack:
>
> bool RenderObject::sizesToMaxWidth() const
> {
> return isFloating() || isCompact() ||
> (element() && (element()->id() == ID_BUTTON || element()->id() ==
> ID_LEGEND));
> }
>
> with proper checks for display inline-block. The method is gone in our
> tree,
> it was only used from RenderBox::calcWidth and therefore I manually
> inlined
> it in that place.
>
You are right that button should default to inline-block. However the
following is perfectly legal HTML.
<body>
This text should be above the button.
<button style="display:block">Button</button>
This text should be below the button.
</body>
If you only check for inline-block in calcWidth, the button will fill
the width of the containing block when it shouldn't.
What would enable the hack to be removed is support for the proposed
intrinsic specification on max-width, i.e.,
button {
max-width: intrinsic;
}
dave
More information about the Khtml-devel
mailing list