WebKit Bugzilla
Attachment 346093 Details for
Bug 188174
: [WinCairo] Search terms are not saved for <input type="search">
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-188174-20180730132759.patch (text/plain), 3.38 KB, created by
Stephan Szabo
on 2018-07-30 13:28:00 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Stephan Szabo
Created:
2018-07-30 13:28:00 PDT
Size:
3.38 KB
patch
obsolete
>Subversion Revision: 234370 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 3dafd0ac45297bd16a95c9c7b7c70fbc33d0187b..5c7d11ba2d99e48bc94ae4e84e94a55db882923f 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,15 @@ >+2018-07-30 Stephan Szabo <stephan.szabo@sony.com> >+ >+ [WinCairo] Search terms are not saved for <input type="search"> >+ https://bugs.webkit.org/show_bug.cgi?id=188174 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * UIProcess/win/WebPageProxyWin.cpp: >+ (WebKit::autosaveKey): Get preference key for search list with given name >+ (WebKit::WebPageProxy::saveRecentSearches): Save search list to cf preferences >+ (WebKit::WebPageProxy::loadRecentSearches): Load search list to cf preferences >+ > 2018-07-30 Chris Dumez <cdumez@apple.com> > > Potential null dereference under WebPage::applicationDidBecomeActive() >diff --git a/Source/WebKit/UIProcess/win/WebPageProxyWin.cpp b/Source/WebKit/UIProcess/win/WebPageProxyWin.cpp >index c7483531f452e741ce6de4a60fa87b987c135fde..c90f6f0d1b585d3eebd40eebe9ebf13a576c8327 100644 >--- a/Source/WebKit/UIProcess/win/WebPageProxyWin.cpp >+++ b/Source/WebKit/UIProcess/win/WebPageProxyWin.cpp >@@ -42,14 +42,54 @@ String WebPageProxy::standardUserAgent(const String& applicationNameForUserAgent > return WebCore::standardUserAgent(applicationNameForUserAgent); > } > >-void WebPageProxy::saveRecentSearches(const String&, const Vector<WebCore::RecentSearch>&) >+#if USE(CF) >+static RetainPtr<CFStringRef> autosaveKey(const String& name) > { >- notImplemented(); >+ return String("com.apple.WebKit.searchField:" + name).createCFString(); > } >+#endif > >-void WebPageProxy::loadRecentSearches(const String&, Vector<WebCore::RecentSearch>&) >+void WebPageProxy::saveRecentSearches(const String& name, const Vector<WebCore::RecentSearch>& searchItems) > { >- notImplemented(); >+ if (!name) >+ return; >+ >+#if USE(CF) >+ RetainPtr<CFMutableArrayRef> items; >+ >+ size_t size = searchItems.size(); >+ if (size) { >+ items = adoptCF(CFArrayCreateMutable(0, size, &kCFTypeArrayCallBacks)); >+ for (size_t i = 0; i < size; ++i) >+ CFArrayAppendValue(items.get(), searchItems[i].string.createCFString().get()); >+ } >+ >+ CFPreferencesSetAppValue(autosaveKey(name).get(), items.get(), kCFPreferencesCurrentApplication); >+ CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication); >+#endif >+} >+ >+void WebPageProxy::loadRecentSearches(const String& name, Vector<WebCore::RecentSearch>& searchItems) >+{ >+ if (!name) >+ return; >+ >+#if USE(CF) >+ searchItems.clear(); >+ RetainPtr<CFArrayRef> items = adoptCF(reinterpret_cast<CFArrayRef>(CFPreferencesCopyAppValue(autosaveKey(name).get(), kCFPreferencesCurrentApplication))); >+ >+ if (!items || CFGetTypeID(items.get()) != CFArrayGetTypeID()) >+ return; >+ >+ size_t size = CFArrayGetCount(items.get()); >+ for (size_t i = 0; i < size; ++i) { >+ CFStringRef item = (CFStringRef)CFArrayGetValueAtIndex(items.get(), i); >+ if (CFGetTypeID(item) == CFStringGetTypeID()) { >+ // We are choosing not to use or store search times on Windows at this time, so for now it's OK to use a "distant past" time as a placeholder. >+ searchItems.append({ String { item }, -WallTime::infinity() }); >+ } >+ } >+#endif > } > > void WebPageProxy::editorStateChanged(const EditorState& editorState)
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 188174
:
346093
|
346178
|
346220
|
346656
|
352094
|
352625
|
352626
|
352627
|
352647
|
352735
|
352810