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

Hajime Morrita morrita at chromium.org
Mon Jun 11 20:14:51 PDT 2012


(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
>


More information about the webkit-dev mailing list