Closed Bug 352059 Opened 18 years ago Closed 14 years ago

<pre> tag uses variable-width font due to residual style

Categories

(Core :: DOM: HTML Parser, defect, P5)

defect

Tracking

()

RESOLVED FIXED

People

(Reporter: steve.shockley, Unassigned)

References

()

Details

(Keywords: regression, testcase, Whiteboard: [dbaron-1.9:RwCo][fixed by the HTML5 parser])

Attachments

(2 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20060908 Minefield/3.0a1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20060908 Minefield/3.0a1

View the example page, scroll to the bottom to see the CAPTCHA "image", it's in a PRE block to preserve formatting.  On Minefield, extra spaces are removed so it's unreadable.  It looks okay in View Source, and looks okay in IE7 and FF 1.5.0.6.

Reproducible: Always

Steps to Reproduce:
View example page with Minefield, look at CAPTCHA "image".
Actual Results:  
Pre-formatted text is garbled.

Expected Results:  
Un-garbled preformatted text.
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9a1) Gecko/20060910 Minefield/3.0a1

Works for me.
Severity: trivial → normal
Component: General → Layout
Product: Firefox → Core
QA Contact: general → layout
Summary: pre tag strips out spaces in formatting → <pre> tag strips out spaces in formatting
Version: unspecified → 1.8 Branch
Version: 1.8 Branch → Trunk
Attached image screenshot
Yeah, I see it too. Looks like a cairo thing as I can't reproduce it in non-cairo trunk.
Status: UNCONFIRMED → NEW
Component: Layout → GFX: Thebes
Ever confirmed: true
QA Contact: layout → thebes
A minimized testcase here would be nice.
Attached file Minimal test case
Here's a minimal test case for this bug.  Note that the bug goes away if I remove the font tag or close (or remove) the i tag.
Flags: blocking1.9?
Keywords: testcase
taking this.

I think that the cause is a invalid font-face specify in the HTML document. Now, we don't checking whether the font-face is a valid font family in the system. We should do it in bug 352174.
Assignee: nobody → masayuki
Status: NEW → ASSIGNED
Fixed by the patch for bug 352174 (also changed summary to reflect what was actually going on).
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Summary: <pre> tag strips out spaces in formatting → <pre> tag uses variable-width font
Is this really fixed?

I still see <pre> rendered with a proportional font, using Mozilla/5.0 (X11; U; Linux i686; pl; rv:1.9a1) Gecko/2006112404 Minefield/3.0a1
Test case renders properly for me, using Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20061125 Minefield/3.0a1 ID:2006112504 [cairo].
Marek, please file another bug and attach a testcase. This originally worked on Linux, but I think Masayuki has broken it in one of his recent patches (probably bug 352174).
Flags: blocking1.9?
This appears to have regressed in Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9a8pre) Gecko/2007080505 Minefield/3.0a8pre.  Both the original site and the test case render in a non-fixed-width typeface for me now.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Are you sure this has anything to do with the cairo landing?  Cairo's not involved in any way in our font selection.
Sorry, you're right, I blamed the wrong bug, I can see this bug also in the 2007-04-24 trunk build:
http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&module=all&branch=HEAD&branchtype=match&dir=&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=explicit&mindate=2007-07-23+04&maxdate=2007-07-24+09&cvsroot=%2Fcvsroot
Regression from bug 383979?
Assignee: masayuki → nobody
Status: REOPENED → NEW
Component: GFX: Thebes → Layout
No longer depends on: 352174
QA Contact: thebes → layout
Component: Layout → Style System (CSS)
QA Contact: layout → style-system
Assignee: nobody → dbaron
Flags: blocking1.9? → blocking1.9+
Whiteboard: [dbaron-1.9:RwCo]
So if this is a bug at all, it's an HTML parser bug.  The HTML parser is creating a document tree structure where the font tag is repeated inside the pre element.  Bug 383979 (or maybe bug 216456?) fixed some style system bugs.  If there's a <font face="helvetica"> inside a <pre>, we should make it Helvetica.
Assignee: dbaron → nobody
Component: Style System (CSS) → HTML: Parser
OS: Windows XP → All
QA Contact: style-system → parser
Hardware: PC → All
I wonder if we shouldn't bother opening residual style tags inside of <pre>, it seems to cause more confusion than good.
Could you just drop the face attribute of font tags?
Keywords: regression
Summary: <pre> tag uses variable-width font → <pre> tag uses variable-width font due to residual style
Blake, not sure how important this is, feel free to prioritize as you see fit.
Assignee: nobody → mrbkap
Priority: -- → P5
This isn't really a regression
Keywords: regression
(In reply to comment #19)
> This isn't really a regression
> 

If not should we drop from blocking list?
Sicking, what do you mean by "this isn't really a regression"?  Firefox 2 keeps the text preformatted and trunk doesn't, so it looks like a regression to me.
Yeah. It is in some ways a regression. Basically it's a case of two bugs previously canceling each other out, and now we fixed one of them.

So adding regression keyword.
Keywords: regression
Flags: wanted1.9.0.x+
Flags: tracking1.9+
Flags: blocking1.9-
Just a warning, the undeadly site now removed all face attributes from font tags.

If anyone sees further mistakes in its HTML code that can be fixed to make the captcha render in fixed-pitched font for all Mozilla versions, please let me know (by email is fine, if not related to this bug report).

Thank you.
I don't think we want to touch this kind of stuff in a dot release. We should look at this for the next release.
Flags: wanted1.9.0.x-
Flags: wanted1.9.0.x+
Flags: wanted-next+
I believe this is fixed by bug 487949.
Assignee: mrbkap → nobody
Status: NEW → RESOLVED
Closed: 18 years ago14 years ago
Resolution: --- → FIXED
Whiteboard: [dbaron-1.9:RwCo] → [dbaron-1.9:RwCo][fixed by the HTML5 parser]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: