WebKit Bugzilla
Attachment 373137 Details for
Bug 199331
: Need a way for SPI clients to know when to avoid resizing to accommodate for the input view bounds
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-199331-20190628120320.patch (text/plain), 9.81 KB, created by
Wenson Hsieh
on 2019-06-28 12:03:21 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Wenson Hsieh
Created:
2019-06-28 12:03:21 PDT
Size:
9.81 KB
patch
obsolete
>Subversion Revision: 246924 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 0e9bd6338db5ced000d13aacc8bbc50a0e148697..1d7c1acf8210a9247e6069fde93b46f168e8990a 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,17 @@ >+2019-06-28 Wenson Hsieh <wenson_hsieh@apple.com> >+ >+ Need a way for SPI clients to know when to avoid resizing to accommodate for the input view bounds >+ https://bugs.webkit.org/show_bug.cgi?id=199331 >+ <rdar://problem/52116170> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add a new quirk to avoid resizing the web view when input view bounds change. >+ >+ * page/Quirks.cpp: >+ (WebCore::Quirks::shouldAvoidResizingWhenInputViewBoundsChange const): >+ * page/Quirks.h: >+ > 2019-06-28 Fujii Hironori <Hironori.Fujii@sony.com> > > [Win] unresolved external symbol "JSC::JSObject::didBecomePrototype(void)" referenced in function "JSC::Structure::create(...)" >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 0b2891db236b9f915c4f4509a30d4c3d882b30d2..7da0e6c0e50459ac14df435fc01a6899fdefe7fe 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,36 @@ >+2019-06-28 Wenson Hsieh <wenson_hsieh@apple.com> >+ >+ Need a way for SPI clients to know when to avoid resizing to accommodate for the input view bounds >+ https://bugs.webkit.org/show_bug.cgi?id=199331 >+ <rdar://problem/52116170> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Expose new SPI, such that clients may check whether to avoid resizing the web view when changing input view >+ bounds. In particular, resizing the web view in this case causes toolbar menus in Microsoft Word online to >+ dismiss immediately after opening them, due to resize events fired as a result of the input view dismissing. >+ >+ * Shared/FocusedElementInformation.cpp: >+ (WebKit::FocusedElementInformation::encode const): >+ (WebKit::FocusedElementInformation::decode): >+ * Shared/FocusedElementInformation.h: >+ >+ Add a new flag to FocusedElementInformation to indicate whether we should avoid resizing the web view when an >+ input view is presented. >+ >+ * UIProcess/API/Cocoa/WKWebView.mm: >+ (-[WKWebView _shouldAvoidResizingWhenInputViewBoundsChange]): >+ * UIProcess/API/Cocoa/WKWebViewPrivate.h: >+ * UIProcess/ios/WKContentViewInteraction.h: >+ * UIProcess/ios/WKContentViewInteraction.mm: >+ (-[WKContentView _elementDidBlur]): >+ >+ Reset the value of the flag. >+ >+ (-[WKContentView _shouldAvoidResizingWhenInputViewBoundsChange]): >+ * WebProcess/WebPage/ios/WebPageIOS.mm: >+ (WebKit::WebPage::getFocusedElementInformation): >+ > 2019-06-28 Wenson Hsieh <wenson_hsieh@apple.com> > > -[WKContentView _selectionClipRects] returns a bogus value in -reloadInputViews when focusing an element >diff --git a/Source/WebCore/page/Quirks.cpp b/Source/WebCore/page/Quirks.cpp >index 6fe3b8e9125fcfd56d670ab30774b2d181b1a9ed..f02efe2267b0a95fc3ce9267d7688b619dc83e1e 100644 >--- a/Source/WebCore/page/Quirks.cpp >+++ b/Source/WebCore/page/Quirks.cpp >@@ -298,6 +298,15 @@ bool Quirks::shouldDispatchSimulatedMouseEventsOnTarget(EventTarget* target) con > } > #endif > >+bool Quirks::shouldAvoidResizingWhenInputViewBoundsChange() const >+{ >+ if (!needsQuirks()) >+ return false; >+ >+ auto host = m_document->topDocument().url().host(); >+ return equalLettersIgnoringASCIICase(host, "live.com") || host.endsWithIgnoringASCIICase(".live.com"); >+} >+ > bool Quirks::shouldDisablePointerEventsQuirk() const > { > #if PLATFORM(IOS_FAMILY) >diff --git a/Source/WebCore/page/Quirks.h b/Source/WebCore/page/Quirks.h >index 0702dfc04764d2c260ca0364bcfc06c1d027473f..05122a9952a85ec00e90ac5af9c68a5c6838a76b 100644 >--- a/Source/WebCore/page/Quirks.h >+++ b/Source/WebCore/page/Quirks.h >@@ -60,6 +60,7 @@ public: > WEBCORE_EXPORT bool shouldSuppressAutocorrectionAndAutocaptializationInHiddenEditableAreas() const; > WEBCORE_EXPORT bool isTouchBarUpdateSupressedForHiddenContentEditable() const; > WEBCORE_EXPORT bool isNeverRichlyEditableForTouchBar() const; >+ WEBCORE_EXPORT bool shouldAvoidResizingWhenInputViewBoundsChange() const; > > bool needsGMailOverflowScrollQuirk() const; > bool needsYouTubeOverflowScrollQuirk() const; >diff --git a/Source/WebKit/Shared/FocusedElementInformation.cpp b/Source/WebKit/Shared/FocusedElementInformation.cpp >index f1e5364fae4e647aa6c80f1c44dbb722cbafbd42..14821ecbec8fe0923e3935717413ce12797943ac 100644 >--- a/Source/WebKit/Shared/FocusedElementInformation.cpp >+++ b/Source/WebKit/Shared/FocusedElementInformation.cpp >@@ -106,6 +106,7 @@ void FocusedElementInformation::encode(IPC::Encoder& encoder) const > #endif > encoder << shouldSynthesizeKeyEventsForEditing; > encoder << isSpellCheckingEnabled; >+ encoder << shouldAvoidResizingWhenInputViewBoundsChange; > } > > bool FocusedElementInformation::decode(IPC::Decoder& decoder, FocusedElementInformation& result) >@@ -230,6 +231,9 @@ bool FocusedElementInformation::decode(IPC::Decoder& decoder, FocusedElementInfo > if (!decoder.decode(result.isSpellCheckingEnabled)) > return false; > >+ if (!decoder.decode(result.shouldAvoidResizingWhenInputViewBoundsChange)) >+ return false; >+ > return true; > } > #endif >diff --git a/Source/WebKit/Shared/FocusedElementInformation.h b/Source/WebKit/Shared/FocusedElementInformation.h >index 2f665a929592224343a4bf47935968fc805c77e3..46bf7532a720cb0e26644f90bd32a6c6d55b42c1 100644 >--- a/Source/WebKit/Shared/FocusedElementInformation.h >+++ b/Source/WebKit/Shared/FocusedElementInformation.h >@@ -138,6 +138,7 @@ struct FocusedElementInformation { > #endif > bool shouldSynthesizeKeyEventsForEditing { false }; > bool isSpellCheckingEnabled { true }; >+ bool shouldAvoidResizingWhenInputViewBoundsChange { false }; > > FocusedElementIdentifier focusedElementIdentifier { 0 }; > >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm b/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm >index 857ef857c5daac1f3940e814c15fbe6c8249dbb4..919b799885a62f0886030e313529fb6fca0846a7 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm >@@ -1424,6 +1424,11 @@ - (BOOL)_contentViewIsFirstResponder > return self._currentContentView.isFirstResponder; > } > >+- (BOOL)_shouldAvoidResizingWhenInputViewBoundsChange >+{ >+ return [_contentView _shouldAvoidResizingWhenInputViewBoundsChange]; >+} >+ > - (_WKDragInteractionPolicy)_dragInteractionPolicy > { > return _dragInteractionPolicy; >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h b/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h >index 9263301d59d68ad9528184aea5e5d83a62e79f72..957cfa12d55d31ad6879915f3b73c297a6303a42 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h >@@ -272,6 +272,7 @@ typedef NS_OPTIONS(NSUInteger, _WKRectEdge) { > @property (nonatomic, readonly) _WKWebViewPrintFormatter *_webViewPrintFormatter; > > @property (nonatomic, setter=_setDragInteractionPolicy:) _WKDragInteractionPolicy _dragInteractionPolicy WK_API_AVAILABLE(ios(11.0)); >+@property (nonatomic, readonly) BOOL _shouldAvoidResizingWhenInputViewBoundsChange WK_API_AVAILABLE(ios(WK_IOS_TBA)); > > - (void)_beginInteractiveObscuredInsetsChange; > - (void)_endInteractiveObscuredInsetsChange; >diff --git a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h >index db52020a15bdcfa161bdbfa60cbcd7e329e5e9ce..438e4b18630ca709ea313b9464e75c5491714496 100644 >--- a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h >+++ b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h >@@ -525,7 +525,8 @@ FOR_EACH_PRIVATE_WKCONTENTVIEW_ACTION(DECLARE_WKCONTENTVIEW_ACTION_FOR_WEB_VIEW) > > - (void)_didStartProvisionalLoadForMainFrame; > >-@property (nonatomic, readonly, getter=_shouldUseContextMenus) BOOL _shouldUseContextMenus; >+@property (nonatomic, readonly) BOOL _shouldUseContextMenus; >+@property (nonatomic, readonly) BOOL _shouldAvoidResizingWhenInputViewBoundsChange; > > @end > >diff --git a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >index f731345a75573356fa9b68e32d43c097c65af970..580e7f6df95b0bda7676feb5f2e163d0005fbcb0 100644 >--- a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >+++ b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >@@ -5300,6 +5300,7 @@ - (void)_elementDidBlur > > _focusedElementInformation.elementType = WebKit::InputType::None; > _focusedElementInformation.shouldSynthesizeKeyEventsForEditing = false; >+ _focusedElementInformation.shouldAvoidResizingWhenInputViewBoundsChange = false; > _inputPeripheral = nil; > _focusRequiresStrongPasswordAssistance = NO; > >@@ -6221,6 +6222,11 @@ - (BOOL)_shouldUseContextMenus > return NO; > } > >+- (BOOL)_shouldAvoidResizingWhenInputViewBoundsChange >+{ >+ return _focusedElementInformation.shouldAvoidResizingWhenInputViewBoundsChange; >+} >+ > - (UIView *)containerViewForTargetedPreviews > { > return self.unscaledView ?: self; >diff --git a/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm b/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >index c60f1ab0d612c6071f94a2fd910b34c347a50a7e..7718368a84b4b5c0e62899bf0aec2b9d007955a5 100644 >--- a/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >+++ b/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >@@ -2969,6 +2969,8 @@ void WebPage::getFocusedElementInformation(FocusedElementInformation& informatio > information.autocapitalizeType = AutocapitalizeTypeNone; > information.isAutocorrect = false; > } >+ >+ information.shouldAvoidResizingWhenInputViewBoundsChange = m_focusedElement->document().quirks().shouldAvoidResizingWhenInputViewBoundsChange(); > } > > void WebPage::autofillLoginCredentials(const String& username, const String& password)
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 199331
: 373137 |
373150