Open Bug 453791 Opened 12 years ago Updated 8 years ago

Entities "emsp", "ensp", "thinsp" in combination with CSS "font-style: italic" result into a giant top/bottom-padding


(Core :: Layout: Text and Fonts, defect)

Windows XP
Not set




(Reporter: jean.lee, Unassigned)



(Keywords: css2, html4, testcase)


(2 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv: Gecko/2008070208 Firefox/3.0.1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv: Gecko/2008070208 Firefox/3.0.1

The HTML-code (see below) will result in giant top/bottom-padding. Firefox seems to create nonsens, in case special HTML entities come together with a specific CSS-attribute ("font-style").


<title>Ugly bug in Firefox v3</title>
p { border: 1px solid black; font-style: italic; }

<p>This paragraph contains a normal space character.</p>
<p>This paragraph contains a&nbsp;nbsp-entity.</p>
<p>This paragraph contains a&thinsp;thinsp-entity.</p>
<p>This paragraph contains a&emsp;emsp-entity.</p>
<p>This paragraph contains a&ensp;ensp-entity.</p>


Reproducible: Always

Steps to Reproduce:
1. Create a file containing the HTML-Code mentioned above.
2. Save as html-file
3. Open with Firefox
Actual Results:  
The paragraphs containing one of the entities "emsp", "ensp", "thinsp" got a giant top-/bottom-padding

Expected Results:  
The top-/bottom-padding should be the same like the paragraph with normal space or "nbsp"-entitie.
Keywords: css2, html4
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv: Gecko/2008070208 Firefox/3.0.1 ID:2008070208

Testcase appears to WFM. Please can you attach a screenshot as to what you are seeing? Thanks!
Severity: major → normal
Keywords: testcase
Version: unspecified → 3.0 Branch
I can confirm this, running Firefox 3.0.1 on Windows, in safe-mode.
Adding a (4.01 strict) DTD and type="text/css" to the style tag doesn't help either.

Using DOMi I see the same rules apply to all paragraphs, but the first two get a height of 20px in computed style (same as line-height) and the last 3 paragraphs get height 89px.
Ever confirmed: true
Component: General → Layout: Text
Product: Firefox → Core
QA Contact: general → layout.fonts-and-text
Version: 3.0 Branch → unspecified
I'm pretty sure I understand what is (was?) happening here. The entities in question map to specific Unicode characters; but the thinspace, en-space and em-space characters are not supported by the italic face of the user's default font, and so the browser falls back to some other installed font in order to render these characters - and the font it happens to find (Cambria Math?) has very large vertical metrics.

Reproducing this would be dependent on the specific collection of fonts installed on the test system, but AFAIK it could still happen with current trunk code, given the right environment.

This should get fixed as a result of the patch in bug 668813, I believe.
Depends on: 668813
You need to log in before you can comment on or make changes to this bug.