RESOLVED FIXED162326
PlatformEvent::m_modifiers should be an OptionSet
https://bugs.webkit.org/show_bug.cgi?id=162326
Summary PlatformEvent::m_modifiers should be an OptionSet
Anders Carlsson
Reported 2016-09-20 16:52:15 PDT
PlatformEvent::m_modifiers should be an OptionSet
Attachments
Patch (19.10 KB, patch)
2016-09-20 16:54 PDT, Anders Carlsson
no flags
Patch (27.97 KB, patch)
2016-09-22 13:27 PDT, Anders Carlsson
no flags
Patch (28.08 KB, patch)
2016-09-22 14:01 PDT, Anders Carlsson
dbates: review+
Anders Carlsson
Comment 1 2016-09-20 16:54:18 PDT
Anders Carlsson
Comment 2 2016-09-22 13:27:11 PDT
Anders Carlsson
Comment 3 2016-09-22 14:01:12 PDT
Daniel Bates
Comment 4 2016-09-22 14:22:28 PDT
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.
Anders Carlsson
Comment 5 2016-09-27 12:10:56 PDT
Radar WebKit Bug Importer
Comment 6 2017-04-21 09:45:54 PDT
Alex Christensen
Comment 7 2017-04-25 16:37:55 PDT
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
Note You need to log in before you can comment on or make changes to this bug.