<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[174908] trunk/Source</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/174908">174908</a></dd>
<dt>Author</dt> <dd>bdakin@apple.com</dd>
<dt>Date</dt> <dd>2014-10-20 14:00:15 -0700 (Mon, 20 Oct 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Add support for action menus
https://bugs.webkit.org/show_bug.cgi?id=137891
rdar://problem/18451638
rdar://problem/18694470
Reviewed by Anders Carlsson.
Source/WebCore:
New SPI that is needed for this.
* WebCore.exp.in:
* WebCore.xcodeproj/project.pbxproj:
* platform/spi/mac: Added.
* platform/spi/mac/NSViewSPI.h: Added.
Source/WebKit2:
Temporary artwork needed for menu item.
* Resources/OpenInNewWindowTemplate.pdf: Added.
* WebKit2.xcodeproj/project.pbxproj:
Add a preference that defaults to false for action menu support.
* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetActionMenuSupportEnabled):
(WKPreferencesGetActionMenuSupportEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
New SPI. WebKit clients can implement this method to customize the action menu.
* UIProcess/API/Cocoa/WKViewPrivate.h:
Create the action menu if it is supported.
* UIProcess/API/mac/WKView.mm:
(-[WKView initWithFrame:context:configuration:webView:]):
Methods to implement the default menu actions.
(-[WKView _openURLFromActionMenu:]):
(-[WKView _addToReadingListFromActionMenu:]):
(-[WKView _quickLookURLFromActionMenu:]):
Add action menus support for links. Populate the menu at the right time.
(-[WKView _defaultMenuItemsForLink]):
(-[WKView _defaultMenuItems]):
(-[WKView prepareForMenu:withEvent:]):
(-[WKView _actionMenuItemsForHitTestResult:defaultActionMenuItems:]):
New member variable caches the HitTestResult on mouse move.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::mouseDidMoveOverElement):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::activeActionMenuHitTestResult):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedWebPreferencesDefinitionsh">trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICWKPreferencescpp">trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICWKPreferencesRefPrivateh">trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKViewPrivateh">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKViewPrivate.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPImacWKViewmm">trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxycpp">trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxyh">trunk/Source/WebKit2/UIProcess/WebPageProxy.h</a></li>
<li><a href="#trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj">trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li>trunk/Source/WebCore/platform/spi/mac/</li>
<li><a href="#trunkSourceWebCoreplatformspimacNSViewSPIh">trunk/Source/WebCore/platform/spi/mac/NSViewSPI.h</a></li>
<li><a href="#trunkSourceWebKit2ResourcesOpenInNewWindowTemplatepdf">trunk/Source/WebKit2/Resources/OpenInNewWindowTemplate.pdf</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (174907 => 174908)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-10-20 20:46:38 UTC (rev 174907)
+++ trunk/Source/WebCore/ChangeLog        2014-10-20 21:00:15 UTC (rev 174908)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2014-10-20 Beth Dakin <bdakin@apple.com>
+
+ Add support for action menus
+ https://bugs.webkit.org/show_bug.cgi?id=137891
+ rdar://problem/18451638
+ rdar://problem/18694470
+
+ Reviewed by Anders Carlsson.
+
+ New SPI that is needed for this.
+ * WebCore.exp.in:
+ * WebCore.xcodeproj/project.pbxproj:
+ * platform/spi/mac: Added.
+ * platform/spi/mac/NSViewSPI.h: Added.
+
</ins><span class="cx"> 2014-10-20 Dean Jackson <dino@apple.com>
</span><span class="cx">
</span><span class="cx"> [Mac] Support "inverted-colors" and "monochrome" media feature.
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (174907 => 174908)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2014-10-20 20:46:38 UTC (rev 174907)
+++ trunk/Source/WebCore/WebCore.exp.in        2014-10-20 21:00:15 UTC (rev 174908)
</span><span class="lines">@@ -998,6 +998,7 @@
</span><span class="cx"> __ZN7WebCore22createFragmentFromTextERNS_5RangeERKN3WTF6StringE
</span><span class="cx"> __ZN7WebCore22externalRepresentationEPNS_5FrameEj
</span><span class="cx"> __ZN7WebCore22externalRepresentationEPNS_7ElementEj
</span><ins>+__ZN7WebCore22protocolIsInHTTPFamilyERKN3WTF6StringE
</ins><span class="cx"> __ZN7WebCore22systemMarketingVersionEv
</span><span class="cx"> __ZN7WebCore22throwSequenceTypeErrorERN3JSC9ExecStateE
</span><span class="cx"> __ZN7WebCore22userPreferredLanguagesEv
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (174907 => 174908)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-10-20 20:46:38 UTC (rev 174907)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-10-20 21:00:15 UTC (rev 174908)
</span><span class="lines">@@ -3223,6 +3223,7 @@
</span><span class="cx">                 9343CB8212F25E510033C5EE /* TextCodecUTF8.h in Headers */ = {isa = PBXBuildFile; fileRef = 9343CB8012F25E510033C5EE /* TextCodecUTF8.h */; };
</span><span class="cx">                 93442C9E0D2B335C00338FF9 /* HTMLTableRowsCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 93442C9D0D2B335C00338FF9 /* HTMLTableRowsCollection.h */; };
</span><span class="cx">                 93442CA00D2B336000338FF9 /* HTMLTableRowsCollection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93442C9F0D2B336000338FF9 /* HTMLTableRowsCollection.cpp */; };
</span><ins>+                9348428219F1A9190009D5AE /* NSViewSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 9348428119F1A9190009D5AE /* NSViewSPI.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 934907E4125BBBC8007F23A0 /* GraphicsContextCG.h in Headers */ = {isa = PBXBuildFile; fileRef = 934907E3125BBBC8007F23A0 /* GraphicsContextCG.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 934CC10A0EDB223900A658F2 /* ScriptSourceCode.h in Headers */ = {isa = PBXBuildFile; fileRef = 934CC1090EDB223900A658F2 /* ScriptSourceCode.h */; };
</span><span class="cx">                 934D9BA50B8C116B007B42A9 /* WebCoreNSStringExtras.mm in Sources */ = {isa = PBXBuildFile; fileRef = 934D9BA40B8C116B007B42A9 /* WebCoreNSStringExtras.mm */; };
</span><span class="lines">@@ -10352,6 +10353,7 @@
</span><span class="cx">                 9343CB8012F25E510033C5EE /* TextCodecUTF8.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextCodecUTF8.h; sourceTree = "<group>"; };
</span><span class="cx">                 93442C9D0D2B335C00338FF9 /* HTMLTableRowsCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLTableRowsCollection.h; sourceTree = "<group>"; };
</span><span class="cx">                 93442C9F0D2B336000338FF9 /* HTMLTableRowsCollection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLTableRowsCollection.cpp; sourceTree = "<group>"; };
</span><ins>+                9348428119F1A9190009D5AE /* NSViewSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSViewSPI.h; sourceTree = "<group>"; };
</ins><span class="cx">                 934907E3125BBBC8007F23A0 /* GraphicsContextCG.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GraphicsContextCG.h; sourceTree = "<group>"; };
</span><span class="cx">                 934CC1090EDB223900A658F2 /* ScriptSourceCode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptSourceCode.h; sourceTree = "<group>"; };
</span><span class="cx">                 934D9BA40B8C116B007B42A9 /* WebCoreNSStringExtras.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreNSStringExtras.mm; sourceTree = "<group>"; };
</span><span class="lines">@@ -16164,6 +16166,7 @@
</span><span class="cx">                                 65086DA619AC1719009AF46B /* cf */,
</span><span class="cx">                                 653EF83719A043AE0052202C /* cocoa */,
</span><span class="cx">                                 A172182419DE182B00464D17 /* ios */,
</span><ins>+                                9348428019F1A9190009D5AE /* mac */,
</ins><span class="cx">                         );
</span><span class="cx">                         path = spi;
</span><span class="cx">                         sourceTree = "<group>";
</span><span class="lines">@@ -17513,6 +17516,14 @@
</span><span class="cx">                         path = filters;
</span><span class="cx">                         sourceTree = "<group>";
</span><span class="cx">                 };
</span><ins>+                9348428019F1A9190009D5AE /* mac */ = {
+                        isa = PBXGroup;
+                        children = (
+                                9348428119F1A9190009D5AE /* NSViewSPI.h */,
+                        );
+                        path = mac;
+                        sourceTree = "<group>";
+                };
</ins><span class="cx">                 93A1EAA20A5634D8006960A0 /* mac */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><span class="lines">@@ -25913,6 +25924,7 @@
</span><span class="cx">                                 0A4844990CA44CB200B7BD48 /* SoftLinking.h in Headers */,
</span><span class="cx">                                 4B3043C70AE0370300A82647 /* Sound.h in Headers */,
</span><span class="cx">                                 84A81F3E0FC7DFF000955300 /* SourceAlpha.h in Headers */,
</span><ins>+                                9348428219F1A9190009D5AE /* NSViewSPI.h in Headers */,
</ins><span class="cx">                                 CD3A496217A9D01B00274E42 /* SourceBuffer.h in Headers */,
</span><span class="cx">                                 CD3A496517A9D01B00274E42 /* SourceBufferList.h in Headers */,
</span><span class="cx">                                 CD641EB41818F5ED00EE4C41 /* SourceBufferPrivate.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformspimacNSViewSPIh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/spi/mac/NSViewSPI.h (0 => 174908)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/spi/mac/NSViewSPI.h         (rev 0)
+++ trunk/Source/WebCore/platform/spi/mac/NSViewSPI.h        2014-10-20 21:00:15 UTC (rev 174908)
</span><span class="lines">@@ -0,0 +1,38 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#if USE(APPLE_INTERNAL_SDK)
+
+#import <AppKit/NSView_Private.h>
+
+#else
+
+#import <AppKit/NSView.h>
+
+@interface NSView (Private)
+@property (strong) NSMenu *actionMenu;
+@end
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (174907 => 174908)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-10-20 20:46:38 UTC (rev 174907)
+++ trunk/Source/WebKit2/ChangeLog        2014-10-20 21:00:15 UTC (rev 174908)
</span><span class="lines">@@ -1,3 +1,47 @@
</span><ins>+2014-10-20 Beth Dakin <bdakin@apple.com>
+
+ Add support for action menus
+ https://bugs.webkit.org/show_bug.cgi?id=137891
+ rdar://problem/18451638
+ rdar://problem/18694470
+
+ Reviewed by Anders Carlsson.
+
+ Temporary artwork needed for menu item.
+ * Resources/OpenInNewWindowTemplate.pdf: Added.
+ * WebKit2.xcodeproj/project.pbxproj:
+
+ Add a preference that defaults to false for action menu support.
+ * Shared/WebPreferencesDefinitions.h:
+ * UIProcess/API/C/WKPreferences.cpp:
+ (WKPreferencesSetActionMenuSupportEnabled):
+ (WKPreferencesGetActionMenuSupportEnabled):
+ * UIProcess/API/C/WKPreferencesRefPrivate.h:
+
+ New SPI. WebKit clients can implement this method to customize the action menu.
+ * UIProcess/API/Cocoa/WKViewPrivate.h:
+
+ Create the action menu if it is supported.
+ * UIProcess/API/mac/WKView.mm:
+ (-[WKView initWithFrame:context:configuration:webView:]):
+
+ Methods to implement the default menu actions.
+ (-[WKView _openURLFromActionMenu:]):
+ (-[WKView _addToReadingListFromActionMenu:]):
+ (-[WKView _quickLookURLFromActionMenu:]):
+
+ Add action menus support for links. Populate the menu at the right time.
+ (-[WKView _defaultMenuItemsForLink]):
+ (-[WKView _defaultMenuItems]):
+ (-[WKView prepareForMenu:withEvent:]):
+ (-[WKView _actionMenuItemsForHitTestResult:defaultActionMenuItems:]):
+
+ New member variable caches the HitTestResult on mouse move.
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::mouseDidMoveOverElement):
+ * UIProcess/WebPageProxy.h:
+ (WebKit::WebPageProxy::activeActionMenuHitTestResult):
+
</ins><span class="cx"> 2014-10-20 Timothy Hatcher <timothy@apple.com>
</span><span class="cx">
</span><span class="cx"> Web Inspector: Delay and white area when Web Inspector crashes
</span></span></pre></div>
<a id="trunkSourceWebKit2ResourcesOpenInNewWindowTemplatepdf"></a>
<div class="binary"><h4>Added: trunk/Source/WebKit2/Resources/OpenInNewWindowTemplate.pdf</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/Source/WebKit2/Resources/OpenInNewWindowTemplate.pdf
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkSourceWebKit2SharedWebPreferencesDefinitionsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h (174907 => 174908)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h        2014-10-20 20:46:38 UTC (rev 174907)
+++ trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h        2014-10-20 21:00:15 UTC (rev 174908)
</span><span class="lines">@@ -195,6 +195,7 @@
</span><span class="cx"> macro(ShouldConvertPositionStyleOnCopy, shouldConvertPositionStyleOnCopy, Bool, bool, false) \
</span><span class="cx"> macro(Standalone, standalone, Bool, bool, false) \
</span><span class="cx"> macro(TelephoneNumberParsingEnabled, telephoneNumberParsingEnabled, Bool, bool, false) \
</span><ins>+ macro(ActionMenuSupportEnabled, actionMenuSupportEnabled, Bool, bool, false) \
</ins><span class="cx"> macro(AlwaysUseBaselineOfPrimaryFont, alwaysUseBaselineOfPrimaryFont, Bool, bool, false) \
</span><span class="cx"> macro(AllowMultiElementImplicitSubmission, allowMultiElementImplicitSubmission, Bool, bool, false) \
</span><span class="cx"> macro(AlwaysUseAcceleratedOverflowScroll, alwaysUseAcceleratedOverflowScroll, Bool, bool, false) \
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKPreferencescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp (174907 => 174908)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp        2014-10-20 20:46:38 UTC (rev 174907)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp        2014-10-20 21:00:15 UTC (rev 174908)
</span><span class="lines">@@ -1236,6 +1236,16 @@
</span><span class="cx"> return toImpl(preferencesRef)->telephoneNumberParsingEnabled();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void WKPreferencesSetActionMenuSupportEnabled(WKPreferencesRef preferencesRef, bool enabled)
+{
+ toImpl(preferencesRef)->setActionMenuSupportEnabled(enabled);
+}
+
+bool WKPreferencesGetActionMenuSupportEnabled(WKPreferencesRef preferencesRef)
+{
+ return toImpl(preferencesRef)->actionMenuSupportEnabled();
+}
+
</ins><span class="cx"> void WKPreferencesSetEnableInheritURIQueryComponent(WKPreferencesRef preferencesRef, bool enabled)
</span><span class="cx"> {
</span><span class="cx"> toImpl(preferencesRef)->setEnableInheritURIQueryComponent(enabled);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKPreferencesRefPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h (174907 => 174908)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h        2014-10-20 20:46:38 UTC (rev 174907)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h        2014-10-20 21:00:15 UTC (rev 174908)
</span><span class="lines">@@ -315,6 +315,10 @@
</span><span class="cx"> WK_EXPORT bool WKPreferencesGetTelephoneNumberParsingEnabled(WKPreferencesRef preferencesRef);
</span><span class="cx">
</span><span class="cx"> // Default to false.
</span><ins>+WK_EXPORT void WKPreferencesSetActionMenuSupportEnabled(WKPreferencesRef, bool);
+WK_EXPORT bool WKPreferencesGetActionMenuSupportEnabled(WKPreferencesRef);
+
+// Default to false.
</ins><span class="cx"> WK_EXPORT void WKPreferencesSetEnableInheritURIQueryComponent(WKPreferencesRef preferencesRef, bool enabled);
</span><span class="cx"> WK_EXPORT bool WKPreferencesGetEnableInheritURIQueryComponent(WKPreferencesRef preferencesRef);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKViewPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKViewPrivate.h (174907 => 174908)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKViewPrivate.h        2014-10-20 20:46:38 UTC (rev 174907)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKViewPrivate.h        2014-10-20 21:00:15 UTC (rev 174908)
</span><span class="lines">@@ -116,6 +116,8 @@
</span><span class="cx"> // The rect returned is always that of the snapshot, and only if it is the view being manipulated by the swipe. This only works for layer-backed windows.
</span><span class="cx"> - (void)_setDidMoveSwipeSnapshotCallback:(void(^)(CGRect swipeSnapshotRectInWindowCoordinates))callback;
</span><span class="cx">
</span><ins>+- (NSArray *)_actionMenuItemsForHitTestResult:(WKHitTestResultRef)hitTestResult defaultActionMenuItems:(NSArray *)defaultMenuItems;
+
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> @end
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPImacWKViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm (174907 => 174908)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm        2014-10-20 20:46:38 UTC (rev 174907)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm        2014-10-20 21:00:15 UTC (rev 174908)
</span><span class="lines">@@ -85,6 +85,7 @@
</span><span class="cx"> #import <WebCore/FileSystem.h>
</span><span class="cx"> #import <WebCore/KeyboardEvent.h>
</span><span class="cx"> #import <WebCore/LocalizedStrings.h>
</span><ins>+#import <WebCore/NSViewSPI.h>
</ins><span class="cx"> #import <WebCore/PlatformEventFactoryMac.h>
</span><span class="cx"> #import <WebCore/PlatformScreen.h>
</span><span class="cx"> #import <WebCore/Region.h>
</span><span class="lines">@@ -117,6 +118,10 @@
</span><span class="cx"> - (void)_maskRoundedBottomCorners:(NSRect)clipRect;
</span><span class="cx"> @end
</span><span class="cx">
</span><ins>+@interface NSObject (WKQLPreviewBubbleDetails)
++ (void)presentBubbleForItem:(id)item parentWindow:(NSWindow *)aWindow itemFrame:(NSRect)itemFrame maximumSize:(NSSize)maximumSize preferredEdge:(NSRectEdge)preferredEdge;
+@end
+
</ins><span class="cx"> #if USE(ASYNC_NSTEXTINPUTCLIENT)
</span><span class="cx"> @interface NSTextInputContext (WKNSTextInputContextDetails)
</span><span class="cx"> - (void)handleEvent:(NSEvent *)theEvent completionHandler:(void(^)(BOOL handled))completionHandler;
</span><span class="lines">@@ -3525,6 +3530,11 @@
</span><span class="cx">
</span><span class="cx"> [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_applicationWillTerminate:) name:NSApplicationWillTerminateNotification object:NSApp];
</span><span class="cx">
</span><ins>+ if (_data->_page->preferences().actionMenuSupportEnabled() && [self respondsToSelector:@selector(setActionMenu:)]) {
+ RetainPtr<NSMenu> actionMenu = adoptNS([[NSMenu alloc] init]);
+ [self setActionMenu:actionMenu.get()];
+ }
+
</ins><span class="cx"> return self;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -3622,6 +3632,95 @@
</span><span class="cx"> _data->_gestureController->removeSwipeSnapshot();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+- (void)_openURLFromActionMenu:(id)sender
+{
+ WebHitTestResult* hitTestResult = _data->_page->activeActionMenuHitTestResult();
+ if (!hitTestResult)
+ return;
+
+ NSURL *url = [NSURL URLWithString:hitTestResult->absoluteLinkURL()];
+ [[NSWorkspace sharedWorkspace] openURL:url];
+}
+
+- (void)_addToReadingListFromActionMenu:(id)sender
+{
+ WebHitTestResult* hitTestResult = _data->_page->activeActionMenuHitTestResult();
+ if (!hitTestResult)
+ return;
+
+ NSURL *url = [NSURL URLWithString:hitTestResult->absoluteLinkURL()];
+ NSSharingService *service = [NSSharingService sharingServiceNamed:NSSharingServiceNameAddToSafariReadingList];
+ [service performWithItems:@[ url ]];
+}
+
+- (void)_quickLookURLFromActionMenu:(id)sender
+{
+ WebHitTestResult* hitTestResult = _data->_page->activeActionMenuHitTestResult();
+ if (!hitTestResult)
+ return;
+
+ NSRect itemFrame = [self convertRect:hitTestResult->elementBoundingBox() toView:nil];
+ NSSize maximumPreviewSize = NSMakeSize(self.bounds.size.width * 0.75, self.bounds.size.height * 0.75);
+
+ NSURL *url = [NSURL URLWithString:hitTestResult->absoluteLinkURL()];
+ [NSClassFromString(@"QLPreviewBubble") presentBubbleForItem:url parentWindow:self.window itemFrame:itemFrame maximumSize:maximumPreviewSize preferredEdge:NSMaxYEdge];
+}
+
+- (NSArray *)_defaultMenuItemsForLink
+{
+ NSMutableArray *menuItems = [NSMutableArray array];
+
+ WebHitTestResult* hitTestResult = _data->_page->activeActionMenuHitTestResult();
+ if (!hitTestResult)
+ return menuItems;
+
+ if (!WebCore::protocolIsInHTTPFamily(hitTestResult->absoluteLinkURL()))
+ return menuItems;
+
+ RetainPtr<NSMenuItem> openLinkItem = adoptNS([[NSMenuItem alloc] initWithTitle:@"Open" action:@selector(_openURLFromActionMenu:) keyEquivalent:@""]);
+ [openLinkItem setImage:[[NSBundle bundleForClass:[WKView class]] imageForResource:@"OpenInNewWindowTemplate"]];
+ [openLinkItem setTarget:self];
+ [menuItems addObject:openLinkItem.get()];
+
+ RetainPtr<NSMenuItem> previewLinkItem = adoptNS([[NSMenuItem alloc] initWithTitle:@"Preview" action:@selector(_quickLookURLFromActionMenu:) keyEquivalent:@""]);
+ [previewLinkItem setImage:[NSImage imageNamed:NSImageNameQuickLookTemplate]];
+ [previewLinkItem setTarget:self];
+ [menuItems addObject:previewLinkItem.get()];
+
+ RetainPtr<NSMenuItem> readingListItem = adoptNS([[NSMenuItem alloc] initWithTitle:@"Add to Safari Reading List" action:@selector(_addToReadingListFromActionMenu:) keyEquivalent:@""]);
+ [readingListItem setImage:[NSImage imageNamed:NSImageNameBookmarksTemplate]];
+ [readingListItem setTarget:self];
+ [menuItems addObject:readingListItem.get()];
+
+ // FIXME: Required to work around <rdar://18684207>.
+ [menuItems addObject:[NSMenuItem separatorItem]];
+
+ return menuItems;
+}
+
+- (NSArray *)_defaultMenuItems
+{
+ if (WebHitTestResult* hitTestResult = _data->_page->activeActionMenuHitTestResult()) {
+ if (!hitTestResult->absoluteLinkURL().isEmpty())
+ return [self _defaultMenuItemsForLink];
+ }
+
+ return @[];
+}
+
+- (void)prepareForMenu:(NSMenu *)menu withEvent:(NSEvent *)event
+{
+ if (menu != self.actionMenu)
+ return;
+
+ [[self actionMenu] removeAllItems];
+
+ NSArray *menuItems = [self _actionMenuItemsForHitTestResult:toAPI(_data->_page->activeActionMenuHitTestResult()) defaultActionMenuItems:[self _defaultMenuItems]];
+
+ for (NSMenuItem *item in menuItems)
+ [[self actionMenu] addItem:item];
+}
+
</ins><span class="cx"> @end
</span><span class="cx">
</span><span class="cx"> @implementation WKView (Private)
</span><span class="lines">@@ -4089,6 +4188,12 @@
</span><span class="cx"> _data->_gestureController->setDidMoveSwipeSnapshotCallback(callback);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+
+- (NSArray *)_actionMenuItemsForHitTestResult:(WKHitTestResultRef)hitTestResult defaultActionMenuItems:(NSArray *)defaultMenuItems
+{
+ return defaultMenuItems;
+}
+
</ins><span class="cx"> #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
</span><span class="cx">
</span><span class="cx"> - (void)_setAutomaticallyAdjustsContentInsets:(BOOL)automaticallyAdjustsContentInsets
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (174907 => 174908)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2014-10-20 20:46:38 UTC (rev 174907)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2014-10-20 21:00:15 UTC (rev 174908)
</span><span class="lines">@@ -3101,6 +3101,8 @@
</span><span class="cx"> if (!decoder.decode(messageDecoder))
</span><span class="cx"> return;
</span><span class="cx">
</span><ins>+ m_activeActionMenuHitTestResult = WebHitTestResult::create(hitTestResultData);
+
</ins><span class="cx"> WebEvent::Modifiers modifiers = static_cast<WebEvent::Modifiers>(opaqueModifiers);
</span><span class="cx">
</span><span class="cx"> m_uiClient->mouseDidMoveOverElement(this, hitTestResultData, modifiers, userData.get());
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (174907 => 174908)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2014-10-20 20:46:38 UTC (rev 174907)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2014-10-20 21:00:15 UTC (rev 174908)
</span><span class="lines">@@ -922,6 +922,8 @@
</span><span class="cx"> void removeNavigationGestureSnapshot();
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+ WebHitTestResult* activeActionMenuHitTestResult() const { return m_activeActionMenuHitTestResult.get(); }
+
</ins><span class="cx"> private:
</span><span class="cx"> WebPageProxy(PageClient&, WebProcessProxy&, uint64_t pageID, const WebPageConfiguration&);
</span><span class="cx"> void platformInitialize();
</span><span class="lines">@@ -1367,6 +1369,8 @@
</span><span class="cx"> RefPtr<WebContextMenuProxy> m_activeContextMenu;
</span><span class="cx"> ContextMenuContextData m_activeContextMenuContextData;
</span><span class="cx"> #endif
</span><ins>+ RefPtr<WebHitTestResult> m_activeActionMenuHitTestResult;
+
</ins><span class="cx"> RefPtr<WebOpenPanelResultListenerProxy> m_openPanelResultListener;
</span><span class="cx"> GeolocationPermissionRequestManagerProxy m_geolocationPermissionRequestManager;
</span><span class="cx"> NotificationPermissionRequestManagerProxy m_notificationPermissionRequestManager;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (174907 => 174908)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2014-10-20 20:46:38 UTC (rev 174907)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2014-10-20 21:00:15 UTC (rev 174908)
</span><span class="lines">@@ -1077,6 +1077,7 @@
</span><span class="cx">                 909854EC12BC4E17000AD080 /* WebMemorySampler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 905620E812BC248B000799B6 /* WebMemorySampler.cpp */; };
</span><span class="cx">                 909854ED12BC4E18000AD080 /* WebMemorySampler.h in Headers */ = {isa = PBXBuildFile; fileRef = 905620E912BC248B000799B6 /* WebMemorySampler.h */; };
</span><span class="cx">                 909854EE12BC4E18000AD080 /* WebMemorySampler.mac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 905620E512BC2476000799B6 /* WebMemorySampler.mac.mm */; };
</span><ins>+                9348427D19F19BD10009D5AE /* OpenInNewWindowTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 9348427C19F19BD00009D5AE /* OpenInNewWindowTemplate.pdf */; };
</ins><span class="cx">                 935EEB9B1277617C003322B8 /* WKBundleBackForwardListItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 935EEB981277616D003322B8 /* WKBundleBackForwardListItem.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 935EEB9E127761AC003322B8 /* WKBundleBackForwardList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 935EEB951277616D003322B8 /* WKBundleBackForwardList.cpp */; };
</span><span class="cx">                 935EEB9F127761AC003322B8 /* WKBundleBackForwardList.h in Headers */ = {isa = PBXBuildFile; fileRef = 935EEB961277616D003322B8 /* WKBundleBackForwardList.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -3125,6 +3126,7 @@
</span><span class="cx">                 905620E512BC2476000799B6 /* WebMemorySampler.mac.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebMemorySampler.mac.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
</span><span class="cx">                 905620E812BC248B000799B6 /* WebMemorySampler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebMemorySampler.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 905620E912BC248B000799B6 /* WebMemorySampler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebMemorySampler.h; sourceTree = "<group>"; };
</span><ins>+                9348427C19F19BD00009D5AE /* OpenInNewWindowTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; name = OpenInNewWindowTemplate.pdf; path = Resources/OpenInNewWindowTemplate.pdf; sourceTree = "<group>"; };
</ins><span class="cx">                 935EEB8F1277615D003322B8 /* InjectedBundleBackForwardList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundleBackForwardList.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 935EEB901277615D003322B8 /* InjectedBundleBackForwardList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedBundleBackForwardList.h; sourceTree = "<group>"; };
</span><span class="cx">                 935EEB911277615D003322B8 /* InjectedBundleBackForwardListItem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundleBackForwardListItem.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -3986,6 +3988,7 @@
</span><span class="cx">                                 1C8AE7601992F62F00ABF6EC /* DockRightLegacy.pdf */,
</span><span class="cx">                                 8DC2EF5A0486A6940098B216 /* Info.plist */,
</span><span class="cx">                                 089C1666FE841158C02AAC07 /* InfoPlist.strings */,
</span><ins>+                                9348427C19F19BD00009D5AE /* OpenInNewWindowTemplate.pdf */,
</ins><span class="cx">                                 E1D26A4C1759634E0095BFD1 /* WebContentProcess.xib */,
</span><span class="cx">                                 E133FD891423DD7F00FC7BFB /* WebKit.icns */,
</span><span class="cx">                         );
</span><span class="lines">@@ -8269,6 +8272,7 @@
</span><span class="cx">                                 E11D35AE16B63D1B006D23D7 /* com.apple.WebProcess.sb in Resources */,
</span><span class="cx">                                 1CBC945E16515ED200D68AAE /* DockBottom.pdf in Resources */,
</span><span class="cx">                                 E115C716190F8A2500ECC516 /* com.apple.WebKit.Databases.sb in Resources */,
</span><ins>+                                9348427D19F19BD10009D5AE /* OpenInNewWindowTemplate.pdf in Resources */,
</ins><span class="cx">                                 1CB75C941701E880009F809F /* DockRight.pdf in Resources */,
</span><span class="cx">                                 1C8AE7611992F63A00ABF6EC /* DockBottomLegacy.pdf in Resources */,
</span><span class="cx">                                 8DC2EF530486A6940098B216 /* InfoPlist.strings in Resources */,
</span></span></pre>
</div>
</div>
</body>
</html>