Bug 212051 - Replace TextIndicatorOptions with OptionSet<TextIndicatorOption>
Summary: Replace TextIndicatorOptions with OptionSet<TextIndicatorOption>
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: David Kilzer (:ddkilzer)
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-05-18 15:41 PDT by David Kilzer (:ddkilzer)
Modified: 2020-05-18 21:59 PDT (History)
12 users (show)

See Also:


Attachments
Patch v1 (45.78 KB, patch)
2020-05-18 17:22 PDT, David Kilzer (:ddkilzer)
no flags Details | Formatted Diff | Diff
Patch v2 (45.79 KB, patch)
2020-05-18 18:46 PDT, David Kilzer (:ddkilzer)
simon.fraser: review+
Details | Formatted Diff | Diff
Patch for landing (47.26 KB, patch)
2020-05-18 20:17 PDT, David Kilzer (:ddkilzer)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Kilzer (:ddkilzer) 2020-05-18 15:41:39 PDT
Replace TextIndicatorOptions with OptionSet<TextIndicatorOption>.

Also change enum TextIndicatorOption to an enum class while we're here.
Comment 1 Radar WebKit Bug Importer 2020-05-18 16:43:01 PDT
<rdar://problem/63368556>
Comment 2 David Kilzer (:ddkilzer) 2020-05-18 17:22:46 PDT
Created attachment 399686 [details]
Patch v1
Comment 3 David Kilzer (:ddkilzer) 2020-05-18 17:24:44 PDT
Style bot complains about using "{ ... }" in an Objectve-C argument list:

ERROR: Source/WebKitLegacy/mac/WebView/WebImmediateActionController.mm:565:  Missing space before {  [whitespace/braces] [5]
ERROR: Source/WebKitLegacy/mac/WebView/WebHTMLView.mm:5908:  Missing space before {  [whitespace/braces] [5]
Comment 4 David Kilzer (:ddkilzer) 2020-05-18 17:39:28 PDT
Comment on attachment 399686 [details]
Patch v1

Oops!  Need to compile for iOS, too.
Comment 5 David Kilzer (:ddkilzer) 2020-05-18 18:46:37 PDT
Created attachment 399694 [details]
Patch v2
Comment 6 Simon Fraser (smfr) 2020-05-18 19:50:40 PDT
Comment on attachment 399694 [details]
Patch v2

View in context: https://bugs.webkit.org/attachment.cgi?id=399694&action=review

> Source/WebCore/platform/ios/DragImageIOS.mm:148
> +    constexpr OptionSet<TextIndicatorOption> defaultLinkIndicatorOptions { TextIndicatorOption::TightlyFitContent, TextIndicatorOption::RespectTextColor, TextIndicatorOption::UseBoundingRectAndPaintAllContentForComplexRanges, TextIndicatorOption::ExpandClipBeyondVisibleRect, TextIndicatorOption::ComputeEstimatedBackgroundColor };

Maybe put these one per line.

> Source/WebCore/platform/ios/DragImageIOS.mm:168
> +constexpr OptionSet<TextIndicatorOption> defaultSelectionDragImageTextIndicatorOptions { TextIndicatorOption::ExpandClipBeyondVisibleRect, TextIndicatorOption::PaintAllContent, TextIndicatorOption::UseSelectionRectForSizing, TextIndicatorOption::ComputeEstimatedBackgroundColor };

Ditto

> Source/WebCore/testing/Internals.h:966
> +        OptionSet<WebCore::TextIndicatorOption> core()

core() is a really weird name.

> Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:1010
> +    constexpr OptionSet<TextIndicatorOption> defaultTextIndicatorOptionsForEditDrag { TextIndicatorOption::IncludeSnapshotOfAllVisibleContentWithoutSelection, TextIndicatorOption::ExpandClipBeyondVisibleRect, TextIndicatorOption::PaintAllContent, TextIndicatorOption::IncludeMarginIfRangeMatchesSelection, TextIndicatorOption::PaintBackgrounds, TextIndicatorOption::ComputeEstimatedBackgroundColor, TextIndicatorOption::UseSelectionRectForSizing, TextIndicatorOption::IncludeSnapshotWithSelectionHighlight };

One per line

> Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:2607
> +        { TextIndicatorOption::TightlyFitContent, TextIndicatorOption::RespectTextColor, TextIndicatorOption::PaintBackgrounds, TextIndicatorOption::UseBoundingRectAndPaintAllContentForComplexRanges, TextIndicatorOption::IncludeMarginIfRangeMatchesSelection, TextIndicatorOption::ComputeEstimatedBackgroundColor },

One per line

> Source/WebKitLegacy/mac/DOM/DOM.mm:526
> +    constexpr OptionSet<TextIndicatorOption> options { TextIndicatorOption::TightlyFitContent, TextIndicatorOption::RespectTextColor, TextIndicatorOption::PaintBackgrounds, TextIndicatorOption::UseBoundingRectAndPaintAllContentForComplexRanges, TextIndicatorOption::IncludeMarginIfRangeMatchesSelection };

One per line

> Source/WebKitLegacy/mac/WebView/WebView.mm:1964
> +    constexpr OptionSet<WebCore::TextIndicatorOption> defaultEditDragTextIndicatorOptions { WebCore::TextIndicatorOption::IncludeSnapshotOfAllVisibleContentWithoutSelection, WebCore::TextIndicatorOption::ExpandClipBeyondVisibleRect, WebCore::TextIndicatorOption::PaintAllContent, WebCore::TextIndicatorOption::IncludeMarginIfRangeMatchesSelection, WebCore::TextIndicatorOption::PaintBackgrounds, WebCore::TextIndicatorOption::UseSelectionRectForSizing, WebCore::TextIndicatorOption::IncludeSnapshotWithSelectionHighlight, WebCore::TextIndicatorOption::RespectTextColor };

One per line
Comment 7 David Kilzer (:ddkilzer) 2020-05-18 20:01:54 PDT
Comment on attachment 399694 [details]
Patch v2

View in context: https://bugs.webkit.org/attachment.cgi?id=399694&action=review

Will make the other multi-line changes as well before landing.

>> Source/WebCore/testing/Internals.h:966
>> +        OptionSet<WebCore::TextIndicatorOption> core()
> 
> core() is a really weird name.

Changed to coreOptions().
Comment 8 David Kilzer (:ddkilzer) 2020-05-18 20:17:26 PDT
Created attachment 399703 [details]
Patch for landing
Comment 9 EWS 2020-05-18 21:59:20 PDT
Committed r261848: <https://trac.webkit.org/changeset/261848>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 399703 [details].