<!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>[243863] 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/243863">243863</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2019-04-03 22:52:44 -0700 (Wed, 03 Apr 2019)</dd>
</dl>

<h3>Log Message</h3>
<pre>[ATK] Cleanup WebPageAccessibilityObjectAtk
https://bugs.webkit.org/show_bug.cgi?id=196537

Reviewed by Michael Catanzaro.

Source/WebKit:

Several changes and cleanups:

 - Add WebKit prefix so that style checker doesn't complain about GObject conventions.
 - Rename the header to remove the Atk prefix to match the cpp file and class name.
 - Use pragma once.
 - Use nullptr instead of 0.
 - Use WEBKIT_DEFINE_TYPE instead of G_DEFINE_TYPE.
 - Return generic AtkObject* from constructor.

* SourcesGTK.txt:
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/atk/WebKitWebPageAccessibilityObject.cpp: Renamed from Source/WebKit/WebProcess/WebPage/atk/WebPageAccessibilityObjectAtk.cpp.
(accessibilityRootObjectWrapper):
(webkitWebPageAccessibilityObjectInitialize):
(webkitWebPageAccessibilityObjectGetIndexInParent):
(webkitWebPageAccessibilityObjectGetNChildren):
(webkitWebPageAccessibilityObjectRefChild):
(webkit_web_page_accessibility_object_class_init):
(webkitWebPageAccessibilityObjectNew):
(webkitWebPageAccessibilityObjectRefresh):
* WebProcess/WebPage/atk/WebKitWebPageAccessibilityObject.h: Added.
* WebProcess/WebPage/atk/WebPageAccessibilityObject.h: Removed.
* WebProcess/WebPage/gtk/WebPageGtk.cpp:
(WebKit::WebPage::platformInitialize):
(WebKit::WebPage::updateAccessibilityTree):

Tools:

Also consider files under atk directories as exceptions for GObject conventions.

* Scripts/webkitpy/style/checkers/cpp.py:
(check_identifier_name_in_declaration):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitSourcesGTKtxt">trunk/Source/WebKit/SourcesGTK.txt</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPageWebPageh">trunk/Source/WebKit/WebProcess/WebPage/WebPage.h</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPagegtkWebPageGtkcpp">trunk/Source/WebKit/WebProcess/WebPage/gtk/WebPageGtk.cpp</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsScriptswebkitpystylecheckerscpppy">trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKitWebProcessWebPageatkWebKitWebPageAccessibilityObjectcpp">trunk/Source/WebKit/WebProcess/WebPage/atk/WebKitWebPageAccessibilityObject.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPageatkWebKitWebPageAccessibilityObjecth">trunk/Source/WebKit/WebProcess/WebPage/atk/WebKitWebPageAccessibilityObject.h</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebKitWebProcessWebPageatkWebPageAccessibilityObjecth">trunk/Source/WebKit/WebProcess/WebPage/atk/WebPageAccessibilityObject.h</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPageatkWebPageAccessibilityObjectAtkcpp">trunk/Source/WebKit/WebProcess/WebPage/atk/WebPageAccessibilityObjectAtk.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (243862 => 243863)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2019-04-04 05:51:37 UTC (rev 243862)
+++ trunk/Source/WebKit/ChangeLog       2019-04-04 05:52:44 UTC (rev 243863)
</span><span class="lines">@@ -1,5 +1,38 @@
</span><span class="cx"> 2019-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
</span><span class="cx"> 
</span><ins>+        [ATK] Cleanup WebPageAccessibilityObjectAtk
+        https://bugs.webkit.org/show_bug.cgi?id=196537
+
+        Reviewed by Michael Catanzaro.
+
+        Several changes and cleanups:
+
+         - Add WebKit prefix so that style checker doesn't complain about GObject conventions.
+         - Rename the header to remove the Atk prefix to match the cpp file and class name.
+         - Use pragma once.
+         - Use nullptr instead of 0.
+         - Use WEBKIT_DEFINE_TYPE instead of G_DEFINE_TYPE.
+         - Return generic AtkObject* from constructor.
+
+        * SourcesGTK.txt:
+        * WebProcess/WebPage/WebPage.h:
+        * WebProcess/WebPage/atk/WebKitWebPageAccessibilityObject.cpp: Renamed from Source/WebKit/WebProcess/WebPage/atk/WebPageAccessibilityObjectAtk.cpp.
+        (accessibilityRootObjectWrapper):
+        (webkitWebPageAccessibilityObjectInitialize):
+        (webkitWebPageAccessibilityObjectGetIndexInParent):
+        (webkitWebPageAccessibilityObjectGetNChildren):
+        (webkitWebPageAccessibilityObjectRefChild):
+        (webkit_web_page_accessibility_object_class_init):
+        (webkitWebPageAccessibilityObjectNew):
+        (webkitWebPageAccessibilityObjectRefresh):
+        * WebProcess/WebPage/atk/WebKitWebPageAccessibilityObject.h: Added.
+        * WebProcess/WebPage/atk/WebPageAccessibilityObject.h: Removed.
+        * WebProcess/WebPage/gtk/WebPageGtk.cpp:
+        (WebKit::WebPage::platformInitialize):
+        (WebKit::WebPage::updateAccessibilityTree):
+
+2019-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
+
</ins><span class="cx">         [ATK] Set ATK_STATE_TRANSIENT on the atk socket until it's embedded
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=196535
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitSourcesGTKtxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/SourcesGTK.txt (243862 => 243863)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/SourcesGTK.txt       2019-04-04 05:51:37 UTC (rev 243862)
+++ trunk/Source/WebKit/SourcesGTK.txt  2019-04-04 05:52:44 UTC (rev 243863)
</span><span class="lines">@@ -410,7 +410,7 @@
</span><span class="cx"> WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp
</span><span class="cx"> WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp
</span><span class="cx"> 
</span><del>-WebProcess/WebPage/atk/WebPageAccessibilityObjectAtk.cpp
</del><ins>+WebProcess/WebPage/atk/WebKitWebPageAccessibilityObject.cpp
</ins><span class="cx"> 
</span><span class="cx"> WebProcess/WebPage/gstreamer/WebPageGStreamer.cpp
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPageWebPageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.h (243862 => 243863)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.h 2019-04-04 05:51:37 UTC (rev 243862)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.h    2019-04-04 05:52:44 UTC (rev 243863)
</span><span class="lines">@@ -85,7 +85,7 @@
</span><span class="cx"> #include <wtf/text/WTFString.h>
</span><span class="cx"> 
</span><span class="cx"> #if HAVE(ACCESSIBILITY) && PLATFORM(GTK)
</span><del>-#include "WebPageAccessibilityObject.h"
</del><ins>+typedef struct _AtkObject AtkObject;
</ins><span class="cx"> #include <wtf/glib/GRefPtr.h>
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -1634,7 +1634,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if HAVE(ACCESSIBILITY) && PLATFORM(GTK)
</span><del>-    GRefPtr<WebPageAccessibilityObject> m_accessibilityObject;
</del><ins>+    GRefPtr<AtkObject> m_accessibilityObject;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL)
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPageatkWebKitWebPageAccessibilityObjectcppfromrev243862trunkSourceWebKitWebProcessWebPageatkWebPageAccessibilityObjectAtkcpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit/WebProcess/WebPage/atk/WebKitWebPageAccessibilityObject.cpp (from rev 243862, trunk/Source/WebKit/WebProcess/WebPage/atk/WebPageAccessibilityObjectAtk.cpp) (0 => 243863)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/atk/WebKitWebPageAccessibilityObject.cpp                          (rev 0)
+++ trunk/Source/WebKit/WebProcess/WebPage/atk/WebKitWebPageAccessibilityObject.cpp     2019-04-04 05:52:44 UTC (rev 243863)
</span><span class="lines">@@ -0,0 +1,143 @@
</span><ins>+/*
+ * Copyright (C) 2012, 2019 Igalia S.L.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebKitWebPageAccessibilityObject.h"
+
+#if HAVE(ACCESSIBILITY)
+
+#include "WebPage.h"
+#include <WebCore/AXObjectCache.h>
+#include <WebCore/Document.h>
+#include <WebCore/Frame.h>
+#include <WebCore/Page.h>
+#include <wtf/glib/WTFGType.h>
+
+using namespace WebKit;
+using namespace WebCore;
+
+struct _WebKitWebPageAccessibilityObjectPrivate {
+    WebPage* page;
+};
+
+WEBKIT_DEFINE_TYPE(WebKitWebPageAccessibilityObject, webkit_web_page_accessibility_object, ATK_TYPE_PLUG)
+
+static AtkObject* accessibilityRootObjectWrapper(AtkObject* atkObject)
+{
+    if (!AXObjectCache::accessibilityEnabled())
+        AXObjectCache::enableAccessibility();
+
+    auto* accessible = WEBKIT_WEB_PAGE_ACCESSIBILITY_OBJECT(atkObject);
+    if (!accessible->priv->page)
+        return nullptr;
+
+    Page* corePage = accessible->priv->page->corePage();
+    if (!corePage)
+        return nullptr;
+
+    Frame& coreFrame = corePage->mainFrame();
+    if (!coreFrame.document())
+        return nullptr;
+
+    AXObjectCache* cache = coreFrame.document()->axObjectCache();
+    if (!cache)
+        return nullptr;
+
+    AccessibilityObject* coreRootObject = cache->rootObject();
+    if (!coreRootObject)
+        return nullptr;
+
+    AtkObject* rootObject = coreRootObject->wrapper();
+    if (!rootObject || !ATK_IS_OBJECT(rootObject))
+        return nullptr;
+
+    return rootObject;
+}
+
+static void webkitWebPageAccessibilityObjectInitialize(AtkObject* atkObject, gpointer data)
+{
+    if (ATK_OBJECT_CLASS(webkit_web_page_accessibility_object_parent_class)->initialize)
+        ATK_OBJECT_CLASS(webkit_web_page_accessibility_object_parent_class)->initialize(atkObject, data);
+
+    WEBKIT_WEB_PAGE_ACCESSIBILITY_OBJECT(atkObject)->priv->page = reinterpret_cast<WebPage*>(data);
+    atk_object_set_role(atkObject, ATK_ROLE_FILLER);
+}
+
+static gint webkitWebPageAccessibilityObjectGetIndexInParent(AtkObject*)
+{
+    // An AtkPlug is the only child an AtkSocket can have.
+    return 0;
+}
+
+static gint webkitWebPageAccessibilityObjectGetNChildren(AtkObject* atkObject)
+{
+    return accessibilityRootObjectWrapper(atkObject) ? 1 : 0;
+}
+
+static AtkObject* webkitWebPageAccessibilityObjectRefChild(AtkObject* atkObject, gint index)
+{
+    // It's supposed to have either one child or zero.
+    if (index && index != 1)
+        return nullptr;
+
+    AtkObject* rootObject = accessibilityRootObjectWrapper(atkObject);
+    if (!rootObject)
+        return nullptr;
+
+    atk_object_set_parent(rootObject, atkObject);
+    g_object_ref(rootObject);
+
+    return rootObject;
+}
+
+static void webkit_web_page_accessibility_object_class_init(WebKitWebPageAccessibilityObjectClass* klass)
+{
+    AtkObjectClass* atkObjectClass = ATK_OBJECT_CLASS(klass);
+    // No need to implement get_parent() here since this is a subclass
+    // of AtkPlug and all the logic related to that function will be
+    // implemented by the ATK bridge.
+    atkObjectClass->initialize = webkitWebPageAccessibilityObjectInitialize;
+    atkObjectClass->get_index_in_parent = webkitWebPageAccessibilityObjectGetIndexInParent;
+    atkObjectClass->get_n_children = webkitWebPageAccessibilityObjectGetNChildren;
+    atkObjectClass->ref_child = webkitWebPageAccessibilityObjectRefChild;
+}
+
+AtkObject* webkitWebPageAccessibilityObjectNew(WebPage* page)
+{
+    AtkObject* object = ATK_OBJECT(g_object_new(WEBKIT_TYPE_WEB_PAGE_ACCESSIBILITY_OBJECT, nullptr));
+    atk_object_initialize(object, page);
+    return object;
+}
+
+void webkitWebPageAccessibilityObjectRefresh(WebKitWebPageAccessibilityObject* accessible)
+{
+    // We just need to ensure that there's a connection in the ATK
+    // world between this accessibility object and the AtkObject of
+    // the accessibility object for the root of the DOM tree.
+    if (auto* rootObject = accessibilityRootObjectWrapper(ATK_OBJECT(accessible)))
+        atk_object_set_parent(rootObject, ATK_OBJECT(accessible));
+}
+
+#endif // HAVE(ACCESSIBILITY)
</ins></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPageatkWebKitWebPageAccessibilityObjecth"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit/WebProcess/WebPage/atk/WebKitWebPageAccessibilityObject.h (0 => 243863)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/atk/WebKitWebPageAccessibilityObject.h                            (rev 0)
+++ trunk/Source/WebKit/WebProcess/WebPage/atk/WebKitWebPageAccessibilityObject.h       2019-04-04 05:52:44 UTC (rev 243863)
</span><span class="lines">@@ -0,0 +1,67 @@
</span><ins>+/*
+ * Copyright (C) 2012, 2019 Igalia S.L.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if HAVE(ACCESSIBILITY)
+
+#include <atk/atk.h>
+
+namespace WebKit {
+class WebPage;
+}
+
+G_BEGIN_DECLS
+
+#define WEBKIT_TYPE_WEB_PAGE_ACCESSIBILITY_OBJECT              (webkit_web_page_accessibility_object_get_type())
+#define WEBKIT_WEB_PAGE_ACCESSIBILITY_OBJECT(object)           (G_TYPE_CHECK_INSTANCE_CAST((object), WEBKIT_TYPE_WEB_PAGE_ACCESSIBILITY_OBJECT, WebKitWebPageAccessibilityObject))
+#define WEBKIT_WEB_PAGE_ACCESSIBILITY_OBJECT_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST((klass), WEBKIT_TYPE_WEB_PAGE_ACCESSIBILITY_OBJECT, WebKitWebPageAccessibilityObjectClass))
+#define WEBKIT_IS_WEB_PAGE_ACCESSIBILITY_OBJECT(object)        (G_TYPE_CHECK_INSTANCE_TYPE((object), WEBKIT_TYPE_WEB_PAGE_ACCESSIBILITY_OBJECT))
+#define WEBKIT_IS_WEB_PAGE_ACCESSIBILITY_OBJECT_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE((klass), WEBKIT_TYPE_WEB_PAGE_ACCESSIBILITY_OBJECT))
+#define WEBKIT_WEB_PAGE_ACCESSIBILITY_OBJECT_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS((object), WEBKIT_TYPE_WEB_PAGE_ACCESSIBILITY_OBJECT, WebKitWebPageAccessibilityObjectClass))
+
+typedef struct _WebKitWebPageAccessibilityObject WebKitWebPageAccessibilityObject;
+typedef struct _WebKitWebPageAccessibilityObjectClass WebKitWebPageAccessibilityObjectClass;
+typedef struct _WebKitWebPageAccessibilityObjectPrivate WebKitWebPageAccessibilityObjectPrivate;
+
+struct _WebKitWebPageAccessibilityObject {
+    AtkPlug parent;
+
+    WebKitWebPageAccessibilityObjectPrivate* priv;
+};
+
+struct _WebKitWebPageAccessibilityObjectClass {
+    AtkPlugClass parentClass;
+};
+
+GType webkit_web_page_accessibility_object_get_type();
+
+AtkObject* webkitWebPageAccessibilityObjectNew(WebKit::WebPage*);
+
+void webkitWebPageAccessibilityObjectRefresh(WebKitWebPageAccessibilityObject*);
+
+G_END_DECLS
+
+#endif // HAVE(ACCESSIBILITY)
</ins></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPageatkWebPageAccessibilityObjecth"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit/WebProcess/WebPage/atk/WebPageAccessibilityObject.h (243862 => 243863)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/atk/WebPageAccessibilityObject.h  2019-04-04 05:51:37 UTC (rev 243862)
+++ trunk/Source/WebKit/WebProcess/WebPage/atk/WebPageAccessibilityObject.h     2019-04-04 05:52:44 UTC (rev 243863)
</span><span class="lines">@@ -1,67 +0,0 @@
</span><del>-/*
- * Copyright (C) 2012 Igalia S.L.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef WebPageAccessibilityObject_h
-#define WebPageAccessibilityObject_h
-
-#if HAVE(ACCESSIBILITY)
-
-#include <atk/atk.h>
-
-namespace WebKit {
-class WebPage;
-}
-
-G_BEGIN_DECLS
-
-#define WEB_TYPE_PAGE_ACCESSIBILITY_OBJECT              (web_page_accessibility_object_get_type())
-#define WEB_PAGE_ACCESSIBILITY_OBJECT(object)           (G_TYPE_CHECK_INSTANCE_CAST((object), WEB_TYPE_PAGE_ACCESSIBILITY_OBJECT, WebPageAccessibilityObject))
-#define WEB_PAGE_ACCESSIBILITY_OBJECT_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST((klass), WEB_TYPE_PAGE_ACCESSIBILITY_OBJECT, WebPageAccessibilityObjectClass))
-#define WEB_IS_PAGE_ACCESSIBILITY_OBJECT(object)        (G_TYPE_CHECK_INSTANCE_TYPE((object), WEB_TYPE_PAGE_ACCESSIBILITY_OBJECT))
-#define WEB_IS_PAGE_ACCESSIBILITY_OBJECT_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE((klass), WEB_TYPE_PAGE_ACCESSIBILITY_OBJECT))
-#define WEB_PAGE_ACCESSIBILITY_OBJECT_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS((object), WEB_TYPE_PAGE_ACCESSIBILITY_OBJECT, WebPageAccessibilityObjectClass))
-
-typedef struct _WebPageAccessibilityObject WebPageAccessibilityObject;
-typedef struct _WebPageAccessibilityObjectClass WebPageAccessibilityObjectClass;
-
-struct _WebPageAccessibilityObject {
-    AtkPlug parent;
-    WebKit::WebPage* m_page;
-};
-
-struct _WebPageAccessibilityObjectClass {
-    AtkPlugClass parentClass;
-};
-
-GType web_page_accessibility_object_get_type();
-
-WebPageAccessibilityObject* webPageAccessibilityObjectNew(WebKit::WebPage*);
-
-void webPageAccessibilityObjectRefresh(WebPageAccessibilityObject*);
-
-G_END_DECLS
-
-#endif
-#endif // WebPageAccessibilityObject_h
</del></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPageatkWebPageAccessibilityObjectAtkcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit/WebProcess/WebPage/atk/WebPageAccessibilityObjectAtk.cpp (243862 => 243863)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/atk/WebPageAccessibilityObjectAtk.cpp     2019-04-04 05:51:37 UTC (rev 243862)
+++ trunk/Source/WebKit/WebProcess/WebPage/atk/WebPageAccessibilityObjectAtk.cpp        2019-04-04 05:52:44 UTC (rev 243863)
</span><span class="lines">@@ -1,149 +0,0 @@
</span><del>-/*
- * Copyright (C) 2012 Igalia S.L.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "WebPageAccessibilityObject.h"
-
-#if HAVE(ACCESSIBILITY)
-
-#include "WebPage.h"
-#include <WebCore/AXObjectCache.h>
-#include <WebCore/Document.h>
-#include <WebCore/Frame.h>
-#include <WebCore/Page.h>
-
-using namespace WebKit;
-using namespace WebCore;
-
-G_DEFINE_TYPE(WebPageAccessibilityObject, web_page_accessibility_object, ATK_TYPE_PLUG)
-
-static AtkObject* accessibilityRootObjectWrapper(AtkObject* atkObject)
-{
-    if (!AXObjectCache::accessibilityEnabled())
-        AXObjectCache::enableAccessibility();
-
-    WebPageAccessibilityObject* accessible = WEB_PAGE_ACCESSIBILITY_OBJECT(atkObject);
-    if (!accessible->m_page)
-        return 0;
-
-    Page* corePage = accessible->m_page->corePage();
-    if (!corePage)
-        return 0;
-
-    Frame& coreFrame = corePage->mainFrame();
-    if (!coreFrame.document())
-        return 0;
-
-    AXObjectCache* cache = coreFrame.document()->axObjectCache();
-    if (!cache)
-        return nullptr;
-
-    AccessibilityObject* coreRootObject = cache->rootObject();
-    if (!coreRootObject)
-        return 0;
-
-    AtkObject* rootObject = coreRootObject->wrapper();
-    if (!rootObject || !ATK_IS_OBJECT(rootObject))
-        return 0;
-
-    return rootObject;
-}
-
-static void webPageAccessibilityObjectInitialize(AtkObject* atkObject, gpointer data)
-{
-    if (ATK_OBJECT_CLASS(web_page_accessibility_object_parent_class)->initialize)
-        ATK_OBJECT_CLASS(web_page_accessibility_object_parent_class)->initialize(atkObject, data);
-
-    WEB_PAGE_ACCESSIBILITY_OBJECT(atkObject)->m_page = reinterpret_cast<WebPage*>(data);
-    atk_object_set_role(atkObject, ATK_ROLE_FILLER);
-}
-
-static gint webPageAccessibilityObjectGetIndexInParent(AtkObject*)
-{
-    // An AtkPlug is the only child an AtkSocket can have.
-    return 0;
-}
-
-static gint webPageAccessibilityObjectGetNChildren(AtkObject* atkObject)
-{
-    AtkObject* rootObject = accessibilityRootObjectWrapper(atkObject);
-    if (!rootObject)
-        return 0;
-
-    return 1;
-}
-
-static AtkObject* webPageAccessibilityObjectRefChild(AtkObject* atkObject, gint index)
-{
-    // It's supposed to have either one child or zero.
-    if (index && index != 1)
-        return 0;
-
-    AtkObject* rootObject = accessibilityRootObjectWrapper(atkObject);
-    if (!rootObject)
-        return 0;
-
-    atk_object_set_parent(rootObject, atkObject);
-    g_object_ref(rootObject);
-
-    return rootObject;
-}
-
-static void web_page_accessibility_object_init(WebPageAccessibilityObject*)
-{
-}
-
-static void web_page_accessibility_object_class_init(WebPageAccessibilityObjectClass* klass)
-{
-    AtkObjectClass* atkObjectClass = ATK_OBJECT_CLASS(klass);
-
-    // No need to implement get_parent() here since this is a subclass
-    // of AtkPlug and all the logic related to that function will be
-    // implemented by the ATK bridge.
-    atkObjectClass->initialize = webPageAccessibilityObjectInitialize;
-    atkObjectClass->get_index_in_parent = webPageAccessibilityObjectGetIndexInParent;
-    atkObjectClass->get_n_children = webPageAccessibilityObjectGetNChildren;
-    atkObjectClass->ref_child = webPageAccessibilityObjectRefChild;
-}
-
-WebPageAccessibilityObject* webPageAccessibilityObjectNew(WebPage* page)
-{
-    AtkObject* object = ATK_OBJECT(g_object_new(WEB_TYPE_PAGE_ACCESSIBILITY_OBJECT, NULL));
-    atk_object_initialize(object, page);
-    return WEB_PAGE_ACCESSIBILITY_OBJECT(object);
-}
-
-void webPageAccessibilityObjectRefresh(WebPageAccessibilityObject* accessible)
-{
-    // We just need to ensure that there's a connection in the ATK
-    // world between this accessibility object and the AtkObject of
-    // the accessibility object for the root of the DOM tree.
-    AtkObject* rootObject = accessibilityRootObjectWrapper(ATK_OBJECT(accessible));
-    if (!rootObject)
-        return;
-    atk_object_set_parent(rootObject, ATK_OBJECT(accessible));
-}
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPagegtkWebPageGtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/gtk/WebPageGtk.cpp (243862 => 243863)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/gtk/WebPageGtk.cpp        2019-04-04 05:51:37 UTC (rev 243862)
+++ trunk/Source/WebKit/WebProcess/WebPage/gtk/WebPageGtk.cpp   2019-04-04 05:52:44 UTC (rev 243863)
</span><span class="lines">@@ -31,7 +31,7 @@
</span><span class="cx"> #include "EditorState.h"
</span><span class="cx"> #include "WebEvent.h"
</span><span class="cx"> #include "WebFrame.h"
</span><del>-#include "WebPageAccessibilityObject.h"
</del><ins>+#include "WebKitWebPageAccessibilityObject.h"
</ins><span class="cx"> #include "WebPageProxyMessages.h"
</span><span class="cx"> #include "WebProcess.h"
</span><span class="cx"> #include <WebCore/BackForwardController.h>
</span><span class="lines">@@ -61,7 +61,7 @@
</span><span class="cx">     // entry point to the Web process, and send a message to the UI
</span><span class="cx">     // process to connect the two worlds through the accessibility
</span><span class="cx">     // object there specifically placed for that purpose (the socket).
</span><del>-    m_accessibilityObject = adoptGRef(webPageAccessibilityObjectNew(this));
</del><ins>+    m_accessibilityObject = adoptGRef(webkitWebPageAccessibilityObjectNew(this));
</ins><span class="cx">     GUniquePtr<gchar> plugID(atk_plug_get_id(ATK_PLUG(m_accessibilityObject.get())));
</span><span class="cx">     send(Messages::WebPageProxy::BindAccessibilityTree(String(plugID.get())));
</span><span class="cx"> #endif
</span><span class="lines">@@ -117,7 +117,7 @@
</span><span class="cx">     if (!m_accessibilityObject)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    webPageAccessibilityObjectRefresh(m_accessibilityObject.get());
</del><ins>+    webkitWebPageAccessibilityObjectRefresh(WEBKIT_WEB_PAGE_ACCESSIBILITY_OBJECT(m_accessibilityObject.get()));
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (243862 => 243863)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog    2019-04-04 05:51:37 UTC (rev 243862)
+++ trunk/Tools/ChangeLog       2019-04-04 05:52:44 UTC (rev 243863)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2019-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [ATK] Cleanup WebPageAccessibilityObjectAtk
+        https://bugs.webkit.org/show_bug.cgi?id=196537
+
+        Reviewed by Michael Catanzaro.
+
+        Also consider files under atk directories as exceptions for GObject conventions.
+
+        * Scripts/webkitpy/style/checkers/cpp.py:
+        (check_identifier_name_in_declaration):
+
</ins><span class="cx"> 2019-04-03  Fujii Hironori  <Hironori.Fujii@sony.com>
</span><span class="cx"> 
</span><span class="cx">         The page's focusedFrame / frameSetLargestFrame do not get cleared on process swap or crash
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpystylecheckerscpppy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py (243862 => 243863)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py       2019-04-04 05:51:37 UTC (rev 243862)
+++ trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py  2019-04-04 05:52:44 UTC (rev 243863)
</span><span class="lines">@@ -3585,7 +3585,7 @@
</span><span class="cx">         if not file_state.is_objective_c_or_objective_cpp() and modified_identifier.find('_') >= 0:
</span><span class="cx">             # Various exceptions to the rule: JavaScript op codes functions, const_iterator.
</span><span class="cx">             if (not (filename.find('JavaScriptCore') >= 0 and (modified_identifier.find('op_') >= 0 or modified_identifier.find('intrinsic_') >= 0))
</span><del>-                and not (('gtk' in filename or 'glib' in filename or 'wpe' in filename) and modified_identifier.startswith('webkit_'))
</del><ins>+                and not (('gtk' in filename or 'glib' in filename or 'wpe' in filename or 'atk' in filename) and modified_identifier.startswith('webkit_'))
</ins><span class="cx">                 and not modified_identifier.startswith('tst_')
</span><span class="cx">                 and not modified_identifier.startswith('webkit_dom_object_')
</span><span class="cx">                 and not modified_identifier.startswith('webkit_soup')
</span></span></pre>
</div>
</div>

</body>
</html>