Changeset 248033 in webkit
- Timestamp:
- Jul 31, 2019 1:02:09 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 16 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r247810 r248033 1 2019-07-31 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GTK] Datalist element support for TextFieldInputType 4 https://bugs.webkit.org/show_bug.cgi?id=98934 5 6 Reviewed by Michael Catanzaro. 7 8 Enable DATALIST_ELEMENT. 9 10 * Source/cmake/OptionsGTK.cmake: 11 1 12 2019-07-24 Fujii Hironori <fujii.hironori@gmail.com> 2 13 -
trunk/LayoutTests/ChangeLog
r248031 r248033 1 2019-07-31 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GTK] Datalist element support for TextFieldInputType 4 https://bugs.webkit.org/show_bug.cgi?id=98934 5 6 Reviewed by Michael Catanzaro. 7 8 Unskip datalist tests for GTK port. 9 10 * platform/gtk/TestExpectations: 11 1 12 2019-07-31 Zan Dobersek <zdobersek@igalia.com> 2 13 -
trunk/LayoutTests/platform/gtk/TestExpectations
r247535 r248033 177 177 fast/history/page-cache-notification-non-suspendable.html 178 178 fast/history/page-cache-notification-suspendable.html 179 180 # Datalist is not yet enabled.181 accessibility/datalist.html [ Skip ]182 webkit.org/b/98934 fast/forms/datalist [ Skip ]183 179 184 180 # ENABLE_INPUT_TYPE_* are not enabled. … … 3800 3796 3801 3797 webkit.org/b/199860 accessibility/button-with-aria-haspopup-role.html [ Failure ] 3798 webkit.org/b/199860 accessibility/datalist.html [ Failure ] 3802 3799 webkit.org/b/199868 accessibility/gtk/aria-haspopup.html [ Failure ] 3803 3800 -
trunk/Source/WebCore/ChangeLog
r248028 r248033 1 2019-07-31 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GTK] Datalist element support for TextFieldInputType 4 https://bugs.webkit.org/show_bug.cgi?id=98934 5 6 Reviewed by Michael Catanzaro. 7 8 Add support for rendering the arrow indicator of text fields having data list. 9 10 * rendering/RenderThemeGtk.cpp: 11 (WebCore::RenderThemeGtk::paintTextField): 12 (WebCore::RenderThemeGtk::adjustListButtonStyle const): 13 (WebCore::RenderThemeGtk::paintListButtonForInput): 14 (WebCore::RenderThemeGtk::adjustSearchFieldStyle const): 15 * rendering/RenderThemeGtk.h: 16 1 17 2019-07-30 Tim Horton <timothy_horton@apple.com> 2 18 -
trunk/Source/WebCore/rendering/RenderThemeGtk.cpp
r246790 r248033 521 521 entryWidget.entry().setState(themePartStateFlags(*this, Entry, renderObject)); 522 522 entryWidget.entry().render(paintInfo.context().platformContext()->cr(), rect); 523 524 #if ENABLE(DATALIST_ELEMENT) 525 if (is<HTMLInputElement>(renderObject.generatingNode())) { 526 const auto& input = downcast<HTMLInputElement>(*(renderObject.generatingNode())); 527 if (input.list()) 528 paintListButtonForInput(renderObject, paintInfo, rect); 529 } 530 #endif 523 531 } 524 532 return false; … … 597 605 return paintSearchFieldIcon(this, EntryIconRight, renderObject, paintInfo, rect); 598 606 } 607 608 #if ENABLE(DATALIST_ELEMENT) 609 void RenderThemeGtk::adjustListButtonStyle(StyleResolver&, RenderStyle& style, const Element*) const 610 { 611 // Add a margin to place the button at end of the input field. 612 if (style.isLeftToRightDirection()) 613 style.setMarginRight(Length(-4, Fixed)); 614 else 615 style.setMarginLeft(Length(-4, Fixed)); 616 } 617 618 void RenderThemeGtk::paintListButtonForInput(const RenderObject& renderObject, const PaintInfo& paintInfo, const FloatRect& rect) 619 { 620 // Use a combo box widget to render its arrow. 621 auto& comboWidget = static_cast<RenderThemeComboBox&>(RenderThemeWidget::getOrCreate(RenderThemeWidget::Type::ComboBox)); 622 comboWidget.arrow().setState(themePartStateFlags(*this, ComboBoxButton, renderObject)); 623 624 // But a search entry widget to get the contents rect, since this is a text input field. 625 auto& searchEntryWidget = static_cast<RenderThemeSearchEntry&>(RenderThemeWidget::getOrCreate(RenderThemeWidget::Type::SearchEntry)); 626 auto& icon = static_cast<RenderThemeIconGadget&>(searchEntryWidget.rightIcon()); 627 icon.setIconSize(comboWidget.arrow().preferredSize().width()); 628 GtkBorder contentsBox = searchEntryWidget.entry().contentsBox(); 629 FloatRect adjustedRect(rect); 630 adjustedRect.move(contentsBox.left, contentsBox.top); 631 adjustedRect.contract(contentsBox.right + 1, contentsBox.top + contentsBox.bottom); 632 comboWidget.arrow().render(paintInfo.context().platformContext()->cr(), adjustedRect); 633 } 634 #endif 599 635 600 636 void RenderThemeGtk::adjustSearchFieldStyle(StyleResolver&, RenderStyle& style, const Element*) const -
trunk/Source/WebCore/rendering/RenderThemeGtk.h
r246632 r248033 144 144 bool paintSearchFieldCancelButton(const RenderBox&, const PaintInfo&, const IntRect&) override; 145 145 146 #if ENABLE(DATALIST_ELEMENT) 147 void paintListButtonForInput(const RenderObject&, const PaintInfo&, const FloatRect&); 148 void adjustListButtonStyle(StyleResolver&, RenderStyle&, const Element*) const override; 149 #endif 150 146 151 bool paintSliderTrack(const RenderObject&, const PaintInfo&, const IntRect&) override; 147 152 void adjustSliderTrackStyle(StyleResolver&, RenderStyle&, const Element*) const override; -
trunk/Source/WebKit/ChangeLog
r248032 r248033 1 2019-07-31 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GTK] Datalist element support for TextFieldInputType 4 https://bugs.webkit.org/show_bug.cgi?id=98934 5 6 Reviewed by Michael Catanzaro. 7 8 Add a WebDataListSuggestionsDropdown implementation for the GTK port using a popup window with a tree view list. 9 10 * Sources.txt: 11 * SourcesGTK.txt: 12 * UIProcess/API/gtk/PageClientImpl.cpp: 13 (WebKit::PageClientImpl::createDataListSuggestionsDropdown): 14 * UIProcess/API/gtk/PageClientImpl.h: 15 * UIProcess/gtk/WebDataListSuggestionsDropdownGtk.cpp: Added. 16 (WebKit::firstTimeItemSelectedCallback): 17 (WebKit::WebDataListSuggestionsDropdownGtk::WebDataListSuggestionsDropdownGtk): 18 (WebKit::WebDataListSuggestionsDropdownGtk::~WebDataListSuggestionsDropdownGtk): 19 (WebKit::WebDataListSuggestionsDropdownGtk::treeViewRowActivatedCallback): 20 (WebKit::WebDataListSuggestionsDropdownGtk::didSelectOption): 21 (WebKit::WebDataListSuggestionsDropdownGtk::show): 22 (WebKit::WebDataListSuggestionsDropdownGtk::handleKeydownWithIdentifier): 23 (WebKit::WebDataListSuggestionsDropdownGtk::close): 24 * UIProcess/gtk/WebDataListSuggestionsDropdownGtk.h: Copied from Tools/WebKitTestRunner/gtk/UIScriptControllerGtk.h. 25 1 26 2019-07-31 Tim Horton <timothy_horton@apple.com> 2 27 -
trunk/Source/WebKit/Sources.txt
r247146 r248033 269 269 UIProcess/WebCookieManagerProxy.cpp 270 270 UIProcess/WebCookieManagerProxyClient.cpp 271 UIProcess/WebDataListSuggestionsDropdown.cpp 271 272 UIProcess/WebEditCommandProxy.cpp 272 273 UIProcess/WebFormClient.cpp … … 533 534 WebProcess/WebCoreSupport/WebColorChooser.cpp 534 535 WebProcess/WebCoreSupport/WebContextMenuClient.cpp 536 WebProcess/WebCoreSupport/WebDataListSuggestionPicker.cpp 535 537 WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp 536 538 WebProcess/WebCoreSupport/WebDragClient.cpp -
trunk/Source/WebKit/SourcesCocoa.txt
r247502 r248033 219 219 UIProcess/ViewGestureController.cpp 220 220 UIProcess/ViewSnapshotStore.cpp 221 UIProcess/WebDataListSuggestionsDropdown.cpp222 221 UIProcess/WebMediaSessionFocusManager.cpp 223 222 UIProcess/WebMediaSessionFocusManagerClient.cpp … … 553 552 WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm 554 553 555 WebProcess/WebCoreSupport/WebDataListSuggestionPicker.cpp556 554 WebProcess/WebCoreSupport/WebPasteboardOverrides.cpp 557 555 WebProcess/WebCoreSupport/WebValidationMessageClient.cpp -
trunk/Source/WebKit/SourcesGTK.txt
r247096 r248033 252 252 UIProcess/gtk/WebColorPickerGtk.cpp 253 253 UIProcess/gtk/WebContextMenuProxyGtk.cpp 254 UIProcess/gtk/WebDataListSuggestionsDropdownGtk.cpp 254 255 UIProcess/gtk/WebInspectorProxyGtk.cpp 255 256 UIProcess/gtk/WebKitInspectorWindow.cpp -
trunk/Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp
r246677 r248033 36 36 #include "WebColorPickerGtk.h" 37 37 #include "WebContextMenuProxyGtk.h" 38 #include "WebDataListSuggestionsDropdownGtk.h" 38 39 #include "WebEventFactory.h" 39 40 #include "WebKitColorChooser.h" … … 250 251 return WebColorPickerGtk::create(*page, color, rect); 251 252 } 253 254 #if ENABLE(DATALIST_ELEMENT) 255 RefPtr<WebDataListSuggestionsDropdown> PageClientImpl::createDataListSuggestionsDropdown(WebPageProxy& page) 256 { 257 return WebDataListSuggestionsDropdownGtk::create(m_viewWidget, page); 258 } 259 #endif 252 260 253 261 void PageClientImpl::enterAcceleratedCompositingMode(const LayerTreeContext& layerTreeContext) -
trunk/Source/WebKit/UIProcess/API/gtk/PageClientImpl.h
r246635 r248033 95 95 RefPtr<WebColorPicker> createColorPicker(WebPageProxy*, const WebCore::Color& initialColor, const WebCore::IntRect&, Vector<WebCore::Color>&&) override; 96 96 #endif 97 #if ENABLE(DATALIST_ELEMENT) 98 RefPtr<WebDataListSuggestionsDropdown> createDataListSuggestionsDropdown(WebPageProxy&) override; 99 #endif 97 100 void selectionDidChange() override; 98 101 RefPtr<ViewSnapshot> takeViewSnapshot() override; -
trunk/Source/WebKit/UIProcess/gtk/WebDataListSuggestionsDropdownGtk.h
r248032 r248033 1 1 /* 2 * Copyright (C) 2019 Apple Inc. All rights reserved.2 * Copyright (C) 2019 Igalia S.L. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 11 11 * documentation and/or other materials provided with the distribution. 12 12 * 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS AS IS'' 14 14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 15 15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR … … 26 26 #pragma once 27 27 28 #include "PlatformWebView.h" 29 #include "TestController.h" 30 #include "UIScriptController.h" 31 #include <WebKit/WKViewPrivate.h> 28 #if ENABLE(DATALIST_ELEMENT) 32 29 33 namespace WTR { 30 #include "WebDataListSuggestionsDropdown.h" 34 31 35 class UIScriptControllerGtk : public UIScriptController { 32 typedef struct _GtkTreePath GtkTreePath; 33 typedef struct _GtkTreeView GtkTreeView; 34 typedef struct _GtkTreeViewColumn GtkTreeViewColumn; 35 36 namespace WebKit { 37 38 class WebPageProxy; 39 40 class WebDataListSuggestionsDropdownGtk final : public WebDataListSuggestionsDropdown { 36 41 public: 37 explicit UIScriptControllerGtk(UIScriptContext& context) 38 : UIScriptController(context) 42 static Ref<WebDataListSuggestionsDropdownGtk> create(GtkWidget* webView, WebPageProxy& page) 39 43 { 44 return adoptRef(*new WebDataListSuggestionsDropdownGtk(webView, page)); 40 45 } 41 46 42 void beginBackSwipe(JSValueRef) override; 43 void completeBackSwipe(JSValueRef) override; 47 ~WebDataListSuggestionsDropdownGtk(); 48 49 private: 50 WebDataListSuggestionsDropdownGtk(GtkWidget*, WebPageProxy&); 51 52 void show(WebCore::DataListSuggestionInformation&&) final; 53 void handleKeydownWithIdentifier(const String&) final; 54 void close() final; 55 56 static void treeViewRowActivatedCallback(GtkTreeView*, GtkTreePath*, GtkTreeViewColumn*, WebDataListSuggestionsDropdownGtk*); 57 void didSelectOption(const String&); 58 59 GtkWidget* m_webView { nullptr }; 60 GtkWidget* m_popup { nullptr }; 61 GtkWidget* m_treeView { nullptr }; 44 62 }; 45 63 46 } // namespace WTR 64 } // namespace WebKit 65 66 #endif // ENABLE(DATALIST_ELEMENT) -
trunk/Source/cmake/OptionsGTK.cmake
r247721 r248033 151 151 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_CONTENT_EXTENSIONS PRIVATE ON) 152 152 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_DARK_MODE_CSS PRIVATE ON) 153 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_DATALIST_ELEMENT PRIVATE ON) 153 154 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_DOWNLOAD_ATTRIBUTE PRIVATE ON) 154 155 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_ENCRYPTED_MEDIA PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES}) -
trunk/Tools/ChangeLog
r248030 r248033 1 2019-07-31 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GTK] Datalist element support for TextFieldInputType 4 https://bugs.webkit.org/show_bug.cgi?id=98934 5 6 Reviewed by Michael Catanzaro. 7 8 Implement UIScriptControllerGtk::isShowingDataListSuggestions. 9 10 * WebKitTestRunner/gtk/UIScriptControllerGtk.cpp: 11 (WTR::UIScriptControllerGtk::isShowingDataListSuggestions const): 12 * WebKitTestRunner/gtk/UIScriptControllerGtk.h: 13 1 14 2019-07-30 Tim Horton <timothy_horton@apple.com> 2 15 -
trunk/Tools/WebKitTestRunner/gtk/UIScriptControllerGtk.cpp
r247898 r248033 30 30 #include "TestController.h" 31 31 #include <WebKit/WKViewPrivate.h> 32 #include <gtk/gtk.h> 32 33 33 34 namespace WTR { … … 52 53 } 53 54 55 bool UIScriptControllerGtk::isShowingDataListSuggestions() const 56 { 57 auto* webView = TestController::singleton().mainWebView()->platformView(); 58 if (auto* popup = g_object_get_data(G_OBJECT(webView), "wk-datalist-popup")) 59 return gtk_widget_get_mapped(GTK_WIDGET(popup)); 60 return false; 61 } 62 54 63 } // namespace WTR -
trunk/Tools/WebKitTestRunner/gtk/UIScriptControllerGtk.h
r247898 r248033 42 42 void beginBackSwipe(JSValueRef) override; 43 43 void completeBackSwipe(JSValueRef) override; 44 bool isShowingDataListSuggestions() const override; 44 45 }; 45 46
Note: See TracChangeset
for help on using the changeset viewer.