Closed Bug 707862 Opened 13 years ago Closed 13 years ago

Reset childCount on SHEntry when all children have been removed

Categories

(Core :: DOM: Navigation, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla13

People

(Reporter: ttaubert, Assigned: ttaubert)

Details

Attachments

(1 file)

Follow-up from bug 705597 comment #43: Removing children from a SHEntry creates holes. After all children have been removed the .childCount property should be reset to zero. Otherwise it indicates there are SHEntry children but will return null for every GetChildAt() call.
Attached patch patch v1Splinter Review
I realized that we could go even further and always remove empty children when they're at the end of the mChildren array - that's what this patch does. Regarding the test, I didn't know where a test like this should go and if there are any SHistory mochitests? I for now chose the sessionstore component because the test is almost identical to the one from bug 705597 (only slightly adapted).
Assignee: nobody → tim.taubert
Status: NEW → ASSIGNED
Attachment #580643 - Flags: review?(bugs)
There are quite a few tests in docshell/test
Oops, I looked for them in docshell/shistory/... Will move the test.
I'm trying to remember if we can cleanup mChildren, especially if there are some non-dynamically added children and some dynamically added.
How often does the situation actually happen?
I have no idea how often that happens in the wild. It seems to happen but maybe not really often or only with some sites. In fact, since bug 705597 landed it doesn't affect session store anymore so if you're not sure about the consequences of resetting childCount I'm fine with not doing it. Just wanted to try fixing 'the real issue' instead of just the symptom :)
Comment on attachment 580643 [details] [diff] [review] patch v1 Please land this very early in FF13 cycle. Session history changes are very regression risky. If this causes regressions, please back out asap.
Attachment #580643 - Flags: review?(bugs) → review+
Comment on attachment 580643 [details] [diff] [review] patch v1 And use --i, not i--
(In reply to Olli Pettay [:smaug] from comment #8) > And use --i, not i-- Fixed. https://hg.mozilla.org/integration/fx-team/rev/d8b2e5047c9b
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → mozilla13
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: