PlatformEvent::m_modifiers should be an OptionSet
Created attachment 289410 [details] Patch
Created attachment 289590 [details] Patch
Created attachment 289593 [details] Patch
Comment on attachment 289593 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=289593&action=review > Source/WTF/wtf/OptionSet.h:116 > + constexpr friend bool operator!=(OptionSet lhs, OptionSet rhs) > + { > + return lhs.m_storage != rhs.m_storage; > + } > + Although the implementation of this function is trivial, I suggest that we add a test for it to file Tools/TestWebKitAPI/Tests/WTF/OptionSet.cpp. > Source/WTF/wtf/OptionSet.h:128 > + constexpr friend OptionSet operator-(OptionSet lhs, OptionSet rhs) > + { > + return OptionSet::fromRaw(lhs.m_storage & ~rhs.m_storage); > + } > + Ditto. > Source/WebCore/page/EventHandler.cpp:2974 > + ASSERT(!(accessKeyModifiers().contains(PlatformEvent::Modifier::ShiftKey))); The inner parentheses are not needed. I suggest that we remove them. > Source/WebKit2/Shared/WebEventConversion.cpp:316 > + m_modifiers |= PlatformEvent::Modifier::ShiftKey; Can we remove PlatformEvent::? > Source/WebKit2/Shared/WebEventConversion.cpp:318 > + m_modifiers |= PlatformEvent::Modifier::CtrlKey; Ditto. > Source/WebKit2/Shared/WebEventConversion.cpp:320 > + m_modifiers |= PlatformEvent::Modifier::AltKey; Ditto. > Source/WebKit2/Shared/WebEventConversion.cpp:322 > + m_modifiers |= PlatformEvent::Modifier::MetaKey; Ditto.
Committed r206450: <http://trac.webkit.org/changeset/206450>
<rdar://problem/31759503>
Comment on attachment 289593 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=289593&action=review > Source/WebKit2/Shared/WebEventConversion.cpp:-117 > - m_modifierFlags = 0; > - if (webEvent.shiftKey()) > - m_modifierFlags |= WebEvent::ShiftKey; > - if (webEvent.controlKey()) > - m_modifierFlags |= WebEvent::ControlKey; > - if (webEvent.altKey()) > - m_modifierFlags |= WebEvent::AltKey; > - if (webEvent.metaKey()) > - m_modifierFlags |= WebEvent::MetaKey; Removing this with no replacement was a regression fixed in https://bugs.webkit.org/show_bug.cgi?id=171297