WebKit Bugzilla
Attachment 348425 Details for
Bug 189095
: Followup (r235427): Use the null string instead of std::nullopt when no suggestion is selected
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-189095-20180829132235.patch (text/plain), 2.64 KB, created by
Aditya Keerthi
on 2018-08-29 13:22:35 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Aditya Keerthi
Created:
2018-08-29 13:22:35 PDT
Size:
2.64 KB
patch
obsolete
>Subversion Revision: 235471 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index bf2a8bae103d8cb01315ad1a7889a54e455e8a61..242183f0e5dba63e47345dd48124f2e018900889 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,21 @@ >+2018-08-29 Aditya Keerthi <akeerthi@apple.com> >+ >+ Followup (r235427): Use the null string instead of std::nullopt when no suggestion is selected >+ https://bugs.webkit.org/show_bug.cgi?id=189095 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Followup to r235427 as per Darin's comment. >+ >+ We can avoid unnecessary use of std::optional by taking advantage of the fact that >+ WTF::String already has a null value distinct from the empty value. >+ >+ No change in behavior. >+ >+ * UIProcess/mac/WebDataListSuggestionsDropdownMac.mm: >+ (WebKit::WebDataListSuggestionsDropdownMac::selectOption): >+ (-[WKDataListSuggestionsView currentSelectedString]): >+ > 2018-08-28 Don Olmstead <don.olmstead@sony.com> > > [CMake] Use CMake's FindFreetype >diff --git a/Source/WebKit/UIProcess/mac/WebDataListSuggestionsDropdownMac.mm b/Source/WebKit/UIProcess/mac/WebDataListSuggestionsDropdownMac.mm >index 31481d0dad5938778245580a9b846f160781d057..4e8619101bae9ee54b1384a5b045020fca84093c 100644 >--- a/Source/WebKit/UIProcess/mac/WebDataListSuggestionsDropdownMac.mm >+++ b/Source/WebKit/UIProcess/mac/WebDataListSuggestionsDropdownMac.mm >@@ -77,7 +77,7 @@ static NSString * const suggestionCellReuseIdentifier = @"WKDataListSuggestionCe > - (void)moveSelectionByDirection:(const String&)direction; > - (void)invalidate; > >-- (std::optional<String>)currentSelectedString; >+- (String)currentSelectedString; > @end > > namespace WebKit { >@@ -120,9 +120,9 @@ void WebDataListSuggestionsDropdownMac::selectOption() > if (!m_client) > return; > >- std::optional<String> selectedOption = [m_dropdownUI currentSelectedString]; >- if (selectedOption) >- m_client->didSelectOption(selectedOption.value()); >+ String selectedOption = [m_dropdownUI currentSelectedString]; >+ if (!selectedOption.isNull()) >+ m_client->didSelectOption(selectedOption); > > close(); > } >@@ -329,13 +329,13 @@ void WebDataListSuggestionsDropdownMac::close() > return self; > } > >-- (std::optional<String>)currentSelectedString >+- (String)currentSelectedString > { > std::optional<size_t> selectedRow = [_table currentActiveRow]; > if (selectedRow && selectedRow.value() < _suggestions.size()) > return _suggestions.at(selectedRow.value()); > >- return std::nullopt; >+ return String(); > } > > - (void)updateWithInformation:(WebCore::DataListSuggestionInformation&&)information
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 189095
: 348425