Open Bug 385615 Opened 14 years ago Updated 3 months ago

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

Categories

(Core :: Layout, defect)

x86
All
defect
Not set
normal

Tracking

()

Webcompat Priority ?

People

(Reporter: martijn.martijn, Unassigned)

References

(Depends on 2 open bugs)

Details

(Keywords: regression, testcase)

Attachments

(3 files, 1 obsolete file)

Attached file testcase
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
Another testcase, on a div this time.  Button sets then removes a padding.
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
Duplicate of this bug: 448169
Duplicate of this bug: 504092
Duplicate of this bug: 607235
Duplicate of this bug: 639744
Duplicate of this bug: 658792
Duplicate of this bug: 442043
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”.
Duplicate of this bug: 706776
Blocks: 718424
Blocks: 765798
Duplicate of this bug: 808989
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.
Duplicate of this bug: 851624
Attachment #562320 - Attachment mime type: text/plain → text/html
Duplicate of this bug: 905229
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.
Duplicate of this bug: 1108537
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.
Duplicate of this bug: 1279244
Duplicate of this bug: 765798
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
Duplicate of this bug: 718424
Blocks: 1311298
No longer blocks: 1311298
Duplicate of this bug: 1311298
Duplicate of this bug: 1384556
Duplicate of this bug: 1258991
Note that bug 362880 comment 2 has some thoughts on how to fix this.
Duplicate of this bug: 1419885
Duplicate of this bug: 1441520
Duplicate of this bug: 1472760
Duplicate of this bug: 1551126
Webcompat Priority: --- → ?
Duplicate of this bug: 1613353
Duplicate of this bug: 1653666
Duplicate of this bug: 1691839
You need to log in before you can comment on or make changes to this bug.