Diff
Modified: branches/safari-608.1.5.1-branch/Source/WebCore/ChangeLog (241765 => 241766)
--- branches/safari-608.1.5.1-branch/Source/WebCore/ChangeLog 2019-02-19 19:05:17 UTC (rev 241765)
+++ branches/safari-608.1.5.1-branch/Source/WebCore/ChangeLog 2019-02-19 19:05:29 UTC (rev 241766)
@@ -1,5 +1,81 @@
2019-02-19 Alan Coon <[email protected]>
+ Cherry-pick r241721. rdar://problem/47677951
+
+ AX: PSON: Going back from apple.com to search results, cannot interact with HTML content. Disabling Swap Processes on Cross-Site Navigation resolves the issue.
+ https://bugs.webkit.org/show_bug.cgi?id=194742
+
+ Reviewed by Chris Dumez.
+
+ Source/WebCore:
+
+ With the new process model, WebProcess hits a case where it tries to send the "page loaded" notification before VoiceOver
+ had a chance to register for any notifications. This leads to those notifications being dropped (and thus this bug).
+
+ This change instead asks the UIProcess to send the notification, which we know VoiceOver has registered for, and can reliably
+ receive notifications.
+
+ It also sends the notification for "load failures," which to the VO users' perspective amounts to the same thing as a successful
+ page load.
+
+ * accessibility/mac/AXObjectCacheMac.mm:
+ (WebCore::AXObjectCache::frameLoadingEventPlatformNotification):
+
+ Source/WebKit:
+
+ Re-initialize the accessibility web process tokens when swapping processes.
+ Send page load notifications from the UIProcess instead of the WebProcess to improve reliability.
+
+ * UIProcess/mac/PageClientImplMac.mm:
+ (WebKit::PageClientImpl::didFinishLoadForMainFrame):
+ (WebKit::PageClientImpl::didFailLoadForMainFrame):
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::reinitializeWebPage):
+ * WebProcess/WebPage/WebPage.h:
+ * WebProcess/WebPage/gtk/WebPageGtk.cpp:
+ (WebKit::WebPage::platformReinitialize):
+ (WebKit::WebPage::platformDetach): Deleted.
+ (WebKit::WebPage::platformEditorState const): Deleted.
+ (WebKit::WebPage::updateAccessibilityTree): Deleted.
+ (WebKit::WebPage::performDefaultBehaviorForKeyEvent): Deleted.
+ (WebKit::WebPage::platformCanHandleRequest): Deleted.
+ (WebKit::WebPage::platformUserAgent const): Deleted.
+ (WebKit::WebPage::getCenterForZoomGesture): Deleted.
+ (WebKit::WebPage::setInputMethodState): Deleted.
+ (WebKit::WebPage::collapseSelectionInFrame): Deleted.
+ * WebProcess/WebPage/ios/WebPageIOS.mm:
+ (WebKit::WebPage::platformReinitialize):
+ * WebProcess/WebPage/mac/WebPageMac.mm:
+ (WebKit::WebPage::platformReinitialize):
+ * WebProcess/WebPage/win/WebPageWin.cpp:
+ (WebKit::WebPage::platformReinitialize):
+ * WebProcess/WebPage/wpe/WebPageWPE.cpp:
+ (WebKit::WebPage::platformReinitialize):
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241721 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2019-02-18 Chris Fleizach <[email protected]>
+
+ AX: PSON: Going back from apple.com to search results, cannot interact with HTML content. Disabling Swap Processes on Cross-Site Navigation resolves the issue.
+ https://bugs.webkit.org/show_bug.cgi?id=194742
+
+ Reviewed by Chris Dumez.
+
+ With the new process model, WebProcess hits a case where it tries to send the "page loaded" notification before VoiceOver
+ had a chance to register for any notifications. This leads to those notifications being dropped (and thus this bug).
+
+ This change instead asks the UIProcess to send the notification, which we know VoiceOver has registered for, and can reliably
+ receive notifications.
+
+ It also sends the notification for "load failures," which to the VO users' perspective amounts to the same thing as a successful
+ page load.
+
+ * accessibility/mac/AXObjectCacheMac.mm:
+ (WebCore::AXObjectCache::frameLoadingEventPlatformNotification):
+
+2019-02-19 Alan Coon <[email protected]>
+
Cherry-pick r241556. rdar://problem/46793397
[PSON] Introduce a WebContent Process cache
Modified: branches/safari-608.1.5.1-branch/Source/WebCore/accessibility/mac/AXObjectCacheMac.mm (241765 => 241766)
--- branches/safari-608.1.5.1-branch/Source/WebCore/accessibility/mac/AXObjectCacheMac.mm 2019-02-19 19:05:17 UTC (rev 241765)
+++ branches/safari-608.1.5.1-branch/Source/WebCore/accessibility/mac/AXObjectCacheMac.mm 2019-02-19 19:05:29 UTC (rev 241766)
@@ -259,15 +259,19 @@
axShouldRepostNotificationsForTests = value;
}
-static void AXPostNotificationWithUserInfo(AccessibilityObjectWrapper *object, NSString *notification, id userInfo)
+static void AXPostNotificationWithUserInfo(AccessibilityObjectWrapper *object, NSString *notification, id userInfo, bool skipSystemNotification = false)
{
if (id associatedPluginParent = [object associatedPluginParent])
object = associatedPluginParent;
-
- NSAccessibilityPostNotificationWithUserInfo(object, notification, userInfo);
+
// To simplify monitoring for notifications in tests, repost as a simple NSNotification instead of forcing test infrastucture to setup an IPC client and do all the translation between WebCore types and platform specific IPC types and back
if (UNLIKELY(axShouldRepostNotificationsForTests))
[object accessibilityPostedNotification:notification userInfo:userInfo];
+
+ if (skipSystemNotification)
+ return;
+
+ NSAccessibilityPostNotificationWithUserInfo(object, notification, userInfo);
}
void AXObjectCache::postPlatformNotification(AccessibilityObject* obj, AXNotification notification)
@@ -274,7 +278,8 @@
{
if (!obj)
return;
-
+
+ bool skipSystemNotification = false;
// Some notifications are unique to Safari and do not have NSAccessibility equivalents.
NSString *macNotification;
switch (notification) {
@@ -302,6 +307,11 @@
break;
case AXLoadComplete:
macNotification = @"AXLoadComplete";
+ // Frame loading events are handled by the UIProcess on macOS to improve reliability.
+ // On macOS, before notifications are allowed by AppKit to be sent to clients, you need to have a client (e.g. VoiceOver)
+ // register for that notification. Because these new processes appear before VO has a chance to register, it will often
+ // miss AXLoadComplete notifications. By moving them to the UIProcess, we can eliminate that issue.
+ skipSystemNotification = true;
break;
case AXInvalidStatusChanged:
macNotification = @"AXInvalidStatusChanged";
@@ -359,7 +369,7 @@
ASSERT([obj->wrapper() accessibilityIsIgnored] || true);
ALLOW_DEPRECATED_DECLARATIONS_END
- AXPostNotificationWithUserInfo(obj->wrapper(), macNotification, nil);
+ AXPostNotificationWithUserInfo(obj->wrapper(), macNotification, nil, skipSystemNotification);
}
void AXObjectCache::postTextStateChangePlatformNotification(AccessibilityObject* object, const AXTextStateChangeIntent& intent, const VisibleSelection& selection)
Modified: branches/safari-608.1.5.1-branch/Source/WebKit/ChangeLog (241765 => 241766)
--- branches/safari-608.1.5.1-branch/Source/WebKit/ChangeLog 2019-02-19 19:05:17 UTC (rev 241765)
+++ branches/safari-608.1.5.1-branch/Source/WebKit/ChangeLog 2019-02-19 19:05:29 UTC (rev 241766)
@@ -1,5 +1,98 @@
2019-02-19 Alan Coon <[email protected]>
+ Cherry-pick r241721. rdar://problem/47677951
+
+ AX: PSON: Going back from apple.com to search results, cannot interact with HTML content. Disabling Swap Processes on Cross-Site Navigation resolves the issue.
+ https://bugs.webkit.org/show_bug.cgi?id=194742
+
+ Reviewed by Chris Dumez.
+
+ Source/WebCore:
+
+ With the new process model, WebProcess hits a case where it tries to send the "page loaded" notification before VoiceOver
+ had a chance to register for any notifications. This leads to those notifications being dropped (and thus this bug).
+
+ This change instead asks the UIProcess to send the notification, which we know VoiceOver has registered for, and can reliably
+ receive notifications.
+
+ It also sends the notification for "load failures," which to the VO users' perspective amounts to the same thing as a successful
+ page load.
+
+ * accessibility/mac/AXObjectCacheMac.mm:
+ (WebCore::AXObjectCache::frameLoadingEventPlatformNotification):
+
+ Source/WebKit:
+
+ Re-initialize the accessibility web process tokens when swapping processes.
+ Send page load notifications from the UIProcess instead of the WebProcess to improve reliability.
+
+ * UIProcess/mac/PageClientImplMac.mm:
+ (WebKit::PageClientImpl::didFinishLoadForMainFrame):
+ (WebKit::PageClientImpl::didFailLoadForMainFrame):
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::reinitializeWebPage):
+ * WebProcess/WebPage/WebPage.h:
+ * WebProcess/WebPage/gtk/WebPageGtk.cpp:
+ (WebKit::WebPage::platformReinitialize):
+ (WebKit::WebPage::platformDetach): Deleted.
+ (WebKit::WebPage::platformEditorState const): Deleted.
+ (WebKit::WebPage::updateAccessibilityTree): Deleted.
+ (WebKit::WebPage::performDefaultBehaviorForKeyEvent): Deleted.
+ (WebKit::WebPage::platformCanHandleRequest): Deleted.
+ (WebKit::WebPage::platformUserAgent const): Deleted.
+ (WebKit::WebPage::getCenterForZoomGesture): Deleted.
+ (WebKit::WebPage::setInputMethodState): Deleted.
+ (WebKit::WebPage::collapseSelectionInFrame): Deleted.
+ * WebProcess/WebPage/ios/WebPageIOS.mm:
+ (WebKit::WebPage::platformReinitialize):
+ * WebProcess/WebPage/mac/WebPageMac.mm:
+ (WebKit::WebPage::platformReinitialize):
+ * WebProcess/WebPage/win/WebPageWin.cpp:
+ (WebKit::WebPage::platformReinitialize):
+ * WebProcess/WebPage/wpe/WebPageWPE.cpp:
+ (WebKit::WebPage::platformReinitialize):
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241721 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2019-02-18 Chris Fleizach <[email protected]>
+
+ AX: PSON: Going back from apple.com to search results, cannot interact with HTML content. Disabling Swap Processes on Cross-Site Navigation resolves the issue.
+ https://bugs.webkit.org/show_bug.cgi?id=194742
+
+ Reviewed by Chris Dumez.
+
+ Re-initialize the accessibility web process tokens when swapping processes.
+ Send page load notifications from the UIProcess instead of the WebProcess to improve reliability.
+
+ * UIProcess/mac/PageClientImplMac.mm:
+ (WebKit::PageClientImpl::didFinishLoadForMainFrame):
+ (WebKit::PageClientImpl::didFailLoadForMainFrame):
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::reinitializeWebPage):
+ * WebProcess/WebPage/WebPage.h:
+ * WebProcess/WebPage/gtk/WebPageGtk.cpp:
+ (WebKit::WebPage::platformReinitialize):
+ (WebKit::WebPage::platformDetach): Deleted.
+ (WebKit::WebPage::platformEditorState const): Deleted.
+ (WebKit::WebPage::updateAccessibilityTree): Deleted.
+ (WebKit::WebPage::performDefaultBehaviorForKeyEvent): Deleted.
+ (WebKit::WebPage::platformCanHandleRequest): Deleted.
+ (WebKit::WebPage::platformUserAgent const): Deleted.
+ (WebKit::WebPage::getCenterForZoomGesture): Deleted.
+ (WebKit::WebPage::setInputMethodState): Deleted.
+ (WebKit::WebPage::collapseSelectionInFrame): Deleted.
+ * WebProcess/WebPage/ios/WebPageIOS.mm:
+ (WebKit::WebPage::platformReinitialize):
+ * WebProcess/WebPage/mac/WebPageMac.mm:
+ (WebKit::WebPage::platformReinitialize):
+ * WebProcess/WebPage/win/WebPageWin.cpp:
+ (WebKit::WebPage::platformReinitialize):
+ * WebProcess/WebPage/wpe/WebPageWPE.cpp:
+ (WebKit::WebPage::platformReinitialize):
+
+2019-02-19 Alan Coon <[email protected]>
+
Cherry-pick r241641. rdar://problem/47833813
NetworkDataTask should check its client before calling shouldCaptureExtraNetworkLoadMetrics
Modified: branches/safari-608.1.5.1-branch/Source/WebKit/UIProcess/mac/PageClientImplMac.mm (241765 => 241766)
--- branches/safari-608.1.5.1-branch/Source/WebKit/UIProcess/mac/PageClientImplMac.mm 2019-02-19 19:05:17 UTC (rev 241765)
+++ branches/safari-608.1.5.1-branch/Source/WebKit/UIProcess/mac/PageClientImplMac.mm 2019-02-19 19:05:29 UTC (rev 241766)
@@ -89,6 +89,8 @@
#include <WebCore/WebMediaSessionManager.h>
#endif
+static NSString * const kAXLoadCompleteNotification = @"AXLoadComplete";
+
@interface NSApplication (WebNSApplicationDetails)
- (NSCursor *)_cursorRectCursor;
@end
@@ -830,6 +832,8 @@
{
if (auto gestureController = m_impl->gestureController())
gestureController->didFinishLoadForMainFrame();
+
+ NSAccessibilityPostNotification(NSAccessibilityUnignoredAncestor(m_view), kAXLoadCompleteNotification);
}
void PageClientImpl::didFailLoadForMainFrame()
@@ -836,6 +840,8 @@
{
if (auto gestureController = m_impl->gestureController())
gestureController->didFailLoadForMainFrame();
+
+ NSAccessibilityPostNotification(NSAccessibilityUnignoredAncestor(m_view), kAXLoadCompleteNotification);
}
void PageClientImpl::didSameDocumentNavigationForMainFrame(SameDocumentNavigationType type)
Modified: branches/safari-608.1.5.1-branch/Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm (241765 => 241766)
--- branches/safari-608.1.5.1-branch/Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm 2019-02-19 19:05:17 UTC (rev 241765)
+++ branches/safari-608.1.5.1-branch/Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm 2019-02-19 19:05:29 UTC (rev 241766)
@@ -183,6 +183,12 @@
return dictionaryPopupInfo;
}
+void WebPage::accessibilityTransferRemoteToken(RetainPtr<NSData> remoteToken)
+{
+ IPC::DataReference dataToken = IPC::DataReference(reinterpret_cast<const uint8_t*>([remoteToken bytes]), [remoteToken length]);
+ send(Messages::WebPageProxy::RegisterWebProcessAccessibilityToken(dataToken));
+}
+
} // namespace WebKit
#endif // PLATFORM(COCOA)
Modified: branches/safari-608.1.5.1-branch/Source/WebKit/WebProcess/WebPage/WebPage.cpp (241765 => 241766)
--- branches/safari-608.1.5.1-branch/Source/WebKit/WebProcess/WebPage/WebPage.cpp 2019-02-19 19:05:17 UTC (rev 241765)
+++ branches/safari-608.1.5.1-branch/Source/WebKit/WebProcess/WebPage/WebPage.cpp 2019-02-19 19:05:29 UTC (rev 241766)
@@ -710,6 +710,8 @@
setActivityState(parameters.activityState, ActivityStateChangeAsynchronous, Vector<CallbackID>());
if (m_layerHostingMode != parameters.layerHostingMode)
setLayerHostingMode(parameters.layerHostingMode);
+
+ platformReinitialize();
}
void WebPage::updateThrottleState()
Modified: branches/safari-608.1.5.1-branch/Source/WebKit/WebProcess/WebPage/WebPage.h (241765 => 241766)
--- branches/safari-608.1.5.1-branch/Source/WebKit/WebProcess/WebPage/WebPage.h 2019-02-19 19:05:17 UTC (rev 241765)
+++ branches/safari-608.1.5.1-branch/Source/WebKit/WebProcess/WebPage/WebPage.h 2019-02-19 19:05:29 UTC (rev 241766)
@@ -1155,6 +1155,7 @@
uint64_t messageSenderDestinationID() override;
void platformInitialize();
+ void platformReinitialize();
void platformDetach();
void platformEditorState(WebCore::Frame&, EditorState& result, IncludePostLayoutDataHint) const;
void sendEditorStateUpdate();
@@ -1449,6 +1450,8 @@
#if PLATFORM(COCOA)
void requestActiveNowPlayingSessionInfo(CallbackID);
+ RetainPtr<NSData> accessibilityRemoteTokenData() const;
+ void accessibilityTransferRemoteToken(RetainPtr<NSData>);
#endif
void setShouldDispatchFakeMouseMoveEvents(bool dispatch) { m_shouldDispatchFakeMouseMoveEvents = dispatch; }
Modified: branches/safari-608.1.5.1-branch/Source/WebKit/WebProcess/WebPage/gtk/WebPageGtk.cpp (241765 => 241766)
--- branches/safari-608.1.5.1-branch/Source/WebKit/WebProcess/WebPage/gtk/WebPageGtk.cpp 2019-02-19 19:05:17 UTC (rev 241765)
+++ branches/safari-608.1.5.1-branch/Source/WebKit/WebProcess/WebPage/gtk/WebPageGtk.cpp 2019-02-19 19:05:29 UTC (rev 241766)
@@ -67,6 +67,10 @@
#endif
}
+void WebPage::platformReinitialize()
+{
+}
+
void WebPage::platformDetach()
{
}
Modified: branches/safari-608.1.5.1-branch/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm (241765 => 241766)
--- branches/safari-608.1.5.1-branch/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm 2019-02-19 19:05:17 UTC (rev 241765)
+++ branches/safari-608.1.5.1-branch/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm 2019-02-19 19:05:29 UTC (rev 241766)
@@ -141,12 +141,20 @@
{
m_mockAccessibilityElement = adoptNS([[WKAccessibilityWebPageObject alloc] init]);
[m_mockAccessibilityElement setWebPage:this];
-
- NSData *remoteToken = newAccessibilityRemoteToken([NSUUID UUID]);
- IPC::DataReference dataToken = IPC::DataReference(reinterpret_cast<const uint8_t*>([remoteToken bytes]), [remoteToken length]);
- send(Messages::WebPageProxy::RegisterWebProcessAccessibilityToken(dataToken));
+
+ accessibilityTransferRemoteToken(accessibilityRemoteTokenData());
}
+void WebPage::platformReinitialize()
+{
+ accessibilityTransferRemoteToken(accessibilityRemoteTokenData());
+}
+
+RetainPtr<NSData> WebPage::accessibilityRemoteTokenData() const
+{
+ return newAccessibilityRemoteToken([NSUUID UUID]);
+}
+
static void computeEditableRootHasContentAndPlainText(const VisibleSelection& selection, EditorState::PostLayoutData& data)
{
data.hasContent = false;
Modified: branches/safari-608.1.5.1-branch/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm (241765 => 241766)
--- branches/safari-608.1.5.1-branch/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm 2019-02-19 19:05:17 UTC (rev 241765)
+++ branches/safari-608.1.5.1-branch/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm 2019-02-19 19:05:29 UTC (rev 241766)
@@ -111,14 +111,22 @@
if ([mockAccessibilityElement respondsToSelector:@selector(accessibilitySetPresenterProcessIdentifier:)])
[(id)mockAccessibilityElement accessibilitySetPresenterProcessIdentifier:pid];
[mockAccessibilityElement setWebPage:this];
+ m_mockAccessibilityElement = mockAccessibilityElement;
- // send data back over
- NSData* remoteToken = [NSAccessibilityRemoteUIElement remoteTokenForLocalUIElement:mockAccessibilityElement];
- IPC::DataReference dataToken = IPC::DataReference(reinterpret_cast<const uint8_t*>([remoteToken bytes]), [remoteToken length]);
- send(Messages::WebPageProxy::RegisterWebProcessAccessibilityToken(dataToken));
- m_mockAccessibilityElement = mockAccessibilityElement;
+ accessibilityTransferRemoteToken(accessibilityRemoteTokenData());
}
+void WebPage::platformReinitialize()
+{
+ accessibilityTransferRemoteToken(accessibilityRemoteTokenData());
+}
+
+RetainPtr<NSData> WebPage::accessibilityRemoteTokenData() const
+{
+ ASSERT(m_mockAccessibilityElement);
+ return [NSAccessibilityRemoteUIElement remoteTokenForLocalUIElement:m_mockAccessibilityElement.get()];
+}
+
void WebPage::platformDetach()
{
[m_mockAccessibilityElement setWebPage:nullptr];
Modified: branches/safari-608.1.5.1-branch/Source/WebKit/WebProcess/WebPage/win/WebPageWin.cpp (241765 => 241766)
--- branches/safari-608.1.5.1-branch/Source/WebKit/WebProcess/WebPage/win/WebPageWin.cpp 2019-02-19 19:05:17 UTC (rev 241765)
+++ branches/safari-608.1.5.1-branch/Source/WebKit/WebProcess/WebPage/win/WebPageWin.cpp 2019-02-19 19:05:29 UTC (rev 241766)
@@ -55,6 +55,10 @@
{
}
+void WebPage::platformReinitialize()
+{
+}
+
void WebPage::platformDetach()
{
}
Modified: branches/safari-608.1.5.1-branch/Source/WebKit/WebProcess/WebPage/wpe/WebPageWPE.cpp (241765 => 241766)
--- branches/safari-608.1.5.1-branch/Source/WebKit/WebProcess/WebPage/wpe/WebPageWPE.cpp 2019-02-19 19:05:17 UTC (rev 241765)
+++ branches/safari-608.1.5.1-branch/Source/WebKit/WebProcess/WebPage/wpe/WebPageWPE.cpp 2019-02-19 19:05:29 UTC (rev 241766)
@@ -39,6 +39,10 @@
{
}
+void WebPage::platformReinitialize()
+{
+}
+
void WebPage::platformDetach()
{
}