Changeset 209252 in webkit
- Timestamp:
- Dec 2, 2016, 12:05:07 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r209250 r209252 1 2016-12-02 Chris Dumez <cdumez@apple.com> 2 3 [Mac][WK1] Implement new HTML interactive form validation user interface 4 https://bugs.webkit.org/show_bug.cgi?id=164483 5 6 Reviewed by Simon Fraser. 7 8 Unskip tests for HTML form validation that are now passing on Mac WK1. 9 10 * platform/mac-wk1/TestExpectations: 11 1 12 2016-12-02 Ryan Haddad <ryanhaddad@apple.com> 2 13 -
trunk/LayoutTests/platform/mac-wk1/TestExpectations
r209250 r209252 93 93 http/tests/media/media-stream 94 94 http/tests/ssl/media-stream 95 96 # These tests test the Shadow DOM based HTML form validation UI but Mac WK1 is using native dialogs instead. 97 fast/forms/validation-message-on-listbox.html 98 fast/forms/validation-message-on-menulist.html 99 fast/forms/validation-message-on-radio.html 100 fast/forms/validation-message-on-checkbox.html 101 fast/forms/validation-message-on-range.html 102 fast/forms/validation-message-clone.html 103 fast/forms/validation-message-in-relative-body.html 104 fast/forms/validation-message-appearance.html 105 fast/forms/validation-message-on-textarea.html 95 106 96 107 # Disable snapshotting tests on WK1 only … … 244 255 [ Sierra+ ] svg/hixie/text/003.html [ Failure ] 245 256 246 # We do not support the new HTML validation UI on WebKit1 yet (rdar://problem/28944652).247 fast/forms/validation-custom-message.html [ Skip ]248 fast/forms/validation-messages.html [ Skip ]249 250 257 [ Yosemite ] http/tests/media/hls/video-controller-getStartDate.html [ Pass Timeout ] 251 258 -
trunk/Source/WebKit/ChangeLog
r208841 r209252 1 2016-12-02 Chris Dumez <cdumez@apple.com> 2 3 [Mac][WK1] Implement new HTML interactive form validation user interface 4 https://bugs.webkit.org/show_bug.cgi?id=164483 5 6 Reviewed by Simon Fraser. 7 8 Add new files to xcode project. 9 10 * WebKit.xcodeproj/project.pbxproj: 11 1 12 2016-11-17 Yusuke Suzuki <utatane.tea@gmail.com> 2 13 -
trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj
r208624 r209252 123 123 3AE15D5012DBDED4009323C8 /* WebStorageManagerInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 3AE15D4F12DBDED4009323C8 /* WebStorageManagerInternal.h */; }; 124 124 44BB8B141241A022001E3A22 /* WebArchiveInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 44BB8B131241A022001E3A22 /* WebArchiveInternal.h */; }; 125 4618DFF81DEF760A0033C3AA /* WebValidationMessageClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 4618DFF61DEF760A0033C3AA /* WebValidationMessageClient.h */; }; 126 4618DFF91DEF760A0033C3AA /* WebValidationMessageClient.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4618DFF71DEF760A0033C3AA /* WebValidationMessageClient.mm */; }; 125 127 4BF99F900AE050BC00815C2B /* WebEditorClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF99F8E0AE050BC00815C2B /* WebEditorClient.h */; settings = {ATTRIBUTES = (); }; }; 126 128 4BF99F910AE050BC00815C2B /* WebEditorClient.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4BF99F8F0AE050BC00815C2B /* WebEditorClient.mm */; }; … … 943 945 449098B90F8F82DF0076A327 /* FeatureDefines.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = FeatureDefines.xcconfig; sourceTree = "<group>"; }; 944 946 44BB8B131241A022001E3A22 /* WebArchiveInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebArchiveInternal.h; sourceTree = "<group>"; }; 947 4618DFF61DEF760A0033C3AA /* WebValidationMessageClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebValidationMessageClient.h; sourceTree = "<group>"; }; 948 4618DFF71DEF760A0033C3AA /* WebValidationMessageClient.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebValidationMessageClient.mm; sourceTree = "<group>"; }; 945 949 4BF99F8E0AE050BC00815C2B /* WebEditorClient.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebEditorClient.h; sourceTree = "<group>"; }; 946 950 4BF99F8F0AE050BC00815C2B /* WebEditorClient.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = WebEditorClient.mm; sourceTree = "<group>"; }; … … 2634 2638 070F549917F1E42B00169E04 /* WebUserMediaClient.h */, 2635 2639 070F549A17F1E42B00169E04 /* WebUserMediaClient.mm */, 2640 4618DFF61DEF760A0033C3AA /* WebValidationMessageClient.h */, 2641 4618DFF71DEF760A0033C3AA /* WebValidationMessageClient.mm */, 2636 2642 1430C12A1B2C5DF700DEA01D /* WebViewGroup.cpp */, 2637 2643 1430C12B1B2C5DF700DEA01D /* WebViewGroup.h */, … … 3167 3173 939810890824BF01008DF038 /* WebResourcePrivate.h in Headers */, 3168 3174 7E6FEF0808985A7200C44C3F /* WebScriptDebugDelegate.h in Headers */, 3175 4618DFF81DEF760A0033C3AA /* WebValidationMessageClient.h in Headers */, 3169 3176 C0167BF80D7F5DD00028696E /* WebScriptDebugger.h in Headers */, 3170 3177 C0B1F7E810AC8E3100C925D9 /* WebScriptWorld.h in Headers */, … … 3428 3435 93D4368E1D57ABEE00AB85EA /* DOMDocumentFragment.mm in Sources */, 3429 3436 93D436941D57ABEE00AB85EA /* DOMDocumentType.mm in Sources */, 3437 4618DFF91DEF760A0033C3AA /* WebValidationMessageClient.mm in Sources */, 3430 3438 93D436971D57ABEE00AB85EA /* DOMDOMImplementation.mm in Sources */, 3431 3439 93D4369A1D57ABEE00AB85EA /* DOMDOMTokenList.mm in Sources */, -
trunk/Source/WebKit/mac/ChangeLog
r209230 r209252 1 2016-12-02 Chris Dumez <cdumez@apple.com> 2 3 [Mac][WK1] Implement new HTML interactive form validation user interface 4 https://bugs.webkit.org/show_bug.cgi?id=164483 5 6 Reviewed by Simon Fraser. 7 8 Implement new HTML interactive form validation user interface on Mac 9 WK1 and enable it by default. 10 11 * WebCoreSupport/WebValidationMessageClient.h: Added. 12 * WebCoreSupport/WebValidationMessageClient.mm: Added. 13 (WebValidationMessageClient::WebValidationMessageClient): 14 (WebValidationMessageClient::~WebValidationMessageClient): 15 (WebValidationMessageClient::showValidationMessage): 16 (WebValidationMessageClient::hideValidationMessage): 17 (WebValidationMessageClient::isValidationMessageVisible): 18 * WebView/WebHTMLView.mm: 19 (-[WebHTMLView _frameOrBoundsChanged]): 20 * WebView/WebView.mm: 21 (-[WebView _commonInitializationWithFrameName:groupName:]): 22 (-[WebView _willStartScrollingOrZooming]): 23 (-[WebView _contentsOfUserInterfaceItem:]): 24 (-[WebView _scaleWebView:atOrigin:]): 25 (-[WebView _didScrollDocumentInFrameView:]): 26 (-[WebView _setZoomMultiplier:isTextOnly:]): 27 (-[WebView showFormValidationMessage:withAnchorRect:]): 28 (-[WebView hideFormValidationMessage]): 29 * WebView/WebViewData.h: 30 * WebView/WebViewData.mm: 31 (-[WebViewPrivate init]): 32 * WebView/WebViewInternal.h: 33 * WebView/WebViewPrivate.h: 34 1 35 2016-12-01 Jiewen Tan <jiewen_tan@apple.com> 2 36 -
trunk/Source/WebKit/mac/WebView/WebHTMLView.mm
r208985 r209252 1690 1690 #endif 1691 1691 1692 [ [webView _UIDelegateForwarder] webView:webViewdidScrollDocumentInFrameView:[self _frameView]];1692 [webView _didScrollDocumentInFrameView:[self _frameView]]; 1693 1693 } 1694 1694 _private->lastScrollPosition = origin; -
trunk/Source/WebKit/mac/WebView/WebView.mm
r209230 r209252 112 112 #import "WebUIDelegatePrivate.h" 113 113 #import "WebUserMediaClient.h" 114 #import "WebValidationMessageClient.h" 114 115 #import "WebViewGroup.h" 115 116 #import "WebVisitedLinkStore.h" … … 195 196 #import <WebCore/UserScript.h> 196 197 #import <WebCore/UserStyleSheet.h> 198 #import <WebCore/ValidationBubble.h> 197 199 #import <WebCore/WebCoreObjCExtras.h> 198 200 #import <WebCore/WebCoreView.h> … … 1312 1314 pageConfiguration.chromeClient = new WebChromeClient(self); 1313 1315 pageConfiguration.contextMenuClient = new WebContextMenuClient(self); 1316 // FIXME: We should enable this on iOS as well. 1317 pageConfiguration.validationMessageClient = std::make_unique<WebValidationMessageClient>(self); 1314 1318 #if ENABLE(DRAG_SUPPORT) 1315 1319 pageConfiguration.dragClient = new WebDragClient(self); … … 1961 1965 return; 1962 1966 _private->mainViewIsScrollingOrZooming = YES; 1967 1968 [self hideFormValidationMessage]; 1963 1969 1964 1970 // This suspends active DOM objects like timers, but not media. … … 4309 4315 } 4310 4316 4317 - (NSDictionary *)_contentsOfUserInterfaceItem:(NSString *)userInterfaceItem 4318 { 4319 if ([userInterfaceItem isEqualToString:@"validationBubble"]) { 4320 auto* validationBubble = _private->formValidationBubble.get(); 4321 String message = validationBubble ? validationBubble->message() : emptyString(); 4322 return @{ userInterfaceItem: @{ @"message": (NSString *)message } }; 4323 } 4324 4325 return nil; 4326 } 4327 4311 4328 - (BOOL)_isSoftwareRenderable 4312 4329 { … … 4628 4645 - (void)_scaleWebView:(float)scale atOrigin:(NSPoint)origin 4629 4646 { 4647 [self hideFormValidationMessage]; 4648 4630 4649 _private->page->setPageScaleFactor(scale, IntPoint(origin)); 4631 4650 } … … 4926 4945 { 4927 4946 ResourceRequest::setHTTPPipeliningEnabled(enabled); 4947 } 4948 4949 - (void)_didScrollDocumentInFrameView:(WebFrameView *)frameView 4950 { 4951 [self hideFormValidationMessage]; 4952 [[self _UIDelegateForwarder] webView:self didScrollDocumentInFrameView:frameView]; 4928 4953 } 4929 4954 … … 6136 6161 _private->zoomMultiplier = multiplier; 6137 6162 _private->zoomsTextOnly = isTextOnly; 6163 6164 [self hideFormValidationMessage]; 6138 6165 6139 6166 // FIXME: It might be nice to rework this code so that _private->zoomMultiplier doesn't exist … … 9236 9263 [self _clearTextIndicatorWithAnimation:TextIndicatorWindowDismissalAnimation::FadeOut]; 9237 9264 } 9265 9238 9266 #endif // PLATFORM(MAC) 9267 9268 - (void)showFormValidationMessage:(NSString *)message withAnchorRect:(NSRect)anchorRect 9269 { 9270 // FIXME: We should enable this on iOS as well. 9271 #if PLATFORM(MAC) 9272 _private->formValidationBubble = std::make_unique<ValidationBubble>(self, message); 9273 _private->formValidationBubble->showRelativeTo(enclosingIntRect([self _convertRectFromRootView:anchorRect])); 9274 #else 9275 UNUSED_PARAM(message); 9276 UNUSED_PARAM(anchorRect); 9277 #endif 9278 } 9279 9280 - (void)hideFormValidationMessage 9281 { 9282 _private->formValidationBubble = nullptr; 9283 } 9239 9284 9240 9285 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS) -
trunk/Source/WebKit/mac/WebView/WebViewData.h
r208452 r209252 49 49 class Page; 50 50 class TextIndicatorWindow; 51 class ValidationBubble; 51 52 #if PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE) 52 53 class WebPlaybackSessionInterfaceMac; … … 206 207 #endif // PLATFORM(MAC) 207 208 209 std::unique_ptr<WebCore::ValidationBubble> formValidationBubble; 210 208 211 BOOL shouldMaintainInactiveSelection; 209 212 -
trunk/Source/WebKit/mac/WebView/WebViewData.mm
r207562 r209252 38 38 #import <WebCore/HistoryItem.h> 39 39 #import <WebCore/TextIndicatorWindow.h> 40 #import <WebCore/ValidationBubble.h> 40 41 #import <runtime/InitializeThreading.h> 41 42 #import <wtf/MainThread.h> … … 144 145 zoomsTextOnly = NO; 145 146 146 interactiveFormValidationEnabled = NO;147 interactiveFormValidationEnabled = YES; 147 148 // The default value should be synchronized with WebCore/page/Settings.cpp. 148 149 validationMessageTimerMagnification = 50; -
trunk/Source/WebKit/mac/WebView/WebViewInternal.h
r208452 r209252 301 301 - (NSCandidateListTouchBarItem *)candidateList; 302 302 303 @end 303 - (void)showFormValidationMessage:(NSString *)message withAnchorRect:(NSRect)anchorRect; 304 - (void)hideFormValidationMessage; 305 306 @end -
trunk/Source/WebKit/mac/WebView/WebViewPrivate.h
r208452 r209252 487 487 - (void)_updateActiveState; 488 488 489 - (void)_didScrollDocumentInFrameView:(WebFrameView *)frameView; 490 489 491 /*! 490 492 @method _registerViewClass:representationClass:forURLScheme: … … 743 745 - (int)validationMessageTimerMagnification; 744 746 - (void)setValidationMessageTimerMagnification:(int)newValue; 747 - (NSDictionary *)_contentsOfUserInterfaceItem:(NSString *)userInterfaceItem; 745 748 746 749 // Returns YES if NSView -displayRectIgnoringOpacity:inContext: will produce a faithful representation of the content. -
trunk/Tools/ChangeLog
r209251 r209252 1 2016-12-02 Chris Dumez <cdumez@apple.com> 2 3 [Mac][WK1] Implement new HTML interactive form validation user interface 4 https://bugs.webkit.org/show_bug.cgi?id=164483 5 6 Reviewed by Simon Fraser. 7 8 Add support for UIScriptController's contentsOfUserInterfaceItem("validationBubble") 9 on Mac DRT as this is needed by the HTML form validation layout tests. 10 11 * DumpRenderTree/mac/UIScriptControllerMac.mm: 12 (WTR::UIScriptController::contentsOfUserInterfaceItem): 13 1 14 2016-12-02 Brady Eidson <beidson@apple.com> 2 15 -
trunk/Tools/DumpRenderTree/mac/UIScriptControllerMac.mm
r208926 r209252 29 29 #import "DumpRenderTree.h" 30 30 #import "UIScriptContext.h" 31 #import <JavaScriptCore/JSContext.h> 32 #import <JavaScriptCore/JSStringRefCF.h> 33 #import <JavaScriptCore/JSValue.h> 31 34 #import <WebKit/WebKit.h> 32 35 #import <WebKit/WebViewPrivate.h> … … 76 79 JSObjectRef UIScriptController::contentsOfUserInterfaceItem(JSStringRef interfaceItem) const 77 80 { 81 #if JSC_OBJC_API_ENABLED 82 WebView *webView = [mainFrame webView]; 83 RetainPtr<CFStringRef> interfaceItemCF = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, interfaceItem)); 84 NSDictionary *contentDictionary = [webView _contentsOfUserInterfaceItem:(NSString *)interfaceItemCF.get()]; 85 return JSValueToObject(m_context->jsContext(), [JSValue valueWithObject:contentDictionary inContext:[JSContext contextWithJSGlobalContextRef:m_context->jsContext()]].JSValueRef, nullptr); 86 #else 87 UNUSED_PARAM(interfaceItem); 78 88 return nullptr; 89 #endif 79 90 } 80 91
Note:
See TracChangeset
for help on using the changeset viewer.