<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>157600</bug_id>
          
          <creation_ts>2016-05-11 17:23:10 -0700</creation_ts>
          <short_desc>WebKit fails w3c interface tests on Workers (http://w3c-test.org/workers/interfaces.worker and http://w3c-test.org/IndexedDB/interfaces.worker)</short_desc>
          <delta_ts>2016-06-07 18:02:38 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebCore Misc.</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>158446</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>149117</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Brady Eidson">beidson</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>achristensen</cc>
    
    <cc>cdumez</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1192164</commentid>
    <comment_count>0</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2016-05-11 17:23:10 -0700</bug_when>
    <thetext>Modern IDB: IDB object constructors aren&apos;t exposed on the WorkerGlobalScope

I *think* fixing this is as simple as a change to WorkerGlobalScopeConstructors.idl to shadow DOMWindowConstructors.idl. Will test soon.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1192183</commentid>
    <comment_count>1</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2016-05-11 18:44:39 -0700</bug_when>
    <thetext>I see that all these constructors were put on WorkerGlobalScope.idl in http://trac.webkit.org/changeset/199889

For whatever reason it is not working.

The conditional INDEXED_DATABASE_IN_WORKERS is enabled, and IndexedDBWorkers is enabled at runtime by default, but they still aren&apos;t showing up.

I&apos;m building with these all put in WorkerGlobalScopeConstructors.idl to see if that works...

/me shrugs</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1192189</commentid>
    <comment_count>2</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2016-05-11 19:15:23 -0700</bug_when>
    <thetext>What is not working exactly?

Clearly, they were exposed as of http://trac.webkit.org/changeset/199889 based on the layout test that I added and was passing, right?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1192190</commentid>
    <comment_count>3</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2016-05-11 19:19:29 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; What is not working exactly?
&gt; 
&gt; Clearly, they were exposed as of http://trac.webkit.org/changeset/199889
&gt; based on the layout test that I added and was passing, right?

I have just confirmed that the test that I added in r199889 is not skipped and passing on the bots:
storage/indexeddb/modern/workers-enable.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1192195</commentid>
    <comment_count>4</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2016-05-11 20:32:54 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; What is not working exactly?

Sorry this wasn&apos;t mentioned - most of http://w3c-test.org/IndexedDB/interfaces.worker is failing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1192202</commentid>
    <comment_count>5</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2016-05-11 21:01:05 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; (In reply to comment #2)
&gt; &gt; What is not working exactly?
&gt; 
&gt; Sorry this wasn&apos;t mentioned - most of
&gt; http://w3c-test.org/IndexedDB/interfaces.worker is failing.

I see now. Even though they are failing, I do not believe the reason they are failing is that the constructors are not exposed.

They do:
assert_own_property(self, this.name, &quot;self does not have own property &quot; + format_value(this.name));

I assume this.name is the name of the property they want to check.

This ends up calling:
function _assert_own_property(name) {
        return function(object, property_name, description)
        {
            assert(object.hasOwnProperty(property_name),
                   name, description,
                   &quot;expected property ${p} missing&quot;, {p:property_name});
        };
    }

And we get a JS error saying that &apos;object&apos; is undefined.

AFAICT, &apos;object&apos; is self since this is what we call assert_own_property() with as 1st parameter. Still trying to figure out what this means though.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1192204</commentid>
    <comment_count>6</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2016-05-11 21:05:20 -0700</bug_when>
    <thetext>(In reply to comment #5)
&gt; (In reply to comment #4)
&gt; &gt; (In reply to comment #2)
&gt; &gt; &gt; What is not working exactly?
&gt; &gt; 
&gt; &gt; Sorry this wasn&apos;t mentioned - most of
&gt; &gt; http://w3c-test.org/IndexedDB/interfaces.worker is failing.
&gt; 
&gt; I see now. Even though they are failing, I do not believe the reason they
&gt; are failing is that the constructors are not exposed.
&gt; 
&gt; They do:
&gt; assert_own_property(self, this.name, &quot;self does not have own property &quot; +
&gt; format_value(this.name));
&gt; 
&gt; I assume this.name is the name of the property they want to check.
&gt; 
&gt; This ends up calling:
&gt; function _assert_own_property(name) {
&gt;         return function(object, property_name, description)
&gt;         {
&gt;             assert(object.hasOwnProperty(property_name),
&gt;                    name, description,
&gt;                    &quot;expected property ${p} missing&quot;, {p:property_name});
&gt;         };
&gt;     }
&gt; 
&gt; And we get a JS error saying that &apos;object&apos; is undefined.
&gt; 
&gt; AFAICT, &apos;object&apos; is self since this is what we call assert_own_property()
&gt; with as 1st parameter. Still trying to figure out what this means though.

Thanks for looking into it. I obviously misunderstood the issue, partially because the way that page is constructed is somewhat opaque. =/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1192205</commentid>
    <comment_count>7</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2016-05-11 21:06:31 -0700</bug_when>
    <thetext>Also FWIW, I&apos;d expect at least 154 passes, as the interfaces test that works on DOMWindow has that many:
http://w3c-test.org/IndexedDB/interfaces.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1192206</commentid>
    <comment_count>8</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2016-05-11 21:07:41 -0700</bug_when>
    <thetext>As a layperson in this area, it seemed to be that the difference was related to how we expose these interfaces (which I assumed meant constructors) on DOMWindow vs WorkerGlobalScope.

Not sure if that will give you any tips towards the difference.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1192234</commentid>
    <comment_count>9</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2016-05-11 22:59:26 -0700</bug_when>
    <thetext>(In reply to comment #8)
&gt; As a layperson in this area, it seemed to be that the difference was related
&gt; to how we expose these interfaces (which I assumed meant constructors) on
&gt; DOMWindow vs WorkerGlobalScope.
&gt; 
&gt; Not sure if that will give you any tips towards the difference.

I don&apos;t think the issue is really with the IDB implementation. If you look at the corresponding test for workers:
http://w3c-test.org/workers/interfaces.worker

We are failing most of it as well. I think the issue is with our worker support somehow.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1192320</commentid>
    <comment_count>10</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2016-05-12 06:28:40 -0700</bug_when>
    <thetext>(In reply to comment #9)
&gt; (In reply to comment #8)
&gt; &gt; As a layperson in this area, it seemed to be that the difference was related
&gt; &gt; to how we expose these interfaces (which I assumed meant constructors) on
&gt; &gt; DOMWindow vs WorkerGlobalScope.
&gt; &gt; 
&gt; &gt; Not sure if that will give you any tips towards the difference.
&gt; 
&gt; I don&apos;t think the issue is really with the IDB implementation. If you look
&gt; at the corresponding test for workers:
&gt; http://w3c-test.org/workers/interfaces.worker
&gt; 
&gt; We are failing most of it as well. I think the issue is with our worker
&gt; support somehow.

I see, so we botch these interface checks on web workers for *all* exposed objects.

Yay.

:(</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1199242</commentid>
    <comment_count>11</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2016-06-04 10:20:18 -0700</bug_when>
    <thetext>&lt;rdar://problem/26638397&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1200268</commentid>
    <comment_count>12</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2016-06-07 18:02:38 -0700</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 158446 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>