<?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>4309</bug_id>
          
          <creation_ts>2005-08-06 20:14:16 -0700</creation_ts>
          <short_desc>CSSStyleSheet objects don&apos;t get Obj-C DOMCSSStyleSheet wrappers</short_desc>
          <delta_ts>2006-07-28 05:16:16 -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>WebKit API</component>
          <version>420+</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.4</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</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="Darin Adler">darin</reporter>
          <assigned_to name="Darin Adler">darin</assigned_to>
          <cc>eric</cc>
    
    <cc>todd</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>16045</commentid>
    <comment_count>0</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2005-08-06 20:14:16 -0700</bug_when>
    <thetext>When calling a method that returns a style sheet object, the Objective-C DOM wrappers don&apos;t create the 
right type of wrapper for a CSSStyleSheet. You end up with a DOMStyleSheet instead of a 
DOMCSSStyleSheet.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>16046</commentid>
    <comment_count>1</comment_count>
      <attachid>3246</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2005-08-06 20:16:51 -0700</bug_when>
    <thetext>Created attachment 3246
patch to fix the problem

Added code to handle this like other DOM wrappers with subclasses.

Looks like there&apos;s also a double-deref bug here that this fixes.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>16202</commentid>
    <comment_count>2</comment_count>
      <attachid>3246</attachid>
    <who name="John Sullivan">sullivan</who>
    <bug_when>2005-08-08 09:27:28 -0700</bug_when>
    <thetext>Comment on attachment 3246
patch to fix the problem

Patch looks good, but needs some sort of testing. r=me if you find a way to
test it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>19808</commentid>
    <comment_count>3</comment_count>
      <attachid>3246</attachid>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2005-09-17 14:54:55 -0700</bug_when>
    <thetext>Comment on attachment 3246
patch to fix the problem

Looks fine.  I think this is a good change (simplifies code).

I will note however, your current solution may have some rather odd failure
symantics when passed the wrong pointer type to the wrong class.

If you call _CSSStyleSheetWithImpl and pass a DOMStyleSheetImpl, you&apos;ll get
back a valid pointer to an Obj-C object, but it will be a DOMStyleSheet *. 
Likewise if you call _DOMStyleSheetWithImpl and pass a DOMCSSStyleSheetImpl *,
you&apos;ll get back a DOMCSSStyleSheet * instead of the expected DOMStyleSheet * 
In an ideal world, at least the first case (passing a DOMStyleSheetImpl * to
the DOMCSSStyleSheet creation method) should return nil instead of a
DOMStyleSheet *.  But hopefully all this code will be going away in the next 6
months anyway (to be replaced by autogeneration).

r=me.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>19966</commentid>
    <comment_count>4</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2005-09-18 14:44:44 -0700</bug_when>
    <thetext>As ggaren correctly points out, all of these really should have layout tests.  For better or worse I ignored 
that fact, realizing that we don&apos;t currently (AFAIK) have any way of testing the Obj-C DOM API.  I talked 
with andersca a bit on IRC, he said he started the py-objc Obj-C DOM testing system, but hasn&apos;t finished 
yet.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>20310</commentid>
    <comment_count>5</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2005-09-23 10:38:32 -0700</bug_when>
    <thetext>Eric, the way this is supposed to work is that you get a compile-time error if you try to pass a 
DOMStyleSheetImpl to _CSSStyleSheetWithImpl. There&apos;s no need for the code to handle this case at 
runtime. Same for the other cases you mentioned.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>20311</commentid>
    <comment_count>6</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2005-09-23 10:40:39 -0700</bug_when>
    <thetext>Sorry, the other case was in the other direction.

If you call _DOMStyleSheetWithImpl and pass a DOMCSSStyleSheetImpl *, you *must* get a 
DOMCSSStyleSheet *. That&apos;s a feature of the DOM binding, not a bug. The same is true of any subclasses 
of DOM nodes in a similar way.

So the first of the two cases you mentioned is an error that is supposed to be caught at compile time, not 
runtime. And the second of the two cases is a feature, not a bug. I don&apos;t think there&apos;s anything wrong here. 
Lets talk about this in person if you&apos;re still concerned.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>51027</commentid>
    <comment_count>7</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2006-07-28 05:16:16 -0700</bug_when>
    <thetext>*** Bug 6680 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>3246</attachid>
            <date>2005-08-06 20:16:51 -0700</date>
            <delta_ts>2005-09-17 14:54:55 -0700</delta_ts>
            <desc>patch to fix the problem</desc>
            <filename>ObjCStyleSheetPatch.txt</filename>
            <type>text/plain</type>
            <size>2270</size>
            <attacher name="Darin Adler">darin</attacher>
            
              <data encoding="base64">SW5kZXg6IGt3cS9ET00tQ1NTLm1tCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KUkNTIGZpbGU6IC9jdnMvcm9vdC9XZWJD
b3JlL2t3cS9ET00tQ1NTLm1tLHYKcmV0cmlldmluZyByZXZpc2lvbiAxLjIzCmR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LT5yZWYoKTsKLSAgICBhZGRET01XcmFwcGVyKHNlbGYsIGltcGwpOwotICAgIHJldHVy
biBzZWxmOwotfQotCiArIChET01DU1NTdHlsZVNoZWV0ICopX0NTU1N0eWxlU2hlZXRXaXRoSW1w
bDooQ1NTU3R5bGVTaGVldEltcGwgKilpbXBsCiB7Ci0gICAgaWYgKCFpbXBsKQotICAgICAgICBy
ZXR1cm4gbmlsOwotICAgIAotICAgIGlkIGNhY2hlZEluc3RhbmNlOwotICAgIGNhY2hlZEluc3Rh
bmNlID0gZ2V0RE9NV3JhcHBlcihpbXBsKTsKLSAgICBpZiAoY2FjaGVkSW5zdGFuY2UpCi0gICAg
ICAgIHJldHVybiBbW2NhY2hlZEluc3RhbmNlIHJldGFpbl0gYXV0b3JlbGVhc2VdOwotICAgIAot
ICAgIHJldHVybiBbW1tzZWxmIGFsbG9jXSBfaW5pdFdpdGhDU1NTdHlsZVNoZWV0SW1wbDppbXBs
XSBhdXRvcmVsZWFzZV07CisgICAgcmV0dXJuIChET01DU1NTdHlsZVNoZWV0ICopW0RPTVN0eWxl
U2hlZXQgX0RPTVN0eWxlU2hlZXRXaXRoSW1wbDppbXBsXTsKIH0KIAogQGVuZAo=
</data>
<flag name="review"
          id="564"
          type_id="1"
          status="+"
          setter="eric"
    />
          </attachment>
      

    </bug>

</bugzilla>