[webkit-dev] Rename of selfOnlyRef to guardRef - ok if I change it back? (was Re: DOM tree traversal on detached nodes)
Kentaro Hara
haraken at chromium.org
Mon Jun 11 18:43:17 PDT 2012
> 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?
<!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)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20120612/84406c6f/attachment.html>
More information about the webkit-dev
mailing list