<!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>[207612] branches/safari-602-branch</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/207612">207612</a></dd>
<dt>Author</dt> <dd>matthew_hanson@apple.com</dd>
<dt>Date</dt> <dd>2016-10-20 04:12:25 -0700 (Thu, 20 Oct 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/207385">r207385</a>. rdar://problem/28811872</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari602branchSourceWebKitmacChangeLog">branches/safari-602-branch/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#branchessafari602branchSourceWebKitmacWebViewWebHTMLViewmm">branches/safari-602-branch/Source/WebKit/mac/WebView/WebHTMLView.mm</a></li>
<li><a href="#branchessafari602branchToolsChangeLog">branches/safari-602-branch/Tools/ChangeLog</a></li>
<li><a href="#branchessafari602branchToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj">branches/safari-602-branch/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#branchessafari602branchToolsTestWebKitAPITestsmacContextMenuDefaultItemsHaveTagsmm">branches/safari-602-branch/Tools/TestWebKitAPI/Tests/mac/ContextMenuDefaultItemsHaveTags.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari602branchSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-602-branch/Source/WebKit/mac/ChangeLog (207611 => 207612)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/Source/WebKit/mac/ChangeLog        2016-10-20 11:12:22 UTC (rev 207611)
+++ branches/safari-602-branch/Source/WebKit/mac/ChangeLog        2016-10-20 11:12:25 UTC (rev 207612)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2016-10-20  Matthew Hanson  &lt;matthew_hanson&gt;
+
+        Merge r207385. rdar://problem/28811872
+
+    2016-10-15  Dan Bernstein  &lt;mitz@apple.com&gt;
+
+            REGRESSION (r191699): Contextual menu in Mail compose view doesn’t include any of the standard submenus
+            https://bugs.webkit.org/show_bug.cgi?id=163492
+            &lt;rdar://problem/28654799&gt;
+
+            Reviewed by Darin Adler.
+
+            Test: TestWebKitAPI/Tests/mac/ContextMenuDefaultItemsHaveTags.mm
+
+            * WebView/WebHTMLView.mm:
+            (createMenuItem): Set the tag for items that have submenus as well.
+
</ins><span class="cx"> 2016-10-20  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Merge r207246. rdar://problem/28732731
</span></span></pre></div>
<a id="branchessafari602branchSourceWebKitmacWebViewWebHTMLViewmm"></a>
<div class="modfile"><h4>Modified: branches/safari-602-branch/Source/WebKit/mac/WebView/WebHTMLView.mm (207611 => 207612)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/Source/WebKit/mac/WebView/WebHTMLView.mm        2016-10-20 11:12:22 UTC (rev 207611)
+++ branches/safari-602-branch/Source/WebKit/mac/WebView/WebHTMLView.mm        2016-10-20 11:12:25 UTC (rev 207612)
</span><span class="lines">@@ -3957,6 +3957,9 @@
</span><span class="cx">             [menu addItem:menuItem];
</span><span class="cx"> 
</span><span class="cx">         auto menuItem = adoptNS([[NSMenuItem alloc] initWithTitle:item.title() action:nullptr keyEquivalent:@&quot;&quot;]);
</span><ins>+
+        if (auto tag = toTag(item.action()))
+            [menuItem setTag:*tag];
</ins><span class="cx">         [menuItem setEnabled:item.enabled()];
</span><span class="cx">         [menuItem setSubmenu:menu.get()];
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari602branchToolsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-602-branch/Tools/ChangeLog (207611 => 207612)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/Tools/ChangeLog        2016-10-20 11:12:22 UTC (rev 207611)
+++ branches/safari-602-branch/Tools/ChangeLog        2016-10-20 11:12:25 UTC (rev 207612)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2016-10-20  Matthew Hanson  &lt;matthew_hanson&gt;
+
+        Merge r207385. rdar://problem/28811872
+
+    2016-10-15  Dan Bernstein  &lt;mitz@apple.com&gt;
+
+            REGRESSION (r191699): Contextual menu in Mail compose view doesn’t include any of the standard submenus
+            https://bugs.webkit.org/show_bug.cgi?id=163492
+            &lt;rdar://problem/28654799&gt;
+
+            Reviewed by Darin Adler.
+
+            * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+            * TestWebKitAPI/Tests/mac/ContextMenuDefaultItemsHaveTags.mm: Added.
+            (-[ContextMenuDefaultItemsHaveTagsDelegate webView:didFinishLoadForFrame:]):
+            (TestWebKitAPI::TEST):
+
</ins><span class="cx"> 2016-10-20  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Merge r206833. rdar://problem/28634858
</span></span></pre></div>
<a id="branchessafari602branchToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: branches/safari-602-branch/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (207611 => 207612)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2016-10-20 11:12:22 UTC (rev 207611)
+++ branches/safari-602-branch/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2016-10-20 11:12:25 UTC (rev 207612)
</span><span class="lines">@@ -93,6 +93,7 @@
</span><span class="cx">                 37D36ED71AF42ECD00BAF5D9 /* LoadAlternateHTMLString.mm in Sources */ = {isa = PBXBuildFile; fileRef = 37D36ED61AF42ECD00BAF5D9 /* LoadAlternateHTMLString.mm */; };
</span><span class="cx">                 37DC6791140D7D7600ABCCDB /* DOMRangeOfString.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 37DC678F140D7D3A00ABCCDB /* DOMRangeOfString.html */; };
</span><span class="cx">                 37E1064C1697681800B78BD0 /* DOMHTMLTableCellElementCellAbove.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 37E1064B169767F700B78BD0 /* DOMHTMLTableCellElementCellAbove.html */; };
</span><ins>+                37FB72971DB2E82F00E41BE4 /* ContextMenuDefaultItemsHaveTags.mm in Sources */ = {isa = PBXBuildFile; fileRef = 37FB72951DB2E82F00E41BE4 /* ContextMenuDefaultItemsHaveTags.mm */; };
</ins><span class="cx">                 3FBD1B4A1D3D66AB00E6D6FA /* FullscreenLayoutConstraints.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 3FBD1B491D39D1DB00E6D6FA /* FullscreenLayoutConstraints.html */; };
</span><span class="cx">                 46C519DA1D355AB200DAA51A /* LocalStorageNullEntries.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46C519D81D355A7300DAA51A /* LocalStorageNullEntries.mm */; };
</span><span class="cx">                 46C519E61D3563FD00DAA51A /* LocalStorageNullEntries.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 46C519E21D35629600DAA51A /* LocalStorageNullEntries.html */; };
</span><span class="lines">@@ -810,6 +811,7 @@
</span><span class="cx">                 37E1064A1697676400B78BD0 /* DOMHTMLTableCellCellAbove.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMHTMLTableCellCellAbove.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 37E1064B169767F700B78BD0 /* DOMHTMLTableCellElementCellAbove.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = DOMHTMLTableCellElementCellAbove.html; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 37E38C33169B7D010084C28C /* WebViewDidRemoveFrameFromHierarchy.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebViewDidRemoveFrameFromHierarchy.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                37FB72951DB2E82F00E41BE4 /* ContextMenuDefaultItemsHaveTags.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ContextMenuDefaultItemsHaveTags.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 3F1B52681D3D7129008D60C4 /* FullscreenLayoutConstraints.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FullscreenLayoutConstraints.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 3FBD1B491D39D1DB00E6D6FA /* FullscreenLayoutConstraints.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = FullscreenLayoutConstraints.html; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 41973B5A1AF2286A006C7B36 /* FileSystem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileSystem.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -1822,6 +1824,7 @@
</span><span class="cx">                                 290A9BB51735DE8A00D71BBC /* CloseNewWindowInNavigationPolicyDelegate.mm */,
</span><span class="cx">                                 A1146A8A1D2D704F000FE710 /* ContentFiltering.mm */,
</span><span class="cx">                                 5142B2701517C88B00C32B19 /* ContextMenuCanCopyURL.mm */,
</span><ins>+                                37FB72951DB2E82F00E41BE4 /* ContextMenuDefaultItemsHaveTags.mm */,
</ins><span class="cx">                                 3776BC62150946BC0043A66D /* DeviceScaleFactorInDashboardRegions.mm */,
</span><span class="cx">                                 939BA91614103412001A01BD /* DeviceScaleFactorOnBack.mm */,
</span><span class="cx">                                 37E1064A1697676400B78BD0 /* DOMHTMLTableCellCellAbove.mm */,
</span><span class="lines">@@ -2237,6 +2240,7 @@
</span><span class="cx">                                 7CCE7EE81A411AE600447C4C /* CookieManager.cpp in Sources */,
</span><span class="cx">                                 7CCE7EAC1A411A3400447C4C /* Counters.cpp in Sources */,
</span><span class="cx">                                 2D1C04A71D76298B000A6816 /* TestNavigationDelegate.mm in Sources */,
</span><ins>+                                37FB72971DB2E82F00E41BE4 /* ContextMenuDefaultItemsHaveTags.mm in Sources */,
</ins><span class="cx">                                 7CCE7EDB1A411A9200447C4C /* CSSParser.cpp in Sources */,
</span><span class="cx">                                 7C83E0401D0A63E300FEBCF3 /* FirstResponderScrollingPosition.mm in Sources */,
</span><span class="cx">                                 7C83E0521D0A641800FEBCF3 /* SharedBuffer.cpp in Sources */,
</span></span></pre></div>
<a id="branchessafari602branchToolsTestWebKitAPITestsmacContextMenuDefaultItemsHaveTagsmm"></a>
<div class="addfile"><h4>Added: branches/safari-602-branch/Tools/TestWebKitAPI/Tests/mac/ContextMenuDefaultItemsHaveTags.mm (0 => 207612)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/Tools/TestWebKitAPI/Tests/mac/ContextMenuDefaultItemsHaveTags.mm                                (rev 0)
+++ branches/safari-602-branch/Tools/TestWebKitAPI/Tests/mac/ContextMenuDefaultItemsHaveTags.mm        2016-10-20 11:12:25 UTC (rev 207612)
</span><span class="lines">@@ -0,0 +1,73 @@
</span><ins>+/*
+ * Copyright (C) 2016 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.
+ */
+
+#import &quot;config.h&quot;
+
+#import &quot;PlatformUtilities.h&quot;
+#import &quot;PlatformWebView.h&quot;
+#import &lt;Carbon/Carbon.h&gt;
+#import &lt;wtf/RetainPtr.h&gt;
+
+@interface ContextMenuDefaultItemsHaveTagsDelegate : NSObject &lt;WebFrameLoadDelegate&gt;
+@end
+
+static bool didFinishLoad;
+
+@implementation ContextMenuDefaultItemsHaveTagsDelegate
+
+- (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame
+{
+    didFinishLoad = true;
+}
+
+@end
+
+namespace TestWebKitAPI {
+
+TEST(WebKit1, ContextMenuDefaultItemsHaveTags)
+{
+    RetainPtr&lt;WebView&gt; webView = adoptNS([[WebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) frameName:nil groupName:nil]);
+    RetainPtr&lt;NSWindow&gt; window = adoptNS([[NSWindow alloc] initWithContentRect:NSMakeRect(100, 100, 800, 600) styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES]);
+    RetainPtr&lt;ContextMenuDefaultItemsHaveTagsDelegate&gt; delegate = adoptNS([[ContextMenuDefaultItemsHaveTagsDelegate alloc] init]);
+
+    [window.get().contentView addSubview:webView.get()];
+    webView.get().frameLoadDelegate = delegate.get();
+
+    [webView.get().mainFrame loadHTMLString:@&quot;&lt;body contenteditable&gt;&quot; baseURL:nil];
+
+    Util::run(&amp;didFinishLoad);
+
+    NSEvent *event = [NSEvent mouseEventWithType:NSRightMouseDown location:NSMakePoint(400, 300) modifierFlags:0 timestamp:[NSDate timeIntervalSinceReferenceDate]
+        windowNumber:[window windowNumber] context:[NSGraphicsContext currentContext] eventNumber:0 clickCount:0 pressure:0];
+    NSView *subView = [webView hitTest:[event locationInWindow]];
+    NSMenu *menu = [subView menuForEvent:event];
+
+    for (NSMenuItem *item in menu.itemArray) {
+        if (!item.isSeparatorItem)
+            EXPECT_NE(0, item.tag);
+    }
+}
+
+} // namespace TestWebKitAPI
</ins></span></pre>
</div>
</div>

</body>
</html>