[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
cblu
cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:35:24 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 0e616f0770b9b96694b4ef62d9078a7cfea3026e
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Apr 8 21:39:20 2003 +0000
Fixed: 3221128 - Double grey lines on macromedia.com home page
Flash relies on the ordering of attributes in the EMBED tag (which is really stupid). salign must come after scale.
Changed our plug-in API's to preserve orderings using arrays rather than lose orderings when using dictionaries.
Reviewed by trey.
* Plugins.subproj/WebBaseNetscapePluginView.h:
* Plugins.subproj/WebBaseNetscapePluginView.m:
* Plugins.subproj/WebNetscapePluginEmbeddedView.h:
* Plugins.subproj/WebNetscapePluginEmbeddedView.m:
(-[WebNetscapePluginEmbeddedView initWithFrame:plugin:URL:baseURL:MIMEType:attributeKeys:attributeValues:]): take attributeKeys and attributeValues instead of a dictionary
* WebCoreSupport.subproj/WebBridge.m:
(-[WebBridge viewForPluginWithURL:attributes:baseURL:MIMEType:]): create attributeKeys and attributeValues to pass to the above method
(-[WebBridge viewForJavaAppletWithFrame:attributes:baseURL:]): create attributeKeys and attributeValues to pass to the above method
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@4047 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 3b78d54..5d9c7fe 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,5 +1,23 @@
2003-04-08 Chris Blumenberg <cblu at apple.com>
+ Fixed: 3221128 - Double grey lines on macromedia.com home page
+
+ Flash relies on the ordering of attributes in the EMBED tag (which is really stupid). salign must come after scale.
+ Changed our plug-in API's to preserve orderings using arrays rather than lose orderings when using dictionaries.
+
+ Reviewed by trey.
+
+ * Plugins.subproj/WebBaseNetscapePluginView.h:
+ * Plugins.subproj/WebBaseNetscapePluginView.m:
+ * Plugins.subproj/WebNetscapePluginEmbeddedView.h:
+ * Plugins.subproj/WebNetscapePluginEmbeddedView.m:
+ (-[WebNetscapePluginEmbeddedView initWithFrame:plugin:URL:baseURL:MIMEType:attributeKeys:attributeValues:]): take attributeKeys and attributeValues instead of a dictionary
+ * WebCoreSupport.subproj/WebBridge.m:
+ (-[WebBridge viewForPluginWithURL:attributes:baseURL:MIMEType:]): create attributeKeys and attributeValues to pass to the above method
+ (-[WebBridge viewForJavaAppletWithFrame:attributes:baseURL:]): create attributeKeys and attributeValues to pass to the above method
+
+2003-04-08 Chris Blumenberg <cblu at apple.com>
+
Fixed: 3220463 - REGRESSION: PDF viewer plug-in does not display (worked in 69 and previous)
Reviewed by darin.
diff --git a/WebKit/Plugins.subproj/WebBaseNetscapePluginView.h b/WebKit/Plugins.subproj/WebBaseNetscapePluginView.h
index bafb2a5..52c1dae 100644
--- a/WebKit/Plugins.subproj/WebBaseNetscapePluginView.h
+++ b/WebKit/Plugins.subproj/WebBaseNetscapePluginView.h
@@ -70,7 +70,7 @@
- (void)setPlugin:(WebNetscapePluginPackage *)thePlugin;
- (void)setMIMEType:(NSString *)theMIMEType;
- (void)setBaseURL:(NSURL *)theBaseURL;
-- (void)setAttributes:(NSDictionary *)attributes;
+- (void)setAttributeKeys:(NSArray *)keys andValues:(NSArray *)values;
- (void)setMode:(int)theMode;
- (void)viewWillMoveToHostWindow:(NSWindow *)hostWindow;
diff --git a/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m b/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m
index 33c3a62..06b916e 100644
--- a/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m
+++ b/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m
@@ -863,31 +863,32 @@ typedef struct {
baseURL = [theBaseURL retain];
}
-- (void)setAttributes:(NSDictionary *)attributes
+- (void)setAttributeKeys:(NSArray *)keys andValues:(NSArray *)values;
{
- LOG(Plugins, "%@", attributes);
-
- // Convert arguments dictionary to 2 string arrays.
+ ASSERT([keys count] == [values count]);
+
+ // Convert the attributes to 2 C string arrays.
// These arrays are passed to NPP_New, but the strings need to be
// modifiable and live the entire life of the plugin.
// The Java plug-in requires the first argument to be the base URL
if ([MIMEType isEqualToString:@"application/x-java-applet"]) {
- cAttributes = (char **)malloc(([attributes count] + 1) * sizeof(char *));
- cValues = (char **)malloc(([attributes count] + 1) * sizeof(char *));
+ cAttributes = (char **)malloc(([keys count] + 1) * sizeof(char *));
+ cValues = (char **)malloc(([values count] + 1) * sizeof(char *));
cAttributes[0] = strdup("DOCBASE");
cValues[0] = strdup([[baseURL absoluteString] UTF8String]);
argsCount++;
} else {
- cAttributes = (char **)malloc([attributes count] * sizeof(char *));
- cValues = (char **)malloc([attributes count] * sizeof(char *));
+ cAttributes = (char **)malloc([keys count] * sizeof(char *));
+ cValues = (char **)malloc([values count] * sizeof(char *));
}
- NSEnumerator *e = [attributes keyEnumerator];
- NSString *key;
- while ((key = [e nextObject])) {
- cAttributes[argsCount] = strdup([key UTF8String]);
- cValues[argsCount] = strdup([[attributes objectForKey:key] UTF8String]);
+ unsigned i;
+ unsigned count = [keys count];
+ for (i = 0; i < count; i++) {
+ cAttributes[argsCount] = strdup([[keys objectAtIndex:i] UTF8String]);
+ cValues[argsCount] = strdup([[values objectAtIndex:i] UTF8String]);
+ LOG(Plugins, "%@ = %@", [keys objectAtIndex:i], [values objectAtIndex:i]);
argsCount++;
}
}
diff --git a/WebKit/Plugins.subproj/WebNetscapePluginEmbeddedView.h b/WebKit/Plugins.subproj/WebNetscapePluginEmbeddedView.h
index 57f56c5..3ccce6d 100644
--- a/WebKit/Plugins.subproj/WebNetscapePluginEmbeddedView.h
+++ b/WebKit/Plugins.subproj/WebNetscapePluginEmbeddedView.h
@@ -17,6 +17,7 @@
URL:(NSURL *)URL
baseURL:(NSURL *)baseURL
MIMEType:(NSString *)MIME
- attributes:(NSDictionary *)attributes;
+ attributeKeys:(NSArray *)keys
+ attributeValues:(NSArray *)values;
@end
diff --git a/WebKit/Plugins.subproj/WebNetscapePluginEmbeddedView.m b/WebKit/Plugins.subproj/WebNetscapePluginEmbeddedView.m
index 8d26801..7465592 100644
--- a/WebKit/Plugins.subproj/WebNetscapePluginEmbeddedView.m
+++ b/WebKit/Plugins.subproj/WebNetscapePluginEmbeddedView.m
@@ -21,7 +21,8 @@
URL:(NSURL *)theURL
baseURL:(NSURL *)theBaseURL
MIMEType:(NSString *)MIME
- attributes:(NSDictionary *)attributes
+ attributeKeys:(NSArray *)keys
+ attributeValues:(NSArray *)values
{
[super initWithFrame:frame];
@@ -29,7 +30,7 @@
[self setMIMEType:MIME];
[self setBaseURL:theBaseURL];
- [self setAttributes:attributes];
+ [self setAttributeKeys:keys andValues:values];
[self setMode:NP_EMBED];
// load the plug-in if it is not already loaded
diff --git a/WebKit/WebCoreSupport.subproj/WebBridge.m b/WebKit/WebCoreSupport.subproj/WebBridge.m
index 10351c9..bf7635b 100644
--- a/WebKit/WebCoreSupport.subproj/WebBridge.m
+++ b/WebKit/WebCoreSupport.subproj/WebBridge.m
@@ -599,15 +599,24 @@
NSRange r1, r2, r3;
uint i;
- NSMutableDictionary *attributes = [NSMutableDictionary dictionary];
- for (i = 0; i < [attributesArray count]; i++){
+ // Parse the attributesArray into key/value pairs.
+ // Store them in a dictionary so they can be passed to WebPlugins.
+ // Store them in ordered arrays so they can be passed to Netscape plug-ins.
+ NSMutableDictionary *attributes = [[NSMutableDictionary alloc] init];
+ NSMutableArray *attributeKeys = [[NSMutableArray alloc] init];
+ NSMutableArray *attributeValues = [[NSMutableArray alloc] init];
+ for (i = 0; i < [attributesArray count]; i++) {
NSString *attribute = [attributesArray objectAtIndex:i];
if ([attribute rangeOfString:@"__KHTML__"].length == 0) {
- r1 = [attribute rangeOfString:@"="]; // parse out attributes and values
+ r1 = [attribute rangeOfString:@"="];
r2 = [attribute rangeOfString:@"\""];
r3.location = r2.location + 1;
r3.length = [attribute length] - r2.location - 2; // don't include quotes
- [attributes setObject:[attribute substringWithRange:r3] forKey:[attribute substringToIndex:r1.location]];
+ NSString *key = [attribute substringToIndex:r1.location];
+ NSString *value = [attribute substringWithRange:r3];
+ [attributes setObject:value forKey:key];
+ [attributeKeys addObject:key];
+ [attributeValues addObject:value];
}
}
@@ -624,31 +633,31 @@
}
if (pluginPackage) {
- if([pluginPackage isKindOfClass:[WebPluginPackage class]]){
+ if ([pluginPackage isKindOfClass:[WebPluginPackage class]]) {
view = [self pluginViewWithPackage:(WebPluginPackage *)pluginPackage
attributes:attributes
baseURL:[NSURL _web_URLWithString:baseURL]];
- }
- else if([pluginPackage isKindOfClass:[WebNetscapePluginPackage class]]){
+ } else if ([pluginPackage isKindOfClass:[WebNetscapePluginPackage class]]) {
view = [[[WebNetscapePluginEmbeddedView alloc] initWithFrame:NSZeroRect
plugin:(WebNetscapePluginPackage *)pluginPackage
URL:[NSURL _web_URLWithString:URL]
baseURL:[NSURL _web_URLWithString:baseURL]
MIMEType:MIMEType
- attributes:attributes] autorelease];
- }else{
+ attributeKeys:attributeKeys
+ attributeValues:attributeValues] autorelease];
+ } else {
[NSException raise:NSInternalInconsistencyException
format:@"Plugin package class not recognized"];
}
- }else{
+ } else {
errorCode = WebKitErrorCannotFindPlugin;
}
- if(!errorCode && !view){
+ if (!errorCode && !view) {
errorCode = WebKitErrorCannotLoadPlugin;
}
- if(errorCode){
+ if (errorCode) {
WebPlugInError *error = [WebPlugInError pluginErrorWithCode:errorCode
contentURL:URL
pluginPageURL:[attributes objectForKey:@"pluginspage"]
@@ -659,6 +668,10 @@
}
ASSERT(view);
+
+ [attributes release];
+ [attributeKeys release];
+ [attributeValues release];
return view;
}
@@ -672,7 +685,7 @@
pluginPackage = [[WebPluginDatabase installedPlugins] pluginForMIMEType:MIMEType];
if (pluginPackage) {
- if([pluginPackage isKindOfClass:[WebPluginPackage class]]){
+ if ([pluginPackage isKindOfClass:[WebPluginPackage class]]) {
NSMutableDictionary *theAttributes = [NSMutableDictionary dictionary];
[theAttributes addEntriesFromDictionary:attributes];
[theAttributes setObject:[NSString stringWithFormat:@"%d", (int)theFrame.size.width] forKey:@"width"];
@@ -681,21 +694,33 @@
view = [self pluginViewWithPackage:(WebPluginPackage *)pluginPackage
attributes:theAttributes
baseURL:[NSURL _web_URLWithString:baseURL]];
- }
- else if([pluginPackage isKindOfClass:[WebNetscapePluginPackage class]]){
+ } else if ([pluginPackage isKindOfClass:[WebNetscapePluginPackage class]]) {
+ // Convert the attributes dictionary to 2 string arrays because this is what Netscape plug-ins expect.
+ NSMutableArray *attributeKeys = [[NSMutableArray alloc] init];
+ NSMutableArray *attributeValues = [[NSMutableArray alloc] init];
+ NSEnumerator *enumerator = [attributes keyEnumerator];
+ NSString *key;
+
+ while ((key = [enumerator nextObject]) != nil) {
+ [attributeKeys addObject:key];
+ [attributeValues addObject:[attributes objectForKey:key]];
+ }
view = [[[WebNetscapePluginEmbeddedView alloc] initWithFrame:theFrame
plugin:(WebNetscapePluginPackage *)pluginPackage
URL:nil
baseURL:[NSURL _web_URLWithString:baseURL]
MIMEType:MIMEType
- attributes:attributes] autorelease];
- }else{
+ attributeKeys:attributeKeys
+ attributeValues:attributeValues] autorelease];
+ [attributeKeys release];
+ [attributeValues release];
+ } else {
[NSException raise:NSInternalInconsistencyException
format:@"Plugin package class not recognized"];
}
}
- if(!view){
+ if (!view) {
WebPlugInError *error = [WebPlugInError pluginErrorWithCode:WebKitErrorJavaUnavailable
contentURL:nil
pluginPageURL:nil
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list