[webkit-dev] Rename of selfOnlyRef to guardRef - ok if I change it back? (was Re: DOM tree traversal on detached nodes)

Ryosuke Niwa rniwa at webkit.org
Fri Jun 15 09:47:56 PDT 2012


On Fri, Jun 15, 2012 at 9:30 AM, Darin Adler <darin at apple.com> wrote:

> On Jun 15, 2012, at 12:12 AM, Roland Steiner wrote:
>
> I made the original name change, because I honestly was entirely confused
> about the meaning of "selfOnlyRef" (it's done by Node on Document, so what
> is "self"? Why is it needed?)
>
>
> A good rule of thumb, the one that I use, is that a name like this
> shouldn't be changed when you still don’t understand the meaning of the
> original name. Changing a name you fully understand, but find unclear, is
> OK.
>
> I can see why “selfOnlyRef” is not clear to you, and I agree with Maciej
> that “guardRef” is even less clear. We can probably come up with a better
> name. For clarity, what we want is a name that means “parent only, not
> including children”.
>

How about refAvoidingCyclesWithDescendents or refWithoutRefingDescendents?

Here's the comment right above the declaration / definition of guardRef:
// Nodes belonging to this document hold guard references -
// these are enough to keep the document from being destroyed, but
// not enough to keep it from removing its children. This allows a
// node that outlives its document to still have a valid document
// pointer without introducing reference cycles.

- Ryosuke
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20120615/55ccf9f3/attachment.html>


More information about the webkit-dev mailing list