<!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>[244538] trunk</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/244538">244538</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2019-04-23 03:47:45 -0700 (Tue, 23 Apr 2019)</dd>
</dl>
<h3>Log Message</h3>
<pre>[ATK] Implement AtkComponentIface scroll_to methods
https://bugs.webkit.org/show_bug.cgi?id=196856
Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2019-04-23
Reviewed by Michael Catanzaro.
Source/WebCore:
Implement scroll_to and scroll_to_point when ATK >= 2.30.
Fixes: accessibility/scroll-to-global-point-iframe-nested.html
accessibility/scroll-to-global-point-iframe.html
accessibility/scroll-to-global-point-main-window.html
accessibility/scroll-to-global-point-nested.html
accessibility/scroll-to-make-visible-div-overflow.html
accessibility/scroll-to-make-visible-iframe.html
accessibility/scroll-to-make-visible-nested-2.html
accessibility/scroll-to-make-visible-nested.html
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::scrollToMakeVisible const): Add new method receiving the
ScrollRectToVisibleOptions since ATK interface has a parameter to decide how to scroll.
* accessibility/AccessibilityObject.h:
* accessibility/atk/WebKitAccessibleInterfaceComponent.cpp:
(atkToContents):
(webkitAccessibleComponentRefAccessibleAtPoint):
(webkitAccessibleComponentGetExtents):
(webkitAccessibleComponentGrabFocus):
(webkitAccessibleComponentScrollTo):
(webkitAccessibleComponentScrollToPoint):
(webkitAccessibleComponentInterfaceInit):
(core): Deleted.
Tools:
* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(WTR::AccessibilityUIElement::scrollToMakeVisible): Call atk_component_scroll_to().
(WTR::AccessibilityUIElement::scrollToGlobalPoint): Call atk_component_scroll_to_point().
* gtk/jhbuild.modules: Bump atk, at-spi2-core and at-spi2-atk to their latest stable version.
LayoutTests:
Remove expectations for tests that are passing now.
* platform/gtk/TestExpectations:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformgtkTestExpectations">trunk/LayoutTests/platform/gtk/TestExpectations</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityObjectcpp">trunk/Source/WebCore/accessibility/AccessibilityObject.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityObjecth">trunk/Source/WebCore/accessibility/AccessibilityObject.h</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityatkWebKitAccessibleInterfaceComponentcpp">trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceComponent.cpp</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleatkAccessibilityUIElementAtkcpp">trunk/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp</a></li>
<li><a href="#trunkToolsgtkjhbuildmodules">trunk/Tools/gtk/jhbuild.modules</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (244537 => 244538)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog 2019-04-23 01:36:39 UTC (rev 244537)
+++ trunk/LayoutTests/ChangeLog 2019-04-23 10:47:45 UTC (rev 244538)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2019-04-23 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [ATK] Implement AtkComponentIface scroll_to methods
+ https://bugs.webkit.org/show_bug.cgi?id=196856
+
+ Reviewed by Michael Catanzaro.
+
+ Remove expectations for tests that are passing now.
+
+ * platform/gtk/TestExpectations:
+
</ins><span class="cx"> 2019-04-22 Zalan Bujtas <zalan@apple.com>
</span><span class="cx">
</span><span class="cx"> [ContentChangeObserver] Some dropdown menus may close without user gesture on americanexpress.com
</span></span></pre></div>
<a id="trunkLayoutTestsplatformgtkTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/gtk/TestExpectations (244537 => 244538)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/gtk/TestExpectations 2019-04-23 01:36:39 UTC (rev 244537)
+++ trunk/LayoutTests/platform/gtk/TestExpectations 2019-04-23 10:47:45 UTC (rev 244538)
</span><span class="lines">@@ -817,8 +817,6 @@
</span><span class="cx"> # No support for Filters Level 2 on GTK yet
</span><span class="cx"> webkit.org/b/169988 css3/filters/backdrop [ Skip ]
</span><span class="cx">
</span><del>-webkit.org/b/141072 accessibility/frame-disconnect-textmarker-cache-crash.html [ Failure ]
-
</del><span class="cx"> webkit.org/b/141423 fast/css/font-shorthand-from-longhands.html [ Failure ]
</span><span class="cx"> webkit.org/b/141423 fast/css/font-shorthand-line-height.html [ Failure ]
</span><span class="cx"> webkit.org/b/141423 fast/css/getComputedStyle/computed-style-font.html [ Failure ]
</span><span class="lines">@@ -907,6 +905,7 @@
</span><span class="cx">
</span><span class="cx"> # Text marker tests are not supported
</span><span class="cx"> webkit.org/b/153292 accessibility/text-marker [ Skip ]
</span><ins>+webkit.org/b/141072 accessibility/frame-disconnect-textmarker-cache-crash.html [ Skip ]
</ins><span class="cx">
</span><span class="cx"> # WebKitGTK+ doesn't have killring support.
</span><span class="cx"> webkit.org/b/152379 editing/pasteboard/emacs-killring-alternating-append-prepend.html [ Failure ]
</span><span class="lines">@@ -3110,14 +3109,6 @@
</span><span class="cx"> webkit.org/b/148932 imported/w3c/web-platform-tests/css/css-color/t424-hsl-basic-a.xht [ ImageOnlyFailure Pass ]
</span><span class="cx"> webkit.org/b/148932 imported/w3c/web-platform-tests/css/css-color/t425-hsla-clip-outside-device-gamut-b.xht [ ImageOnlyFailure ]
</span><span class="cx">
</span><del>-webkit.org/b/148935 accessibility/scroll-to-global-point-iframe-nested.html [ Failure ]
-webkit.org/b/148935 accessibility/scroll-to-global-point-iframe.html [ Failure ]
-webkit.org/b/148935 accessibility/scroll-to-global-point-main-window.html [ Failure ]
-webkit.org/b/148935 accessibility/scroll-to-global-point-nested.html [ Failure ]
-webkit.org/b/148935 accessibility/scroll-to-make-visible-div-overflow.html [ Failure ]
-webkit.org/b/148935 accessibility/scroll-to-make-visible-iframe.html [ Failure ]
-webkit.org/b/148935 accessibility/scroll-to-make-visible-nested-2.html [ Failure ]
-webkit.org/b/148935 accessibility/scroll-to-make-visible-nested.html [ Failure ]
</del><span class="cx"> webkit.org/b/148935 accessibility/scroll-to-make-visible-with-subfocus.html [ Failure ]
</span><span class="cx">
</span><span class="cx"> webkit.org/b/149128 fast/text/control-characters [ ImageOnlyFailure ]
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (244537 => 244538)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog 2019-04-23 01:36:39 UTC (rev 244537)
+++ trunk/Source/WebCore/ChangeLog 2019-04-23 10:47:45 UTC (rev 244538)
</span><span class="lines">@@ -1,3 +1,35 @@
</span><ins>+2019-04-23 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [ATK] Implement AtkComponentIface scroll_to methods
+ https://bugs.webkit.org/show_bug.cgi?id=196856
+
+ Reviewed by Michael Catanzaro.
+
+ Implement scroll_to and scroll_to_point when ATK >= 2.30.
+
+ Fixes: accessibility/scroll-to-global-point-iframe-nested.html
+ accessibility/scroll-to-global-point-iframe.html
+ accessibility/scroll-to-global-point-main-window.html
+ accessibility/scroll-to-global-point-nested.html
+ accessibility/scroll-to-make-visible-div-overflow.html
+ accessibility/scroll-to-make-visible-iframe.html
+ accessibility/scroll-to-make-visible-nested-2.html
+ accessibility/scroll-to-make-visible-nested.html
+
+ * accessibility/AccessibilityObject.cpp:
+ (WebCore::AccessibilityObject::scrollToMakeVisible const): Add new method receiving the
+ ScrollRectToVisibleOptions since ATK interface has a parameter to decide how to scroll.
+ * accessibility/AccessibilityObject.h:
+ * accessibility/atk/WebKitAccessibleInterfaceComponent.cpp:
+ (atkToContents):
+ (webkitAccessibleComponentRefAccessibleAtPoint):
+ (webkitAccessibleComponentGetExtents):
+ (webkitAccessibleComponentGrabFocus):
+ (webkitAccessibleComponentScrollTo):
+ (webkitAccessibleComponentScrollToPoint):
+ (webkitAccessibleComponentInterfaceInit):
+ (core): Deleted.
+
</ins><span class="cx"> 2019-04-22 Youenn Fablet <youenn@apple.com>
</span><span class="cx">
</span><span class="cx"> Update libwebrtc logging when WebCore WebRTC logging is updated
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.cpp (244537 => 244538)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityObject.cpp 2019-04-23 01:36:39 UTC (rev 244537)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.cpp 2019-04-23 10:47:45 UTC (rev 244538)
</span><span class="lines">@@ -3064,14 +3064,19 @@
</span><span class="cx">
</span><span class="cx"> void AccessibilityObject::scrollToMakeVisible() const
</span><span class="cx"> {
</span><ins>+ scrollToMakeVisible({ SelectionRevealMode::Reveal, ScrollAlignment::alignCenterIfNeeded, ScrollAlignment::alignCenterIfNeeded, ShouldAllowCrossOriginScrolling::Yes });
+}
+
+void AccessibilityObject::scrollToMakeVisible(const ScrollRectToVisibleOptions& options) const
+{
</ins><span class="cx"> if (dispatchAccessibilityEventWithType(AccessibilityEventType::ScrollIntoView))
</span><span class="cx"> return;
</span><del>-
</del><ins>+
</ins><span class="cx"> if (isScrollView() && parentObject())
</span><span class="cx"> parentObject()->scrollToMakeVisible();
</span><span class="cx">
</span><span class="cx"> if (auto* renderer = this->renderer())
</span><del>- renderer->scrollRectToVisible(boundingBoxRect(), false, { SelectionRevealMode::Reveal, ScrollAlignment::alignCenterIfNeeded, ScrollAlignment::alignCenterIfNeeded, ShouldAllowCrossOriginScrolling::Yes });
</del><ins>+ renderer->scrollRectToVisible(boundingBoxRect(), false, options);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void AccessibilityObject::scrollToMakeVisibleWithSubFocus(const IntRect& subfocus) const
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.h (244537 => 244538)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityObject.h 2019-04-23 01:36:39 UTC (rev 244537)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.h 2019-04-23 10:47:45 UTC (rev 244538)
</span><span class="lines">@@ -81,6 +81,7 @@
</span><span class="cx"> class ScrollableArea;
</span><span class="cx"> class ScrollView;
</span><span class="cx"> class Widget;
</span><ins>+struct ScrollRectToVisibleOptions;
</ins><span class="cx">
</span><span class="cx"> enum class AccessibilityTextSource {
</span><span class="cx"> Alternative,
</span><span class="lines">@@ -882,6 +883,7 @@
</span><span class="cx"> IntPoint scrollPosition() const;
</span><span class="cx"> IntSize scrollContentsSize() const;
</span><span class="cx"> IntRect scrollVisibleContentRect() const;
</span><ins>+ void scrollToMakeVisible(const ScrollRectToVisibleOptions&) const;
</ins><span class="cx">
</span><span class="cx"> bool lastKnownIsIgnoredValue();
</span><span class="cx"> void setLastKnownIsIgnoredValue(bool);
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityatkWebKitAccessibleInterfaceComponentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceComponent.cpp (244537 => 244538)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceComponent.cpp 2019-04-23 01:36:39 UTC (rev 244537)
+++ trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceComponent.cpp 2019-04-23 10:47:45 UTC (rev 244538)
</span><span class="lines">@@ -36,77 +36,137 @@
</span><span class="cx"> #include "AccessibilityObject.h"
</span><span class="cx"> #include "FrameView.h"
</span><span class="cx"> #include "IntRect.h"
</span><ins>+#include "RenderLayer.h"
</ins><span class="cx"> #include "WebKitAccessible.h"
</span><span class="cx"> #include "WebKitAccessibleUtil.h"
</span><span class="cx">
</span><span class="cx"> using namespace WebCore;
</span><span class="cx">
</span><del>-static AccessibilityObject* core(AtkComponent* component)
</del><ins>+static IntPoint atkToContents(const AccessibilityObject& coreObject, AtkCoordType coordType, gint x, gint y)
</ins><span class="cx"> {
</span><del>- if (!WEBKIT_IS_ACCESSIBLE(component))
- return 0;
</del><ins>+ auto* frameView = coreObject.documentFrameView();
+ if (!frameView)
+ return { x, y };
</ins><span class="cx">
</span><del>- return &webkitAccessibleGetAccessibilityObject(WEBKIT_ACCESSIBLE(component));
-}
-
-static IntPoint atkToContents(AccessibilityObject* coreObject, AtkCoordType coordType, gint x, gint y)
-{
- IntPoint pos(x, y);
-
- FrameView* frameView = coreObject->documentFrameView();
- if (frameView) {
- switch (coordType) {
- case ATK_XY_SCREEN:
- return frameView->screenToContents(pos);
- case ATK_XY_WINDOW:
- return frameView->windowToContents(pos);
</del><ins>+ switch (coordType) {
+ case ATK_XY_SCREEN:
+ return frameView->screenToContents({ x, y });
+ case ATK_XY_WINDOW:
+ return frameView->windowToContents({ x, y });
</ins><span class="cx"> #if ATK_CHECK_VERSION(2, 30, 0)
</span><del>- case ATK_XY_PARENT:
- RELEASE_ASSERT_NOT_REACHED();
</del><ins>+ case ATK_XY_PARENT:
+ RELEASE_ASSERT_NOT_REACHED();
</ins><span class="cx"> #endif
</span><del>- }
</del><span class="cx"> }
</span><span class="cx">
</span><del>- return pos;
</del><ins>+ return { x, y };
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static AtkObject* webkitAccessibleComponentRefAccessibleAtPoint(AtkComponent* component, gint x, gint y, AtkCoordType coordType)
</span><span class="cx"> {
</span><del>- g_return_val_if_fail(ATK_IS_COMPONENT(component), 0);
- returnValIfWebKitAccessibleIsInvalid(WEBKIT_ACCESSIBLE(component), 0);
</del><ins>+ auto* accessible = WEBKIT_ACCESSIBLE(component);
+ returnValIfWebKitAccessibleIsInvalid(accessible, nullptr);
</ins><span class="cx">
</span><del>- IntPoint pos = atkToContents(core(component), coordType, x, y);
</del><ins>+ auto& coreObject = webkitAccessibleGetAccessibilityObject(accessible);
+ auto* target = downcast<AccessibilityObject>(coreObject.accessibilityHitTest(atkToContents(coreObject, coordType, x, y)));
+ if (!target)
+ return nullptr;
</ins><span class="cx">
</span><del>- AccessibilityObject* target = downcast<AccessibilityObject>(core(component)->accessibilityHitTest(pos));
- if (!target)
- return 0;
- g_object_ref(target->wrapper());
- return ATK_OBJECT(target->wrapper());
</del><ins>+ if (auto* wrapper = target->wrapper())
+ return ATK_OBJECT(g_object_ref(wrapper));
+
+ return nullptr;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static void webkitAccessibleComponentGetExtents(AtkComponent* component, gint* x, gint* y, gint* width, gint* height, AtkCoordType coordType)
</span><span class="cx"> {
</span><del>- g_return_if_fail(ATK_IS_COMPONENT(component));
- returnIfWebKitAccessibleIsInvalid(WEBKIT_ACCESSIBLE(component));
</del><ins>+ auto* accessible = WEBKIT_ACCESSIBLE(component);
+ returnIfWebKitAccessibleIsInvalid(accessible);
</ins><span class="cx">
</span><del>- IntRect rect = snappedIntRect(core(component)->elementRect());
- contentsRelativeToAtkCoordinateType(core(component), coordType, rect, x, y, width, height);
</del><ins>+ auto& coreObject = webkitAccessibleGetAccessibilityObject(accessible);
+ contentsRelativeToAtkCoordinateType(&coreObject, coordType, snappedIntRect(coreObject.elementRect()), x, y, width, height);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static gboolean webkitAccessibleComponentGrabFocus(AtkComponent* component)
</span><span class="cx"> {
</span><del>- g_return_val_if_fail(ATK_IS_COMPONENT(component), FALSE);
- returnValIfWebKitAccessibleIsInvalid(WEBKIT_ACCESSIBLE(component), FALSE);
</del><ins>+ auto* accessible = WEBKIT_ACCESSIBLE(component);
+ returnValIfWebKitAccessibleIsInvalid(accessible, FALSE);
</ins><span class="cx">
</span><del>- core(component)->setFocused(true);
- return core(component)->isFocused();
</del><ins>+ auto& coreObject = webkitAccessibleGetAccessibilityObject(accessible);
+ coreObject.setFocused(true);
+ return coreObject.isFocused();
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+#if ATK_CHECK_VERSION(2, 30, 0)
+static gboolean webkitAccessibleComponentScrollTo(AtkComponent* component, AtkScrollType scrollType)
+{
+ auto* accessible = WEBKIT_ACCESSIBLE(component);
+ returnValIfWebKitAccessibleIsInvalid(accessible, FALSE);
+
+ ScrollAlignment alignX;
+ ScrollAlignment alignY;
+
+ switch (scrollType) {
+ case ATK_SCROLL_TOP_LEFT:
+ alignX = ScrollAlignment::alignLeftAlways;
+ alignY = ScrollAlignment::alignTopAlways;
+ break;
+ case ATK_SCROLL_BOTTOM_RIGHT:
+ alignX = ScrollAlignment::alignRightAlways;
+ alignY = ScrollAlignment::alignBottomAlways;
+ break;
+ case ATK_SCROLL_TOP_EDGE:
+ case ATK_SCROLL_BOTTOM_EDGE:
+ // Align to a particular edge is not supported, it's always the closest edge.
+ alignX = ScrollAlignment::alignCenterIfNeeded;
+ alignY = ScrollAlignment::alignToEdgeIfNeeded;
+ break;
+ case ATK_SCROLL_LEFT_EDGE:
+ case ATK_SCROLL_RIGHT_EDGE:
+ // Align to a particular edge is not supported, it's always the closest edge.
+ alignX = ScrollAlignment::alignToEdgeIfNeeded;
+ alignY = ScrollAlignment::alignCenterIfNeeded;
+ break;
+ case ATK_SCROLL_ANYWHERE:
+ alignX = ScrollAlignment::alignCenterIfNeeded;
+ alignY = ScrollAlignment::alignCenterIfNeeded;
+ break;
+ }
+
+ auto& coreObject = webkitAccessibleGetAccessibilityObject(accessible);
+ coreObject.scrollToMakeVisible({ SelectionRevealMode::Reveal, alignX, alignY, ShouldAllowCrossOriginScrolling::Yes });
+
+ return TRUE;
+}
+
+static gboolean webkitAccessibleComponentScrollToPoint(AtkComponent* component, AtkCoordType coordType, gint x, gint y)
+{
+ auto* accessible = WEBKIT_ACCESSIBLE(component);
+ returnValIfWebKitAccessibleIsInvalid(accessible, FALSE);
+
+ auto& coreObject = webkitAccessibleGetAccessibilityObject(accessible);
+
+ IntPoint point(x, y);
+ if (coordType == ATK_XY_SCREEN) {
+ if (auto* frameView = coreObject.documentFrameView())
+ point = frameView->contentsToWindow(frameView->screenToContents(point));
+ }
+
+ coreObject.scrollToGlobalPoint(point);
+
+ return TRUE;
+}
+#endif
+
</ins><span class="cx"> void webkitAccessibleComponentInterfaceInit(AtkComponentIface* iface)
</span><span class="cx"> {
</span><span class="cx"> iface->ref_accessible_at_point = webkitAccessibleComponentRefAccessibleAtPoint;
</span><span class="cx"> iface->get_extents = webkitAccessibleComponentGetExtents;
</span><span class="cx"> iface->grab_focus = webkitAccessibleComponentGrabFocus;
</span><ins>+#if ATK_CHECK_VERSION(2, 30, 0)
+ iface->scroll_to = webkitAccessibleComponentScrollTo;
+ iface->scroll_to_point = webkitAccessibleComponentScrollToPoint;
+#endif
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-#endif
</del><ins>+#endif // HAVE(ACCESSIBILITY)
</ins></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (244537 => 244538)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog 2019-04-23 01:36:39 UTC (rev 244537)
+++ trunk/Tools/ChangeLog 2019-04-23 10:47:45 UTC (rev 244538)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2019-04-23 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [ATK] Implement AtkComponentIface scroll_to methods
+ https://bugs.webkit.org/show_bug.cgi?id=196856
+
+ Reviewed by Michael Catanzaro.
+
+ * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
+ (WTR::AccessibilityUIElement::scrollToMakeVisible): Call atk_component_scroll_to().
+ (WTR::AccessibilityUIElement::scrollToGlobalPoint): Call atk_component_scroll_to_point().
+ * gtk/jhbuild.modules: Bump atk, at-spi2-core and at-spi2-atk to their latest stable version.
+
</ins><span class="cx"> 2019-04-22 Aakash Jain <aakash_jain@apple.com>
</span><span class="cx">
</span><span class="cx"> [ews-build] Improve summary for UploadBuiltProduct step
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleatkAccessibilityUIElementAtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp (244537 => 244538)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp 2019-04-23 01:36:39 UTC (rev 244537)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp 2019-04-23 10:47:45 UTC (rev 244538)
</span><span class="lines">@@ -2332,14 +2332,24 @@
</span><span class="cx">
</span><span class="cx"> void AccessibilityUIElement::scrollToMakeVisible()
</span><span class="cx"> {
</span><del>- // FIXME: implement
</del><ins>+#if ATK_CHECK_VERSION(2, 30, 0)
+ if (!ATK_IS_COMPONENT(m_element.get()))
+ return;
+
+ atk_component_scroll_to(ATK_COMPONENT(m_element.get()), ATK_SCROLL_ANYWHERE);
+#endif
</ins><span class="cx"> }
</span><del>-
</del><ins>+
</ins><span class="cx"> void AccessibilityUIElement::scrollToGlobalPoint(int x, int y)
</span><span class="cx"> {
</span><del>- // FIXME: implement
</del><ins>+#if ATK_CHECK_VERSION(2, 30, 0)
+ if (!ATK_IS_COMPONENT(m_element.get()))
+ return;
+
+ atk_component_scroll_to_point(ATK_COMPONENT(m_element.get()), ATK_XY_WINDOW, x, y);
+#endif
</ins><span class="cx"> }
</span><del>-
</del><ins>+
</ins><span class="cx"> void AccessibilityUIElement::scrollToMakeVisibleWithSubFocus(int x, int y, int width, int height)
</span><span class="cx"> {
</span><span class="cx"> // FIXME: implement
</span></span></pre></div>
<a id="trunkToolsgtkjhbuildmodules"></a>
<div class="modfile"><h4>Modified: trunk/Tools/gtk/jhbuild.modules (244537 => 244538)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/gtk/jhbuild.modules 2019-04-23 01:36:39 UTC (rev 244537)
+++ trunk/Tools/gtk/jhbuild.modules 2019-04-23 10:47:45 UTC (rev 244538)
</span><span class="lines">@@ -281,31 +281,26 @@
</span><span class="cx"> hash="sha256:ccf79ff3bd340254737ce4d28b87f0ccee4b3358cd3cd5cd11dc7b42f41b272a"/>
</span><span class="cx"> </autotools>
</span><span class="cx">
</span><del>- <autotools id="atk"
- autogen-sh="configure"
- autogenargs="--disable-introspection">
- <branch module="pub/GNOME/sources/atk/2.25/atk-2.25.2.tar.xz" version="2.25.2"
</del><ins>+ <meson id="atk" mesonargs="-Dintrospection=false">
+ <branch module="pub/GNOME/sources/atk/2.32/atk-2.32.0.tar.xz" version="2.32.0"
</ins><span class="cx"> repo="ftp.gnome.org"
</span><del>- hash="sha256:75ac1f63e845f895dec8d72d4645ef5f362e32c921cc78987f2f19c2ce212a24"/>
- </autotools>
</del><ins>+ hash="sha256:cb41feda7fe4ef0daa024471438ea0219592baf7c291347e5a858bb64e4091cc"/>
+ </meson>
</ins><span class="cx">
</span><del>- <autotools id="at-spi2-core"
- autogen-sh="configure"
- autogenargs="--disable-introspection">
- <branch module="pub/GNOME/sources/at-spi2-core/2.25/at-spi2-core-2.25.4.tar.xz" version="2.25.4"
</del><ins>+ <meson id="at-spi2-core" mesonargs="-Dintrospection=no">
+ <branch module="pub/GNOME/sources/at-spi2-core/2.32/at-spi2-core-2.32.1.tar.xz" version="2.32.1"
</ins><span class="cx"> repo="ftp.gnome.org"
</span><del>- hash="sha256:baeccbf92e84e64bb4a853f076c27b78ab44edf1fa5414a9c6e59a9b180bc9d8">
</del><ins>+ hash="sha256:3c2aa937ebfaca2c86569bce9b16a34fbe20d69ef0c58846313b1c42f53b0d53">
</ins><span class="cx"> </branch>
</span><span class="cx"> <dependencies>
</span><span class="cx"> <dep package="glib"/>
</span><span class="cx"> </dependencies>
</span><del>- </autotools>
</del><ins>+ </meson>
</ins><span class="cx">
</span><del>- <autotools id="at-spi2-atk"
- autogen-sh="configure">
- <branch module="pub/GNOME/sources/at-spi2-atk/2.25/at-spi2-atk-2.25.3.tar.xz" version="2.25.3"
</del><ins>+ <meson id="at-spi2-atk">
+ <branch module="pub/GNOME/sources/at-spi2-atk/2.32/at-spi2-atk-2.32.0.tar.xz" version="2.32.0"
</ins><span class="cx"> repo="ftp.gnome.org"
</span><del>- hash="sha256:b7aab1a4ee7182083fcfafb595b7b3fe4df34aa2230c775050fe6015b01f84e1">
</del><ins>+ hash="sha256:0b51e6d339fa2bcca3a3e3159ccea574c67b107f1ac8b00047fa60e34ce7a45c">
</ins><span class="cx"> </branch>
</span><span class="cx"> <dependencies>
</span><span class="cx"> <dep package="glib"/>
</span><span class="lines">@@ -312,7 +307,7 @@
</span><span class="cx"> <dep package="atk"/>
</span><span class="cx"> <dep package="at-spi2-core"/>
</span><span class="cx"> </dependencies>
</span><del>- </autotools>
</del><ins>+ </meson>
</ins><span class="cx">
</span><span class="cx"> <autotools id="libxml2" supports-non-srcdir-builds="no"
</span><span class="cx"> autogen-sh="./autogen.sh; ./configure --with-python=no">
</span></span></pre>
</div>
</div>
</body>
</html>