Closed Bug 577309 Opened 15 years ago Closed 15 years ago

Stop using indices into content child lists in frame construction

Categories

(Core :: Layout, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla2.0b2

People

(Reporter: bzbarsky, Assigned: bzbarsky)

Details

Attachments

(15 files, 3 obsolete files)

1.50 KB, patch
sicking
: review+
Details | Diff | Splinter Review
16.90 KB, patch
tnikkel
: review+
Details | Diff | Splinter Review
6.34 KB, patch
tnikkel
: review+
Details | Diff | Splinter Review
5.29 KB, patch
tnikkel
: review+
Details | Diff | Splinter Review
6.70 KB, patch
tnikkel
: review+
Details | Diff | Splinter Review
1.27 KB, patch
tnikkel
: review+
Details | Diff | Splinter Review
25.72 KB, patch
roc
: review+
Details | Diff | Splinter Review
11.61 KB, patch
roc
: review+
Details | Diff | Splinter Review
8.03 KB, patch
tnikkel
: review+
Details | Diff | Splinter Review
7.87 KB, patch
roc
: review+
Details | Diff | Splinter Review
4.91 KB, patch
tnikkel
: review+
Details | Diff | Splinter Review
9.08 KB, patch
tnikkel
: review+
Details | Diff | Splinter Review
18.06 KB, patch
tnikkel
: review+
Details | Diff | Splinter Review
19.27 KB, patch
tnikkel
: review+
Details | Diff | Splinter Review
9.26 KB, patch
tnikkel
: review+
Details | Diff | Splinter Review
We'd like to move away from the index-based access to content child lists we have now. This bug is about switching frame construction to the new GetFirstChild/GetLastChild/GetNextSibling/GetPreviousSibling APIs.
Attachment #456297 - Flags: review? → review?(tnikkel)
Attachment #456298 - Flags: review?(tnikkel)
Attachment #456299 - Flags: review?(tnikkel)
Attachment #456306 - Flags: review?(tnikkel)
Attachment #456310 - Attachment description: Part 12. Stop using indices in ContentRangeInserted → Part 12. Mostly stop using indices in ContentRangeInserted
Attachment #456311 - Flags: review?(tnikkel)
Comment on attachment 456296 [details] [diff] [review] Part 2. Pass the end child to ContentRangeInserted + // child at aIndexInContainer, and must be non-null. aEndChild is the node at + // aEndIndexInContainer (which may be null). If aAllowLazyConstruction is Please indicate that aEndChild may only be null when the range is at the end of the child list.
Attachment #456296 - Flags: review?(tnikkel) → review+
Comment on attachment 456297 [details] [diff] [review] Part 3. Change ClearLazyBitsInChildren Maybe ClearLazyBitsInSiblings or ClearLazyBits instead of ClearLazyBitsInChildren since we don't look at the children of the passed in nodes anymore? Anyways, that's a nice improvement to that function.
Attachment #456297 - Flags: review?(tnikkel) → review+
Comment on attachment 456298 [details] [diff] [review] Part 4. Change MaybeRecreateForFrameset That's a nice improvement too.
Attachment #456298 - Flags: review?(tnikkel) → review+
Comment on attachment 456299 [details] [diff] [review] Part 5. Change MaybeConstructLazily >- * -(for inserts) the child is not at the passed in index (this should only >- * be happening because the editor is broken and passes in native anonymous >- * content with index -1) >+ * -(for inserts) the child is anonymous When we had indices it was pretty clear that passing content that was not in the container's principal child list to ContentAppended would just not work. Without indices it is not clear why this only applies to inserts. Maybe mention why this only applies to inserts and add an assertion in the append case in MaybeConstructLazily that the children are not anonymous.
Attachment #456299 - Flags: review?(tnikkel) → review+
Attachment #456300 - Flags: review?(tnikkel) → review+
Comment on attachment 456306 [details] [diff] [review] Part 9. Stop using indices in GetInsertionPrevSibling This patch appears to be broken. The function signature for GetInsertionPrevSibling doesn't match in the .h and .cpp and aStartSkipIndexInContainer is still used in GetInsertionPrevSibling.
> Please indicate that aEndChild may only be null when the range is at the end Done. > Maybe ClearLazyBitsInSiblings or ClearLazyBits ClearLazyBits it is! > Maybe mention why this only applies to inserts and add an assertion in the > append case Done. New comment: * -(for inserts) the child is anonymous. In the append case this function * must not be called with anonymous children. and I'm asserting for each child in the CONTENTAPPEND loop. > The function signature for GetInsertionPrevSibling doesn't match in the .h > and .cpp Oops. Indeed. Needed to remove the aIndexInContainer arg in the .cpp (I had accidentally put that in a later patch in the queue). > and aStartSkipIndexInContainer is still used in GetInsertionPrevSibling. Where? With the aIndexInContainer removal things compile fine, and I see no uses in the code.
Attached patch Part 9 updated to comments (obsolete) — Splinter Review
Attachment #456306 - Attachment is obsolete: true
Attachment #456397 - Flags: review?(tnikkel)
Attachment #456306 - Flags: review?(tnikkel)
Attachment #456311 - Attachment is obsolete: true
Attachment #456398 - Flags: review?(tnikkel)
Attachment #456311 - Flags: review?(tnikkel)
Comment on attachment 456397 [details] [diff] [review] Part 9 updated to comments This looks the same as the previous version.
> This looks the same as the previous version. I could have sworn I ran qref before attaching.... in any case, _this_ version is different!
Attachment #456397 - Attachment is obsolete: true
Attachment #456455 - Flags: review?(tnikkel)
Attachment #456397 - Flags: review?(tnikkel)
(In reply to comment #21) > > and aStartSkipIndexInContainer is still used in GetInsertionPrevSibling. > > Where? With the aIndexInContainer removal things compile fine, and I see no > uses in the code. My mistake, I didn't realize that this function was also changed in a patch you didn't ask for my review on.
Comment on attachment 456301 [details] [diff] [review] Part 7. Stop using indices for whitespace-suppression optimizations Looks fine, however I think instead of boolean parameters it's much more readable (and extensible) to use a flags word and a meaningful flag #define or enum.
Attachment #456301 - Flags: review?(roc) → review+
Comment on attachment 456302 [details] [diff] [review] Part 8. Stop using indices in ChildIterator >@@ -6042,40 +6043,31 @@ nsCSSFrameConstructor::GetInsertionPrevS >+ if (xblCase || !aChild->IsRootOfAnonymousSubtree()) { Wouldn't we want the condition on this if to be just "!aChild->IsRootOfAnonymousSubtree()"? Also, the only other place you use xblCase is in a comment, and you delete that comment in the next patch.
> Wouldn't we want the condition on this if to be just > "!aChild->IsRootOfAnonymousSubtree()"? I was trying to avoid changing behavior... In particular, I'm not sure what the deal with |container != aContainer| is. It might be worth a followup bug on this.
(In reply to comment #29) > I was trying to avoid changing behavior... In particular, I'm not sure what > the deal with |container != aContainer| is. It might be worth a followup bug > on this. That makes sense. I would be happy with a followup to do just what I suggested.
Attachment #456455 - Flags: review?(tnikkel) → review+
Comment on attachment 456307 [details] [diff] [review] Part 10. Stop using indices in GetRangeInsertionPoint >@@ -6010,17 +6010,16 @@ GetAdjustedParentFrame(nsIFrame* a >- PRInt32 aIndexInContainer, Looks like you have a stray fragment in here from part 9. I assume you fixed this when you fixed part 9.
Attachment #456307 - Flags: review?(tnikkel) → review+
> I assume you fixed this when you fixed part 9. Yes, I did.
Attachment #456310 - Flags: review?(tnikkel) → review+
Attachment #456398 - Flags: review?(tnikkel) → review+
Attachment #456312 - Flags: review?(tnikkel) → review+
Comment on attachment 456302 [details] [diff] [review] Part 8. Stop using indices in ChildIterator + aFirst->mChild = aLast->mChild = 0; nsnull
Attachment #456302 - Flags: review?(roc) → review+
Attachment #456313 - Flags: review?(tnikkel) → review+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: