Closed
Bug 223737
Opened 21 years ago
Closed 19 years ago
{inc}display several extra newlines for <img>text<br clear="all">
Categories
(Core :: Layout: Floats, defect)
Core
Layout: Floats
Tracking
()
RESOLVED
FIXED
People
(Reporter: hsaito54, Assigned: roc)
References
Details
(Keywords: testcase)
Attachments
(6 files, 4 obsolete files)
362 bytes,
text/html
|
Details | |
26.68 KB,
image/png
|
Details | |
1.20 KB,
patch
|
roc
:
review+
roc
:
superreview+
asa
:
approval1.8b3+
|
Details | Diff | Splinter Review |
1.02 KB,
patch
|
roc
:
review-
roc
:
superreview-
|
Details | Diff | Splinter Review |
128 bytes,
text/html
|
Details | |
3.02 KB,
patch
|
dbaron
:
review+
dbaron
:
superreview+
benjamin
:
approval1.8b4+
|
Details | Diff | Splinter Review |
Several extra newlines are displaied, if an attribute of the position of an IMG is specified and the text includes tags of <br> and <br clear="all">. This problem may be solved with the patch to append.
Reporter | ||
Comment 1•21 years ago
|
||
Reporter | ||
Comment 2•21 years ago
|
||
Reporter | ||
Comment 3•21 years ago
|
||
.
Assignee: table → float
Component: Layout: Tables → Layout: Floats
QA Contact: ian
Summary: display several extra newlines for <img>text<br clear="all"> → {inc}display several extra newlines for <img>text<br clear="all">
Reporter | ||
Updated•21 years ago
|
OS: Windows XP → All
Hardware: PC → All
Comment 5•19 years ago
|
||
I've tried the patch, seems to work fine for the testcase. Hideo, why don't you ask review for the patch?
Reporter | ||
Comment 6•19 years ago
|
||
The testcase shows following two problems. 1. several extra newlines are displaied, if the window is narrow 2. 'bbbbbbbbbb' does not go back to the right side, if the window is wide In order to mark the next line dirty, the changes make delay to clear the dirty of the current line including BRFrame.
Reporter | ||
Updated•19 years ago
|
Attachment #134179 -
Attachment is obsolete: true
Attachment #183645 -
Flags: review?(roc)
Assignee | ||
Comment 7•19 years ago
|
||
+ if (NS_FRAME_IS_NOT_COMPLETE(frameReflowStatus) || aLine->IsDirty()) { Won't aLine always be dirty, since we're currently reflowing it? So you might as well just remove this 'if' condition. That seems OK to me.
Reporter | ||
Updated•19 years ago
|
Attachment #183645 -
Attachment is obsolete: true
Attachment #183645 -
Flags: review?(roc)
Reporter | ||
Comment 8•19 years ago
|
||
Attachment #185937 -
Flags: superreview?(roc)
Attachment #185937 -
Flags: review?(roc)
Assignee | ||
Updated•19 years ago
|
Attachment #185937 -
Flags: superreview?(roc)
Attachment #185937 -
Flags: superreview+
Attachment #185937 -
Flags: review?(roc)
Attachment #185937 -
Flags: review+
Reporter | ||
Comment 9•19 years ago
|
||
Comment on attachment 185937 [details] [diff] [review] patch I think that this patch is low-risk and floated lines split by <br> are done the layout correctly.
Attachment #185937 -
Flags: approval1.8b3?
Updated•19 years ago
|
Attachment #185937 -
Flags: approval1.8b3? → approval1.8b3+
Reporter | ||
Comment 10•19 years ago
|
||
roc, could you check in to the trunk?
Reporter | ||
Comment 11•19 years ago
|
||
masayuki, this patch was approved for 1.8b3. Could you check in to the trunk? and please check Bug 291757.
Hardware: All → PC
Reporter | ||
Updated•19 years ago
|
Hardware: PC → All
Assignee | ||
Comment 12•19 years ago
|
||
checked in. Thanks Hideo!!!
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Comment 13•19 years ago
|
||
I backed out this fix (with a=roc) because it caused severe performance issues when typing at the beginning of a textarea with lots of text -- due to this patch we reflowed every single line on every single keystroke...
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Whiteboard: [checkin needed]
Reporter | ||
Comment 14•19 years ago
|
||
I think that textarea frame does not have block frame. Should I give up this approach?
Attachment #190116 -
Flags: review?(bzbarsky)
Comment 15•19 years ago
|
||
Comment on attachment 190116 [details] [diff] [review] patch for skip to reflow lines of a textarea > I think that textarea frame does not have block frame. It sure does. In any case, textarea is not the only case this patch made way too slow; just the most obvious one. Also, you may want to request reviews from roc; he knows this code much better than I do...
Attachment #190116 -
Flags: review?(bzbarsky) → review-
Updated•19 years ago
|
Assignee: layout.floats → saito
Status: REOPENED → NEW
Comment 16•19 years ago
|
||
Roc: Do you have better idea? Mozilla Japan hopes that this bug should be fixed before Firefox 1.5. Because bug 291757 is reproduced on "Amazon.co.jp" that is major site in Japan.
Assignee | ||
Comment 17•19 years ago
|
||
I will work on this.
Reporter | ||
Comment 18•19 years ago
|
||
In order to skip to reflow lines of a text control frame, a bit of NS_FRAME_INDEPENDENT_SELECTION is checked.
Attachment #190116 -
Attachment is obsolete: true
Attachment #190229 -
Flags: superreview?(roc)
Attachment #190229 -
Flags: review?(roc)
Assignee | ||
Comment 19•19 years ago
|
||
I don't think that's right. There is no logical connection between frames having independent selection and incremental reflow of lines with BRs. There must be a fix that fixes the actual bug here and doesn't force us to reflow every line with a BR before it.
Assignee | ||
Updated•19 years ago
|
Attachment #190229 -
Flags: superreview?(roc)
Attachment #190229 -
Flags: superreview-
Attachment #190229 -
Flags: review?(roc)
Attachment #190229 -
Flags: review-
Reporter | ||
Comment 20•19 years ago
|
||
(In reply to comment #19) > I don't think that's right. There is no logical connection between frames having > independent selection and incremental reflow of lines with BRs. A mState bit of NS_FRAME_INDEPENDENT_SELECTIONA is set for text control frame at nsTextControlFrame::CreateAnonymousContent and SELECTION_ON is also set for selection controller. I think that these conditions are distinguishable from other selected frames as follows changes. Is this idea wrong? + PRBool needsDirty = NS_FRAME_IS_NOT_COMPLETE(frameReflowStatus); + if (!needsDirty) { + needsDirty = PR_TRUE; + if (aFrame->GetStateBits() & NS_FRAME_INDEPENDENT_SELECTION) { + nsCOMPtr<nsISelectionController> selCon; + rv = GetSelectionController(aState.mPresContext, getter_AddRefs(selCon)); + //get the selection controller + if (NS_SUCCEEDED(rv) && selCon) + { + PRInt16 displayresult; + selCon->GetDisplaySelection(&displayresult); + if (displayresult == nsISelectionController::SELECTION_ON) + needsDirty = PR_FALSE; + } + } + } + if (needsDirty) { + nsLineList_iterator next = aLine.next(); + if (next != end_lines() && !next->IsBlock()) { + next->MarkDirty(); + }
Assignee | ||
Comment 21•19 years ago
|
||
There is nothing special about text frames that should require them to be reflowed differently from normal.
Assignee | ||
Comment 22•19 years ago
|
||
The newlines in the testcase are correct, by the way. align="left" floats the image to the left, and <br clear="all"> forces that line break to happen below the float. http://www.w3.org/TR/1998/REC-html40-19980424/present/graphics.html#floating The only bug is that the line bbbbbbbbb doesn't correctly move back up when the window gets wider.
Assignee | ||
Comment 23•19 years ago
|
||
This simplifies the testcase a bit more.
Assignee | ||
Comment 24•19 years ago
|
||
The basic problem is that with a narrow width, resize reflow decides it is not necessary to reflow line bbbbbbb because it is not "impacted by a float". It's not impacted by a float because we've moved it below the float. Really we should say it is impacted by float because we tried to reflow it at least once next to a float. This patch does that.
Assignee: saito → roc
Status: NEW → ASSIGNED
Attachment #190374 -
Flags: superreview?(dbaron)
Attachment #190374 -
Flags: review?(dbaron)
Assignee | ||
Comment 25•19 years ago
|
||
The patch does not fix bug 291757. That bug shows another issue which I will fix there.
Comment 26•19 years ago
|
||
This patch fixes this bug and bug 291757. I think that we are not marking to dirty the next line after clearance when it is necessary. But I don't know when we should marking to dirty it.
Comment on attachment 190374 [details] [diff] [review] fix r+sr=dbaron
Attachment #190374 -
Flags: superreview?(dbaron)
Attachment #190374 -
Flags: superreview+
Attachment #190374 -
Flags: review?(dbaron)
Attachment #190374 -
Flags: review+
Assignee | ||
Comment 28•19 years ago
|
||
Comment on attachment 190374 [details] [diff] [review] fix Fixes one problem with amazon.co.jp
Attachment #190374 -
Flags: approval1.8b4?
Assignee | ||
Comment 29•19 years ago
|
||
Comment on attachment 190429 [details] [diff] [review] test patch This is basically the same as Hideo's original patch, which caused some performance problems.
Attachment #190429 -
Attachment is obsolete: true
Assignee | ||
Comment 30•19 years ago
|
||
Comment on attachment 190374 [details] [diff] [review] fix BTW this patch is very low risk because it just does a bit of extra dirtying, so it should only be able to cause performance problems if any.
Updated•19 years ago
|
Attachment #190374 -
Flags: approval1.8b4? → approval1.8b4+
Assignee | ||
Comment 31•19 years ago
|
||
checked in
Status: ASSIGNED → RESOLVED
Closed: 19 years ago → 19 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•