[webkit-dev] Rename of selfOnlyRef to guardRef - ok if I change it back? (was Re: DOM tree traversal on detached nodes)
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?
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.
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):
> Then later it was moved back to Document but retaining the rename:
> Would anyone object if I renamed it back? Alternately, could the reason
> for the new name be documented somewhere?
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
Kentaro Hara, Tokyo, Japan (http://haraken.info)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the webkit-dev