Diff
Modified: branches/safari-601.1.46-branch/ChangeLog (190462 => 190463)
--- branches/safari-601.1.46-branch/ChangeLog 2015-10-02 07:58:53 UTC (rev 190462)
+++ branches/safari-601.1.46-branch/ChangeLog 2015-10-02 08:00:13 UTC (rev 190463)
@@ -1,3 +1,21 @@
+2015-10-02 Babak Shafiei <[email protected]>
+
+ Merge r188405.
+
+ 2015-08-13 Wenson Hsieh <[email protected]>
+
+ A focused node should not be assisted when handling touch events synchronously
+ https://bugs.webkit.org/show_bug.cgi?id=147836
+
+ Reviewed by Enrica Casucci.
+
+ Added manual tests for keyboard assistance behavior due to receiving touch events on iOS.
+
+ * ManualTests/ios/focused-input-should-assist-on-touch.html: Checks that a currently focused
+ input can still be assisted due to a touch event.
+ * ManualTests/ios/keyboard-should-not-show-on-touch-event.html: Checks that handling a touch
+ event does not automatically cause us to assist the currently focused node.
+
2015-07-10 Michael Catanzaro <[email protected]>
[GTK] ar warning when linking static libraries
Copied: branches/safari-601.1.46-branch/ManualTests/ios/focused-input-should-assist-on-touch.html (from rev 188405, trunk/ManualTests/ios/focused-input-should-assist-on-touch.html) (0 => 190463)
--- branches/safari-601.1.46-branch/ManualTests/ios/focused-input-should-assist-on-touch.html (rev 0)
+++ branches/safari-601.1.46-branch/ManualTests/ios/focused-input-should-assist-on-touch.html 2015-10-02 08:00:13 UTC (rev 190463)
@@ -0,0 +1,25 @@
+<html>
+<head>
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <script>
+ function handleTouchEvent(event) {
+ event.target.focus();
+ event.preventDefault();
+ }
+ </script>
+
+ <style>
+ input:focus {
+ outline: none;
+ border: 1px solid #4D90FE;
+ }
+ </style>
+
+</head>
+
+<body style="margin: 0;">
+ <p>This tests checks that a node can be assisted when focused due to a touch event, even when the focus does not change.</p>
+ <p>Tapping the below input should show the keyboard.</p>
+ <input autofocus _ontouchstart_="handleTouchEvent(event);"></input>
+</body>
+</html>
Copied: branches/safari-601.1.46-branch/ManualTests/ios/keyboard-should-not-show-on-touch-event.html (from rev 188405, trunk/ManualTests/ios/keyboard-should-not-show-on-touch-event.html) (0 => 190463)
--- branches/safari-601.1.46-branch/ManualTests/ios/keyboard-should-not-show-on-touch-event.html (rev 0)
+++ branches/safari-601.1.46-branch/ManualTests/ios/keyboard-should-not-show-on-touch-event.html 2015-10-02 08:00:13 UTC (rev 190463)
@@ -0,0 +1,34 @@
+<html>
+<head>
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <script>
+ function touchTest(event) { }
+ </script>
+
+ <style>
+ button {
+ top: 300px;
+ left: 100px;
+ width: 200px;
+ height: 200px;
+ background-color: #FFAAAA;
+ position: absolute;
+ padding: 10px;
+ }
+
+ input:focus {
+ outline: none;
+ border: 1px solid #4D90FE;
+ }
+ </style>
+
+</head>
+
+<body style="margin: 0;">
+ <button _ontouchstart_="touchTest(event);">
+ <p>This test checks that any interaction that fires touch events will not assist the currently focused node.</p>
+ <p>Thus, tapping in this touch-handling region should not deploy the keyboard for the autofocused input above.</p>
+ </button>
+ <input autofocus></input>
+</body>
+</html>
Modified: branches/safari-601.1.46-branch/Source/WebCore/ChangeLog (190462 => 190463)
--- branches/safari-601.1.46-branch/Source/WebCore/ChangeLog 2015-10-02 07:58:53 UTC (rev 190462)
+++ branches/safari-601.1.46-branch/Source/WebCore/ChangeLog 2015-10-02 08:00:13 UTC (rev 190463)
@@ -1,5 +1,33 @@
2015-10-02 Babak Shafiei <[email protected]>
+ Merge r188405.
+
+ 2015-08-13 Wenson Hsieh <[email protected]>
+
+ A focused node should not be assisted when handling touch events synchronously
+ https://bugs.webkit.org/show_bug.cgi?id=147836
+ <rdar://problem/22204108>
+
+ Reviewed by Enrica Casucci.
+
+ Makes interaction with touch handlers no longer assist the currently focused element in the
+ general case. Added plumbing to reassist a currently focused node when dispatching touch events,
+ so that an input that programmatically focuses itself and prevents default on a touch event will
+ be properly assisted when it has been programmatically focused (either through _javascript_ or the
+ autofocus attribute) prior to receiving the touch event. This patch also removes the now
+ unnecessary special-casing of the Gmail settings app that currently makes the keyboard deploy
+ upon autofocus.
+
+ * dom/Element.cpp:
+ (WebCore::Element::focus): Notifies the chrome client that the element has refocused before
+ returning early.
+ * page/ChromeClient.h: Refocusing an element does nothing by default.
+ * platform/RuntimeApplicationChecksIOS.h: Removed special casing for Gmail Add Account.
+ * platform/RuntimeApplicationChecksIOS.mm: See above.
+ (WebCore::applicationIsGmailAddAccountOnIOS): See above.
+
+2015-10-02 Babak Shafiei <[email protected]>
+
Merge r188182.
2015-08-07 James Craig <[email protected]>
Modified: branches/safari-601.1.46-branch/Source/WebCore/dom/Element.cpp (190462 => 190463)
--- branches/safari-601.1.46-branch/Source/WebCore/dom/Element.cpp 2015-10-02 07:58:53 UTC (rev 190462)
+++ branches/safari-601.1.46-branch/Source/WebCore/dom/Element.cpp 2015-10-02 08:00:13 UTC (rev 190463)
@@ -2117,8 +2117,12 @@
if (!inDocument())
return;
- if (document().focusedElement() == this)
+ if (document().focusedElement() == this) {
+ if (document().page())
+ document().page()->chrome().client().elementDidRefocus(this);
+
return;
+ }
// If the stylesheets have already been loaded we can reliably check isFocusable.
// If not, we continue and set the focused node on the focus controller below so
Modified: branches/safari-601.1.46-branch/Source/WebCore/page/ChromeClient.h (190462 => 190463)
--- branches/safari-601.1.46-branch/Source/WebCore/page/ChromeClient.h 2015-10-02 07:58:53 UTC (rev 190462)
+++ branches/safari-601.1.46-branch/Source/WebCore/page/ChromeClient.h 2015-10-02 08:00:13 UTC (rev 190463)
@@ -277,6 +277,7 @@
virtual void elementDidFocus(const Node*) { };
virtual void elementDidBlur(const Node*) { };
+ virtual void elementDidRefocus(const Node*) { };
virtual bool shouldPaintEntireContents() const { return false; }
virtual bool hasStablePageScaleFactor() const { return true; }
Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/RuntimeApplicationChecksIOS.h (190462 => 190463)
--- branches/safari-601.1.46-branch/Source/WebCore/platform/RuntimeApplicationChecksIOS.h 2015-10-02 07:58:53 UTC (rev 190462)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/RuntimeApplicationChecksIOS.h 2015-10-02 08:00:13 UTC (rev 190463)
@@ -43,7 +43,6 @@
WEBCORE_EXPORT bool applicationIsTheEconomistOnIPhone();
bool applicationIsWebProcess();
bool applicationIsIBooksOnIOS();
-WEBCORE_EXPORT bool applicationIsGmailAddAccountOnIOS();
} // namespace WebCore
Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/RuntimeApplicationChecksIOS.mm (190462 => 190463)
--- branches/safari-601.1.46-branch/Source/WebCore/platform/RuntimeApplicationChecksIOS.mm 2015-10-02 07:58:53 UTC (rev 190462)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/RuntimeApplicationChecksIOS.mm 2015-10-02 08:00:13 UTC (rev 190463)
@@ -122,12 +122,6 @@
return isIBooksOnIOS;
}
-bool applicationIsGmailAddAccountOnIOS()
-{
- static const bool isGmailAddAccountOnIOS = [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.social.SLGoogleAuth.SLGoogleAuthService"];
- return isGmailAddAccountOnIOS;
-}
-
} // namespace WebCore
#endif // PLATFORM(IOS)
Modified: branches/safari-601.1.46-branch/Source/WebKit2/ChangeLog (190462 => 190463)
--- branches/safari-601.1.46-branch/Source/WebKit2/ChangeLog 2015-10-02 07:58:53 UTC (rev 190462)
+++ branches/safari-601.1.46-branch/Source/WebKit2/ChangeLog 2015-10-02 08:00:13 UTC (rev 190463)
@@ -1,3 +1,34 @@
+2015-10-02 Babak Shafiei <[email protected]>
+
+ Merge r188405.
+
+ 2015-08-13 Wenson Hsieh <[email protected]>
+
+ A focused node should not be assisted when handling touch events synchronously
+ https://bugs.webkit.org/show_bug.cgi?id=147836
+ <rdar://problem/22204108>
+
+ Reviewed by Enrica Casucci.
+
+ Makes interaction with touch handlers no longer assist the currently focused element in the
+ general case. Added plumbing to reassist a currently focused node when dispatching touch events,
+ so that an input that programmatically focuses itself and prevents default on a touch event will
+ be properly assisted when it has been programmatically focused (either through _javascript_ or the
+ autofocus attribute) prior to receiving the touch event. This patch also removes the now
+ unnecessary special-casing of the Gmail settings app that currently makes the keyboard deploy
+ upon autofocus.
+
+ * UIProcess/ios/WKContentViewInteraction.mm:
+ (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]): Removed
+ special case to avoid the early return for Gmail Add Account.
+ * WebProcess/WebCoreSupport/WebChromeClient.h: Added a handler for refocusing an element.
+ * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
+ (WebKit::WebChromeClient::elementDidRefocus): Makes refocusing an element trigger input
+ assistance on iOS.
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::dispatchTouchEvent): Removes logic to focus the currently focused element upon
+ receiving a touch event.
+
2015-10-01 Babak Shafiei <[email protected]>
Merge r190418.
Modified: branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm (190462 => 190463)
--- branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm 2015-10-02 07:58:53 UTC (rev 190462)
+++ branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm 2015-10-02 08:00:13 UTC (rev 190463)
@@ -3018,7 +3018,7 @@
{
// FIXME: This is a temporary workaround for <rdar://problem/22126518>. The real fix will involve refactoring
// the way we assist programmatically focused nodes.
- if (!applicationIsGmailAddAccountOnIOS() && !userIsInteracting && !_textSelectionAssistant)
+ if (!userIsInteracting && !_textSelectionAssistant)
return;
if (blurPreviousNode)
Modified: branches/safari-601.1.46-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h (190462 => 190463)
--- branches/safari-601.1.46-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h 2015-10-02 07:58:53 UTC (rev 190462)
+++ branches/safari-601.1.46-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h 2015-10-02 08:00:13 UTC (rev 190463)
@@ -243,6 +243,7 @@
#if PLATFORM(IOS)
virtual void elementDidFocus(const WebCore::Node*) override;
virtual void elementDidBlur(const WebCore::Node*) override;
+ virtual void elementDidRefocus(const WebCore::Node*) override;
#endif
#if PLATFORM(IOS)
Modified: branches/safari-601.1.46-branch/Source/WebKit2/WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm (190462 => 190463)
--- branches/safari-601.1.46-branch/Source/WebKit2/WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm 2015-10-02 07:58:53 UTC (rev 190462)
+++ branches/safari-601.1.46-branch/Source/WebKit2/WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm 2015-10-02 08:00:13 UTC (rev 190463)
@@ -54,6 +54,11 @@
m_page->elementDidBlur(const_cast<WebCore::Node*>(node));
}
+void WebChromeClient::elementDidRefocus(const WebCore::Node* node)
+{
+ elementDidFocus(node);
+}
+
void WebChromeClient::didReceiveMobileDocType(bool isMobileDoctype)
{
m_page->didReceiveMobileDocType(isMobileDoctype);
Modified: branches/safari-601.1.46-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (190462 => 190463)
--- branches/safari-601.1.46-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2015-10-02 07:58:53 UTC (rev 190462)
+++ branches/safari-601.1.46-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2015-10-02 08:00:13 UTC (rev 190463)
@@ -2171,24 +2171,12 @@
#if ENABLE(IOS_TOUCH_EVENTS)
void WebPage::dispatchTouchEvent(const WebTouchEvent& touchEvent, bool& handled)
{
- RefPtr<Frame> oldFocusedFrame = m_page->focusController().focusedFrame();
- RefPtr<Element> oldFocusedElement = oldFocusedFrame ? oldFocusedFrame->document()->focusedElement() : nullptr;
m_userIsInteracting = true;
m_lastInteractionLocation = touchEvent.position();
CurrentEvent currentEvent(touchEvent);
handled = handleTouchEvent(touchEvent, m_page.get());
- RefPtr<Frame> newFocusedFrame = m_page->focusController().focusedFrame();
- RefPtr<Element> newFocusedElement = newFocusedFrame ? newFocusedFrame->document()->focusedElement() : nullptr;
-
- // If the focus has not changed, we need to notify the client anyway, since it might be
- // necessary to start assisting the node.
- // If the node has been focused by _javascript_ without user interaction, the
- // keyboard is not on screen.
- if (newFocusedElement && newFocusedElement == oldFocusedElement)
- elementDidFocus(newFocusedElement.get());
-
m_userIsInteracting = false;
}