Closed
Bug 1050412
Opened 10 years ago
Closed 10 years ago
nsSimplePageSequenceFrame.cpp should use a frame enumerator during reflow
Categories
(Core :: Layout, defect)
Core
Layout
Tracking
()
RESOLVED
FIXED
mozilla34
People
(Reporter: dholbert, Assigned: dholbert)
Details
Attachments
(2 files)
3.44 KB,
patch
|
tnikkel
:
review+
|
Details | Diff | Splinter Review |
1.41 KB,
patch
|
tnikkel
:
review+
|
Details | Diff | Splinter Review |
During nsSimplePageSequence's reflow method, it walks over its child frames like this: > 204 for (nsIFrame* kidFrame = mFrames.FirstChild(); nullptr != kidFrame; ) { > [...] > 249 kidFrame = kidFrame->GetNextSibling(); > } http://mxr.mozilla.org/mozilla-central/source/layout/generic/nsSimplePageSequenceFrame.cpp?rev=05eb059f70bf#204 I don't think there's any good reason that the "kidFrame = kidFrame->GetNextSibling()" line is outside of the "for" statement. It should move up into the "for" statement. Better, though, we should just use a nsFrameList::Enumerator, since IIUC that's what we're trying to use for iterating over frame lists.
Assignee | ||
Comment 1•10 years ago
|
||
Attachment #8469486 -
Flags: review?(tnikkel)
Assignee | ||
Comment 2•10 years ago
|
||
This second part fixes up some broken code that I noticed in one of the loops. In particular, this patch: (1) makes us assert before static_casting (2) drops a useless null-check of child-frame. (The loop ensures that the pointer must be non-null. nsFrameList is a linked-list, which means it's impossible to have a null pointer in the middle of the list.) I suspect the original author might've mistakenly thought that this null-check was testing the validity of the static_cast.
Assignee | ||
Updated•10 years ago
|
Attachment #8469486 -
Attachment description: fix v1 → part 1: Use nsFrameList::Enumerator (plus nsFrameList::GetLength() in one spot)
Updated•10 years ago
|
Attachment #8469486 -
Flags: review?(tnikkel) → review+
Updated•10 years ago
|
Attachment #8469491 -
Flags: review?(tnikkel) → review+
Assignee | ||
Comment 3•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/b6c812537814 https://hg.mozilla.org/integration/mozilla-inbound/rev/3ac1b309271d
Flags: in-testsuite-
OS: Linux → All
Hardware: x86_64 → All
Comment 4•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/b6c812537814 https://hg.mozilla.org/mozilla-central/rev/3ac1b309271d
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
You need to log in
before you can comment on or make changes to this bug.
Description
•