Open Bug 844357 Opened 12 years ago Updated 2 years ago

Rename nsPresContext::Document to nsPresContext::GetDocument

Categories

(Core :: Layout, defect)

x86_64
Linux
defect

Tracking

()

People

(Reporter: smaug, Unassigned)

Details

The method may return null (after unlink), so it should have Get* prefix.
Does after unlink really count? One shouldn't have access to the pres context after it's been unlinked, either.
After unlink does count. That is at least how non-Get* methods work on dom side. Never ever return null. (Well, there can be some phase during initialization of the object when the naming of the method may lie.) Since unlinking doesn't mean deletion, it shouldn't affect to the naming. The prescontext has still access to itself. So, during deletion, one needs to null check Document().
I just tried using mDocument from inside ~nsPresContext and failed. I think at least a note in a comment where mDocument is defined would be good. No opinion on renaming Document().
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.