diff options
Diffstat (limited to 'WebKit/mac/Misc')
-rw-r--r-- | WebKit/mac/Misc/WebNSAttributedStringExtras.mm | 8 | ||||
-rw-r--r-- | WebKit/mac/Misc/WebNSPasteboardExtras.mm | 11 |
2 files changed, 12 insertions, 7 deletions
diff --git a/WebKit/mac/Misc/WebNSAttributedStringExtras.mm b/WebKit/mac/Misc/WebNSAttributedStringExtras.mm index eb422f1..35b2524 100644 --- a/WebKit/mac/Misc/WebNSAttributedStringExtras.mm +++ b/WebKit/mac/Misc/WebNSAttributedStringExtras.mm @@ -154,12 +154,12 @@ static NSFileWrapper *fileWrapperForElement(Element* e) RenderStyle* style = renderer->style(); NSFont *font = style->font().primaryFont()->getNSFont(); [attrs.get() setObject:font forKey:NSFontAttributeName]; - if (style->color().isValid()) - [attrs.get() setObject:nsColor(style->color()) forKey:NSForegroundColorAttributeName]; + if (style->visitedDependentColor(CSSPropertyColor).isValid()) + [attrs.get() setObject:nsColor(style->visitedDependentColor(CSSPropertyColor)) forKey:NSForegroundColorAttributeName]; else [attrs.get() removeObjectForKey:NSForegroundColorAttributeName]; - if (style->backgroundColor().isValid()) - [attrs.get() setObject:nsColor(style->backgroundColor()) forKey:NSBackgroundColorAttributeName]; + if (style->visitedDependentColor(CSSPropertyBackgroundColor).isValid()) + [attrs.get() setObject:nsColor(style->visitedDependentColor(CSSPropertyBackgroundColor)) forKey:NSBackgroundColorAttributeName]; else [attrs.get() removeObjectForKey:NSBackgroundColorAttributeName]; diff --git a/WebKit/mac/Misc/WebNSPasteboardExtras.mm b/WebKit/mac/Misc/WebNSPasteboardExtras.mm index 8cebeb6..ab3baf7 100644 --- a/WebKit/mac/Misc/WebNSPasteboardExtras.mm +++ b/WebKit/mac/Misc/WebNSPasteboardExtras.mm @@ -141,12 +141,17 @@ static NSArray *_writableTypesForImageWithArchive (void) if ([types containsObject:NSFilenamesPboardType]) { NSArray *files = [self propertyListForType:NSFilenamesPboardType]; + // FIXME: Maybe it makes more sense to allow multiple files and only use the first one? if ([files count] == 1) { NSString *file = [files objectAtIndex:0]; + // FIXME: We are filtering out directories because that's what the original code used to + // do. Without this check, if the URL points to a local directory, Safari will open the + // parent directory of the directory in Finder. This check should go away as soon as + // possible. BOOL isDirectory; - if([[NSFileManager defaultManager] fileExistsAtPath:file isDirectory:&isDirectory] && !isDirectory){ - return [[NSURL fileURLWithPath:file] _webkit_canonicalize]; - } + if ([[NSFileManager defaultManager] fileExistsAtPath:file isDirectory:&isDirectory] && isDirectory) + return nil; + return [[NSURL fileURLWithPath:file] _webkit_canonicalize]; } } |