Closed Bug 34731 Opened 25 years ago Closed 25 years ago

[regression] Line break does not work JA page correctly


(Core :: Layout, defect, P3)






(Reporter: teruko, Assigned: troy)




When you open the Japanese page and change the size of window, the line break
does not change depending on the size of window.

Steps of reproduce
1. Launch Netscape 
2. Go to above URL
3. Select menu View|Character coding->Japanese(EUC-JP)
4. Use mouse to make small the window

Each line should break depending on the size of the window. Lines do not break.
If you move the scroll bar, you can see the whole line.

Tested 2000040509 Win32 M15 build.

I tested this in 2000033112 Beta Win32 build.  Lines breaks depending on the 
size of windows.
Darn if I know what to do with this bug
Assignee: troy → erik
reassigned to ftang.
qa assigned => teruko
Assignee: erik → ftang
QA Contact: petersen → teruko
Frank, Troy recently made a change in the "text transformer" code, and his
comments suggest that it has something to do with GetNextWord. That's why I
asked IQA to test international line breaking. Now it turns out that it is
broken, but of course we're not sure that it's due to Troy's check-in. I think
it would be a good idea to undo Troy's change in a local tree to see if it has
anything to do with it. Here are Troy's comments from layout.checkins:

Subject: Checkin (layout) - text measurement
From: Troy Chevalier <>
Newsgroups: netscape.public.mozilla.layout.checkins

When measuring text in runs the text frame code had been buffering up
the transformed text and when it has accumulated the estimated number of
characters it called the rendering context

This copying needed  for this layer of buffering was slowing us down too
much so I changed the text transformer API for GetNextWord() to have an
additional parameter that indicates whether the buffer should be reset
to the beginning when fetching the next word (default is PR_TRUE and the
buffer is reset to its default position)

This allows the buffering to occur in the text transform objects
internal buffer where we already do a copy of the transformed text
anyway, and eliminates the extra copying the text frame was doing
It's certainly possible I broke it with my recent changes. Sorry in advance if 
that's the case.

Frank, if you can help narrow down the problem that will be a big help

You guys probably know this, but the text transformer code has a self-test that 
is run the first time the code is executed. It's very helpful in catching 
problems. It caught a couple of problems with my recent changes

Can you expand the self-test code to include more Intl test cases?
troy- please back out your changes. Your change break the CJK line break. Sorry 
that I don't have time to look into this. It will be nice if you let me review 
it before you check and try it on my local tree first next time. 
Assignee: ftang → troy
Summary: Line break does not work JA page correctly → [regression] Line break does not work JA page correctly
Blocks: 35012
major loss of function and impacts QA severely
Severity: normal → major
I have a fix in my tree which I will check in once the tree opens after the
M15 milestone
troy - do you want me to try your fix in my local tree first ? If so, please 
mail me your patch. Thanks.
No thanks, I was able to test the page myself. It turns out that the problem was 
in the rendering context code. The new function I added that can measure chunks 
of text at a time. It wasn't properly handling the case where it needed to back 

The problem wasn't Japanese specific
Checked in the fix to the GetWidth() function
Closed: 25 years ago
Resolution: --- → FIXED
I tested this in 2000041306 M15 Win32, 2000041307 M15 Mac and 2000041309 M16 
Win32 build. This still happen in these build. I need to reopen this.
Resolution: FIXED → ---
Here's what I think is going on. There was a problem in the new GetWidth() 
function that measures chunks of text, but I fixed it. I verified using a 
reduced test case of the URL above and it works. It still does.

However, the full test case doesn't work. It still doesn't work even if I turn 
off the code to measure in chunks and we revert to measuring a word at a time

I think the current problem is bug 35681 where the BODY element is getting 
enlarged to accomodate the widest element within it. That in turn causes us to 
think we have enough room and so we don't wrap the text

*** This bug has been marked as a duplicate of 35681 ***
Closed: 25 years ago25 years ago
Resolution: --- → DUPLICATE
Verified as dup.
You need to log in before you can comment on or make changes to this bug.