<?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>8131</bug_id>
          
          <creation_ts>2006-04-01 18:45:48 -0800</creation_ts>
          <short_desc>Some properties and methods of window and document objects cannot be converted to a string</short_desc>
          <delta_ts>2008-03-21 11:31:35 -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>DOM</component>
          <version>416.x</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.4</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://www.gtalbot.org/DHTMLSection/ListAllAttributesAndMethodsOfObjects.html</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="Gérard Talbot (no longer involved)">browserbugs2</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>ytpete</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>38243</commentid>
    <comment_count>0</comment_count>
    <who name="Gérard Talbot (no longer involved)">browserbugs2</who>
    <bug_when>2006-04-01 18:45:48 -0800</bug_when>
    <thetext>Steps to reproduce:
1- Load provided URL
2- click the button to list the properties and methods of window | document | event object

Actual results in Safari 2.02 (416.13): nothing happens

Expected results: properties and methods should be listed.

Right now, Mozilla browsers, MSIE 6, Opera 7+ lists the properties and methods of these objects (albeit some browsers may have a few bugs too).

Fixing this bug would help DHTML and/or js+DOM scripters figuring out what they can use in a DHTML application and establish the level/degree of support/implementation of this or that property/method in Safari.

I searched for duplicate and couldn&apos;t find any.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>38263</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2006-04-02 01:08:37 -0800</bug_when>
    <thetext>Some of the properties here cannot be explicitly converted to a string:
alert(window[&apos;CSSRule&apos;]); // OK, [object CSSRuleConstructor]
alert(window[&apos;CSSRule&apos;]+&quot;&quot;); // exception, &quot;TypeError: No default value&quot;. OK in Firefox.

Interestingly, these problematic properties are just not listed in Firefox - not sure why.

Event object is dumped correctly in current WebKit builds, available at &lt;http://nightly.webkit.org&gt;. The troublesome property was event.view.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>38266</commentid>
    <comment_count>2</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2006-04-02 01:30:54 -0800</bug_when>
    <thetext>I feel like I fixed a very similar bug last fall which was caused by some of our java script binding objects not having proper prototypes (thus not having a toString() method).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>38283</commentid>
    <comment_count>3</comment_count>
    <who name="Gérard Talbot (no longer involved)">browserbugs2</who>
    <bug_when>2006-04-02 12:22:58 -0700</bug_when>
    <thetext>
&gt; Some of the properties here cannot be explicitly converted to a string:
&gt; alert(window[&apos;CSSRule&apos;]); // OK, [object CSSRuleConstructor]

I&apos;ve never seen such &quot;window[&apos;CSSRule&apos;]&quot; code but I know one can access css rules in Firefox with

if(document.styleSheets &amp;&amp; &quot;cssRules&quot; in document.styleSheets[0]) 
// DOM 2 CSS interface compliant
{
... code ...
};

http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/css.html#CSS-CSSStyleSheet-cssRules

At this precise url
&lt;http://www.quirksmode.org/dom/w3c_css.html#access&gt;
Peter-Paul Koch claims that Safari 1.3 supports cssRules[] collection. He gives a testpage:
&lt;http://www.quirksmode.org/dom/tests/stylesheets.html&gt;

&gt; Event object is dumped correctly in current WebKit builds, available at
&gt; &lt;http://nightly.webkit.org&gt;.

&lt;...Argh...sigh&gt; unfortunately, I can only test my website with a Mac in an Internet Cafe.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>38288</commentid>
    <comment_count>4</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2006-04-02 14:12:41 -0700</bug_when>
    <thetext>&gt; I&apos;ve never seen such &quot;window[&apos;CSSRule&apos;]&quot; code 

Oh, this is actually just a reduction of what fails in the test case:

TotalString += PropertyIterator + 1 + &quot;. &quot; + arrWindowProperties[PropertyIterator] + &quot; = &quot; + window[arrWindowProperties[PropertyIterator]] + &quot;&lt;br&gt;&quot;;

arrWindowProperties[0] happens to be CSSRule in Safari. Several other window properties (e.g. window.XMLHttpRequest) have the same problem. To partially work around this WebKit bug, you can use a try/catch block:

try {
 TotalString += PropertyIterator + 1 + &quot;. &quot; + arrWindowProperties[PropertyIterator] + &quot; = &quot; + window[arrWindowProperties[PropertyIterator]] + &quot;&lt;br&gt;&quot;;
} catch (ex) {
 TotalString += PropertyIterator + 1 + &quot;. &quot; + arrWindowProperties[PropertyIterator] + &quot; - &quot; + ex + &quot;&lt;br&gt;&quot;;
}

&gt; &lt;...Argh...sigh&gt; unfortunately, I can only test my website with a Mac in an
&gt; Internet Cafe.

No problem, checking with nightly builds is not a requirement for filing WebKit bugs, it&apos;s just an extra favor :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39321</commentid>
    <comment_count>5</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2006-04-15 02:30:24 -0700</bug_when>
    <thetext>*** Bug 7936 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>44817</commentid>
    <comment_count>6</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2006-06-05 22:06:53 -0700</bug_when>
    <thetext>Most of the missing prototypes have been added in bug 9310. There is a strange problem with window.debug - it is only present when the document is loaded for the first time (not after a reload), and it still causes a &quot;No default value&quot; exception.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>46087</commentid>
    <comment_count>7</comment_count>
      <attachid>8884</attachid>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2006-06-17 07:29:01 -0700</bug_when>
    <thetext>Created attachment 8884
fix window.debug and test all properties

I have added a prototype to window.debug, now all the properties of window and document objects can be converted to string.

The strange behavior of window.debug is caused by it being added in KJSProxy::initScriptIfNeeded(), which isn&apos;t called when reloading. I am not sure where it should be (Interpreter::initGlobalObject? kjs_window.cpp? removed completely?)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>46139</commentid>
    <comment_count>8</comment_count>
      <attachid>8884</attachid>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2006-06-17 20:51:55 -0700</bug_when>
    <thetext>Comment on attachment 8884
fix window.debug and test all properties

Good fix.

Given the goofiness of this property, and the existence of alternatives like window.console.log, I think we should probably remove it entirely.

If KDE folks are listening, do you get any mileage out of window.debug?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>46147</commentid>
    <comment_count>9</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2006-06-17 23:59:18 -0700</bug_when>
    <thetext>Landed r14903. Opened bug 9492 for window.debug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74637</commentid>
    <comment_count>10</comment_count>
    <who name="Gérard Talbot (no longer involved)">browserbugs2</who>
    <bug_when>2008-03-21 09:07:10 -0700</bug_when>
    <thetext>Marking as VERIFIED</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>8884</attachid>
            <date>2006-06-17 07:29:01 -0700</date>
            <delta_ts>2006-06-17 20:51:55 -0700</delta_ts>
            <desc>fix window.debug and test all properties</desc>
            <filename>8131r1_patch.txt</filename>
            <type>text/plain</type>
            <size>2968</size>
            <attacher name="Alexey Proskuryakov">ap</attacher>
            
              <data encoding="base64">SW5kZXg6IExheW91d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XS0+dG9TdHJpbmcoZXhlYykuYXNjaWkoKSk7CkBAIC0xNDcsNyArMTUzLDcgQEAg
dm9pZCBLSlNQcm94eTo6aW5pdFNjcmlwdElmTmVlZGVkKCkKIAogICAvLyBDcmVhdGUgYSBLSlMg
aW50ZXJwcmV0ZXIgZm9yIHRoaXMgZnJhbWUKICAgbV9zY3JpcHQgPSBuZXcgU2NyaXB0SW50ZXJw
cmV0ZXIoZ2xvYmFsT2JqZWN0LCBtX2ZyYW1lKTsKLSAgZ2xvYmFsT2JqZWN0LT5wdXQobV9zY3Jp
cHQtPmdsb2JhbEV4ZWMoKSwgImRlYnVnIiwgbmV3IFRlc3RGdW5jdGlvbkltcCgpLCBJbnRlcm5h
bCk7CisgIGdsb2JhbE9iamVjdC0+cHV0KG1fc2NyaXB0LT5nbG9iYWxFeGVjKCksICJkZWJ1ZyIs
IG5ldyBUZXN0RnVuY3Rpb25JbXAobV9zY3JpcHQtPmdsb2JhbEV4ZWMoKSksIEludGVybmFsKTsK
IAogICBTdHJpbmcgdXNlckFnZW50ID0gbV9mcmFtZS0+dXNlckFnZW50KCk7CiAgIGlmICh1c2Vy
QWdlbnQuZmluZCgiTWljcm9zb2Z0IikgPj0gMCB8fCB1c2VyQWdlbnQuZmluZCgiTVNJRSIpID49
IDApCg==
</data>
<flag name="review"
          id="2594"
          type_id="1"
          status="+"
          setter="ggaren"
    />
          </attachment>
      

    </bug>

</bugzilla>