<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[178838] branches/safari-600.1.4.15-branch</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/178838">178838</a></dd>
<dt>Author</dt> <dd>bshafiei@apple.com</dd>
<dt>Date</dt> <dd>2015-01-21 10:38:11 -0800 (Wed, 21 Jan 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Merged <a href="http://trac.webkit.org/projects/webkit/changeset/176904">r176904</a>. rdar://problem/19419865</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari6001415branchSourceWebCoreChangeLog">branches/safari-600.1.4.15-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari6001415branchSourceWebCoreaccessibilityAccessibilityObjectcpp">branches/safari-600.1.4.15-branch/Source/WebCore/accessibility/AccessibilityObject.cpp</a></li>
<li><a href="#branchessafari6001415branchSourceWebCoreaccessibilityAccessibilityObjecth">branches/safari-600.1.4.15-branch/Source/WebCore/accessibility/AccessibilityObject.h</a></li>
<li><a href="#branchessafari6001415branchSourceWebCorepageEventHandlerh">branches/safari-600.1.4.15-branch/Source/WebCore/page/EventHandler.h</a></li>
<li><a href="#branchessafari6001415branchSourceWebCorepageiosEventHandlerIOSmm">branches/safari-600.1.4.15-branch/Source/WebCore/page/ios/EventHandlerIOS.mm</a></li>
<li><a href="#branchessafari6001415branchSourceWebCoreplatformiosPlatformEventFactoryIOSh">branches/safari-600.1.4.15-branch/Source/WebCore/platform/ios/PlatformEventFactoryIOS.h</a></li>
<li><a href="#branchessafari6001415branchSourceWebCoreplatformiosPlatformEventFactoryIOSmm">branches/safari-600.1.4.15-branch/Source/WebCore/platform/ios/PlatformEventFactoryIOS.mm</a></li>
<li><a href="#branchessafari6001415branchToolsChangeLog">branches/safari-600.1.4.15-branch/Tools/ChangeLog</a></li>
<li><a href="#branchessafari6001415branchToolsDumpRenderTreeiosAccessibilityUIElementIOSmm">branches/safari-600.1.4.15-branch/Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari6001415branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1.4.15-branch/Source/WebCore/ChangeLog (178837 => 178838)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1.4.15-branch/Source/WebCore/ChangeLog        2015-01-21 18:32:53 UTC (rev 178837)
+++ branches/safari-600.1.4.15-branch/Source/WebCore/ChangeLog        2015-01-21 18:38:11 UTC (rev 178838)
</span><span class="lines">@@ -1,5 +1,36 @@
</span><span class="cx"> 2015-01-21 Babak Shafiei <bshafiei@apple.com>
</span><span class="cx">
</span><ins>+ Merge r176904.
+
+ 2014-12-05 Chris Fleizach <cfleizach@apple.com>
+
+ AX: I cannot activate links on the mobile version of news.google.com
+ https://bugs.webkit.org/show_bug.cgi?id=139330
+
+ Reviewed by Simon Fraser.
+
+ This website only listens for touch events. VoiceOver normally dispatches click and mouse events,
+ so on iOS this falls and VoiceOver is not able to activate anything.
+
+ The solution here is to dispatch simulated touch down/up events.
+
+ Test: platform/ios-simulator/ios-accessibility/press-fires-touch-events.html
+
+ * accessibility/AccessibilityObject.cpp:
+ (WebCore::AccessibilityObject::press):
+ (WebCore::AccessibilityObject::dispatchTouchEvent):
+ * accessibility/AccessibilityObject.h:
+ (WebCore::AccessibilityObject::isDetachedFromParent):
+ * page/EventHandler.h:
+ * page/ios/EventHandlerIOS.mm:
+ (WebCore::EventHandler::dispatchSimulatedTouchEvent):
+ * platform/ios/PlatformEventFactoryIOS.h:
+ * platform/ios/PlatformEventFactoryIOS.mm:
+ (WebCore::PlatformTouchEventBuilder::PlatformTouchEventBuilder):
+ (WebCore::PlatformEventFactory::createPlatformSimulatedTouchEvent):
+
+2015-01-21 Babak Shafiei <bshafiei@apple.com>
+
</ins><span class="cx"> Merge r176768.
</span><span class="cx">
</span><span class="cx"> 2014-12-03 Myles C. Maxfield <mmaxfield@apple.com>
</span></span></pre></div>
<a id="branchessafari6001415branchSourceWebCoreaccessibilityAccessibilityObjectcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1.4.15-branch/Source/WebCore/accessibility/AccessibilityObject.cpp (178837 => 178838)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1.4.15-branch/Source/WebCore/accessibility/AccessibilityObject.cpp        2015-01-21 18:32:53 UTC (rev 178837)
+++ branches/safari-600.1.4.15-branch/Source/WebCore/accessibility/AccessibilityObject.cpp        2015-01-21 18:38:11 UTC (rev 178838)
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx"> #include "AccessibilityTable.h"
</span><span class="cx"> #include "DOMTokenList.h"
</span><span class="cx"> #include "Editor.h"
</span><ins>+#include "EventHandler.h"
</ins><span class="cx"> #include "FloatRect.h"
</span><span class="cx"> #include "FocusController.h"
</span><span class="cx"> #include "Frame.h"
</span><span class="lines">@@ -775,10 +776,27 @@
</span><span class="cx"> pressElement = hitTestElement;
</span><span class="cx">
</span><span class="cx"> UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture);
</span><del>- pressElement->accessKeyAction(true);
</del><ins>+
+ bool dispatchedTouchEvent = dispatchTouchEvent();
+ if (!dispatchedTouchEvent)
+ pressElement->accessKeyAction(true);
+
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><ins>+
+bool AccessibilityObject::dispatchTouchEvent()
+{
+ bool handled = false;
+#if ENABLE(IOS_TOUCH_EVENTS)
+ MainFrame* frame = mainFrame();
+ if (!frame)
+ return false;
</ins><span class="cx">
</span><ins>+ frame->eventHandler().dispatchSimulatedTouchEvent(clickPoint());
+#endif
+ return handled;
+}
+
</ins><span class="cx"> Frame* AccessibilityObject::frame() const
</span><span class="cx"> {
</span><span class="cx"> Node* node = this->node();
</span></span></pre></div>
<a id="branchessafari6001415branchSourceWebCoreaccessibilityAccessibilityObjecth"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1.4.15-branch/Source/WebCore/accessibility/AccessibilityObject.h (178837 => 178838)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1.4.15-branch/Source/WebCore/accessibility/AccessibilityObject.h        2015-01-21 18:32:53 UTC (rev 178837)
+++ branches/safari-600.1.4.15-branch/Source/WebCore/accessibility/AccessibilityObject.h        2015-01-21 18:38:11 UTC (rev 178838)
</span><span class="lines">@@ -978,7 +978,8 @@
</span><span class="cx"> static bool objectMatchesSearchCriteriaWithResultLimit(AccessibilityObject*, AccessibilitySearchCriteria*, AccessibilityChildrenVector&);
</span><span class="cx"> virtual AccessibilityRole buttonRoleType() const;
</span><span class="cx"> bool isOnscreen() const;
</span><del>-
</del><ins>+ bool dispatchTouchEvent();
+
</ins><span class="cx"> #if (PLATFORM(GTK) || PLATFORM(EFL)) && HAVE(ACCESSIBILITY)
</span><span class="cx"> bool allowsTextRanges() const;
</span><span class="cx"> unsigned getLengthForTextRange() const;
</span></span></pre></div>
<a id="branchessafari6001415branchSourceWebCorepageEventHandlerh"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1.4.15-branch/Source/WebCore/page/EventHandler.h (178837 => 178838)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1.4.15-branch/Source/WebCore/page/EventHandler.h        2015-01-21 18:32:53 UTC (rev 178837)
+++ branches/safari-600.1.4.15-branch/Source/WebCore/page/EventHandler.h        2015-01-21 18:38:11 UTC (rev 178838)
</span><span class="lines">@@ -210,6 +210,7 @@
</span><span class="cx">
</span><span class="cx"> #if ENABLE(IOS_TOUCH_EVENTS)
</span><span class="cx"> bool dispatchTouchEvent(const PlatformTouchEvent&, const AtomicString&, const EventTargetTouchMap&, float, float);
</span><ins>+ bool dispatchSimulatedTouchEvent(IntPoint location);
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if ENABLE(IOS_GESTURE_EVENTS)
</span></span></pre></div>
<a id="branchessafari6001415branchSourceWebCorepageiosEventHandlerIOSmm"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1.4.15-branch/Source/WebCore/page/ios/EventHandlerIOS.mm (178837 => 178838)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1.4.15-branch/Source/WebCore/page/ios/EventHandlerIOS.mm        2015-01-21 18:32:53 UTC (rev 178837)
+++ branches/safari-600.1.4.15-branch/Source/WebCore/page/ios/EventHandlerIOS.mm        2015-01-21 18:38:11 UTC (rev 178838)
</span><span class="lines">@@ -104,6 +104,15 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(IOS_TOUCH_EVENTS)
</span><ins>+
+bool EventHandler::dispatchSimulatedTouchEvent(IntPoint location)
+{
+ bool handled = handleTouchEvent(PlatformEventFactory::createPlatformSimulatedTouchEvent(PlatformEvent::TouchStart, location));
+ if (handled)
+ handleTouchEvent(PlatformEventFactory::createPlatformSimulatedTouchEvent(PlatformEvent::TouchEnd, location));
+ return handled;
+}
+
</ins><span class="cx"> void EventHandler::touchEvent(WebEvent *event)
</span><span class="cx"> {
</span><span class="cx"> CurrentEventScope scope(event);
</span></span></pre></div>
<a id="branchessafari6001415branchSourceWebCoreplatformiosPlatformEventFactoryIOSh"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1.4.15-branch/Source/WebCore/platform/ios/PlatformEventFactoryIOS.h (178837 => 178838)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1.4.15-branch/Source/WebCore/platform/ios/PlatformEventFactoryIOS.h        2015-01-21 18:32:53 UTC (rev 178837)
+++ branches/safari-600.1.4.15-branch/Source/WebCore/platform/ios/PlatformEventFactoryIOS.h        2015-01-21 18:38:11 UTC (rev 178838)
</span><span class="lines">@@ -42,6 +42,7 @@
</span><span class="cx"> static PlatformKeyboardEvent createPlatformKeyboardEvent(WebEvent *);
</span><span class="cx"> #if ENABLE(TOUCH_EVENTS)
</span><span class="cx"> static PlatformTouchEvent createPlatformTouchEvent(WebEvent *);
</span><ins>+ static PlatformTouchEvent createPlatformSimulatedTouchEvent(PlatformEvent::Type, IntPoint location);
</ins><span class="cx"> #endif
</span><span class="cx"> };
</span><span class="cx">
</span></span></pre></div>
<a id="branchessafari6001415branchSourceWebCoreplatformiosPlatformEventFactoryIOSmm"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1.4.15-branch/Source/WebCore/platform/ios/PlatformEventFactoryIOS.mm (178837 => 178838)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1.4.15-branch/Source/WebCore/platform/ios/PlatformEventFactoryIOS.mm        2015-01-21 18:32:53 UTC (rev 178837)
+++ branches/safari-600.1.4.15-branch/Source/WebCore/platform/ios/PlatformEventFactoryIOS.mm        2015-01-21 18:38:11 UTC (rev 178838)
</span><span class="lines">@@ -213,6 +213,21 @@
</span><span class="cx"> return PlatformEvent::TouchCancel;
</span><span class="cx"> }
</span><span class="cx"> }
</span><ins>+
+static PlatformTouchPoint::TouchPhaseType touchPhaseFromPlatformEventType(PlatformEvent::Type type)
+{
+ switch (type) {
+ case PlatformEvent::TouchStart:
+ return PlatformTouchPoint::TouchPhaseBegan;
+ case PlatformEvent::TouchMove:
+ return PlatformTouchPoint::TouchPhaseMoved;
+ case PlatformEvent::TouchEnd:
+ return PlatformTouchPoint::TouchPhaseEnded;
+ default:
+ ASSERT_NOT_REACHED();
+ return PlatformTouchPoint::TouchPhaseCancelled;
+ }
+}
</ins><span class="cx">
</span><span class="cx"> class PlatformTouchPointBuilder : public PlatformTouchPoint {
</span><span class="cx"> public:
</span><span class="lines">@@ -245,12 +260,35 @@
</span><span class="cx"> m_touchPoints.uncheckedAppend(PlatformTouchPointBuilder(identifier, location, touchPhase));
</span><span class="cx"> }
</span><span class="cx"> }
</span><ins>+
+ PlatformTouchEventBuilder(PlatformEvent::Type type, IntPoint location)
+ {
+ m_type = type;
+ m_timestamp = currentTime();
+
+ m_gestureScale = 1;
+ m_gestureRotation = 0;
+ m_isGesture = 0;
+ m_position = location;
+ m_globalPosition = location;
+
+ unsigned touchCount = 1;
+ m_touchPoints.reserveInitialCapacity(touchCount);
+ for (unsigned i = 0; i < touchCount; ++i)
+ m_touchPoints.uncheckedAppend(PlatformTouchPointBuilder(1, location, touchPhaseFromPlatformEventType(type)));
+ }
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> PlatformTouchEvent PlatformEventFactory::createPlatformTouchEvent(WebEvent *event)
</span><span class="cx"> {
</span><span class="cx"> return PlatformTouchEventBuilder(event);
</span><span class="cx"> }
</span><ins>+
+PlatformTouchEvent PlatformEventFactory::createPlatformSimulatedTouchEvent(PlatformEvent::Type type, IntPoint location)
+{
+ return PlatformTouchEventBuilder(type, location);
+}
+
</ins><span class="cx"> #endif // ENABLE(TOUCH_EVENTS)
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="branchessafari6001415branchToolsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1.4.15-branch/Tools/ChangeLog (178837 => 178838)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1.4.15-branch/Tools/ChangeLog        2015-01-21 18:32:53 UTC (rev 178837)
+++ branches/safari-600.1.4.15-branch/Tools/ChangeLog        2015-01-21 18:38:11 UTC (rev 178838)
</span><span class="lines">@@ -1,5 +1,21 @@
</span><span class="cx"> 2015-01-21 Babak Shafiei <bshafiei@apple.com>
</span><span class="cx">
</span><ins>+ Merge r176904.
+
+ 2014-12-05 Chris Fleizach <cfleizach@apple.com>
+
+ AX: I cannot activate links on the mobile version of news.google.com
+ https://bugs.webkit.org/show_bug.cgi?id=139330
+
+ Reviewed by Simon Fraser.
+
+ Implement press for iOS.
+
+ * DumpRenderTree/ios/AccessibilityUIElementIOS.mm:
+ (AccessibilityUIElement::press):
+
+2015-01-21 Babak Shafiei <bshafiei@apple.com>
+
</ins><span class="cx"> Merge r176318.
</span><span class="cx">
</span><span class="cx"> 2014-11-19 Chris Fleizach <cfleizach@apple.com>
</span></span></pre></div>
<a id="branchessafari6001415branchToolsDumpRenderTreeiosAccessibilityUIElementIOSmm"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1.4.15-branch/Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm (178837 => 178838)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1.4.15-branch/Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm        2015-01-21 18:32:53 UTC (rev 178837)
+++ branches/safari-600.1.4.15-branch/Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm        2015-01-21 18:38:11 UTC (rev 178838)
</span><span class="lines">@@ -77,6 +77,7 @@
</span><span class="cx"> - (CGFloat)_accessibilityMinValue;
</span><span class="cx"> - (CGFloat)_accessibilityMaxValue;
</span><span class="cx"> - (void)_accessibilitySetValue:(NSString *)value;
</span><ins>+- (void)_accessibilityActivate;
</ins><span class="cx"> @end
</span><span class="cx">
</span><span class="cx"> @interface NSObject (WebAccessibilityObjectWrapperPrivate)
</span><span class="lines">@@ -704,6 +705,7 @@
</span><span class="cx">
</span><span class="cx"> void AccessibilityUIElement::press()
</span><span class="cx"> {
</span><ins>+ [m_element _accessibilityActivate];
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> JSStringRef AccessibilityUIElement::accessibilityValue() const
</span></span></pre>
</div>
</div>
</body>
</html>