<?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>27662</bug_id>
          
          <creation_ts>2009-07-24 12:14:55 -0700</creation_ts>
          <short_desc>Document needs a JSDOMWindow pointer that doesn&apos;t require going through Frame</short_desc>
          <delta_ts>2011-10-06 01:22:15 -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>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</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>
          <dependson>27640</dependson>
          <blocked>26147</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Eric Seidel (no email)">eric</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>abarth</cc>
    
    <cc>ap</cc>
    
    <cc>loic</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>134619</commentid>
    <comment_count>0</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2009-07-24 12:14:55 -0700</bug_when>
    <thetext>Document needs a JSDOMWindow pointer that doesn&apos;t require going through Frame

This is needed for times in the bindings where we have a Node* or a Document* and we need to get the globalObject so that we can correctly call toJS().

NodeFilterConditionCustom.cpp acceptNode() is one such example.

Relating this to bug 27640 which is the inverse of this mapping.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>478322</commentid>
    <comment_count>1</comment_count>
    <who name="Loic Dachary">loic</who>
    <bug_when>2011-10-05 07:10:53 -0700</bug_when>
    <thetext>Hi,

I think this bug is related to bug 26147 . I&apos;m trying to fix it and I would appreciate if you have an advice on how to proceed. Do you think it should be an additional field to the Document class ? If so do you think it should be set when the Document constructor is called or attached to it later on ? 

There are many approach to this problem and any kind of guidance would be most appreciated. 

Cheers</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>478487</commentid>
    <comment_count>2</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2011-10-05 10:38:52 -0700</bug_when>
    <thetext>We solved this problem a different way.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>478717</commentid>
    <comment_count>3</comment_count>
    <who name="Loic Dachary">loic</who>
    <bug_when>2011-10-05 15:10:25 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; We solved this problem a different way.

The chosen solution is incorrect.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>478721</commentid>
    <comment_count>4</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2011-10-05 15:13:51 -0700</bug_when>
    <thetext>(In reply to comment #3)
&gt; (In reply to comment #2)
&gt; &gt; We solved this problem a different way.
&gt; 
&gt; The chosen solution is incorrect.

Could you provide a bit more context as to what the solution was and why you believe it&apos;s incorrect?  (Although I filed this bug, I haven&apos;t worked in this area in a long time.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>478723</commentid>
    <comment_count>5</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2011-10-05 15:15:26 -0700</bug_when>
    <thetext>The reason this bug is invalid is because Document is a DOM-layer object and JSDOMWindow is a bindings-layer object.  It&apos;s generally not a good idea to have a DOM-layer object have a pointer to a bindings-layer object.  Instead, we ended up storing the pointer in the JSDocument wrapper object, which is a bindings-layer object.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>479019</commentid>
    <comment_count>6</comment_count>
    <who name="Loic Dachary">loic</who>
    <bug_when>2011-10-06 01:22:15 -0700</bug_when>
    <thetext>
Thanks for explaining, now I understand. I&apos;m still unsure if this will help in the context of bug 26147, but it&apos;s a different topic.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>