<?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>21572</bug_id>
          
          <creation_ts>2008-10-13 11:18:54 -0700</creation_ts>
          <short_desc>NPAPI implementation bugs in WebKit top-of-tree</short_desc>
          <delta_ts>2008-10-15 18:14:50 -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>Plug-ins</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.5</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>Major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Kenneth Russell">kenneth.russell</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>andersca</cc>
    
    <cc>kenneth.russell</cc>
    
    <cc>swingler</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>95177</commentid>
    <comment_count>0</comment_count>
    <who name="Kenneth Russell">kenneth.russell</who>
    <bug_when>2008-10-13 11:18:54 -0700</bug_when>
    <thetext>There are a couple of bugs in the NPAPI implementation on the WebKit top of tree preventing plug-ins from working as expected:

1. The &quot;size&quot; field of the NPPluginFuncs is not initialized before being passed to NP_GetEntryPoints. Patch ((tested, verified):

Index: WebNetscapePluginPackage.m
===================================================================
--- WebNetscapePluginPackage.m    (revision 37534)
+++ WebNetscapePluginPackage.m    (working copy)
@@ -569,6 +569,7 @@
 #endif
         LOG(Plugins, &quot;%f NP_Initialize took %f seconds&quot;, currentTime, duration);

+        pluginFuncs.size = sizeof(NPPluginFuncs);
         npErr = NP_GetEntryPoints(&amp;pluginFuncs);
         if (npErr != NPERR_NO_ERROR)
             goto abort; 

2. NPN_SetValue(npp, NPPVpluginDrawingModel, (void*)NPDrawingModelCoreGraphics); fails. Patch (tested, verified):

Index: WebBaseNetscapePluginView.mm
===================================================================
--- WebBaseNetscapePluginView.mm    (revision 37534)
+++ WebBaseNetscapePluginView.mm    (working copy)
@@ -2561,9 +2561,13 @@
             NPDrawingModel newDrawingModel = (NPDrawingModel)(uintptr_t)value;
             switch (newDrawingModel) {
                 // Supported drawing models:
+                case NPDrawingModelCoreGraphics:
 #ifndef NP_NO_QUICKDRAW
                 case NPDrawingModelQuickDraw:
 #endif
+                    drawingModel = newDrawingModel;
+                    return NPERR_NO_ERROR;
+
                 // Unsupported (or unknown) drawing models:
                 default:
                     LOG(Plugins, &quot;Plugin %@ uses unsupported drawing model: %d&quot;, pluginPackage, drawingModel);</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95487</commentid>
    <comment_count>1</comment_count>
    <who name="Anders Carlsson">andersca</who>
    <bug_when>2008-10-15 18:14:50 -0700</bug_when>
    <thetext>Part of this patch was landed by Mark Rowe as a different fix.

Committed revision 37624.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>