Closed
Bug 329987
Opened 19 years ago
Closed 19 years ago
<br> can get two linebreaks instead of one in certain too-narrow tables
Categories
(Core :: Layout: Tables, defect)
Core
Layout: Tables
Tracking
()
RESOLVED
FIXED
mozilla1.9alpha1
People
(Reporter: aguertin+bugzilla, Assigned: rbs)
References
()
Details
(Keywords: regression, testcase)
Attachments
(4 files, 5 obsolete files)
(deleted),
text/html
|
Details | |
(deleted),
image/png
|
Details | |
(deleted),
patch
|
bzbarsky
:
review+
bzbarsky
:
superreview+
|
Details | Diff | Splinter Review |
(deleted),
image/gif
|
Details |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9a1) Gecko/20060309 Firefox/1.6a1
If a table is too narrow for its contents and it has " <br>" (i.e. space <br>) in it, there will be two linebreaks instead of one.
Testcase is in URL field.
It seems to only affect the widest cell, even if other cells are too narrow for their contents as well.
This is a regression. It worked fine in 2006-02-16 builds, it fails in 2006-03-09. I'll narrow it down farther.
Reporter | ||
Comment 1•19 years ago
|
||
Regressed between 2006-03-07 and 2006-03-08
Only thing that looks like it could have caused it is checkin for bug 164700
Comment 2•19 years ago
|
||
I think this 'regressed' behavior is correct behavior...
I think that if we want to fix this, we need to trim the spaces around the <br>.
# that's easy.
But that is not specified on HTML spec...
Comment 3•19 years ago
|
||
Assignee: nobody → masayuki
Status: NEW → ASSIGNED
Attachment #214684 -
Flags: superreview?(rbs)
Attachment #214684 -
Flags: review?(rbs)
Attachment #214684 -
Flags: approval-branch-1.8.1?(rbs)
Updated•19 years ago
|
OS: Linux → All
Hardware: PC → All
Target Milestone: --- → mozilla1.9alpha
Comment 4•19 years ago
|
||
*** Bug 331042 has been marked as a duplicate of this bug. ***
Comment 5•19 years ago
|
||
Comment on attachment 214684 [details] [diff] [review]
quirk patch rv1.0
I found a bug in this patch...
Attachment #214684 -
Flags: superreview?(rbs)
Attachment #214684 -
Flags: review?(rbs)
Attachment #214684 -
Flags: review-
Attachment #214684 -
Flags: approval-branch-1.8.1?(rbs)
"we shoud not flag a break-after status if next frame is nsBRFrame."
I agree with this general idea. However, I was wondering if we cannot resolve the problem in another simpler way, by simply distinguishing the hard-break of <br> vs. the "soft-break" (that we are compelled to have to avoid the letter-spacing bug).
That is,
in nsTextFrame, simply add:
+ else if (aTextData.mTrailingSpaceTrimmed && rs == NS_FRAME_COMPLETE) {
+ rs = NS_INLINE_LINE_BREAK_AFTER(rs);
+ lineLayout.SetLineEndsInSoftBR(PR_TRUE);
+ }
Then, in nsBRFrame, add:
+if (!ll->GetLineEndsInSoftBR()) {
aStatus = NS_INLINE_BREAK | NS_INLINE_BREAK_AFTER |
NS_INLINE_MAKE_BREAK_TYPE(breakType);
+else { // promote the existing soft-break to a hard-break -- (the main idea)
+ aStatus = NS_FRAME_COMPLETE;
+ ll->SetLineEndsInSoftBR(PR_FALSE);
+}
ll->SetLineEndsInBR(PR_TRUE);
(with of course the Get/SetLineEndsInSoftBR flag added in linelayout)
What do you think?
Comment 7•19 years ago
|
||
I create the patch from your idea. But it's not working fine with the case of bug 331042 that is having white-space only frame between current frame and br frame...
Comment 8•19 years ago
|
||
Comment 9•19 years ago
|
||
This patch works fine, but this is not simple...
Attachment #214684 -
Attachment is obsolete: true
Attachment #215632 -
Flags: superreview?(rbs)
Attachment #215632 -
Flags: review?(rbs)
Attachment #215632 -
Flags: approval-branch-1.8.1?(rbs)
Comment 10•19 years ago
|
||
Comment 11•19 years ago
|
||
Assignee | ||
Comment 12•19 years ago
|
||
Here is a possible simpler patch that does the trick for me. The idea is to effectively break only if linelayout attempts to put a word (rather than break rightway, assuming that linelayout might add another word on the line, which it might not).
BTW, did you checkin the intended patch for bug 164700? With my tree, I am not seeing any word-spacing between the various "EntryX EntryY" (except before Entry4) on this testcase:
https://bugzilla.mozilla.org/attachment.cgi?id=114531
Comment 13•19 years ago
|
||
Good! It's clever patch! But that has a mistake, we need to check the text frame has only white spaces and they are skipped. Who can review this?
- else if (lineLayout.GetLineEndsInSoftBR()) {
+ else if (lineLayout.GetLineEndsInSoftBR() && column != mColumn) {
Attachment #215631 -
Attachment is obsolete: true
Attachment #215632 -
Attachment is obsolete: true
Attachment #215636 -
Attachment is obsolete: true
Attachment #215632 -
Flags: superreview?(rbs)
Attachment #215632 -
Flags: review?(rbs)
Attachment #215632 -
Flags: approval-branch-1.8.1?(rbs)
Comment 14•19 years ago
|
||
(In reply to comment #12)
> BTW, did you checkin the intended patch for bug 164700? With my tree, I am not
> seeing any word-spacing between the various "EntryX EntryY" (except before
> Entry4) on this testcase:
> https://bugzilla.mozilla.org/attachment.cgi?id=114531
>
I checked-in following patch.
http://bonsai.mozilla.org/cvsview2.cgi?diff_mode=context&whitespace_mode=show&file=nsTextFrame.cpp&branch=&root=/cvsroot&subdir=mozilla/layout/generic&command=DIFF_FRAMESET&rev1=1.548&rev2=1.549
Do you mean that the word-spacing is not applied on your build?
Assignee | ||
Comment 15•19 years ago
|
||
We don't need to chase after the flag to reset it. The linebreak causes a new line and this is handled with a new linelayout object in a clean state.
Trying bz for the review.
Attachment #215639 -
Attachment is obsolete: true
Attachment #215642 -
Flags: superreview?(bzbarsky)
Attachment #215642 -
Flags: review?(bzbarsky)
Assignee | ||
Comment 16•19 years ago
|
||
Here is what I see for attachment 114531 [details] now. It is different from what I used to see (attachment 186900 [details], modulo the linebreak bug).
Assignee | ||
Comment 17•19 years ago
|
||
Also, attachment 186900 [details] was using word-spacing: 100pt; instead of the present 6pt.
Updated•19 years ago
|
Assignee: masayuki → rbs
Status: ASSIGNED → NEW
Updated•19 years ago
|
Status: NEW → ASSIGNED
Comment 18•19 years ago
|
||
I can see that your tree fails |GetTextDimensionsOrLength|.
Assignee | ||
Comment 19•19 years ago
|
||
After the VC8 Express problem (bug 329209), it is strange that I am having this other text-measuring problem and that you are okay.
I have rebuilt my tree with "ac_add_options --enable-default-toolkit=windows". This re-enables the native GDI instead of cairo-windows, which is now the default on Windows. Guess what? With that build option, the spacing comes back as expected.
Are you not using the default cairo-windows (and VC8)?
Comment 20•19 years ago
|
||
Currently, thebes doesn't support letter-spacing, word-spacing and justify. See bug 327184. We should use non-cairo build for working on text rendering, now.
Comment 21•19 years ago
|
||
Comment on attachment 215642 [details] [diff] [review]
even simpler
r+sr=bzbarsky if you document in nsLineLayout what this flag means and how it differs from LL_LINEENDSINBR.
Attachment #215642 -
Flags: superreview?(bzbarsky)
Attachment #215642 -
Flags: superreview+
Attachment #215642 -
Flags: review?(bzbarsky)
Attachment #215642 -
Flags: review+
Assignee | ||
Comment 22•19 years ago
|
||
Checked in the trunk.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•