Closed Bug 366892 Opened 18 years ago Closed 18 years ago

[FIX]nsCellMap::Synchronize should be smarter about calling GetMapFor

Categories

(Core :: Layout: Tables, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9alpha1

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

Details

(Keywords: perf)

Attachments

(1 file, 1 obsolete file)

We can make the safe assumption that _most_ of the cellmaps are in the right order, I think. That should allow us to do a lot better here. The testcase is in bug 313295. See bug 313295 comment 35 for details.
Blocks: 313295
Attached patch Proposed patch (obsolete) (deleted) — Splinter Review
Attachment #251355 - Flags: review?(bernd_mozilla)
OS: Linux → All
Hardware: PC → All
Summary: nsCellMap::Synchronize should be smarter about calling GetMapFor → [FIX]nsCellMap::Synchronize should be smarter about calling GetMapFor
Target Milestone: --- → mozilla1.9alpha
+ // XXXbz we just cast |frame| to nsTableRowGroupFrame*. Why are + // we bothering to call mTableFrame.GetRowGroup()? NEVER EVER miss the GetRowGroup() call, sometimes scrollframes wrap around the rowgroup frame and then it will certainly crash
> NEVER EVER miss the GetRowGroup() call, sometimes scrollframes wrap around The point is that the code looks like: nsIFrame* frame = (nsTableRowGroupFrame*)mRowGroups.ElementAt(mRowGroupIndex); if (!frame) ABORT1(PR_FALSE); mRowGroup = mTableFrame.GetRowGroupFrame(frame); if (!mRowGroup) ABORT1(PR_FALSE); If mRowGroups.ElementAt(mRowGroupIndex) returns a scrollframe, then we're dead as soon as we cast it to nsTableRowGroupFrame* and proceed to call virtual methods on it (which is what GetRowGroupFrame does). Having the cast here be a cast to nsIFrame* would make a lot more sense to me. What would make even more sense is having nsTableFrame::OrderRowGroups fill an nsTPtrArray<nsIFrame> (and having that as a member in the iterator). I'd be happy to do that in a separate bug.
Assignee: nobody → bzbarsky
Attachment #251355 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #251491 - Flags: review?(bernd_mozilla)
Attachment #251355 - Flags: review?(bernd_mozilla)
QA Contact: bzbarsky → layout.tables
Attachment #251491 - Flags: review?(bernd_mozilla) → review+
Attachment #251491 - Flags: superreview?(roc)
Attachment #251491 - Flags: superreview?(roc) → superreview+
Fixed.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: