CSS sizing of INPUT wrong if other attributes present

This is an operational as well as a cosmentic defect: click in the yellow rectangles below and type in a "j" to see the descender cut off - it looks like the text inside the <input> is normal sized, but the <input> is too small.

All of these coloured rectangles are <input> elements using the style attribute to set the background CSS property and their size.
The <input> elements have a border in the table even though the table has border="0".
The yellow <input> element is too small (type=text). The equivalent sized in px is okay.
The green <input> elements are too large (size=1).

1em by 1em; red; border 1px; margin 0 16px by 16px; red; border 1px; margin 0
1em by 1em; yellow; border 1px; margin 0 - type=text size=1 16px by 16px; red; border 1px; margin 0 - type=text size=1
1em by 1em; yellow; border 1px; margin 0 - type=text value="j" size=1 16px by 16px; red; border 1px; margin 0 - type=text value="j" size=1
1em by 1em; green; border 1px; margin 0 - size=1 16px by 16px; green; border 1px; margin 0 - size=1

It seems not to matter whether the <input> elements appear in a <table> or not, or in a <form> or not.