Last Comment Bug 385615 - {inc} font-size of :first-letter used to erroneously calculate (intrinsic) width of element
: {inc} font-size of :first-letter used to erroneously calculate (intrinsic) wi...
Status: NEW
: regression, testcase
Product: Core
Classification: Components
Component: Layout (show other bugs)
: Trunk
: x86 All
: -- normal with 13 votes (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
Mentors:
: 442043 448169 504092 607235 639744 658792 706776 808989 851624 905229 1108537 (view as bug list)
Depends on: 362880 365131
Blocks: 718424 765798 367177 442043
  Show dependency treegraph
 
Reported: 2007-06-23 19:18 PDT by Martijn Wargers [:mwargers] (not working for Mozilla)
Modified: 2015-05-15 09:28 PDT (History)
29 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
testcase (131 bytes, text/html)
2007-06-23 19:18 PDT, Martijn Wargers [:mwargers] (not working for Mozilla)
no flags Details
testcase with a floated block with first-letter (621 bytes, application/xhtml+xml)
2008-04-28 10:14 PDT, nemo
no flags Details
fix of javascript in prior attachment (656 bytes, application/xhtml+xml)
2008-04-28 10:18 PDT, nemo
no flags Details
Some more test-cases with different font-sizes and floating first-letters (1.28 KB, text/html)
2011-09-25 12:57 PDT, Roman Komarov
no flags Details

Description Martijn Wargers [:mwargers] (not working for Mozilla) 2007-06-23 19:18:35 PDT
Created attachment 269562 [details]
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.
Comment 1 nemo 2008-04-28 10:14:01 PDT
Created attachment 318181 [details]
testcase with a floated block with first-letter

Another testcase, on a div this time.  Button sets then removes a padding.
Comment 2 nemo 2008-04-28 10:18:25 PDT
Created attachment 318183 [details]
fix of javascript in prior attachment

removed invalid styling "none" and added a setTimeout since otherwise it didn't apply the styling.
Comment 3 nemo 2008-04-28 10:20:06 PDT
Also odd, is that in the (fixed) attachment after triggering recalc, there is still some white space to the right inside the div.
Comment 4 David Baron :dbaron: ⌚️UTC-7 (review requests must explain patch) 2008-07-27 00:22:36 PDT
*** Bug 448169 has been marked as a duplicate of this bug. ***
Comment 5 David Baron :dbaron: ⌚️UTC-7 (review requests must explain patch) 2009-07-14 13:20:39 PDT
*** Bug 504092 has been marked as a duplicate of this bug. ***
Comment 6 philippe (part-time) 2010-10-26 04:59:43 PDT
*** Bug 607235 has been marked as a duplicate of this bug. ***
Comment 7 Boris Zbarsky [:bz] 2011-03-07 22:48:46 PST
*** Bug 639744 has been marked as a duplicate of this bug. ***
Comment 8 RNicoletto 2011-04-11 07:18:14 PDT
Possible workaround: https://addons.mozilla.org/firefox/addon/bug385615/
Comment 9 Alice0775 White 2011-05-21 09:08:38 PDT
*** Bug 658792 has been marked as a duplicate of this bug. ***
Comment 10 David Baron :dbaron: ⌚️UTC-7 (review requests must explain patch) 2011-06-08 19:33:56 PDT
*** Bug 442043 has been marked as a duplicate of this bug. ***
Comment 11 Roman Komarov 2011-09-25 12:57:13 PDT
Created attachment 562320 [details]
Some more test-cases with different font-sizes and floating first-letters

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”.
Comment 12 David Baron :dbaron: ⌚️UTC-7 (review requests must explain patch) 2011-12-01 11:17:16 PST
*** Bug 706776 has been marked as a duplicate of this bug. ***
Comment 14 Alice0775 White 2012-11-06 05:50:33 PST
*** Bug 808989 has been marked as a duplicate of this bug. ***
Comment 15 jan dvorak 2013-01-02 17:24:06 PST
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.
Comment 16 Boris Zbarsky [:bz] 2013-03-15 19:09:31 PDT
*** Bug 851624 has been marked as a duplicate of this bug. ***
Comment 17 Daniel Holbert [:dholbert] 2013-08-14 12:13:03 PDT
*** Bug 905229 has been marked as a duplicate of this bug. ***
Comment 18 Michał Gołębiowski [:m_gol] 2013-08-19 02:23:04 PDT
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.
Comment 19 Boris Zbarsky [:bz] 2014-12-15 11:22:07 PST
*** Bug 1108537 has been marked as a duplicate of this bug. ***
Comment 20 m93a.cz 2015-04-09 09:17:46 PDT
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.

Note You need to log in before you can comment on or make changes to this bug.