<?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>9417</bug_id>
          
          <creation_ts>2006-06-12 09:34:22 -0700</creation_ts>
          <short_desc>Inappropriate +initialize method added to NSPasteboard via category</short_desc>
          <delta_ts>2007-08-29 23:57:04 -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 Misc.</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>EasyFix, InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jim Correia">jim.correia</reporter>
          <assigned_to name="Darin Adler">darin</assigned_to>
          <cc>darin</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>45424</commentid>
    <comment_count>0</comment_count>
    <who name="Jim Correia">jim.correia</who>
    <bug_when>2006-06-12 09:34:22 -0700</bug_when>
    <thetext>As of r14819 (*) of the WebKit source, there is code in WebNSPasteBoardExtras.m which looks like this:

(*) The version of WebKit shipping on 10.4.6 does something similar.

@implementation NSPasteboard (WebExtras)

+ (void)initialize
{
	[...]
}

Unlike +load (which is sent to every category), +initialize is only sent once per class, thus the category implementation is going to override the NSPasteboard implementation.

NSPasteboard today doesn&apos;t have an +initialize, but if it were to every get one, applications which linked against WebKit would have subtly wrong/different behavior. Some alternative means of initializing the category globals seems like a good idea.

See also rdar://problem/4582212</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>45430</commentid>
    <comment_count>1</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2006-06-12 10:02:32 -0700</bug_when>
    <thetext>(In reply to comment #0)
&gt; As of r14819 (*) of the WebKit source, there is code in WebNSPasteBoardExtras.m
&gt; which looks like this:

Looking at &apos;svn annotate&apos; on WebKit/Misc/WebNSPasteBoardExtras.m, this was added (or at least changed) back in r2185 (when WebKit was still in CVS at Apple) by a user named &apos;cblu&apos;.  This code is quite old.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>45431</commentid>
    <comment_count>2</comment_count>
    <who name="Jim Correia">jim.correia</who>
    <bug_when>2006-06-12 10:08:40 -0700</bug_when>
    <thetext>I didn&apos;t mean for the &quot;as of r14819&quot; to imply that it was new code. Sorry if it has that affect. I just wanted to refer to a revision so if the code changed, the bug make still make sense in the context that I reported it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>45436</commentid>
    <comment_count>3</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2006-06-12 10:59:49 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; I didn&apos;t mean for the &quot;as of r14819&quot; to imply that it was new code. Sorry if it
&gt; has that affect. I just wanted to refer to a revision so if the code changed,
&gt; the bug make still make sense in the context that I reported it.

I didn&apos;t mean this in a bad way...just doing some additional research for the bug.  :)
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>45440</commentid>
    <comment_count>4</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2006-06-12 11:05:55 -0700</bug_when>
    <thetext>We should move this initialization code into a helper function and call that function from any places that use WebURLPboardType or WebURLNamePboardType. Unfortunately, those two are exported in the header file, so we&apos;ll have to look all over WebKit to find those places.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1225</commentid>
    <comment_count>5</comment_count>
    <who name="Jim Correia">jim.correia</who>
    <bug_when>2007-08-29 14:09:43 -0700</bug_when>
    <thetext>This issue is more urgent than when I originally reported it. Additional details appended to &lt;rdar://problem/4582212&gt; since they are subject to NDA.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1223</commentid>
    <comment_count>6</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2007-08-29 14:28:12 -0700</bug_when>
    <thetext>Thanks! I&apos;ll take a look at this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1191</commentid>
    <comment_count>7</comment_count>
    <who name="">mitz</who>
    <bug_when>2007-08-29 23:57:04 -0700</bug_when>
    <thetext>Fixed by Darin in &lt;http://trac.webkit.org/projects/webkit/changeset/25312&gt;.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>