Closed Bug 714162 Opened 13 years ago Closed 13 years ago

Don't traverse certainly alive selections

Categories

(Core :: DOM: Selection, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla12

People

(Reporter: smaug, Assigned: smaug)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

Attached patch patchSplinter Review
nsFrameSelection is kept alive by Presshell (until Presshell is deleted) and
for text form controls nsTextEditorState/nsTextControlFrame.
When presshell is going away mShell is set to null using DisconnectFromPresShell.

So, as long a mShell is there, the nsFrameSelection object should be certainly alive and 
the whole traversing is just useless.
Attachment #584818 - Flags: review?(matspal)
Yes, the above comment is correct.  I'm not familiar with the cycle collector or
what NS_SUCCESS_INTERRUPTED_TRAVERSE means though, so you should get someone else
to review the actual code change.
Attachment #584818 - Flags: review?(matspal) → review?(continuation)
Comment on attachment 584818 [details] [diff] [review]
patch

Review of attachment 584818 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good. Death to death stars!

r=me given mats's comment.
Attachment #584818 - Flags: review?(continuation) → review+
https://hg.mozilla.org/mozilla-central/rev/0d684c34d1e4
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla12
Version: 10 Branch → Trunk
Attached patch Safer versionSplinter Review
I started to worry about this a bit, so better be safe.
Attachment #585860 - Flags: review?(continuation)
Comment on attachment 585860 [details] [diff] [review]
Safer version

Review of attachment 585860 [details] [diff] [review]:
-----------------------------------------------------------------

The diff on top of the previous patch wasn't really necessary for a tiny patch.

At some point, we should probably another CC macro for this pattern (if document is non-null and in the current generation, return interrupted traverse).
Attachment #585860 - Flags: review?(continuation) → review+
Blocks: 716598
No longer blocks: 698919
Blocks: 728705
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: