[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

rjw rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:57:16 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 52f5ac2208cf0028b6eebfa9ca8bcb979c1c31f6
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Sep 24 23:05:26 2003 +0000

    WebKit:
    
    	Fixed 3420736.  Clear renderer caches when get an ATS font changed notification.  This fix may be moot depending on progress toward fixing 2695906.  Also 3428451 needs to should be resolved.
    
    	Also added code to get and log entry point for the function used to get a Java class from plugins.  That class is used for LiveConnect support.
    
            Reviewed by John.
    
            * Misc.subproj/WebKitLogging.h:
            * Misc.subproj/WebKitLogging.m:
            * Plugins.subproj/WebNetscapePluginPackage.h:
            * Plugins.subproj/WebNetscapePluginPackage.m:
            (-[WebNetscapePluginPackage load]):
            * Plugins.subproj/npapi.h:
            * WebCoreSupport.subproj/WebTextRenderer.m:
            (FillStyleWithAttributes):
            * WebCoreSupport.subproj/WebTextRendererFactory.m:
            (-[WebTextRendererFactory clearCaches]):
            (fontsChanged):
            (+[WebTextRendererFactory createSharedFactory]):
            (-[WebTextRendererFactory fontWithFamily:traits:size:]):
            (-[WebTextRendererFactory cachedFontFromFamily:traits:size:]):
    
    WebCore:
    	Fixed 3420736.  Clear renderer caches when get an ATS font changed notification.  This fix may be moot depending on progress toward fixing 2695906.
    
            * kwq/WebCoreBridge.h:
            * kwq/WebCoreBridge.mm:
            (+[WebCoreBridge updateAllViews]):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5046 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 7fea444..6de3845 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,11 @@
+2003-09-24  Richard Williamson   <rjw at apple.com>
+
+	Fixed 3420736.  Clear renderer caches when get an ATS font changed notification.  This fix may be moot depending on progress toward fixing 2695906.
+
+        * kwq/WebCoreBridge.h:
+        * kwq/WebCoreBridge.mm:
+        (+[WebCoreBridge updateAllViews]):
+
 2003-09-24  Darin Adler  <darin at apple.com>
 
         - a new test for JavaScript date parsing
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 7fea444..6de3845 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,11 @@
+2003-09-24  Richard Williamson   <rjw at apple.com>
+
+	Fixed 3420736.  Clear renderer caches when get an ATS font changed notification.  This fix may be moot depending on progress toward fixing 2695906.
+
+        * kwq/WebCoreBridge.h:
+        * kwq/WebCoreBridge.mm:
+        (+[WebCoreBridge updateAllViews]):
+
 2003-09-24  Darin Adler  <darin at apple.com>
 
         - a new test for JavaScript date parsing
diff --git a/WebCore/kwq/WebCoreBridge.h b/WebCore/kwq/WebCoreBridge.h
index 7f8f9a1..bfbba22 100644
--- a/WebCore/kwq/WebCoreBridge.h
+++ b/WebCore/kwq/WebCoreBridge.h
@@ -223,6 +223,8 @@ typedef enum {
 
 - (void)adjustViewSize;
 
++ (void)updateAllViews;
+
 @end
 
 // The WebCoreBridge protocol contains methods for use by the WebCore side of the bridge.
diff --git a/WebCore/kwq/WebCoreBridge.mm b/WebCore/kwq/WebCoreBridge.mm
index a9cf980..0106913 100644
--- a/WebCore/kwq/WebCoreBridge.mm
+++ b/WebCore/kwq/WebCoreBridge.mm
@@ -969,6 +969,14 @@ static HTMLFormElementImpl *formElementFromDOMElement(id <WebDOMElement>element)
     return [WebCoreBridge stringWithData:data textEncoding:textEncoding];
 }
 
++ (void)updateAllViews
+{
+    for (QPtrListIterator<KWQKHTMLPart> it(KWQKHTMLPart::instances()); it.current(); ++it) {
+        KWQKHTMLPart *part = it.current();
+        [part->bridge() setNeedsReapplyStyles];
+    }
+}
+
 - (BOOL)needsLayout
 {
     RenderObject *renderer = _part->renderer();
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index a726eb5..90b3499 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,26 @@
+2003-09-24  Richard Williamson   <rjw at apple.com>
+
+	Fixed 3420736.  Clear renderer caches when get an ATS font changed notification.  This fix may be moot depending on progress toward fixing 2695906.  Also 3428451 needs to should be resolved.
+
+	Also added code to get and log entry point for the function used to get a Java class from plugins.  That class is used for LiveConnect support.
+
+        Reviewed by John.
+
+        * Misc.subproj/WebKitLogging.h:
+        * Misc.subproj/WebKitLogging.m:
+        * Plugins.subproj/WebNetscapePluginPackage.h:
+        * Plugins.subproj/WebNetscapePluginPackage.m:
+        (-[WebNetscapePluginPackage load]):
+        * Plugins.subproj/npapi.h:
+        * WebCoreSupport.subproj/WebTextRenderer.m:
+        (FillStyleWithAttributes):
+        * WebCoreSupport.subproj/WebTextRendererFactory.m:
+        (-[WebTextRendererFactory clearCaches]):
+        (fontsChanged):
+        (+[WebTextRendererFactory createSharedFactory]):
+        (-[WebTextRendererFactory fontWithFamily:traits:size:]):
+        (-[WebTextRendererFactory cachedFontFromFamily:traits:size:]):
+
 2003-09-23  Darin Adler  <darin at apple.com>
 
         Reviewed by John and Richard.
diff --git a/WebKit/Misc.subproj/WebKitLogging.h b/WebKit/Misc.subproj/WebKitLogging.h
index fbcfa9d..3fc8c25 100644
--- a/WebKit/Misc.subproj/WebKitLogging.h
+++ b/WebKit/Misc.subproj/WebKitLogging.h
@@ -14,27 +14,20 @@
 
 extern WebLogChannel WebKitLogTiming;
 extern WebLogChannel WebKitLogLoading;
-
 extern WebLogChannel WebKitLogFontCache;
 extern WebLogChannel WebKitLogFontSubstitution;
 extern WebLogChannel WebKitLogFontSelection;
 extern WebLogChannel WebKitLogDownload;
 extern WebLogChannel WebKitLogDocumentLoad;
 extern WebLogChannel WebKitLogPlugins;
-
 extern WebLogChannel WebKitLogEvents;
 extern WebLogChannel WebKitLogView;
 extern WebLogChannel WebKitLogRedirect;
-
 extern WebLogChannel WebKitLogPageCache;
 extern WebLogChannel WebKitLogCacheSizes;
-
 extern WebLogChannel WebKitLogFormDelegate;
-
 extern WebLogChannel WebKitLogFileDatabaseActivity;
-
 extern WebLogChannel WebKitLogHistory;
-
 extern WebLogChannel WebKitLogBindings;
-
 extern WebLogChannel WebKitLogEncoding;
+extern WebLogChannel WebKitLogLiveConnect;
diff --git a/WebKit/Misc.subproj/WebKitLogging.m b/WebKit/Misc.subproj/WebKitLogging.m
index 3ac1a99..5d9126b 100644
--- a/WebKit/Misc.subproj/WebKitLogging.m
+++ b/WebKit/Misc.subproj/WebKitLogging.m
@@ -10,28 +10,21 @@
 
 WebLogChannel WebKitLogTiming =       		{ 0x00000020, "WebKitLogLevel", WebLogChannelUninitialized };
 WebLogChannel WebKitLogLoading =      		{ 0x00000040, "WebKitLogLevel", WebLogChannelUninitialized };
-
 WebLogChannel WebKitLogFontCache =    		{ 0x00000100, "WebKitLogLevel", WebLogChannelUninitialized };
 WebLogChannel WebKitLogFontSubstitution =	{ 0x00000200, "WebKitLogLevel", WebLogChannelUninitialized };
-WebLogChannel WebKitLogFontSelection =	        { 0x02000000, "WebKitLogLevel", WebLogChannelUninitialized };
 WebLogChannel WebKitLogDownload =     		{ 0x00000800, "WebKitLogLevel", WebLogChannelUninitialized };
 WebLogChannel WebKitLogDocumentLoad =		{ 0x00001000, "WebKitLogLevel", WebLogChannelUninitialized };
 WebLogChannel WebKitLogPlugins =		{ 0x00002000, "WebKitLogLevel", WebLogChannelUninitialized };
-
 WebLogChannel WebKitLogEvents =       		{ 0x00010000, "WebKitLogLevel", WebLogChannelUninitialized };
 WebLogChannel WebKitLogView =         		{ 0x00020000, "WebKitLogLevel", WebLogChannelUninitialized };
 WebLogChannel WebKitLogRedirect =     		{ 0x00040000, "WebKitLogLevel", WebLogChannelUninitialized };
-
 WebLogChannel WebKitLogPageCache =              { 0x00080000, "WebKitLogLevel", WebLogChannelUninitialized };
 WebLogChannel WebKitLogCacheSizes =             { 0x00100000, "WebKitLogLevel", WebLogChannelUninitialized };
-
 WebLogChannel WebKitLogFormDelegate = 	        { 0x00200000, "WebKitLogLevel", WebLogChannelUninitialized };
-
 WebLogChannel WebKitLogFileDatabaseActivity =   { 0x00400000, "WebKitLogLevel", WebLogChannelUninitialized };
-
 WebLogChannel WebKitLogHistory =                { 0x00800000, "WebKitLogLevel", WebLogChannelUninitialized };
-
 WebLogChannel WebKitLogBindings =               { 0x01000000, "WebKitLogLevel", WebLogChannelUninitialized };
-
+WebLogChannel WebKitLogFontSelection =	        { 0x02000000, "WebKitLogLevel", WebLogChannelUninitialized };
 WebLogChannel WebKitLogEncoding =               { 0x04000000, "WebKitLogLevel", WebLogChannelUninitialized };
+WebLogChannel WebKitLogLiveConnect =            { 0x08000000, "WebKitLogLevel", WebLogChannelUninitialized };
 
diff --git a/WebKit/Plugins.subproj/WebNetscapePluginPackage.h b/WebKit/Plugins.subproj/WebNetscapePluginPackage.h
index f81b6ce..e7c4094 100644
--- a/WebKit/Plugins.subproj/WebNetscapePluginPackage.h
+++ b/WebKit/Plugins.subproj/WebNetscapePluginPackage.h
@@ -45,6 +45,7 @@ typedef enum {
     NPP_GetValueProcPtr NPP_GetValue;
     NPP_SetValueProcPtr NPP_SetValue;
     NPP_ShutdownProcPtr NPP_Shutdown;
+    NPP_GetJavaClassProcPtr NPP_GetJavaClass;
 
     BP_CreatePluginMIMETypesPreferencesFuncPtr BP_CreatePluginMIMETypesPreferences;
 }
diff --git a/WebKit/Plugins.subproj/WebNetscapePluginPackage.m b/WebKit/Plugins.subproj/WebNetscapePluginPackage.m
index d947c62..e7ebf56 100644
--- a/WebKit/Plugins.subproj/WebNetscapePluginPackage.m
+++ b/WebKit/Plugins.subproj/WebNetscapePluginPackage.m
@@ -365,6 +365,7 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
                 goto abort;
             }
         }
+
         BP_CreatePluginMIMETypesPreferences = (BP_CreatePluginMIMETypesPreferencesFuncPtr)CFBundleGetFunctionPointerForName(cfBundle, CFSTR("BP_CreatePluginMIMETypesPreferences"));
     } else {
         // single CFM file
@@ -476,6 +477,15 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
         NPP_URLNotify = (NPP_URLNotifyProcPtr)functionPointerForTVector((TransitionVector)pluginFuncs.urlnotify);
         NPP_GetValue = (NPP_GetValueProcPtr)functionPointerForTVector((TransitionVector)pluginFuncs.getvalue);
         NPP_SetValue = (NPP_SetValueProcPtr)functionPointerForTVector((TransitionVector)pluginFuncs.setvalue);
+
+        // LiveConnect support
+        NPP_GetJavaClass = (NPP_GetJavaClassProcPtr)functionPointerForTVector((TransitionVector)pluginFuncs.javaClass);
+        if (NPP_GetJavaClass){
+            LOG(LiveConnect, "%@:  CFM entry point for NPP_GetJavaClass = %p", [self name], NPP_GetJavaClass);
+        } else {
+            LOG(LiveConnect, "%@:  no entry point for NPP_GetJavaClass", [self name]);
+        }
+
     } else {
         // no function pointer conversion necessary for mach-o
         browserFuncs.version = 11;
@@ -537,6 +547,14 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
         NPP_URLNotify = pluginFuncs.urlnotify;
         NPP_GetValue = pluginFuncs.getvalue;
         NPP_SetValue = pluginFuncs.setvalue;
+
+        // LiveConnect support
+        NPP_GetJavaClass = pluginFuncs.javaClass;
+        if (NPP_GetJavaClass){
+            LOG(LiveConnect, "%@:  mach-o entry point for NPP_GetJavaClass = %p", [self name], NPP_GetJavaClass);
+        } else {
+            LOG(LiveConnect, "%@:  no entry point for NPP_GetJavaClass", [self name]);
+        }
     }
 
 #if !LOG_DISABLED
diff --git a/WebKit/Plugins.subproj/npapi.h b/WebKit/Plugins.subproj/npapi.h
index b3da6e9..4075d62 100644
--- a/WebKit/Plugins.subproj/npapi.h
+++ b/WebKit/Plugins.subproj/npapi.h
@@ -217,6 +217,8 @@ typedef void (*NPP_URLNotifyProcPtr)(NPP instance, const char* URL, NPReason rea
 typedef NPError	(*NPP_GetValueProcPtr)(NPP instance, NPPVariable variable, void *ret_value);
 typedef NPError	(*NPP_SetValueProcPtr)(NPP instance, NPNVariable variable, void *value);
 typedef void (*NPP_ShutdownProcPtr)(void);
+
+typedef void *(*NPP_GetJavaClassProcPtr)(void);
 typedef void*	JRIGlobalRef; //not using this right now
 
 typedef struct _NPNetscapeFuncs {
@@ -322,6 +324,8 @@ typedef NPError (* NP_InitializeFuncPtr)(NPNetscapeFuncs*);
 typedef NPError (* NP_GetEntryPointsFuncPtr)(NPPluginFuncs*);
 typedef void 	(* BP_CreatePluginMIMETypesPreferencesFuncPtr)(void);
 
+typedef void*	(* NP_GetJavaClassFuncPtr)(void);
+
 /*
  * NPN_* functions are provided by the navigator and called by the plugin.
  */
@@ -371,5 +375,7 @@ int16		NPP_HandleEvent(NPP instance, void* event);
 void		NPP_URLNotify(NPP instance, const char* URL, NPReason reason, void* notifyData);
 NPError		NPP_GetValue(void *instance, NPPVariable variable, void *value);
 NPError		NPP_SetValue(void *instance, NPNVariable variable, void *value);
+
+void*           NPP_GetJavaClass();
 */
 #endif /* _NPAPI_H_ */
diff --git a/WebKit/WebCoreSupport.subproj/WebTextRenderer.m b/WebKit/WebCoreSupport.subproj/WebTextRenderer.m
index 00d670a..48f3ae8 100644
--- a/WebKit/WebCoreSupport.subproj/WebTextRenderer.m
+++ b/WebKit/WebCoreSupport.subproj/WebTextRenderer.m
@@ -513,13 +513,18 @@ static BOOL FillStyleWithAttributes(ATSUStyle style, NSFont *theFont)
 {
     if (theFont) {
         ATSUFontID fontId = (ATSUFontID)[theFont _atsFontID];
+        LOG (FontCache, "FillStyleWithAttributes:  font = %p,%@, _atsFontID = %x\n", theFont, theFont, (unsigned int)fontId);
         ATSUAttributeTag tag = kATSUFontTag;
         ByteCount size = sizeof(ATSUFontID);
         ATSUFontID *valueArray[1] = {&fontId};
+        OSStatus status;
 
         if (fontId) {
-            if (ATSUSetAttributes(style, 1, &tag, &size, (void *)valueArray) != noErr)
+            status = ATSUSetAttributes(style, 1, &tag, &size, (void *)valueArray);
+            if (status != noErr){
+                LOG (FontCache, "FillStyleWithAttributes failed(%d):  font = %p,%@, _atsFontID = %x\n", (int)status, theFont, theFont, (unsigned int)fontId);
                 return NO;
+            }
         }
         else {
             return NO;
diff --git a/WebKit/WebCoreSupport.subproj/WebTextRendererFactory.m b/WebKit/WebCoreSupport.subproj/WebTextRendererFactory.m
index 523c01f..ce43351 100644
--- a/WebKit/WebCoreSupport.subproj/WebTextRendererFactory.m
+++ b/WebKit/WebCoreSupport.subproj/WebTextRendererFactory.m
@@ -4,8 +4,10 @@
 */
 
 #import <WebKit/WebAssertions.h>
+#import <WebKit/WebBridge.h>
 #import <WebKit/WebKitLogging.h>
 #import <WebKit/WebKitSystemBits.h>
+#import <WebKit/WebPreferences.h>
 #import <WebKit/WebTextRendererFactory.h>
 #import <WebKit/WebTextRenderer.h>
 
@@ -28,6 +30,10 @@
 
 #define DESIRED_WEIGHT 5
 
+ at interface NSFont (WebPrivate)
+- (ATSUFontID)_atsFontID;
+ at end
+
 @interface NSFont (WebAppKitSecretAPI)
 - (BOOL)_isFakeFixedPitch;
 @end
@@ -173,6 +179,35 @@ static int getLCDScaleParameters(void)
 
 }
 
+static CFMutableDictionaryRef fontCache = NULL;
+
+- (void)clearCaches
+{
+    [cacheForScreen release];
+    [cacheForPrinter release];
+    
+    cacheForScreen = [[NSMutableDictionary alloc] init];
+    cacheForPrinter = [[NSMutableDictionary alloc] init];
+
+    if (fontCache)
+        CFRelease (fontCache);
+    fontCache = NULL;
+    
+    [WebBridge updateAllViews];
+}
+
+static void 
+fontsChanged( ATSFontNotificationInfoRef info, void *_factory)
+{
+    WebTextRendererFactory *factory = (WebTextRendererFactory *)_factory;
+    
+    LOG (FontCache, "clearing font caches");
+
+    ASSERT (factory);
+
+    [factory clearCaches];
+}
+
 #define MINIMUM_GLYPH_CACHE_SIZE 1536 * 1024
 
 + (void)createSharedFactory
@@ -194,6 +229,10 @@ static int getLCDScaleParameters(void)
 #endif
         CGFontCacheSetMaxSize (fontCache, s);
         CGFontCacheRelease(fontCache);
+
+        // Ignore errors returned from ATSFontNotificationSubscribe.  If we can't subscribe then we
+        // won't be told about changes to fonts.
+	ATSFontNotificationSubscribe( fontsChanged, kATSFontNotifyOptionDefault, (void *)[super sharedFactory], nil );
     }
     ASSERT([[self sharedFactory] isKindOfClass:self]);
 }
@@ -417,9 +456,8 @@ static BOOL betterChoice(NSFontTraitMask desiredTraits, int desiredWeight,
     }
 
     font = [fontManager fontWithFamily:availableFamily traits:chosenTraits weight:chosenWeight size:size];
-    
-    LOG (FontSelection, "returning font family %@ (%@) traits %x\n\n", 
-            availableFamily, [[[font fontDescriptor] fontAttributes] objectForKey: NSFontNameAttribute], chosenTraits);
+    LOG (FontSelection, "returning font family %@ (%@) traits %x, fontID = %x\n\n", 
+            availableFamily, [[[font fontDescriptor] fontAttributes] objectForKey: NSFontNameAttribute], chosenTraits, (unsigned int)[font _atsFontID]);
     
     return font;
 }
@@ -479,7 +517,6 @@ static void FontCacheValueRelease(CFAllocatorRef allocator, const void *value)
 {
     ASSERT(family);
     
-    static CFMutableDictionaryRef fontCache = NULL;
     if (!fontCache) {
         static const CFDictionaryKeyCallBacks fontCacheKeyCallBacks = { 0, FontCacheKeyCopy, FontCacheKeyFree, NULL, FontCacheKeyEqual, FontCacheKeyHash };
         static const CFDictionaryValueCallBacks fontCacheValueCallBacks = { 0, FontCacheValueRetain, FontCacheValueRelease, NULL, NULL };

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list