Closed Bug 565819 Opened 14 years ago Closed 14 years ago

[FIX]Change RestyleForInsert/Append/Remove to use Element and the new sibling API

Categories

(Core :: Layout, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.3a5

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

Details

Attachments

(1 file, 1 obsolete file)

Prereq for bug 562700, and slightly cleaner/faster code.
Attached patch Like so (obsolete) — Splinter Review
Attachment #445268 - Flags: review?(dbaron)
Comment on attachment 445268 [details] [diff] [review]
Like so

nsCSSFrameConstructor.cpp:

>-    for (PRInt32 index = 0; index < aNewIndexInContainer; ++index) {
>+    for (nsIContent* cur = aContainer->GetFirstChild();
>+         cur;
>+         cur = cur->GetNextSibling()) {

Shouldn't this be |cur != aFirstNewContent| instead of |cur| as the condition?

>@@ -11493,38 +11489,47 @@ nsCSSFrameConstructor::RestyleForRemove(

>-    // restyle the previously-last element child if it is before aOldChild
>-    for (PRInt32 index = aContainer->GetChildCount() - 1;
>-         index >= 0; --index) {
>-      nsIContent *content = aContainer->GetChildAt(index);
>+    // restyle the now-last element child if it was before aOldChild
>+    reachedFollowingSibling = PR_FALSE;

Shouldn't reachedFollowingSibling be initialized to aFollowingSibling != nsnull ?

r=dbaron with that
Attachment #445268 - Flags: review?(dbaron) → review+
> Shouldn't this be |cur != aFirstNewContent| instead of |cur| as the condition?

Yes.  Good catch.

> Shouldn't reachedFollowingSibling be initialized to aFollowingSibling != nsnull

You mean == nsnull.  Yes.
Pushed http://hg.mozilla.org/mozilla-central/rev/93be15b7e54e
Status: NEW → RESOLVED
Closed: 14 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a5
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: