Changeset 242749 in webkit
- Timestamp:
- Mar 11, 2019, 3:46:32 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/events/contextmenu-reentrancy-crash-expected.txt (added)
-
LayoutTests/fast/events/contextmenu-reentrancy-crash.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/page/ContextMenuController.cpp (modified) (2 diffs)
-
Source/WebCore/page/ContextMenuController.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r242744 r242749 1 2019-03-11 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 [macOS] Dispatching reentrant "contextmenu" events may cause crashes 4 https://bugs.webkit.org/show_bug.cgi?id=195571 5 <rdar://problem/48086046> 6 7 Reviewed by Andy Estes. 8 9 Add a test to verify that triggering reentrant "contextmenu" events from script does not cause a crash. 10 11 * fast/events/contextmenu-reentrancy-crash-expected.txt: Added. 12 * fast/events/contextmenu-reentrancy-crash.html: Added. 13 1 14 2019-03-11 Truitt Savell <tsavell@apple.com> 2 15 -
trunk/Source/WebCore/ChangeLog
r242748 r242749 1 2019-03-11 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 [macOS] Dispatching reentrant "contextmenu" events may cause crashes 4 https://bugs.webkit.org/show_bug.cgi?id=195571 5 <rdar://problem/48086046> 6 7 Reviewed by Andy Estes. 8 9 Make ContextMenuController::handleContextMenuEvent robust against reentrancy by guarding it with a boolean flag. 10 As demonstrated in the test case, it is currently possible to force WebKit into a bad state by dispatching a 11 synthetic "contextmenu" event from within the scope of one of the "before(copy|cut|paste)" events triggered as 12 a result of handling a context menu event. 13 14 Test: fast/events/contextmenu-reentrancy-crash.html 15 16 * page/ContextMenuController.cpp: 17 (WebCore::ContextMenuController::handleContextMenuEvent): 18 * page/ContextMenuController.h: 19 1 20 2019-03-11 Andy Estes <aestes@apple.com> 2 21 -
trunk/Source/WebCore/page/ContextMenuController.cpp
r240641 r242749 69 69 #include "WindowFeatures.h" 70 70 #include "markup.h" 71 #include <wtf/SetForScope.h> 71 72 #include <wtf/WallTime.h> 72 73 #include <wtf/unicode/CharacterNames.h> … … 98 99 void ContextMenuController::handleContextMenuEvent(Event& event) 99 100 { 101 if (m_isHandlingContextMenuEvent) 102 return; 103 104 SetForScope<bool> isHandlingContextMenuEventForScope(m_isHandlingContextMenuEvent, true); 105 100 106 m_contextMenu = maybeCreateContextMenu(event); 101 107 if (!m_contextMenu) -
trunk/Source/WebCore/page/ContextMenuController.h
r211033 r242749 94 94 RefPtr<ContextMenuProvider> m_menuProvider; 95 95 ContextMenuContext m_context; 96 bool m_isHandlingContextMenuEvent { false }; 96 97 }; 97 98
Note:
See TracChangeset
for help on using the changeset viewer.