Closed
Bug 514634
Opened 15 years ago
Closed 15 years ago
some misc block frame code cleanup
Categories
(Core :: Layout, defect)
Core
Layout
Tracking
()
RESOLVED
FIXED
People
(Reporter: tnikkel, Assigned: tnikkel)
Details
Attachments
(1 file, 1 obsolete file)
5.73 KB,
patch
|
fantasai.bugs
:
review+
|
Details | Diff | Splinter Review |
Noticed a few things while working on another bug that I wanted to followup on.
Assignee | ||
Comment 1•15 years ago
|
||
Add some assertions to catch problems. nsBlockFrame::PullFrameFrom calls SetNextSibling twice, doing what should be the same thing twice. Fix the comment above nsBlockFrame::PullFrameFrom.
Attachment #398619 -
Flags: review?(fantasai.bugs)
- aLine->LastChild()->SetNextSibling(frame); + NS_ASSERTION(aState.mPrevChild == aLine->LastChild(), + "mPrevChild should be the LastChild of the line we are adding to"); + // The frame is being pulled from a next-in-flow; therefore we + // need to add it to our sibling list. + if (nsnull != aState.mPrevChild) { + aState.mPrevChild->SetNextSibling(frame); + } So what happens when aState.mPrevChild is null? (If that's not supposed to happen, then we should assert here and not have an if-clause.) frame->SetNextSibling(nsnull); This line should also be moved so that the two list-splicing operations are together. You'll need to cache the nextSibling in a newFirstChild variable or something, but I think the code will be more understandable that way.
Assignee | ||
Comment 3•15 years ago
|
||
(In reply to comment #2) > So what happens when aState.mPrevChild is null? (If that's not supposed to > happen, then we should assert here and not have an if-clause.) The NS_ASSERTION(aState.mPrevChild == aLine->LastChild(),...) already asserts for the null mPrevChild case. Removed the if-clause. > frame->SetNextSibling(nsnull); > > This line should also be moved so that the two list-splicing operations are > together. You'll need to cache the nextSibling in a newFirstChild variable or > something, but I think the code will be more understandable that way. Done.
Attachment #398619 -
Attachment is obsolete: true
Attachment #398903 -
Flags: review?(fantasai.bugs)
Attachment #398619 -
Flags: review?(fantasai.bugs)
Attachment #398903 -
Flags: review?(fantasai.bugs) → review+
Assignee | ||
Updated•15 years ago
|
Keywords: checkin-needed
This is continuation from bug 513394 comment 7, bug 513394 comment 12, etc.
You need to log in
before you can comment on or make changes to this bug.
Description
•