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)
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.
| Assignee | ||
Comment 1•15 years ago
|
||
Attachment #456295 -
Flags: review?(jonas)
| Assignee | ||
Comment 2•15 years ago
|
||
Attachment #456296 -
Flags: review?(tnikkel)
| Assignee | ||
Comment 3•15 years ago
|
||
Attachment #456297 -
Flags: review?
| Assignee | ||
Updated•15 years ago
|
Attachment #456297 -
Flags: review? → review?(tnikkel)
| Assignee | ||
Comment 4•15 years ago
|
||
Attachment #456298 -
Flags: review?(tnikkel)
| Assignee | ||
Comment 5•15 years ago
|
||
Attachment #456299 -
Flags: review?(tnikkel)
| Assignee | ||
Comment 6•15 years ago
|
||
Attachment #456300 -
Flags: review?(tnikkel)
| Assignee | ||
Comment 7•15 years ago
|
||
Attachment #456301 -
Flags: review?(roc)
| Assignee | ||
Comment 8•15 years ago
|
||
Attachment #456302 -
Flags: review?(roc)
| Assignee | ||
Comment 9•15 years ago
|
||
Attachment #456306 -
Flags: review?(tnikkel)
| Assignee | ||
Comment 10•15 years ago
|
||
Attachment #456307 -
Flags: review?(tnikkel)
| Assignee | ||
Comment 11•15 years ago
|
||
Attachment #456309 -
Flags: review?(roc)
| Assignee | ||
Comment 12•15 years ago
|
||
Attachment #456310 -
Flags: review?(tnikkel)
| Assignee | ||
Updated•15 years ago
|
Attachment #456310 -
Attachment description: Part 12. Stop using indices in ContentRangeInserted → Part 12. Mostly stop using indices in ContentRangeInserted
| Assignee | ||
Comment 13•15 years ago
|
||
Attachment #456311 -
Flags: review?(tnikkel)
| Assignee | ||
Comment 14•15 years ago
|
||
Attachment #456312 -
Flags: review?(tnikkel)
| Assignee | ||
Comment 15•15 years ago
|
||
Attachment #456313 -
Flags: review?(tnikkel)
Attachment #456295 -
Flags: review?(jonas) → review+
Comment 16•15 years ago
|
||
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 17•15 years ago
|
||
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 18•15 years ago
|
||
Comment on attachment 456298 [details] [diff] [review]
Part 4. Change MaybeRecreateForFrameset
That's a nice improvement too.
Attachment #456298 -
Flags: review?(tnikkel) → review+
Comment 19•15 years ago
|
||
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+
Updated•15 years ago
|
Attachment #456300 -
Flags: review?(tnikkel) → review+
Comment 20•15 years ago
|
||
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.
| Assignee | ||
Comment 21•15 years ago
|
||
> 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.
| Assignee | ||
Comment 22•15 years ago
|
||
Attachment #456306 -
Attachment is obsolete: true
Attachment #456397 -
Flags: review?(tnikkel)
Attachment #456306 -
Flags: review?(tnikkel)
| Assignee | ||
Comment 23•15 years ago
|
||
Attachment #456311 -
Attachment is obsolete: true
Attachment #456398 -
Flags: review?(tnikkel)
Attachment #456311 -
Flags: review?(tnikkel)
Comment 24•15 years ago
|
||
Comment on attachment 456397 [details] [diff] [review]
Part 9 updated to comments
This looks the same as the previous version.
| Assignee | ||
Comment 25•15 years ago
|
||
> 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)
Comment 26•15 years ago
|
||
(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 28•15 years ago
|
||
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.
| Assignee | ||
Comment 29•15 years ago
|
||
> 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.
Comment 30•15 years ago
|
||
(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.
Updated•15 years ago
|
Attachment #456455 -
Flags: review?(tnikkel) → review+
Comment 31•15 years ago
|
||
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+
| Assignee | ||
Comment 32•15 years ago
|
||
> I assume you fixed this when you fixed part 9.
Yes, I did.
Updated•15 years ago
|
Attachment #456310 -
Flags: review?(tnikkel) → review+
Updated•15 years ago
|
Attachment #456398 -
Flags: review?(tnikkel) → review+
Updated•15 years ago
|
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 #456309 -
Flags: review?(roc) → review+
Updated•15 years ago
|
Attachment #456313 -
Flags: review?(tnikkel) → review+
| Assignee | ||
Comment 34•15 years ago
|
||
Made that change and checked in:
http://hg.mozilla.org/mozilla-central/rev/6870012f82dd
http://hg.mozilla.org/mozilla-central/rev/d5fe749035ca
http://hg.mozilla.org/mozilla-central/rev/67ed11b6c280
http://hg.mozilla.org/mozilla-central/rev/56dc9c85d416
http://hg.mozilla.org/mozilla-central/rev/4aa932b494ec
http://hg.mozilla.org/mozilla-central/rev/bbc1189fce68
http://hg.mozilla.org/mozilla-central/rev/c371e7a283a6
http://hg.mozilla.org/mozilla-central/rev/aa1f92ff7a0f
http://hg.mozilla.org/mozilla-central/rev/0e3e71b12b77
http://hg.mozilla.org/mozilla-central/rev/16f50b6267cc
http://hg.mozilla.org/mozilla-central/rev/2fb5e533c18f
http://hg.mozilla.org/mozilla-central/rev/5d26e1919b83
http://hg.mozilla.org/mozilla-central/rev/646ba1458dbd
http://hg.mozilla.org/mozilla-central/rev/c879c3795adb
http://hg.mozilla.org/mozilla-central/rev/f12a52c2b589
Filed bug 578966 on comment 30.
Status: NEW → RESOLVED
Closed: 15 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0b2
You need to log in
before you can comment on or make changes to this bug.
Description
•