Bug 213086
| Summary: | DragState::type should be Optional<DragSourceAction> instead of OptionSet<DragSourceAction> | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | David Kilzer (:ddkilzer) <ddkilzer> |
| Component: | DOM | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | ahmad.saleem792, darin, thorton, wenson_hsieh |
| Priority: | P2 | ||
| Version: | Other | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Bug Depends on: | 212885 | ||
| Bug Blocks: | |||
David Kilzer (:ddkilzer)
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 | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
David Kilzer (:ddkilzer)
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<>.
Ahmad Saleem
Still have this - https://searchfox.org/wubkat/rev/c7ee831c38599255e3ae78a2b28b71968615107f/Source/WebCore/page/DragState.h#38