Changeset 233866 in webkit
- Timestamp:
- Jul 16, 2018 2:15:57 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 5 added
- 25 edited
- 3 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r233865 r233866 1 2018-07-16 Aditya Keerthi <akeerthi@apple.com> 2 3 [Datalist][macOS] Add suggestions UI for TextFieldInputTypes 4 https://bugs.webkit.org/show_bug.cgi?id=186531 5 6 Reviewed by Tim Horton. 7 8 Added tests to verify that the suggestions are correctly shown and hidden, and that 9 suggestions can be selected and inserted into an input field. 10 11 * fast/forms/datalist/datalist-show-hide-expected.txt: Added. 12 * fast/forms/datalist/datalist-show-hide.html: Added. 13 * fast/forms/datalist/datalist-textinput-keydown-expected.txt: Added. 14 * fast/forms/datalist/datalist-textinput-keydown.html: Added. 15 * platform/ios/TestExpectations: 16 * resources/ui-helper.js: 17 (window.UIHelper.isShowingDataListSuggestions): 18 1 19 2018-07-16 Jeremy Jones <jeremyj@apple.com> 2 20 -
trunk/LayoutTests/platform/ios/TestExpectations
r233447 r233866 3330 3330 fast/block/block-only/margin-sibling-collapse-propagated.html [ Failure ] 3331 3331 fast/block/block-only/relative-auto-with-parent-offset.html [ Failure ] 3332 3333 # Datalist 3334 webkit.org/b/186714 fast/forms/datalist/datalist-show-hide.html [ Skip ] 3335 webkit.org/b/186714 fast/forms/datalist/datalist-textinput-keydown.html [ Skip ] -
trunk/LayoutTests/resources/ui-helper.js
r232968 r233866 230 230 } 231 231 232 static isShowingDataListSuggestions() 233 { 234 return new Promise(resolve => { 235 testRunner.runUIScript(`(() => { 236 uiController.uiScriptComplete(uiController.isShowingDataListSuggestions); 237 })()`, resolve); 238 }); 239 } 240 232 241 static zoomScale() 233 242 { -
trunk/Source/WebCore/ChangeLog
r233865 r233866 1 2018-07-16 Aditya Keerthi <akeerthi@apple.com> 2 3 [Datalist][macOS] Add suggestions UI for TextFieldInputTypes 4 https://bugs.webkit.org/show_bug.cgi?id=186531 5 6 Reviewed by Tim Horton. 7 8 Tests: fast/forms/datalist/datalist-show-hide.html 9 fast/forms/datalist/datalist-textinput-keydown.html 10 11 * html/TextFieldInputType.cpp: 12 (WebCore::TextFieldInputType::handleKeydownEvent): 13 (WebCore::TextFieldInputType::handleKeydownEventForSpinButton): The suggestions view takes precedence when handling arrow key events. 14 1 15 2018-07-16 Jeremy Jones <jeremyj@apple.com> 2 16 -
trunk/Source/WebCore/html/TextFieldInputType.cpp
r233578 r233866 185 185 #if ENABLE(DATALIST_ELEMENT) 186 186 const String& key = event.keyIdentifier(); 187 if (m_suggestionPicker && (key == "Enter" || key == "Up" || key == "Down")) 187 if (m_suggestionPicker && (key == "Enter" || key == "Up" || key == "Down")) { 188 188 m_suggestionPicker->handleKeydownWithIdentifier(key); 189 event.setDefaultHandled(); 190 } 189 191 #endif 190 192 RefPtr<Frame> frame = element()->document().frame(); … … 199 201 if (element()->isDisabledOrReadOnly()) 200 202 return; 203 #if ENABLE(DATALIST_ELEMENT) 204 if (m_suggestionPicker) 205 return; 206 #endif 201 207 const String& key = event.keyIdentifier(); 202 208 if (key == "Up") -
trunk/Source/WebKit/ChangeLog
r233865 r233866 1 2018-07-16 Aditya Keerthi <akeerthi@apple.com> 2 3 [Datalist][macOS] Add suggestions UI for TextFieldInputTypes 4 https://bugs.webkit.org/show_bug.cgi?id=186531 5 6 Reviewed by Tim Horton. 7 8 Created WebDataListSuggestionsDropdownMac as a wrapper around the suggestions 9 view. The suggestions for TextFieldInputTypes are displayed using an NSTableView 10 in it's own child window. This is done so that suggestions can be presented 11 outside of the page if the parent window's size is too small. The maximum number 12 of suggestions that are visible at one time is 6, with additional suggestions made 13 available by scrolling. 14 15 Suggestions in the view can be selected via click or by using arrow keys. If the 16 input element associated with the suggestions is blurred, or the page is moved in 17 any way, the suggestions view is hidden. 18 19 Added IPC messages to the UIProcess to enable the display of the suggestions view. 20 This required a new ArgumentCoder for DataListSuggestionInformation. 21 22 * Shared/WebCoreArgumentCoders.cpp: 23 (IPC::ArgumentCoder<DataListSuggestionInformation>::encode): 24 (IPC::ArgumentCoder<DataListSuggestionInformation>::decode): 25 * Shared/WebCoreArgumentCoders.h: 26 * UIProcess/PageClient.h: 27 * UIProcess/WebDataListSuggestionsDropdown.cpp: Copied from Source/WebKit/WebProcess/WebCoreSupport/WebDataListSuggestionPicker.h. 28 (WebKit::WebDataListSuggestionsDropdown::WebDataListSuggestionsDropdown): 29 (WebKit::WebDataListSuggestionsDropdown::~WebDataListSuggestionsDropdown): 30 (WebKit::WebDataListSuggestionsDropdown::close): 31 * UIProcess/WebDataListSuggestionsDropdown.h: Copied from Source/WebKit/WebProcess/WebCoreSupport/WebDataListSuggestionPicker.h. 32 (WebKit::WebDataListSuggestionsDropdown::Client::~Client): 33 * UIProcess/WebPageProxy.cpp: 34 (WebKit::WebPageProxy::viewWillStartLiveResize): 35 (WebKit::WebPageProxy::viewDidLeaveWindow): 36 (WebKit::WebPageProxy::handleWheelEvent): 37 (WebKit::WebPageProxy::setPageZoomFactor): 38 (WebKit::WebPageProxy::setPageAndTextZoomFactors): 39 (WebKit::WebPageProxy::didStartProvisionalLoadForFrame): 40 (WebKit::WebPageProxy::pageDidScroll): 41 (WebKit::WebPageProxy::showDataListSuggestions): 42 (WebKit::WebPageProxy::handleKeydownInDataList): 43 (WebKit::WebPageProxy::endDataListSuggestions): 44 (WebKit::WebPageProxy::didCloseSuggestions): 45 (WebKit::WebPageProxy::didSelectOption): 46 (WebKit::WebPageProxy::resetState): 47 (WebKit::WebPageProxy::closeOverlayedViews): 48 * UIProcess/WebPageProxy.h: 49 * UIProcess/WebPageProxy.messages.in: 50 * UIProcess/ios/PageClientImplIOS.h: 51 * UIProcess/ios/PageClientImplIOS.mm: 52 (WebKit::PageClientImpl::createDataListSuggestionsDropdown): 53 * UIProcess/mac/PageClientImplMac.h: 54 * UIProcess/mac/PageClientImplMac.mm: 55 (WebKit::PageClientImpl::createDataListSuggestionsDropdown): 56 * UIProcess/mac/WebDataListSuggestionsDropdownMac.h: Copied from Source/WebKit/WebProcess/WebCoreSupport/WebDataListSuggestionPicker.h. 57 * UIProcess/mac/WebDataListSuggestionsDropdownMac.mm: Added. 58 (WebKit::WebDataListSuggestionsDropdownMac::create): 59 (WebKit::WebDataListSuggestionsDropdownMac::~WebDataListSuggestionsDropdownMac): 60 (WebKit::WebDataListSuggestionsDropdownMac::WebDataListSuggestionsDropdownMac): 61 (WebKit::WebDataListSuggestionsDropdownMac::show): 62 (WebKit::WebDataListSuggestionsDropdownMac::didSelectOption): 63 (WebKit::WebDataListSuggestionsDropdownMac::selectOption): 64 (WebKit::WebDataListSuggestionsDropdownMac::handleKeydownWithIdentifier): 65 (WebKit::WebDataListSuggestionsDropdownMac::close): 66 (-[WKDataListSuggestionCell initWithFrame:]): 67 (-[WKDataListSuggestionCell setText:]): 68 (-[WKDataListSuggestionCell setActive:]): 69 (-[WKDataListSuggestionCell drawRect:]): 70 (-[WKDataListSuggestionCell mouseEntered:]): 71 (-[WKDataListSuggestionCell mouseExited:]): 72 (-[WKDataListSuggestionCell acceptsFirstResponder]): 73 (-[WKDataListSuggestionTable initWithElementRect:]): 74 (-[WKDataListSuggestionTable setVisibleRect:]): 75 (-[WKDataListSuggestionTable currentActiveRow]): 76 (-[WKDataListSuggestionTable setActiveRow:]): 77 (-[WKDataListSuggestionTable reload]): 78 (-[WKDataListSuggestionTable acceptsFirstResponder]): 79 (-[WKDataListSuggestionTable enclosingScrollView]): 80 (-[WKDataListSuggestionTable removeFromSuperviewWithoutNeedingDisplay]): 81 (-[WKDataListSuggestionsView initWithInformation:inView:]): 82 (-[WKDataListSuggestionsView currentSelectedString]): 83 (-[WKDataListSuggestionsView updateWithInformation:]): 84 (-[WKDataListSuggestionsView moveSelectionByDirection:]): 85 (-[WKDataListSuggestionsView invalidate]): 86 (-[WKDataListSuggestionsView dropdownRectForElementRect:]): 87 (-[WKDataListSuggestionsView showSuggestionsDropdown:]): 88 (-[WKDataListSuggestionsView selectedRow:]): 89 (-[WKDataListSuggestionsView numberOfRowsInTableView:]): 90 (-[WKDataListSuggestionsView tableView:heightOfRow:]): 91 (-[WKDataListSuggestionsView tableView:viewForTableColumn:row:]): 92 * WebKit.xcodeproj/project.pbxproj: 93 * WebProcess/WebCoreSupport/WebDataListSuggestionPicker.cpp: 94 (WebKit::WebDataListSuggestionPicker::handleKeydownWithIdentifier): 95 (WebKit::WebDataListSuggestionPicker::didSelectOption): 96 (WebKit::WebDataListSuggestionPicker::didCloseSuggestions): 97 (WebKit::WebDataListSuggestionPicker::close): 98 (WebKit::WebDataListSuggestionPicker::displayWithActivationType): 99 * WebProcess/WebCoreSupport/WebDataListSuggestionPicker.h: 100 1 101 2018-07-16 Jeremy Jones <jeremyj@apple.com> 2 102 -
trunk/Source/WebKit/Shared/WebCoreArgumentCoders.cpp
r233753 r233866 37 37 #include <WebCore/Credential.h> 38 38 #include <WebCore/Cursor.h> 39 #include <WebCore/DataListSuggestionPicker.h> 39 40 #include <WebCore/DatabaseDetails.h> 40 41 #include <WebCore/DictationAlternative.h> … … 1632 1633 } 1633 1634 1635 #if ENABLE(DATALIST_ELEMENT) 1636 void ArgumentCoder<DataListSuggestionInformation>::encode(Encoder& encoder, const WebCore::DataListSuggestionInformation& info) 1637 { 1638 encoder.encodeEnum(info.activationType); 1639 encoder << info.suggestions; 1640 encoder << info.elementRect; 1641 } 1642 1643 bool ArgumentCoder<DataListSuggestionInformation>::decode(Decoder& decoder, WebCore::DataListSuggestionInformation& info) 1644 { 1645 if (!decoder.decodeEnum(info.activationType)) 1646 return false; 1647 1648 if (!decoder.decode(info.suggestions)) 1649 return false; 1650 1651 if (!decoder.decode(info.elementRect)) 1652 return false; 1653 1654 return true; 1655 } 1656 #endif 1657 1634 1658 void ArgumentCoder<PasteboardCustomData>::encode(Encoder& encoder, const PasteboardCustomData& data) 1635 1659 { -
trunk/Source/WebKit/Shared/WebCoreArgumentCoders.h
r233863 r233866 136 136 #endif 137 137 138 #if ENABLE(DATALIST_ELEMENT) 139 struct DataListSuggestionInformation; 140 #endif 141 138 142 #if USE(SOUP) 139 143 struct SoupNetworkProxySettings; … … 453 457 static bool decode(Decoder&, WebCore::DatabaseDetails&); 454 458 }; 459 460 #if ENABLE(DATALIST_ELEMENT) 461 template<> struct ArgumentCoder<WebCore::DataListSuggestionInformation> { 462 static void encode(Encoder&, const WebCore::DataListSuggestionInformation&); 463 static bool decode(Decoder&, WebCore::DataListSuggestionInformation&); 464 }; 465 #endif 455 466 456 467 template<> struct ArgumentCoder<WebCore::DictationAlternative> { -
trunk/Source/WebKit/UIProcess/PageClient.h
r232544 r233866 28 28 #include "ShareableBitmap.h" 29 29 #include "WebColorPicker.h" 30 #include "WebDataListSuggestionsDropdown.h" 30 31 #include "WebPageProxy.h" 31 32 #include "WebPopupMenuProxy.h" … … 80 81 #if ENABLE(INPUT_TYPE_COLOR) 81 82 class WebColorPicker; 83 #endif 84 85 #if ENABLE(DATALIST_ELEMENT) 86 class WebDataListSuggestionsDropdown; 82 87 #endif 83 88 … … 221 226 #if ENABLE(INPUT_TYPE_COLOR) 222 227 virtual RefPtr<WebColorPicker> createColorPicker(WebPageProxy*, const WebCore::Color& initialColor, const WebCore::IntRect&) = 0; 228 #endif 229 230 #if ENABLE(DATALIST_ELEMENT) 231 virtual RefPtr<WebDataListSuggestionsDropdown> createDataListSuggestionsDropdown(WebPageProxy&) = 0; 223 232 #endif 224 233 -
trunk/Source/WebKit/UIProcess/WebDataListSuggestionsDropdown.cpp
r233865 r233866 24 24 */ 25 25 26 #pragma once 26 #include "config.h" 27 #include "WebDataListSuggestionsDropdown.h" 27 28 28 29 #if ENABLE(DATALIST_ELEMENT) 29 30 30 #include <WebCore/DataListSuggestionPicker.h> 31 #include <wtf/text/WTFString.h> 31 namespace WebKit { 32 32 33 namespace WebCore { 34 class DataListSuggestionsClient; 33 WebDataListSuggestionsDropdown::WebDataListSuggestionsDropdown(Client& client) 34 : m_client(&client) 35 { 35 36 } 36 37 37 namespace WebKit { 38 WebDataListSuggestionsDropdown::~WebDataListSuggestionsDropdown() 39 { 40 } 38 41 39 class WebPage; 40 41 class WebDataListSuggestionPicker : public WebCore::DataListSuggestionPicker { 42 public: 43 WebDataListSuggestionPicker(WebPage*, WebCore::DataListSuggestionsClient*); 44 virtual ~WebDataListSuggestionPicker(); 45 46 void handleKeydownWithIdentifier(const String&) override; 47 void didSelectOption(const String&); 48 void didCloseSuggestions(); 49 void close() override; 50 void displayWithActivationType(WebCore::DataListSuggestionActivationType) override; 51 private: 52 __unused WebCore::DataListSuggestionsClient* m_dataListSuggestionsClient; 53 __unused WebPage* m_page; 54 }; 42 void WebDataListSuggestionsDropdown::close() 43 { 44 m_client->didCloseSuggestions(); 45 m_client = nullptr; 46 } 55 47 56 48 } // namespace WebKit 57 49 58 #endif 50 #endif // ENABLE(DATALIST_ELEMENT) -
trunk/Source/WebKit/UIProcess/WebDataListSuggestionsDropdown.h
r233865 r233866 29 29 30 30 #include <WebCore/DataListSuggestionPicker.h> 31 #include <wtf/text/WTFString.h> 32 33 namespace WebCore { 34 class DataListSuggestionsClient; 35 } 31 #include <wtf/RefCounted.h> 32 #include <wtf/RefPtr.h> 36 33 37 34 namespace WebKit { 38 35 39 class WebPage; 36 class WebDataListSuggestionsDropdown : public RefCounted<WebDataListSuggestionsDropdown> { 37 public: 38 class Client { 39 protected: 40 virtual ~Client() { } 40 41 41 class WebDataListSuggestionPicker : public WebCore::DataListSuggestionPicker { 42 public: 43 WebDataListSuggestionPicker(WebPage*, WebCore::DataListSuggestionsClient*);44 virtual ~WebDataListSuggestionPicker();42 public: 43 virtual void didSelectOption(String&) = 0; 44 virtual void didCloseSuggestions() = 0; 45 }; 45 46 46 void handleKeydownWithIdentifier(const String&) override; 47 void didSelectOption(const String&); 48 void didCloseSuggestions(); 49 void close() override; 50 void displayWithActivationType(WebCore::DataListSuggestionActivationType) override; 51 private: 52 __unused WebCore::DataListSuggestionsClient* m_dataListSuggestionsClient; 53 __unused WebPage* m_page; 47 virtual ~WebDataListSuggestionsDropdown(); 48 49 virtual void show(WebCore::DataListSuggestionInformation&&) = 0; 50 virtual void handleKeydownWithIdentifier(const String&) = 0; 51 virtual void close(); 52 53 protected: 54 explicit WebDataListSuggestionsDropdown(Client&); 55 56 Client* m_client; 54 57 }; 55 58 56 59 } // namespace WebKit 57 60 58 #endif 61 #endif // ENABLE(DATALIST_ELEMENT) -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r233865 r233866 1447 1447 if (!isValid()) 1448 1448 return; 1449 #if ENABLE(INPUT_TYPE_COLOR_POPOVER) && ENABLE(INPUT_TYPE_COLOR) 1450 if (m_colorPicker) 1451 endColorPicker(); 1452 #endif 1449 1450 closeOverlayedViews(); 1453 1451 m_process->send(Messages::WebPage::ViewWillStartLiveResize(), m_pageID); 1454 1452 } … … 1537 1535 void WebPageProxy::viewDidLeaveWindow() 1538 1536 { 1539 #if ENABLE(INPUT_TYPE_COLOR_POPOVER) && ENABLE(INPUT_TYPE_COLOR) 1540 // When leaving the current page, close the popover color well. 1541 if (m_colorPicker) 1542 endColorPicker(); 1543 #endif 1537 closeOverlayedViews(); 1544 1538 #if PLATFORM(IOS) && HAVE(AVKIT) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE)) 1545 1539 // When leaving the current page, close the video fullscreen. … … 2063 2057 return; 2064 2058 2065 hideValidationMessage();2059 closeOverlayedViews(); 2066 2060 2067 2061 if (!m_currentlyProcessedWheelEvents.isEmpty()) { … … 2693 2687 return; 2694 2688 2695 hideValidationMessage();2689 closeOverlayedViews(); 2696 2690 2697 2691 m_pageZoomFactor = zoomFactor; … … 2707 2701 return; 2708 2702 2709 hideValidationMessage();2703 closeOverlayedViews(); 2710 2704 2711 2705 m_pageZoomFactor = pageZoomFactor; … … 3465 3459 m_pageLoadState.didStartProvisionalLoad(transaction, url, unreachableURL); 3466 3460 m_pageClient.didStartProvisionalLoadForMainFrame(); 3467 hideValidationMessage();3461 closeOverlayedViews(); 3468 3462 } 3469 3463 … … 4556 4550 return; 4557 4551 #endif 4558 hideValidationMessage();4552 closeOverlayedViews(); 4559 4553 } 4560 4554 … … 4750 4744 m_process->send(Messages::WebPage::DidEndColorPicker(), m_pageID); 4751 4745 } 4746 #endif 4747 4748 #if ENABLE(DATALIST_ELEMENT) 4749 4750 void WebPageProxy::showDataListSuggestions(WebCore::DataListSuggestionInformation&& info) 4751 { 4752 if (!m_dataListSuggestionsDropdown) 4753 m_dataListSuggestionsDropdown = m_pageClient.createDataListSuggestionsDropdown(*this); 4754 4755 m_dataListSuggestionsDropdown->show(WTFMove(info)); 4756 } 4757 4758 void WebPageProxy::handleKeydownInDataList(const String& key) 4759 { 4760 if (!m_dataListSuggestionsDropdown) 4761 return; 4762 4763 m_dataListSuggestionsDropdown->handleKeydownWithIdentifier(key); 4764 } 4765 4766 void WebPageProxy::endDataListSuggestions() 4767 { 4768 if (m_dataListSuggestionsDropdown) 4769 m_dataListSuggestionsDropdown->close(); 4770 } 4771 4772 void WebPageProxy::didCloseSuggestions() 4773 { 4774 if (!m_dataListSuggestionsDropdown) 4775 return; 4776 4777 m_dataListSuggestionsDropdown = nullptr; 4778 m_process->send(Messages::WebPage::DidCloseSuggestions(), m_pageID); 4779 } 4780 4781 void WebPageProxy::didSelectOption(String& selectedOption) 4782 { 4783 if (!isValid()) 4784 return; 4785 4786 m_process->send(Messages::WebPage::DidSelectDataListOption(selectedOption), m_pageID); 4787 } 4788 4752 4789 #endif 4753 4790 … … 5978 6015 #endif 5979 6016 m_drawingArea = nullptr; 5980 hideValidationMessage();6017 closeOverlayedViews(); 5981 6018 5982 6019 if (m_inspector) { … … 7533 7570 #endif 7534 7571 } 7535 7572 7573 // FIXME: Consolidate with dismissContentRelativeChildWindows 7574 void WebPageProxy::closeOverlayedViews() 7575 { 7576 hideValidationMessage(); 7577 7578 #if ENABLE(DATALIST_ELEMENT) 7579 endDataListSuggestions(); 7580 #endif 7581 7582 #if ENABLE(INPUT_TYPE_COLOR_POPOVER) && ENABLE(INPUT_TYPE_COLOR) 7583 if (m_colorPicker) 7584 endColorPicker(); 7585 #endif 7586 } 7587 7536 7588 #if ENABLE(POINTER_LOCK) 7537 7589 void WebPageProxy::requestPointerLock() -
trunk/Source/WebKit/UIProcess/WebPageProxy.h
r233865 r233866 55 55 #include "WebContextMenuItemData.h" 56 56 #include "WebCoreArgumentCoders.h" 57 #include "WebDataListSuggestionsDropdown.h" 57 58 #include "WebFrameProxy.h" 58 59 #include "WebPageCreationParameters.h" … … 178 179 struct ApplicationManifest; 179 180 struct BackForwardItemIdentifier; 181 struct DataListSuggestionInformation; 180 182 struct DictionaryPopupInfo; 181 183 struct ExceptionDetails; … … 322 324 #if ENABLE(INPUT_TYPE_COLOR) 323 325 , public WebColorPicker::Client 326 #endif 327 #if ENABLE(DATALIST_ELEMENT) 328 , public WebDataListSuggestionsDropdown::Client 324 329 #endif 325 330 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS) … … 1516 1521 #endif 1517 1522 1523 #if ENABLE(DATALIST_ELEMENT) 1524 void showDataListSuggestions(WebCore::DataListSuggestionInformation&&); 1525 void handleKeydownInDataList(const String&); 1526 void endDataListSuggestions(); 1527 void didSelectOption(String&) final; 1528 void didCloseSuggestions() final; 1529 #endif 1530 1531 void closeOverlayedViews(); 1532 1518 1533 void compositionWasCanceled(); 1519 1534 void setHasHadSelectionChangesFromUserInteraction(bool); … … 2032 2047 RefPtr<WebColorPicker> m_colorPicker; 2033 2048 #endif 2049 #if ENABLE(DATALIST_ELEMENT) 2050 RefPtr<WebDataListSuggestionsDropdown> m_dataListSuggestionsDropdown; 2051 #endif 2034 2052 #if PLATFORM(COCOA) 2035 2053 RefPtr<WebCore::ValidationBubble> m_validationBubble; -
trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in
r233865 r233866 99 99 #endif 100 100 101 #if ENABLE(DATALIST_ELEMENT) 102 ShowDataListSuggestions(struct WebCore::DataListSuggestionInformation suggestionInformation); 103 HandleKeydownInDataList(String key); 104 EndDataListSuggestions(); 105 #endif 106 101 107 # Policy messages 102 108 DecidePolicyForResponse(uint64_t frameID, struct WebCore::SecurityOriginData frameSecurityOrigin, uint64_t navigationID, WebCore::ResourceResponse response, WebCore::ResourceRequest request, bool canShowMIMEType, uint64_t listenerID, WebKit::UserData userData) -
trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.h
r232544 r233866 101 101 Ref<WebCore::ValidationBubble> createValidationBubble(const String& message, const WebCore::ValidationBubble::Settings&) final; 102 102 103 #if ENABLE(DATALIST_ELEMENT) 104 RefPtr<WebDataListSuggestionsDropdown> createDataListSuggestionsDropdown(WebPageProxy&) final; 105 #endif 106 103 107 void setTextIndicator(Ref<WebCore::TextIndicator>, WebCore::TextIndicatorWindowLifetime) override; 104 108 void clearTextIndicator(WebCore::TextIndicatorWindowDismissalAnimation) override; -
trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm
r233751 r233866 765 765 } 766 766 767 #if ENABLE(DATALIST_ELEMENT) 768 RefPtr<WebDataListSuggestionsDropdown> PageClientImpl::createDataListSuggestionsDropdown(WebPageProxy& page) 769 { 770 return nullptr; 771 } 772 #endif 773 767 774 #if ENABLE(DATA_INTERACTION) 768 775 void PageClientImpl::didPerformDataInteractionControllerOperation(bool handled) -
trunk/Source/WebKit/UIProcess/mac/PageClientImplMac.h
r232416 r233866 133 133 #endif 134 134 135 #if ENABLE(DATALIST_ELEMENT) 136 RefPtr<WebDataListSuggestionsDropdown> createDataListSuggestionsDropdown(WebPageProxy&) override; 137 #endif 138 135 139 Ref<WebCore::ValidationBubble> createValidationBubble(const String& message, const WebCore::ValidationBubble::Settings&) final; 136 140 -
trunk/Source/WebKit/UIProcess/mac/PageClientImplMac.mm
r232416 r233866 49 49 #import "WebColorPickerMac.h" 50 50 #import "WebContextMenuProxyMac.h" 51 #import "WebDataListSuggestionsDropdownMac.h" 51 52 #import "WebEditCommandProxy.h" 52 53 #import "WebPopupMenuProxyMac.h" … … 459 460 #endif 460 461 462 #if ENABLE(DATALIST_ELEMENT) 463 RefPtr<WebDataListSuggestionsDropdown> PageClientImpl::createDataListSuggestionsDropdown(WebPageProxy& page) 464 { 465 return WebDataListSuggestionsDropdownMac::create(page, m_view); 466 } 467 #endif 468 461 469 Ref<ValidationBubble> PageClientImpl::createValidationBubble(const String& message, const ValidationBubble::Settings& settings) 462 470 { -
trunk/Source/WebKit/UIProcess/mac/WebDataListSuggestionsDropdownMac.h
r233865 r233866 26 26 #pragma once 27 27 28 #if ENABLE(DATALIST_ELEMENT) 28 #if ENABLE(DATALIST_ELEMENT) && USE(APPKIT) 29 29 30 #i nclude <WebCore/DataListSuggestionPicker.h>31 #i nclude <wtf/text/WTFString.h>30 #import "WebDataListSuggestionsDropdown.h" 31 #import <wtf/RetainPtr.h> 32 32 33 namespace WebCore { 34 class DataListSuggestionsClient; 35 } 33 OBJC_CLASS WKDataListSuggestionsView; 36 34 37 35 namespace WebKit { 38 36 39 class WebPage; 37 class WebDataListSuggestionsDropdownMac final : public WebDataListSuggestionsDropdown { 38 public: 39 static Ref<WebDataListSuggestionsDropdownMac> create(WebDataListSuggestionsDropdown::Client&, NSView *); 40 ~WebDataListSuggestionsDropdownMac(); 40 41 41 class WebDataListSuggestionPicker : public WebCore::DataListSuggestionPicker { 42 public: 43 WebDataListSuggestionPicker(WebPage*, WebCore::DataListSuggestionsClient*); 44 virtual ~WebDataListSuggestionPicker(); 42 void didSelectOption(String&); 45 43 46 void handleKeydownWithIdentifier(const String&) override;47 void didSelectOption(const String&);48 void didCloseSuggestions();49 void close() override;50 void displayWithActivationType(WebCore::DataListSuggestionActivationType) override;51 44 private: 52 __unused WebCore::DataListSuggestionsClient* m_dataListSuggestionsClient; 53 __unused WebPage* m_page; 45 WebDataListSuggestionsDropdownMac(WebDataListSuggestionsDropdown::Client&, NSView *); 46 47 void show(WebCore::DataListSuggestionInformation&&) final; 48 void handleKeydownWithIdentifier(const String&) final; 49 void close() final; 50 51 void selectOption(); 52 53 NSView *m_view; 54 RetainPtr<WKDataListSuggestionsView> m_dropdownUI; 54 55 }; 55 56 56 57 } // namespace WebKit 57 58 58 #endif 59 #endif // ENABLE(DATALIST_ELEMENT) && USE(APPKIT) -
trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj
r233770 r233866 2186 2186 E52CF55220A35C3A00DADA27 /* WebDataListSuggestionPicker.h in Headers */ = {isa = PBXBuildFile; fileRef = E52CF55020A35C3A00DADA27 /* WebDataListSuggestionPicker.h */; }; 2187 2187 E52CF55320A35C3A00DADA27 /* WebDataListSuggestionPicker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E52CF55120A35C3A00DADA27 /* WebDataListSuggestionPicker.cpp */; }; 2188 E54A14CF20FCFB7B007E13D8 /* WebDataListSuggestionsDropdown.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E54A14CE20FCFB7B007E13D8 /* WebDataListSuggestionsDropdown.cpp */; }; 2189 E568B91F20A3AB2F00E3C856 /* WebDataListSuggestionsDropdown.h in Headers */ = {isa = PBXBuildFile; fileRef = E568B91E20A3AB2F00E3C856 /* WebDataListSuggestionsDropdown.h */; }; 2190 E568B92220A3AC6A00E3C856 /* WebDataListSuggestionsDropdownMac.h in Headers */ = {isa = PBXBuildFile; fileRef = E568B92020A3AC6A00E3C856 /* WebDataListSuggestionsDropdownMac.h */; }; 2191 E568B92320A3AC6A00E3C856 /* WebDataListSuggestionsDropdownMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = E568B92120A3AC6A00E3C856 /* WebDataListSuggestionsDropdownMac.mm */; }; 2188 2192 ECA680D81E690E2500731D20 /* WebProcessCocoa.h in Headers */ = {isa = PBXBuildFile; fileRef = ECA680D71E690DF800731D20 /* WebProcessCocoa.h */; settings = {ATTRIBUTES = (Private, ); }; }; 2189 2193 ED82A7F2128C6FAF004477B3 /* WKBundlePageOverlay.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A22F0FF1289FCD90085E74F /* WKBundlePageOverlay.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 4825 4829 E52CF55020A35C3A00DADA27 /* WebDataListSuggestionPicker.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebDataListSuggestionPicker.h; sourceTree = "<group>"; }; 4826 4830 E52CF55120A35C3A00DADA27 /* WebDataListSuggestionPicker.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WebDataListSuggestionPicker.cpp; sourceTree = "<group>"; }; 4831 E54A14CE20FCFB7B007E13D8 /* WebDataListSuggestionsDropdown.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WebDataListSuggestionsDropdown.cpp; sourceTree = "<group>"; }; 4832 E568B91E20A3AB2F00E3C856 /* WebDataListSuggestionsDropdown.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebDataListSuggestionsDropdown.h; sourceTree = "<group>"; }; 4833 E568B92020A3AC6A00E3C856 /* WebDataListSuggestionsDropdownMac.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebDataListSuggestionsDropdownMac.h; sourceTree = "<group>"; }; 4834 E568B92120A3AC6A00E3C856 /* WebDataListSuggestionsDropdownMac.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; path = WebDataListSuggestionsDropdownMac.mm; sourceTree = "<group>"; }; 4827 4835 ECA680D31E6904B500731D20 /* ExtraPrivateSymbolsForTAPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExtraPrivateSymbolsForTAPI.h; sourceTree = "<group>"; }; 4828 4836 ECA680D71E690DF800731D20 /* WebProcessCocoa.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebProcessCocoa.h; sourceTree = "<group>"; }; … … 7480 7488 33AA1064131F060000D4A575 /* WebCookieManagerProxyClient.cpp */, 7481 7489 33AA1065131F060000D4A575 /* WebCookieManagerProxyClient.h */, 7490 E54A14CE20FCFB7B007E13D8 /* WebDataListSuggestionsDropdown.cpp */, 7491 E568B91E20A3AB2F00E3C856 /* WebDataListSuggestionsDropdown.h */, 7482 7492 BCA0EF9E12332642007D3CFB /* WebEditCommandProxy.cpp */, 7483 7493 BCA0EF9D12332642007D3CFB /* WebEditCommandProxy.h */, … … 8258 8268 51ACBB9F127A8F2C00D203B9 /* WebContextMenuProxyMac.mm */, 8259 8269 F6D632BA133D181B00743D77 /* WebCookieManagerProxyMac.mm */, 8270 E568B92020A3AC6A00E3C856 /* WebDataListSuggestionsDropdownMac.h */, 8271 E568B92120A3AC6A00E3C856 /* WebDataListSuggestionsDropdownMac.mm */, 8260 8272 1CA8B935127C774E00576C2B /* WebInspectorProxyMac.mm */, 8261 8273 BC857E8512B71EBB00EDEB2E /* WebPageProxyMac.mm */, … … 9446 9458 1AA83F6D1A5B63FF00026EC6 /* WebDatabaseProvider.h in Headers */, 9447 9459 E52CF55220A35C3A00DADA27 /* WebDataListSuggestionPicker.h in Headers */, 9460 E568B91F20A3AB2F00E3C856 /* WebDataListSuggestionsDropdown.h in Headers */, 9461 E568B92220A3AC6A00E3C856 /* WebDataListSuggestionsDropdownMac.h in Headers */, 9448 9462 CD19A26E1A13E834008D650E /* WebDiagnosticLoggingClient.h in Headers */, 9449 9463 1A5B1C5518987EDF004FCF9B /* WebDocumentLoader.h in Headers */, … … 11254 11268 1AA83F6C1A5B63FF00026EC6 /* WebDatabaseProvider.cpp in Sources */, 11255 11269 E52CF55320A35C3A00DADA27 /* WebDataListSuggestionPicker.cpp in Sources */, 11270 E54A14CF20FCFB7B007E13D8 /* WebDataListSuggestionsDropdown.cpp in Sources */, 11271 E568B92320A3AC6A00E3C856 /* WebDataListSuggestionsDropdownMac.mm in Sources */, 11256 11272 CD19A26D1A13E82A008D650E /* WebDiagnosticLoggingClient.cpp in Sources */, 11257 11273 1A5B1C5418987EDF004FCF9B /* WebDocumentLoader.cpp in Sources */, -
trunk/Source/WebKit/WebProcess/WebCoreSupport/WebDataListSuggestionPicker.cpp
r232640 r233866 29 29 #if ENABLE(DATALIST_ELEMENT) 30 30 31 #include "WebCoreArgumentCoders.h" 31 32 #include "WebPage.h" 32 33 #include "WebPageProxyMessages.h" … … 48 49 void WebDataListSuggestionPicker::handleKeydownWithIdentifier(const WTF::String& key) 49 50 { 50 51 WebProcess::singleton().parentProcessConnection()->send(Messages::WebPageProxy::HandleKeydownInDataList(key), m_page->pageID()); 51 52 } 52 53 53 54 void WebDataListSuggestionPicker::didSelectOption(const WTF::String& selectedOption) 54 55 { 55 56 m_dataListSuggestionsClient->didSelectDataListOption(selectedOption); 56 57 } 57 58 58 59 void WebDataListSuggestionPicker::didCloseSuggestions() 59 60 { 60 61 m_dataListSuggestionsClient->didCloseSuggestions(); 61 62 } 62 63 63 64 void WebDataListSuggestionPicker::close() 64 65 { 65 66 WebProcess::singleton().parentProcessConnection()->send(Messages::WebPageProxy::EndDataListSuggestions(), m_page->pageID()); 66 67 } 67 68 68 69 void WebDataListSuggestionPicker::displayWithActivationType(DataListSuggestionActivationType type) 69 70 { 71 if (!m_dataListSuggestionsClient->suggestions().size()) { 72 close(); 73 return; 74 } 70 75 76 m_page->setActiveDataListSuggestionPicker(this); 77 78 DataListSuggestionInformation info = { type, m_dataListSuggestionsClient->suggestions(), m_dataListSuggestionsClient->elementRectInRootViewCoordinates() }; 79 WebProcess::singleton().parentProcessConnection()->send(Messages::WebPageProxy::ShowDataListSuggestions(info), m_page->pageID()); 71 80 } 72 81 -
trunk/Source/WebKit/WebProcess/WebCoreSupport/WebDataListSuggestionPicker.h
r232640 r233866 50 50 void displayWithActivationType(WebCore::DataListSuggestionActivationType) override; 51 51 private: 52 __unusedWebCore::DataListSuggestionsClient* m_dataListSuggestionsClient;53 __unusedWebPage* m_page;52 WebCore::DataListSuggestionsClient* m_dataListSuggestionsClient; 53 WebPage* m_page; 54 54 }; 55 55 -
trunk/Tools/ChangeLog
r233856 r233866 1 2018-07-16 Aditya Keerthi <akeerthi@apple.com> 2 3 [Datalist][macOS] Add suggestions UI for TextFieldInputTypes 4 https://bugs.webkit.org/show_bug.cgi?id=186531 5 6 Reviewed by Tim Horton. 7 8 Added isShowingDatalistSuggestions testing hook in order to enable testing of the 9 visibility of the suggestions view. 10 11 * DumpRenderTree/mac/UIScriptControllerMac.mm: 12 (WTR::UIScriptController::isShowingDataListSuggestions const): 13 * TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl: 14 * TestRunnerShared/UIScriptContext/UIScriptController.cpp: 15 (WTR::UIScriptController::isShowingDataListSuggestions const): 16 * TestRunnerShared/UIScriptContext/UIScriptController.h: 17 * WebKitTestRunner/mac/UIScriptControllerMac.mm: 18 (WTR::UIScriptController::isShowingDataListSuggestions const): 19 1 20 2018-07-16 Yusuke Suzuki <utatane.tea@gmail.com> 2 21 -
trunk/Tools/DumpRenderTree/mac/UIScriptControllerMac.mm
r232452 r233866 181 181 } 182 182 183 bool UIScriptController::isShowingDataListSuggestions() const 184 { 185 return false; 186 } 187 183 188 } 184 189 -
trunk/Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl
r232968 r233866 196 196 void setTimePickerValue(long hour, long minute); 197 197 198 // <datalist> 199 readonly attribute boolean isShowingDataListSuggestions; 200 198 201 void keyboardAccessoryBarNext(); 199 202 void keyboardAccessoryBarPrevious(); -
trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp
r232968 r233866 518 518 } 519 519 520 bool UIScriptController::isShowingDataListSuggestions() const 521 { 522 return false; 523 } 524 520 525 #endif 521 526 -
trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.h
r232968 r233866 103 103 JSRetainPtr<JSStringRef> formInputLabel() const; 104 104 void setTimePickerValue(long hour, long minute); 105 105 106 bool isShowingDataListSuggestions() const; 107 106 108 JSObjectRef contentsOfUserInterfaceItem(JSStringRef) const; 107 109 void overridePreference(JSStringRef preference, JSStringRef value); -
trunk/Tools/WebKitTestRunner/mac/UIScriptControllerMac.mm
r232452 r233866 169 169 } 170 170 171 bool UIScriptController::isShowingDataListSuggestions() const 172 { 173 #if WK_API_ENABLED 174 TestRunnerWKWebView *webView = TestController::singleton().mainWebView()->platformView(); 175 for (NSWindow *childWindow in webView.window.childWindows) { 176 if ([childWindow isKindOfClass:NSClassFromString(@"WKDataListSuggestionWindow")]) 177 return true; 178 } 179 #endif 180 return false; 181 } 182 171 183 void UIScriptController::removeViewFromWindow(JSValueRef callback) 172 184 {
Note: See TracChangeset
for help on using the changeset viewer.