Title: [245451] releases/WebKitGTK/webkit-2.24/Source/WebKit
- Revision
- 245451
- Author
- [email protected]
- Date
- 2019-05-17 04:25:06 -0700 (Fri, 17 May 2019)
Log Message
Merge r245196 - Streamline test-and-clear operation for ContextMenu
https://bugs.webkit.org/show_bug.cgi?id=197795
<rdar://problem/50473746>
Reviewed by Wenson Hsieh.
Rather than performing a check when entering the function, doing work,
then clearing the member variable, perform the check and clear in
a single operation. Only perform the selection if the menu exists.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didSelectItemFromActiveContextMenu):
Modified Paths
Diff
Modified: releases/WebKitGTK/webkit-2.24/Source/WebKit/ChangeLog (245450 => 245451)
--- releases/WebKitGTK/webkit-2.24/Source/WebKit/ChangeLog 2019-05-17 11:25:03 UTC (rev 245450)
+++ releases/WebKitGTK/webkit-2.24/Source/WebKit/ChangeLog 2019-05-17 11:25:06 UTC (rev 245451)
@@ -1,3 +1,18 @@
+2019-05-10 Brent Fulgham <[email protected]>
+
+ Streamline test-and-clear operation for ContextMenu
+ https://bugs.webkit.org/show_bug.cgi?id=197795
+ <rdar://problem/50473746>
+
+ Reviewed by Wenson Hsieh.
+
+ Rather than performing a check when entering the function, doing work,
+ then clearing the member variable, perform the check and clear in
+ a single operation. Only perform the selection if the menu exists.
+
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::didSelectItemFromActiveContextMenu):
+
2019-04-03 Myles C. Maxfield <[email protected]>
-apple-trailing-word is needed for browser detection
Modified: releases/WebKitGTK/webkit-2.24/Source/WebKit/WebProcess/WebPage/WebPage.cpp (245450 => 245451)
--- releases/WebKitGTK/webkit-2.24/Source/WebKit/WebProcess/WebPage/WebPage.cpp 2019-05-17 11:25:03 UTC (rev 245450)
+++ releases/WebKitGTK/webkit-2.24/Source/WebKit/WebProcess/WebPage/WebPage.cpp 2019-05-17 11:25:06 UTC (rev 245451)
@@ -4136,11 +4136,8 @@
#if ENABLE(CONTEXT_MENUS)
void WebPage::didSelectItemFromActiveContextMenu(const WebContextMenuItemData& item)
{
- if (!m_contextMenu)
- return;
-
- m_contextMenu->itemSelected(item);
- m_contextMenu = nullptr;
+ if (auto contextMenu = std::exchange(m_contextMenu, nullptr))
+ contextMenu->itemSelected(item);
}
#endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes