[Webkit-unassigned] [Bug 33696] let's cache nodelists instead of dynamicnodelist::cache

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Mar 26 10:02:52 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=33696





--- Comment #37 from anton muhin <antonm at chromium.org>  2010-03-26 10:02:51 PST ---
(In reply to comment #36)
> (From update of attachment 51734 [details])
> > -    [ "document.getElementsByTagName('body')" ], // NodeList
> > +    [ "document.getElementsByTagName('body')", "allow custom skip" ], // NodeList
> 
> This says that before the patch we did not allow custom properties on node
> lists. And after the patch we do allow custom properties on node lists. That
> has nothing to do with caching. Why did this patch have any effect on this?
> This makes no sense.
> 
> I understand that the caching mean this would change from "allow custom" to
> "allow custom skip", but I don't see why this patch changes behavior of adding
> a custom property to a node list.

Darin, here is my understanding of the situation:

LayoutTest's part:

153 function generateProperties()
154 {
155     for (var i = 0; i < objectsToTest.length; i++) { // >
156         try {
157             eval(objectsToTest[i][0] + ".myCustomProperty = 1;");
158         } catch(e) {
159             print("NOT SUPPORTED: " + objectsToTest[i][0] + "[ " +
e.message + " ]");
160         }
161         var expectedResult = objectsToTest[i][1] ? 1 : undefined;
162         try {                                                               
163             shouldBe(objectsToTest[i][0] + ".myCustomProperty",
expectedResult);
164         } catch(e) {
165         }
166     }
167 }

Before each invocation of getElementsByTagName("body") would yield new object
and thus assignment at line 157 wouldn't be visible at lline 163 (as we
reevaluate data afresh).

Now nodelists are cached and thus properties assignment as visible.

I am more concerned why after GC it disappears, but suspect that JSC bindings
just discard cached nodelist due to some kind of weak references.

Does that make sense?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list