summaryrefslogtreecommitdiffstats
path: root/WebKit/mac
diff options
context:
space:
mode:
Diffstat (limited to 'WebKit/mac')
-rw-r--r--WebKit/mac/ChangeLog195
-rw-r--r--WebKit/mac/Configurations/FeatureDefines.xcconfig3
-rw-r--r--WebKit/mac/Configurations/Version.xcconfig2
-rw-r--r--WebKit/mac/Misc/WebNSAttributedStringExtras.mm8
-rw-r--r--WebKit/mac/Misc/WebNSPasteboardExtras.mm11
-rw-r--r--WebKit/mac/Plugins/Hosted/ProxyInstance.mm8
-rw-r--r--WebKit/mac/Plugins/Hosted/ProxyRuntimeObject.h2
-rw-r--r--WebKit/mac/Plugins/Hosted/ProxyRuntimeObject.mm4
-rw-r--r--WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm23
-rw-r--r--WebKit/mac/Plugins/WebNetscapePluginView.mm25
-rw-r--r--WebKit/mac/WebView/WebDynamicScrollBarsView.mm9
-rw-r--r--WebKit/mac/WebView/WebFrame.mm14
-rw-r--r--WebKit/mac/WebView/WebFrameInternal.h1
-rw-r--r--WebKit/mac/WebView/WebHTMLView.mm5
-rw-r--r--WebKit/mac/WebView/WebPreferenceKeysPrivate.h2
-rw-r--r--WebKit/mac/WebView/WebPreferences.mm21
-rw-r--r--WebKit/mac/WebView/WebPreferencesPrivate.h11
-rw-r--r--WebKit/mac/WebView/WebView.mm5
18 files changed, 319 insertions, 30 deletions
diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
index f43aa5a..510ccfd 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -1,3 +1,198 @@
+2010-05-21 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ https://bugs.webkit.org/show_bug.cgi?id=39420
+
+ Make sure everyone who needs to is using visitedDependentColor rather than accessing styles
+ directly.
+
+ * Misc/WebNSAttributedStringExtras.mm:
+ (+[NSAttributedString _web_attributedStringFromRange:]):
+ * WebView/WebFrame.mm:
+ (-[WebFrame _bodyBackgroundColor]):
+
+2010-05-21 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by Geoffrey Garen.
+
+ All callable objects should have a global object reference
+ https://bugs.webkit.org/show_bug.cgi?id=39495
+
+ Update the plugin proxy to handle the need for global object.
+
+ * Plugins/Hosted/ProxyInstance.mm:
+ (WebKit::ProxyInstance::newRuntimeObject):
+ (WebKit::ProxyRuntimeMethod::ProxyRuntimeMethod):
+ (WebKit::ProxyInstance::getMethod):
+ * Plugins/Hosted/ProxyRuntimeObject.h:
+ * Plugins/Hosted/ProxyRuntimeObject.mm:
+ (WebKit::ProxyRuntimeObject::ProxyRuntimeObject):
+
+2010-05-21 Steve Block <steveblock@google.com>
+
+ Reviewed by Jeremy Orlow.
+
+ Add DeviceOrientation and DeviceOrientationClient
+ https://bugs.webkit.org/show_bug.cgi?id=39479
+
+ * WebView/WebView.mm:
+ (-[WebView _commonInitializationWithFrameName:groupName:usesDocumentViews:]):
+
+2010-05-20 Mike Thole <mthole@apple.com>
+
+ Reviewed by Dave Hyatt.
+
+ When using a scale factor > 1, scrollbars sometimes appear when not necessary
+ https://bugs.webkit.org/show_bug.cgi?id=39458
+
+ * WebView/WebDynamicScrollBarsView.mm:
+ (-[WebDynamicScrollBarsView updateScrollers]): Round up non-integral sizes from AppKit
+ so that they can be compared against the integral document size.
+
+2010-05-20 Kevin Decker <kdecker@apple.com>
+
+ Reviewed by Anders Carlsson.
+
+ https://bugs.webkit.org/show_bug.cgi?id=39441
+ <rdar://problem/7985715> Flash context menu is both horizontally and vertically offset from point of click
+ <rdar://problem/7986109> Youtube video controller UI entirely missing
+ <rdar://problem/7986154> Flash content paints at horizontally and vertically shifted locations (within the plug-in region)
+
+ * Plugins/Hosted/WebHostedNetscapePluginView.mm:
+ (-[WebHostedNetscapePluginView updateAndSetWindow]): The base coordinates of a window and
+ it's contentView happen to be the equal at a userSpaceScaleFactor of 1. For non-1.0 scale
+ factors this assumption is false. Accordingly we now convert to the window contentView
+ coordinate system when computing bounds in "window" and the visible rect.
+ * Plugins/WebNetscapePluginView.mm:
+ (-[WebNetscapePluginView saveAndSetNewPortStateForUpdate:]): Ditto.
+
+2010-05-20 Steve Block <steveblock@google.com>
+
+ Reviewed by Jeremy Orlow.
+
+ Provide bindings for DeviceOrientation
+ https://bugs.webkit.org/show_bug.cgi?id=39210
+
+ Adds ENABLE_DEVICE_ORIENTATION to XCode project file, always disabled.
+
+ * Configurations/FeatureDefines.xcconfig:
+
+2010-05-20 Martin Robinson <mrobinson@webkit.org>
+
+ Reviewed by Ojan Vafai.
+
+ Expose the editing behavior setting in DRT to test all editing code paths
+ https://bugs.webkit.org/show_bug.cgi?id=38603
+
+ * WebView/WebFrame.mm:
+ (core):
+ * WebView/WebFrameInternal.h: Added a conversion method from the API enum to the WebCore enum.
+ * WebView/WebPreferenceKeysPrivate.h: Added a preference key for the new setting.
+ * WebView/WebPreferences.mm:
+ (+[WebPreferences initialize]): Initialize the EditingBehavior to Mac style.
+ (-[WebPreferences editingBehavior]): Added.
+ (-[WebPreferences setEditingBehavior:]): Added.
+ * WebView/WebPreferencesPrivate.h: Added the new API points to the private API.
+ * WebView/WebView.mm:
+ (-[WebView _preferencesChangedNotification:]): Set the editing behavior via the WebPreferences setting.
+
+2010-05-19 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Kevin Decker and Simon Fraser.
+
+ <rdar://problem/8004528>
+ REGRESSION: Coordinate system for Core Animation NPAPI plug-ins is flipped with accelerated compositing turned on
+
+ When needed, create a new CALayer and set it's geometry to be flipped. Add the plug-in layer as a sublayer and then return
+ the newly created layer.
+
+ * Plugins/Hosted/WebHostedNetscapePluginView.mm:
+ (-[WebHostedNetscapePluginView createPlugin]):
+ * Plugins/WebNetscapePluginView.mm:
+ (-[WebNetscapePluginView createPlugin]):
+
+2010-05-18 Tony Chang <tony@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=24943
+ Command-B and Command-I do not generate keydown events in contentEditable regions.
+
+ Manual test because performKeyEquivalent is not called by DRT.
+
+ Test: manual-tests/style-keypress-events.html
+
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView performKeyEquivalent:]): Move style key handling until after webcore gets a chance to handle the event
+
+2010-05-18 Daniel Cheng <dcheng@chromium.org>
+
+ Reviewed by Darin Adler, Jian Li.
+
+ DragData::asURL() shouldn't do file validity checks
+ https://bugs.webkit.org/show_bug.cgi?id=38711
+
+ Change [NSPasteboard _web_bestURL] to still return a file URL for paths
+ that don't exist. Callers who care about the existence of the file or
+ whether or not it is a directory should check themselves when they
+ want to use the file. The directory check has been left in for now,
+ since the Mac implementation of ResourceHandle, which uses this function
+ indirectly via DragController::performDrag) handles directories somewhat
+ non-intuitively: it opens the parent directory in the Finder, rather
+ than opening the directory itself.
+
+ * Misc/WebNSPasteboardExtras.mm:
+ (-[NSPasteboard _web_bestURL]):
+
+2010-05-18 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth (and Maciej Stachowiak).
+
+ Make it possible to enable the new HTML5Tokenizer for testing
+ https://bugs.webkit.org/show_bug.cgi?id=39275
+
+ Expose the WebCore::Settings::html5ParserEnabled as a private WebKit setting.
+
+ * WebView/WebPreferenceKeysPrivate.h:
+ * WebView/WebPreferences.mm:
+ (-[WebPreferences html5ParserEnabled]):
+ (-[WebPreferences setHTML5ParserEnabled:]):
+ * WebView/WebPreferencesPrivate.h:
+ * WebView/WebView.mm:
+ (-[WebView _preferencesChangedNotification:]):
+
+2010-05-17 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r59652.
+ http://trac.webkit.org/changeset/59652
+ https://bugs.webkit.org/show_bug.cgi?id=39268
+
+ file-input-files-access test is broken on Mac (Requested by
+ dcheng on #webkit).
+
+ * Misc/WebNSPasteboardExtras.mm:
+ (-[NSPasteboard _web_bestURL]):
+
+2010-05-17 Daniel Cheng <dcheng@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ DragData::asURL() shouldn't do file validity checks
+ https://bugs.webkit.org/show_bug.cgi?id=38711
+
+ Change [NSPasteboard _web_bestURL] to still return a file URL for paths
+ that don't exist. Callers who care about the existence of the file or
+ whether or not it is a directory should check themselves when they
+ want to use the file. The directory check has been left in for now,
+ since the Mac implementation of ResourceHandle, which uses this function
+ indirectly via DragController::performDrag) handles directories somewhat
+ non-intuitively: it opens the parent directory in the Finder, rather
+ than opening the directory itself.
+
+ * Misc/WebNSPasteboardExtras.mm:
+ (-[NSPasteboard _web_bestURL]):
+
2010-05-14 Stephanie Lewis <slewis@apple.com>
Rubber-stamped by Mark Rowe.
diff --git a/WebKit/mac/Configurations/FeatureDefines.xcconfig b/WebKit/mac/Configurations/FeatureDefines.xcconfig
index 947f371..c64d94c 100644
--- a/WebKit/mac/Configurations/FeatureDefines.xcconfig
+++ b/WebKit/mac/Configurations/FeatureDefines.xcconfig
@@ -47,6 +47,7 @@ ENABLE_CLIENT_BASED_GEOLOCATION = ENABLE_CLIENT_BASED_GEOLOCATION;
ENABLE_DATABASE = ENABLE_DATABASE;
ENABLE_DATAGRID = ;
ENABLE_DATALIST = ENABLE_DATALIST;
+ENABLE_DEVICE_ORIENTATION = ;
ENABLE_DOM_STORAGE = ENABLE_DOM_STORAGE;
ENABLE_EVENTSOURCE = ENABLE_EVENTSOURCE;
ENABLE_FILTERS = ENABLE_FILTERS;
@@ -78,4 +79,4 @@ ENABLE_XHTMLMP = ;
ENABLE_XPATH = ENABLE_XPATH;
ENABLE_XSLT = ENABLE_XSLT;
-FEATURE_DEFINES = $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB_SLICE) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_READER) $(ENABLE_FILE_WRITER) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_RUBY) $(ENABLE_SANDBOX) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB_SLICE) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_READER) $(ENABLE_FILE_WRITER) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_RUBY) $(ENABLE_SANDBOX) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
diff --git a/WebKit/mac/Configurations/Version.xcconfig b/WebKit/mac/Configurations/Version.xcconfig
index daa79a9..6f999af 100644
--- a/WebKit/mac/Configurations/Version.xcconfig
+++ b/WebKit/mac/Configurations/Version.xcconfig
@@ -22,7 +22,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
MAJOR_VERSION = 534;
-MINOR_VERSION = 0;
+MINOR_VERSION = 1;
TINY_VERSION = 0;
FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION);
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];
}
}
diff --git a/WebKit/mac/Plugins/Hosted/ProxyInstance.mm b/WebKit/mac/Plugins/Hosted/ProxyInstance.mm
index 9a976f9..b569a4f 100644
--- a/WebKit/mac/Plugins/Hosted/ProxyInstance.mm
+++ b/WebKit/mac/Plugins/Hosted/ProxyInstance.mm
@@ -133,7 +133,7 @@ ProxyInstance::~ProxyInstance()
RuntimeObject* ProxyInstance::newRuntimeObject(ExecState* exec)
{
- return new (exec) ProxyRuntimeObject(exec, this);
+ return new (exec) ProxyRuntimeObject(exec, exec->lexicalGlobalObject(), this);
}
JSC::Bindings::Class* ProxyInstance::getClass() const
@@ -178,8 +178,8 @@ JSValue ProxyInstance::invoke(JSC::ExecState* exec, InvokeType type, uint64_t id
class ProxyRuntimeMethod : public RuntimeMethod {
public:
- ProxyRuntimeMethod(ExecState* exec, const Identifier& name, Bindings::MethodList& list)
- : RuntimeMethod(exec, name, list)
+ ProxyRuntimeMethod(ExecState* exec, JSGlobalObject* globalObject, const Identifier& name, Bindings::MethodList& list)
+ : RuntimeMethod(exec, globalObject, name, list)
{
}
@@ -193,7 +193,7 @@ const ClassInfo ProxyRuntimeMethod::s_info = { "ProxyRuntimeMethod", &RuntimeMet
JSValue ProxyInstance::getMethod(JSC::ExecState* exec, const JSC::Identifier& propertyName)
{
MethodList methodList = getClass()->methodsNamed(propertyName, this);
- return new (exec) ProxyRuntimeMethod(exec, propertyName, methodList);
+ return new (exec) ProxyRuntimeMethod(exec, exec->lexicalGlobalObject(), propertyName, methodList);
}
JSValue ProxyInstance::invokeMethod(ExecState* exec, JSC::RuntimeMethod* runtimeMethod, const ArgList& args)
diff --git a/WebKit/mac/Plugins/Hosted/ProxyRuntimeObject.h b/WebKit/mac/Plugins/Hosted/ProxyRuntimeObject.h
index af3c5db..81d9b42 100644
--- a/WebKit/mac/Plugins/Hosted/ProxyRuntimeObject.h
+++ b/WebKit/mac/Plugins/Hosted/ProxyRuntimeObject.h
@@ -36,7 +36,7 @@ class ProxyInstance;
class ProxyRuntimeObject : public JSC::Bindings::RuntimeObject {
public:
- ProxyRuntimeObject(JSC::ExecState*, PassRefPtr<ProxyInstance>);
+ ProxyRuntimeObject(JSC::ExecState*, JSC::JSGlobalObject*, PassRefPtr<ProxyInstance>);
virtual ~ProxyRuntimeObject();
ProxyInstance* getInternalProxyInstance() const;
diff --git a/WebKit/mac/Plugins/Hosted/ProxyRuntimeObject.mm b/WebKit/mac/Plugins/Hosted/ProxyRuntimeObject.mm
index 5ba6e15..96855b3 100644
--- a/WebKit/mac/Plugins/Hosted/ProxyRuntimeObject.mm
+++ b/WebKit/mac/Plugins/Hosted/ProxyRuntimeObject.mm
@@ -35,8 +35,8 @@ namespace WebKit {
const ClassInfo ProxyRuntimeObject::s_info = { "ProxyRuntimeObject", &RuntimeObject::s_info, 0, 0 };
-ProxyRuntimeObject::ProxyRuntimeObject(ExecState* exec, PassRefPtr<ProxyInstance> instance)
- : RuntimeObject(exec, instance)
+ProxyRuntimeObject::ProxyRuntimeObject(ExecState* exec, JSGlobalObject* globalObject, PassRefPtr<ProxyInstance> instance)
+ : RuntimeObject(exec, globalObject, instance)
{
}
diff --git a/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm b/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm
index 519e274..6917e5f 100644
--- a/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm
+++ b/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm
@@ -122,6 +122,20 @@ extern "C" {
_pluginLayer = WKMakeRenderLayer(_proxy->renderContextID());
if (accleratedCompositingEnabled && _proxy->rendererType() == UseAcceleratedCompositing) {
+ // FIXME: This code can be shared between WebHostedNetscapePluginView and WebNetscapePluginView.
+#ifndef BUILDING_ON_LEOPARD
+ // Since this layer isn't going to be inserted into a view, we need to create another layer and flip its geometry
+ // in order to get the coordinate system right.
+ RetainPtr<CALayer> realPluginLayer(AdoptNS, _pluginLayer.releaseRef());
+
+ _pluginLayer.adoptNS([[CALayer alloc] init]);
+ _pluginLayer.get().bounds = realPluginLayer.get().bounds;
+ _pluginLayer.get().geometryFlipped = YES;
+
+ realPluginLayer.get().autoresizingMask = kCALayerWidthSizable | kCALayerHeightSizable;
+ [_pluginLayer.get() addSublayer:realPluginLayer.get()];
+#endif
+
// Eagerly enter compositing mode, since we know we'll need it. This avoids firing setNeedsStyleRecalc()
// for iframes that contain composited plugins at bad times. https://bugs.webkit.org/show_bug.cgi?id=39033
core([self webFrame])->view()->enterCompositingMode();
@@ -166,8 +180,11 @@ extern "C" {
if (!_proxy)
return;
- // Use AppKit to convert view coordinates to NSWindow coordinates.
- NSRect boundsInWindow = [self convertRect:[self bounds] toView:nil];
+ // The base coordinates of a window and it's contentView happen to be the equal at a userSpaceScaleFactor
+ // of 1. For non-1.0 scale factors this assumption is false.
+ NSView *windowContentView = [[self window] contentView];
+ NSRect boundsInWindow = [self convertRect:[self bounds] toView:windowContentView];
+
NSRect visibleRectInWindow;
// Core Animation plug-ins need to be updated (with a 0,0,0,0 clipRect) when
@@ -176,7 +193,7 @@ extern "C" {
// compatible with this behavior.
BOOL shouldClipOutPlugin = _pluginLayer && [self shouldClipOutPlugin];
if (!shouldClipOutPlugin)
- visibleRectInWindow = [self convertRect:[self visibleRect] toView:nil];
+ visibleRectInWindow = [self convertRect:[self visibleRect] toView:windowContentView];
else
visibleRectInWindow = NSZeroRect;
diff --git a/WebKit/mac/Plugins/WebNetscapePluginView.mm b/WebKit/mac/Plugins/WebNetscapePluginView.mm
index 9f5a6c2..8b4d998 100644
--- a/WebKit/mac/Plugins/WebNetscapePluginView.mm
+++ b/WebKit/mac/Plugins/WebNetscapePluginView.mm
@@ -274,12 +274,14 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
- (PortState)saveAndSetNewPortStateForUpdate:(BOOL)forUpdate
{
ASSERT([self currentWindow] != nil);
-
- // Use AppKit to convert view coordinates to NSWindow coordinates.
- NSRect boundsInWindow = [self convertRect:[self bounds] toView:nil];
- NSRect visibleRectInWindow = [self convertRect:[self visibleRect] toView:nil];
- // Flip Y to convert NSWindow coordinates to top-left-based window coordinates.
+ // The base coordinates of a window and it's contentView happen to be the equal at a userSpaceScaleFactor
+ // of 1. For non-1.0 scale factors this assumption is false.
+ NSView *windowContentView = [[self window] contentView];
+ NSRect boundsInWindow = [self convertRect:[self bounds] toView:windowContentView];
+ NSRect visibleRectInWindow = [self convertRect:[self visibleRect] toView:windowContentView];
+
+ // Flip Y to convert -[NSWindow contentView] coordinates to top-left-based window coordinates.
float borderViewHeight = [[self currentWindow] frame].size.height;
boundsInWindow.origin.y = borderViewHeight - NSMaxY(boundsInWindow);
visibleRectInWindow.origin.y = borderViewHeight - NSMaxY(visibleRectInWindow);
@@ -1091,6 +1093,19 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
accleratedCompositingEnabled = [[[self webView] preferences] acceleratedCompositingEnabled];
#endif
if (accleratedCompositingEnabled) {
+ // FIXME: This code can be shared between WebHostedNetscapePluginView and WebNetscapePluginView.
+#ifndef BUILDING_ON_LEOPARD
+ // Since this layer isn't going to be inserted into a view, we need to create another layer and flip its geometry
+ // in order to get the coordinate system right.
+ RetainPtr<CALayer> realPluginLayer(AdoptNS, _pluginLayer.releaseRef());
+
+ _pluginLayer.adoptNS([[CALayer alloc] init]);
+ _pluginLayer.get().bounds = realPluginLayer.get().bounds;
+ _pluginLayer.get().geometryFlipped = YES;
+
+ realPluginLayer.get().autoresizingMask = kCALayerWidthSizable | kCALayerHeightSizable;
+ [_pluginLayer.get() addSublayer:realPluginLayer.get()];
+#endif
// Eagerly enter compositing mode, since we know we'll need it. This avoids firing setNeedsStyleRecalc()
// for iframes that contain composited plugins at bad times. https://bugs.webkit.org/show_bug.cgi?id=39033
core([self webFrame])->view()->enterCompositingMode();
diff --git a/WebKit/mac/WebView/WebDynamicScrollBarsView.mm b/WebKit/mac/WebView/WebDynamicScrollBarsView.mm
index 3aaea46..2041ac0 100644
--- a/WebKit/mac/WebView/WebDynamicScrollBarsView.mm
+++ b/WebKit/mac/WebView/WebDynamicScrollBarsView.mm
@@ -262,6 +262,15 @@ static const unsigned cMaxUpdateScrollbarsPass = 2;
NSSize documentSize = [documentView frame].size;
NSSize visibleSize = [self documentVisibleRect].size;
NSSize frameSize = [self frame].size;
+
+ // When in HiDPI with a scale factor > 1, the visibleSize and frameSize may be non-integral values,
+ // while the documentSize (set by WebCore) will be integral. Round up the non-integral sizes so that
+ // the mismatch won't cause unwanted scrollbars to appear. This can result in slightly cut off content,
+ // but it will always be less than one pixel, which should not be noticeable.
+ visibleSize.width = ceilf(visibleSize.width);
+ visibleSize.height = ceilf(visibleSize.height);
+ frameSize.width = ceilf(frameSize.width);
+ frameSize.height = ceilf(frameSize.height);
if (_private->hScroll == ScrollbarAuto) {
newHasHorizontalScroller = documentSize.width > visibleSize.width;
diff --git a/WebKit/mac/WebView/WebFrame.mm b/WebKit/mac/WebView/WebFrame.mm
index 7545bd8..999f177 100644
--- a/WebKit/mac/WebView/WebFrame.mm
+++ b/WebKit/mac/WebView/WebFrame.mm
@@ -196,6 +196,18 @@ EditableLinkBehavior core(WebKitEditableLinkBehavior editableLinkBehavior)
return EditableLinkDefaultBehavior;
}
+WebCore::EditingBehavior core(WebKitEditingBehavior behavior)
+{
+ switch (behavior) {
+ case WebKitEditingMacBehavior:
+ return WebCore::EditingMacBehavior;
+ case WebKitEditingWinBehavior:
+ return WebCore::EditingWindowsBehavior;
+ }
+ ASSERT_NOT_REACHED();
+ return WebCore::EditingMacBehavior;
+}
+
TextDirectionSubmenuInclusionBehavior core(WebTextDirectionSubmenuInclusionBehavior behavior)
{
switch (behavior) {
@@ -1025,7 +1037,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
RenderObject* bodyRenderer = body->renderer();
if (!bodyRenderer)
return nil;
- Color color = bodyRenderer->style()->backgroundColor();
+ Color color = bodyRenderer->style()->visitedDependentColor(CSSPropertyBackgroundColor);
if (!color.isValid())
return nil;
return nsColor(color);
diff --git a/WebKit/mac/WebView/WebFrameInternal.h b/WebKit/mac/WebView/WebFrameInternal.h
index 4c1ee40..9b2248a 100644
--- a/WebKit/mac/WebView/WebFrameInternal.h
+++ b/WebKit/mac/WebView/WebFrameInternal.h
@@ -71,6 +71,7 @@ WebView *kit(WebCore::Page*);
WebCore::EditableLinkBehavior core(WebKitEditableLinkBehavior);
WebCore::TextDirectionSubmenuInclusionBehavior core(WebTextDirectionSubmenuInclusionBehavior);
+WebCore::EditingBehavior core(WebKitEditingBehavior);
WebView *getWebView(WebFrame *webFrame);
diff --git a/WebKit/mac/WebView/WebHTMLView.mm b/WebKit/mac/WebView/WebHTMLView.mm
index 83d2e7b..5f9134f 100644
--- a/WebKit/mac/WebView/WebHTMLView.mm
+++ b/WebKit/mac/WebView/WebHTMLView.mm
@@ -4344,9 +4344,6 @@ static BOOL isInPasswordField(Frame* coreFrame)
// the current event prevents that from causing a problem inside WebKit or AppKit code.
[[event retain] autorelease];
- if ([self _handleStyleKeyEquivalent:event])
- return YES;
-
BOOL eventWasSentToWebCore = (_private->keyDownEvent == event);
BOOL ret = NO;
@@ -4364,7 +4361,7 @@ static BOOL isInPasswordField(Frame* coreFrame)
ret = frame->eventHandler()->keyEvent(event);
if (!ret)
- ret = [super performKeyEquivalent:event];
+ ret = [self _handleStyleKeyEquivalent:event] || [super performKeyEquivalent:event];
[self release];
diff --git a/WebKit/mac/WebView/WebPreferenceKeysPrivate.h b/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
index f4ae333..ba4df8f 100644
--- a/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
+++ b/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
@@ -93,6 +93,7 @@
#define WebKitUsesProxiedOpenPanelPreferenceKey @"WebKitUsesProxiedOpenPanel"
#define WebKitPluginAllowedRunTimePreferenceKey @"WebKitPluginAllowedRunTime"
#define WebKitFrameFlatteningEnabledPreferenceKey @"WebKitFrameFlatteningEnabled"
+#define WebKitHTML5ParserEnabledPreferenceKey @"WebKitHTML5ParserEnabled"
// These are private both because callers should be using the cover methods and because the
// cover methods themselves are private.
@@ -104,6 +105,7 @@
#define WebKitEditableLinkBehaviorPreferenceKey @"WebKitEditableLinkBehavior"
#define WebKitCacheModelPreferenceKey @"WebKitCacheModelPreferenceKey"
#define WebKitTextDirectionSubmenuInclusionBehaviorPreferenceKey @"WebKitTextDirectionSubmenuInclusionBehaviorPreferenceKey"
+#define WebKitEditingBehaviorPreferenceKey @"WebKitEditingBehavior"
// CoreGraphics deferred updates are disabled if WebKitEnableCoalescedUpdatesPreferenceKey is set
// to NO, or has no value. For compatibility with Mac OS X 10.4.6, deferred updates are OFF by
diff --git a/WebKit/mac/WebView/WebPreferences.mm b/WebKit/mac/WebView/WebPreferences.mm
index 9de8495..ac98282 100644
--- a/WebKit/mac/WebView/WebPreferences.mm
+++ b/WebKit/mac/WebView/WebPreferences.mm
@@ -334,6 +334,7 @@ static WebCacheModel cacheModelForMainBundle(void)
@"0", WebKitPDFScaleFactorPreferenceKey,
@"0", WebKitUseSiteSpecificSpoofingPreferenceKey,
[NSNumber numberWithInt:WebKitEditableLinkDefaultBehavior], WebKitEditableLinkBehaviorPreferenceKey,
+ [NSNumber numberWithInt:WebKitEditingMacBehavior], WebKitEditingBehaviorPreferenceKey,
#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
[NSNumber numberWithInt:WebTextDirectionSubmenuAutomaticallyIncluded],
#else
@@ -1237,6 +1238,26 @@ static NSString *classIBCreatorID = nil;
[self _setBoolValue:flag forKey:WebKitFrameFlatteningEnabledPreferenceKey];
}
+- (BOOL)html5ParserEnabled
+{
+ return [self _boolValueForKey:WebKitHTML5ParserEnabledPreferenceKey];
+}
+
+- (void)setHTML5ParserEnabled:(BOOL)flag
+{
+ [self _setBoolValue:flag forKey:WebKitHTML5ParserEnabledPreferenceKey];
+}
+
+- (WebKitEditingBehavior)editingBehavior
+{
+ return static_cast<WebKitEditingBehavior>([self _integerValueForKey:WebKitEditingBehaviorPreferenceKey]);
+}
+
+- (void)setEditingBehavior:(WebKitEditingBehavior)behavior
+{
+ [self _setIntegerValue:behavior forKey:WebKitEditingBehaviorPreferenceKey];
+}
+
- (void)didRemoveFromWebView
{
ASSERT(_private->numWebViews);
diff --git a/WebKit/mac/WebView/WebPreferencesPrivate.h b/WebKit/mac/WebView/WebPreferencesPrivate.h
index ee785e9..0031860 100644
--- a/WebKit/mac/WebView/WebPreferencesPrivate.h
+++ b/WebKit/mac/WebView/WebPreferencesPrivate.h
@@ -43,6 +43,11 @@ typedef enum {
WebTextDirectionSubmenuAlwaysIncluded
} WebTextDirectionSubmenuInclusionBehavior;
+typedef enum {
+ WebKitEditingMacBehavior,
+ WebKitEditingWinBehavior
+} WebKitEditingBehavior;
+
extern NSString *WebPreferencesChangedNotification;
extern NSString *WebPreferencesRemovedNotification;
@@ -129,6 +134,9 @@ extern NSString *WebPreferencesRemovedNotification;
- (WebKitEditableLinkBehavior)editableLinkBehavior;
- (void)setEditableLinkBehavior:(WebKitEditableLinkBehavior)behavior;
+- (WebKitEditingBehavior)editingBehavior;
+- (void)setEditingBehavior:(WebKitEditingBehavior)behavior;
+
- (WebTextDirectionSubmenuInclusionBehavior)textDirectionSubmenuInclusionBehavior;
- (void)setTextDirectionSubmenuInclusionBehavior:(WebTextDirectionSubmenuInclusionBehavior)behavior;
@@ -167,6 +175,9 @@ extern NSString *WebPreferencesRemovedNotification;
- (BOOL)webGLEnabled;
- (void)setWebGLEnabled:(BOOL)enabled;
+- (BOOL)html5ParserEnabled;
+- (void)setHTML5ParserEnabled:(BOOL)flag;
+
- (BOOL)usesProxiedOpenPanel;
- (void)setUsesProxiedOpenPanel:(BOOL)enabled;
diff --git a/WebKit/mac/WebView/WebView.mm b/WebKit/mac/WebView/WebView.mm
index 36313b4..0df62ea 100644
--- a/WebKit/mac/WebView/WebView.mm
+++ b/WebKit/mac/WebView/WebView.mm
@@ -662,7 +662,8 @@ static bool shouldEnableLoadDeferring()
#else
WebGeolocationControllerClient* geolocationControllerClient = 0;
#endif
- _private->page = new Page(new WebChromeClient(self), new WebContextMenuClient(self), new WebEditorClient(self), new WebDragClient(self), new WebInspectorClient(self), new WebPluginHalterClient(self), geolocationControllerClient);
+ DeviceOrientationClient* deviceOrientationClient = 0;
+ _private->page = new Page(new WebChromeClient(self), new WebContextMenuClient(self), new WebEditorClient(self), new WebDragClient(self), new WebInspectorClient(self), new WebPluginHalterClient(self), geolocationControllerClient, deviceOrientationClient);
_private->page->setCanStartMedia([self window]);
_private->page->settings()->setLocalStorageDatabasePath([[self preferences] _localStorageDatabasePath]);
@@ -1368,6 +1369,7 @@ static bool fastDocumentTeardownEnabled()
settings->setTextAreasAreResizable([preferences textAreasAreResizable]);
settings->setShrinksStandaloneImagesToFit([preferences shrinksStandaloneImagesToFit]);
settings->setEditableLinkBehavior(core([preferences editableLinkBehavior]));
+ settings->setEditingBehavior(core([preferences editingBehavior]));
settings->setTextDirectionSubmenuInclusionBehavior(core([preferences textDirectionSubmenuInclusionBehavior]));
settings->setDOMPasteAllowed([preferences isDOMPasteAllowed]);
settings->setUsesPageCache([self usesPageCache]);
@@ -1405,6 +1407,7 @@ static bool fastDocumentTeardownEnabled()
settings->setWebGLEnabled([preferences webGLEnabled]);
settings->setLoadDeferringEnabled(shouldEnableLoadDeferring());
settings->setFrameFlatteningEnabled([preferences isFrameFlatteningEnabled]);
+ settings->setHTML5ParserEnabled([preferences html5ParserEnabled]);
}
static inline IMP getMethod(id o, SEL s)