Bug 46689 - [v8] fast/dom/HTMLElement/class-list.html fails
Summary: [v8] fast/dom/HTMLElement/class-list.html fails
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Erik Arvidsson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-27 19:32 PDT by Hajime Morrita
Modified: 2010-09-29 14:01 PDT (History)
5 users (show)

See Also:


Attachments
Test case (263 bytes, text/html)
2010-09-28 08:01 PDT, Erik Arvidsson
no flags Details
Another related test (332 bytes, text/html)
2010-09-28 08:11 PDT, Erik Arvidsson
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hajime Morrita 2010-09-27 19:32:29 PDT
It's flaky on chromium buildbot.
Comment 1 Erik Arvidsson 2010-09-27 23:23:30 PDT
I only managed to reproduce this on DRT (it does not happen on TestShell nor Chromium). I should try it on

The test tests the following:

assert(classList[-1] === undefined);
assert(classList[-1] === undefined);

However, the second call incorrectly triggers the indexed getter which should return null for UInt32 that are larger than the length - 1. Why this happens on the second call is a mystery to me. I haven't been able to get a debugger attached to DRT.

I would really appreciate some help from someone with some V8 binding foo.
Comment 3 anton muhin 2010-09-28 02:49:32 PDT
(In reply to comment #1)
> I only managed to reproduce this on DRT (it does not happen on TestShell nor Chromium). I should try it on
> 
> The test tests the following:
> 
> assert(classList[-1] === undefined);
> assert(classList[-1] === undefined);
> 
> However, the second call incorrectly triggers the indexed getter which should return null for UInt32 that are larger than the length - 1. Why this happens on the second call is a mystery to me. I haven't been able to get a debugger attached to DRT.

What is the platform?

> 
> I would really appreciate some help from someone with some V8 binding foo.

Is it the exact JS code which triggers the problem?  v8 might compile different code if the code is in a loop, for example.

If you could send a minimal test case in JS with instructions how to run it, I'll try to debug it on my box.

I'd try to see (with printf unless there will be found the way to attach a debugger) the whole stack: how v8 invokes the callback (we should go either via runtime or small compiled stub).

In any event, Erik, feel free to ping me on IM, I'd be glad to help.
Comment 4 Erik Arvidsson 2010-09-28 08:01:54 PDT
Created attachment 69050 [details]
Test case
Comment 5 anton muhin 2010-09-28 08:04:11 PDT
(In reply to comment #4)
> Created an attachment (id=69050) [details]
> Test case

It looks empty
Comment 6 Erik Arvidsson 2010-09-28 08:06:49 PDT
This happens on all platforms according to http://test-results.appspot.com/dashboards/flakiness_dashboard.html#tests=class-list.html&useWebKitCanary=true

I only managed to repro this using DRT and it works as expected on TestShell and Chromium (I'm on a Mac).
Comment 7 Erik Arvidsson 2010-09-28 08:08:30 PDT
(In reply to comment #5)
> (In reply to comment #4)
> > Created an attachment (id=69050) [details] [details]
> > Test case
> 
> It looks empty

You need a build from yesterday or you'll see script errors.

However I managed to reproduce this with MediaList. I'll add another test that shows the same bug with a media list.
Comment 8 Erik Arvidsson 2010-09-28 08:11:46 PDT
Created attachment 69052 [details]
Another related test

This shows that MediaList has the same indexed getter bug in DRT as DOMTokenList.
Comment 9 anton muhin 2010-09-29 07:08:37 PDT
It's actually V8 issue.  The cure should be on the way: http://codereview.chromium.org/3520006/show
Comment 10 anton muhin 2010-09-29 09:09:13 PDT
https://code.google.com/p/v8/source/detail?r=5553 committed to bleeding_edge, should reach Chromium ToT early next week (if everything goes smooth).

r5554--5556 brings the fix to various v8 branches and should eventually go into Chrome 7 and maybe even Chrome 6.

Erik, may you check if this fixes the issue and close the bug if it's the case?
Comment 11 Erik Arvidsson 2010-09-29 14:01:56 PDT
I verified that the fix works.