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

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>13752</bug_id>
          
          <creation_ts>2011-08-10 18:45:57 +0000</creation_ts>
          <short_desc>Figure out what &apos;delete window.Node&apos; should do</short_desc>
          <delta_ts>2011-08-29 03:25:10 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>WebIDL</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>NEEDSINFO</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ms2ger">Ms2ger</reporter>
          <assigned_to name="Cameron McCormack">cam</assigned_to>
          <cc>dhtmlkitchen</cc>
    
    <cc>mike</cc>
    
    <cc>public-script-coord</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>54613</commentid>
    <comment_count>0</comment_count>
    <who name="Ms2ger">Ms2ger</who>
    <bug_when>2011-08-10 18:45:57 +0000</bug_when>
    <thetext>From &lt;http://dev.w3.org/2006/webapi/WebIDL/#es-interfaces&gt; and &lt;http://es5.github.com/#x8.12.7&gt;, I would assume &apos;delete window.Node&apos; returns true and removes the property, but that doesn&apos;t seem to be the case in browsers. They seem to all return true and still keep the property around.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55821</commentid>
    <comment_count>1</comment_count>
    <who name="Cameron McCormack">cam</who>
    <bug_when>2011-08-25 23:18:54 +0000</bug_when>
    <thetext>Testing with http://people.mozilla.org/~cmccormack/tests/interface-object-property.html, I find that Opera, Firefox and IE allow the property to be deleted, while Safari reports the property as non-configurable so refuses to delete it and Chrome reports the property as configurable but still refuses to delete it.

Do you have a test case showing interface object properties being deleted in Opera/Firefox/IE?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55848</commentid>
    <comment_count>2</comment_count>
    <who name="Ms2ger">Ms2ger</who>
    <bug_when>2011-08-26 09:57:57 +0000</bug_when>
    <thetext>OK, looks like the spec is correct in the general case. However, something goes wrong with window.Node in particular in Gecko; I&apos;m assuming that&apos;s a Gecko bug. (See &lt;http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1120&gt;.)

I&apos;m satisfied with your response.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55953</commentid>
    <comment_count>3</comment_count>
    <who name="Ms2ger">Ms2ger</who>
    <bug_when>2011-08-28 17:59:53 +0000</bug_when>
    <thetext>(And for people who are interested: &lt;http://w3c-test.org/webapps/DOMCore/tests/submissions/Ms2ger/interfaces.html&gt;.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55961</commentid>
    <comment_count>4</comment_count>
    <who name="Garrett">dhtmlkitchen</who>
    <bug_when>2011-08-29 03:25:10 +0000</bug_when>
    <thetext>Here is your code:

function testInterfaceDeletable(iface) {
  test(function() {
    assert_true(!!window[iface], &quot;Interface should exist.&quot;)
    assert_true(delete window[iface], &quot;The delete operator should return true.&quot;)
    assert_equals(window[iface], undefined, &quot;Interface should be gone.&quot;)
}
 Avoid getting bit by ASI bugs by consistently using explicit semicolons where they are required.

The delete operator does not &quot;return&quot; anything. The delete operator is just what it is: an operator. It performs an operation which has a boolean result. 

test(function() {
  for (var p in window) {
    interfaces.forEach(function(i) {
      assert_not_equals(p, i)
    })
  }
}, &quot;Interface objects properties should not be Enumerable&quot;)

If `window` is specified to have own interface objects as own properties, then you can use:

({}).propertyIsEnumerable.call(window, &quot;Node&quot;);

Otherwise, if interface objects can exist in `window` prototype chain, `propertyIsEnumerable`, which doesn&apos;t check the object&apos;s prototype, won&apos;t work there.

Does WebIDL or HTML5 specify `window` to have `Object.prototype` on its prototype chain? If so, then the code could use `window.propertyIsEnumerable(&quot;Node&quot;)`.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>