Closed Bug 411059 Opened 17 years ago Closed 16 years ago

Tab character in table cell with white-space:pre leads to table border overlapping text

Categories

(Core :: Graphics, defect, P3)

defect

Tracking

()

RESOLVED FIXED

People

(Reporter: jruderman, Assigned: roc)

References

Details

(Keywords: regression, testcase)

Attachments

(2 files)

A tab character in a table cell can trigger:

WARNING: Tabs encountered in a situation where we don't support tabbing: file /Users/jruderman/trunk/mozilla/layout/generic/nsTextFrameThebes.cpp, line 2293

Also, the border of the table overlaps the table cell, so the table seems to be confused about how long the text is.  In bug 375058, Bernd said he thought this wasn't a table bug.
It's hard to determine the preferred or minimum width of text containing a preformatted tab, because the width of the tab depends on where the tab occurs in the line and thus on where line breaks have been placed. This testcase might be fixable but there are more general testcases that aren't. Any thoughts David?
I think, just like everything else, we should assume that we take all optional breaks for GetMinWidth, and don't take any optional breaks for GetPrefWidth.  I'm having trouble thinking of what that wouldn't be sufficient for.
I guess you're right, if we use the current width in the InlineData as the x position to figure out where the next tab stop is, we should be OK. Inserting a break before a tab can never make the content wider, and removing a break before a tab can never make the content narrower.
This used to work in Firefox 2, so marking as regression.
Keywords: regression
OS: Mac OS X → All
Hardware: PC → All
here's a somewhat more general test case, with tabs at various points within a line:  http://www.cs.cmu.edu/~dkindred/tmp/ff3-width-bug.html
Flags: wanted1.9.1? → wanted1.9.1+
Priority: -- → P3
Assignee: nobody → roc
Adding dependency on bug 230555 since the patch there treads on AddInline(Min/Pref)WidthForFlow which I need to change here.
Depends on: 230555
Attached patch fixSplinter Review
Includes a reftest partially based on dkindred's testcase.
Attachment #333892 - Flags: review?(smontagu)
Comment on attachment 333892 [details] [diff] [review]
fix

>   PRBool collapseWhitespace = !textStyle->WhiteSpaceIsSignificant();
>   PRBool preformatNewlines = textStyle->NewlineIsSignificant();
>+  PRBool preformatTabs = textStyle->WhiteSpaceIsSignificant();

The extra boolean which is just equivalent to !collapseWhitespace seems redundant to me, but OK if you think it's worth it for clarity.
Attachment #333892 - Flags: review?(smontagu) → review+
Pushed c4b0381a259b. I think the extra boolean helps clarity significantly.
Status: NEW → RESOLVED
Closed: 16 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Comment on attachment 333892 [details] [diff] [review]
fix

Pretty bad regression in 1.9, no regressions noted on trunk so far, so we might want to take on 1.9.0.x.
Attachment #333892 - Flags: approval1.9.0.3?
Comment on attachment 333892 [details] [diff] [review]
fix

Looks ugly, but I think we have to minus for the branch. Appeal to mconnor directly if you disagree.
Attachment #333892 - Flags: approval1.9.0.4? → approval1.9.0.4-
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: