NEW 213086
DragState::type should be Optional<DragSourceAction> instead of OptionSet<DragSourceAction>
https://bugs.webkit.org/show_bug.cgi?id=213086
Summary DragState::type should be Optional<DragSourceAction> instead of OptionSet<Dra...
David Kilzer (:ddkilzer)
Reported 2020-06-11 11:20:50 PDT
Per Darin's feedback in Bug 212885 Comment #12, DragState::type should be Optional<DragSourceAction> instead of OptionSet<DragSourceAction>. ''' Refactoring this to be explicitly "OptionSet" when before it was not explicit is making the confusion worse, so I think we need to straighten this out first. I guess there is some code can set the type to more than one thing. But this seems disorganized and messy. I think it’s not really a general set. It’s just one type plus possibly "selection". Seems really messy. I suppose you aren’t making it worse, but all this "hasExactlyOneBitSet" stuff is just what happens when we make the data structure too confusing. Clearly the "selection" is an independent flag, and need not be included in an option set. '''
Attachments
David Kilzer (:ddkilzer)
Comment 1 2020-06-11 11:37:02 PDT
Note that when DragState::type is changed from OptionSet<> to Optional<>, then WTF::Optional<>::hasExactlyOneBitSet() and WTF::Optional<>::toSingleValue() may also be removed. The need for both of these methods are also indicative of the need to change DragState::type to Optional<>.
Note You need to log in before you can comment on or make changes to this bug.