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

Roland Steiner rolandsteiner at google.com
Fri Jun 15 00:12:39 PDT 2012


Sorry for the late reply, this thread flew under my radar.

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?) - so I guess we'll have to agree to disagree
which one is clearer. ^_-

That said, I don't have a terribly strong opinion on this (and am not
actively developing WebKit ATM as well).
Also, as Morita-san mentioned, the scope of the implementation has changed,
too, so if you feel strongly about this, please go ahead! :)


Cheers,

- Roland

On Tue, Jun 12, 2012 at 12:14 PM, Hajime Morrita <morrita at chromium.org>wrote:

> (from right address)
>
> +1 for the rename.
> The original idea to pull guardRef() mechanism up to TreeScope was
> abandoned
> and the size of intended responsibility of TreeScope has become much
> smaller than it originally was.
> So there is no reason to keep it even if the original intention wasn't
> clear.
> --
> morrita
>
> On Tue, Jun 12, 2012 at 12:05 PM, Ojan Vafai <ojan at chromium.org> wrote:
> >
> >
> > On Mon, Jun 11, 2012 at 6:43 PM, Kentaro Hara <haraken at chromium.org>
> wrote:
> >>
> >> > I think selfOnlyRef() was a much clearer name.
> >>
> >> I would agree with the rename. (selfOnlyRef() might be removed if I
> could
> >> implement a reference counting that guarantees "Reachable DOM nodes are
> kept
> >> alive", but it is still uncertain. Renaming would make sense to me.)
> >>
> >>
> >> Just a confirmation: In the following example, div.ownerDocument should
> >> return (not null but) iframe.contentDocument. Right?
> >
> >
> > Correct.
> >
> >>
> >>
> >> <!DOCTYPE html>
> >> <html><body><iframe id="iframe"></iframe>
> >> <script>
> >> var iframe = document.getElementById("iframe");
> >> var div = iframe.contentDocument.createElement("div");  // div is not
> yet
> >> in the iframe's document tree
> >> document.body.innerHTML = '';
> >> console.log(div.ownerDocument);  // This should be
> iframe.contentDocument.
> >> There is no reference to nodes in the tree, but selfOnlyRef() keeps the
> >> reference to div.ownerDocument.
> >> </script>
> >> </body></html>
> >>
> >>
> >> On Tue, Jun 12, 2012 at 10:14 AM, Maciej Stachowiak <mjs at apple.com>
> wrote:
> >>>
> >>>
> >>> On Jun 11, 2012, at 6:06 PM, Maciej Stachowiak <mjs at apple.com> wrote:
> >>>
> >>> >  not a self-only reference (at some point renamed to guardRef).
> >>>
> >>> BTW I was able to find where it was renamed but not a good explanation
> of
> >>> why. I think selfOnlyRef() was a much clearer name.
> >>>
> >>> The history seems to be that it was renamed when moved from Document to
> >>> TreeScope (without explanation in the bug or ChangeLog, and apparently
> >>> retaining it's self-only referencing behavior per comments):
> >>>
> >>>    http://trac.webkit.org/changeset/82882
> >>>    https://bugs.webkit.org/show_bug.cgi?id=57689
> >>>
> >>> Then later it was moved back to Document but retaining the rename:
> >>>
> >>>    http://trac.webkit.org/changeset/83123
> >>>    https://bugs.webkit.org/show_bug.cgi?id=57994
> >>>
> >>> Would anyone object if I renamed it back? Alternately, could the reason
> >>> for the new name be documented somewhere?
> >>>
> >>> Regards,
> >>> Maciej
> >>>
> >>> _______________________________________________
> >>> webkit-dev mailing list
> >>> webkit-dev at lists.webkit.org
> >>> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
> >>
> >>
> >>
> >>
> >> --
> >> Kentaro Hara, Tokyo, Japan (http://haraken.info)
> >>
> >> _______________________________________________
> >> webkit-dev mailing list
> >> webkit-dev at lists.webkit.org
> >> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
> >>
> >
> >
> > _______________________________________________
> > webkit-dev mailing list
> > webkit-dev at lists.webkit.org
> > http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20120615/0b9ad3a8/attachment.html>


More information about the webkit-dev mailing list