Open Bug 385615 Opened 17 years ago Updated 1 year ago

{inc} style of :first-letter used to erroneously calculate (intrinsic) width of element

Categories

(Core :: Layout, defect)

x86
All
defect

Tracking

()

Webcompat Priority P2

People

(Reporter: martijn.martijn, Unassigned)

References

(Depends on 2 open bugs)

Details

(Keywords: regression, testcase)

Attachments

(3 files, 1 obsolete file)

Attached file testcase (deleted) —
See testcase, when clicking on the button, it shrinks.
Although the end result looks more correct to me, the button should not change size when clicking on it.
OS: Windows XP → All
Depends on: 365131
Attached file testcase with a floated block with first-letter (obsolete) (deleted) —
Another testcase, on a div this time.  Button sets then removes a padding.
Attached file fix of javascript in prior attachment (deleted) —
removed invalid styling "none" and added a setTimeout since otherwise it didn't apply the styling.
Attachment #318181 - Attachment is obsolete: true
Also odd, is that in the (fixed) attachment after triggering recalc, there is still some white space to the right inside the div.
Summary: Shrinking button, use of ::first-letter height: 600% → font-size of :first-letter used to erroneously calculate width of element
Summary: font-size of :first-letter used to erroneously calculate width of element → {inc} font-size of :first-letter used to erroneously calculate width of element
Blocks: 442043
Summary: {inc} font-size of :first-letter used to erroneously calculate width of element → {inc} font-size of :first-letter used to erroneously calculate (intrinsic) width of element
Depends on: 362880
Attached some more test-cases.

What I can see: with larger font-size the bigger extra width would be, the more letters after the first, again the bigger the extra width would be.

Adding float to first-letter invert this behavior, but the extra would depend only on the font-size of the first letter.

And if the font-size of the first-letter is lesser than the inline-block's, then the width of this inline-block “shrinks”.
Blocks: 718424
Blocks: 765798
Crosslinking another Stack overflow question: http://stackoverflow.com/questions/14130653/firefox-calculating-blocks-larger/14131771#14131771

A block-level link shrinks (recalculates its width) to the correct size when focused. All (left, right, middle) clicks trigger the fix. Tabbing onto the link triggers the fix if not prevented by Javascript. Some hover effects also fix the bug.

Manifests as an unwanted gap between floating elements.
Attachment #562320 - Attachment mime type: text/plain → text/html
Any chance of getting it fixed soon? This bug has been open for 6 years and the styling errors caused by this bug are very visible and workarounds are so ugly... This bug is a huge PITA.
Still present in FF 38. Not only "font-size" but also "text-transform" triggers the bug. I'm not sure why but in my case "uppercase" makes a way bigger bug-padding than "capitalize", although the result should be (and is in standard-compliant browsers) the same.
This applies to any aspect of the style of ::first-letter that may affect measurement (not only font-size). E.g. it can be reproduced with text-transform, font-family, font-stretch, font-weight, letter-spacing, etc. Updating the summary to make it more general.
Summary: {inc} font-size of :first-letter used to erroneously calculate (intrinsic) width of element → {inc} style of :first-letter used to erroneously calculate (intrinsic) width of element
Blocks: 1311298
No longer blocks: 1311298
Note that bug 362880 comment 2 has some thoughts on how to fix this.
Webcompat Priority: --- → ?
Webcompat Priority: ? → P2
Severity: normal → S3

The severity field for this bug is relatively low, S3. However, the bug has 24 duplicates and 14 votes.
:dholbert, could you consider increasing the bug severity?

For more information, please visit auto_nag documentation.

Flags: needinfo?(dholbert)

The last needinfo from me was triggered in error by recent activity on the bug. I'm clearing the needinfo since this is a very old bug and I don't know if it's still relevant.

Flags: needinfo?(dholbert)
Duplicate of this bug: 1834521
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: