<!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>[244072] trunk/Source/WebCore</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/244072">244072</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2019-04-09 02:01:35 -0700 (Tue, 09 Apr 2019)</dd>
</dl>

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

Reviewed by Michael Catanzaro.

Cleanups:

 - Rename webkitAccessibleHyperlinkNew() as webkitAccessibleHyperlinkGetOrCreate() and move the code to get/set
   the object data here.
 - Use WEBKIT_DEFINE_TYPE instead of custom type registration. This ensures that all CStrings used in private
   struct are no longer leaked.
 - Remove all confusing core() functions and simply use webkitAccessibleGetAccessibilityObject().
 - Use nullptr instead of 0 and other coding style issues.

* accessibility/atk/WebKitAccessibleHyperlink.cpp:
(webkitAccessibleHyperlinkActionDoAction):
(webkitAccessibleHyperlinkActionGetNActions):
(webkitAccessibleHyperlinkActionGetDescription):
(webkitAccessibleHyperlinkActionGetKeybinding):
(webkitAccessibleHyperlinkActionGetName):
(atk_action_interface_init):
(webkitAccessibleHyperlinkGetURI):
(webkitAccessibleHyperlinkGetObject):
(rangeLengthForObject):
(webkitAccessibleHyperlinkGetStartIndex):
(webkitAccessibleHyperlinkGetEndIndex):
(webkitAccessibleHyperlinkIsValid):
(webkitAccessibleHyperlinkGetNAnchors):
(webkitAccessibleHyperlinkIsSelectedLink):
(webkitAccessibleHyperlinkGetProperty):
(webkitAccessibleHyperlinkSetProperty):
(webkit_accessible_hyperlink_class_init):
(webkitAccessibleHyperlinkGetOrCreate):
(core): Deleted.
(atkActionInterfaceInit): Deleted.
(getRangeLengthForObject): Deleted.
(webkitAccessibleHyperlinkFinalize): Deleted.
(webkitAccessibleHyperlinkClassInit): Deleted.
(webkitAccessibleHyperlinkInit): Deleted.
(webkitAccessibleHyperlinkGetType): Deleted.
(webkitAccessibleHyperlinkNew): Deleted.
(webkitAccessibleHyperlinkGetAccessibilityObject): Deleted.
* accessibility/atk/WebKitAccessibleHyperlink.h:
* accessibility/atk/WebKitAccessibleInterfaceHyperlinkImpl.cpp:
(webkitAccessibleHyperlinkImplGetHyperlink):
(webkitAccessibleHyperlinkImplInterfaceInit):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityatkWebKitAccessibleHyperlinkcpp">trunk/Source/WebCore/accessibility/atk/WebKitAccessibleHyperlink.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityatkWebKitAccessibleHyperlinkh">trunk/Source/WebCore/accessibility/atk/WebKitAccessibleHyperlink.h</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityatkWebKitAccessibleInterfaceHyperlinkImplcpp">trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceHyperlinkImpl.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (244071 => 244072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2019-04-09 08:41:59 UTC (rev 244071)
+++ trunk/Source/WebCore/ChangeLog      2019-04-09 09:01:35 UTC (rev 244072)
</span><span class="lines">@@ -1,3 +1,52 @@
</span><ins>+2019-04-09  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [ATK] Cleanup WebKitAccessibleHyperlink
+        https://bugs.webkit.org/show_bug.cgi?id=196602
+
+        Reviewed by Michael Catanzaro.
+
+        Cleanups:
+
+         - Rename webkitAccessibleHyperlinkNew() as webkitAccessibleHyperlinkGetOrCreate() and move the code to get/set
+           the object data here.
+         - Use WEBKIT_DEFINE_TYPE instead of custom type registration. This ensures that all CStrings used in private
+           struct are no longer leaked.
+         - Remove all confusing core() functions and simply use webkitAccessibleGetAccessibilityObject().
+         - Use nullptr instead of 0 and other coding style issues.
+
+        * accessibility/atk/WebKitAccessibleHyperlink.cpp:
+        (webkitAccessibleHyperlinkActionDoAction):
+        (webkitAccessibleHyperlinkActionGetNActions):
+        (webkitAccessibleHyperlinkActionGetDescription):
+        (webkitAccessibleHyperlinkActionGetKeybinding):
+        (webkitAccessibleHyperlinkActionGetName):
+        (atk_action_interface_init):
+        (webkitAccessibleHyperlinkGetURI):
+        (webkitAccessibleHyperlinkGetObject):
+        (rangeLengthForObject):
+        (webkitAccessibleHyperlinkGetStartIndex):
+        (webkitAccessibleHyperlinkGetEndIndex):
+        (webkitAccessibleHyperlinkIsValid):
+        (webkitAccessibleHyperlinkGetNAnchors):
+        (webkitAccessibleHyperlinkIsSelectedLink):
+        (webkitAccessibleHyperlinkGetProperty):
+        (webkitAccessibleHyperlinkSetProperty):
+        (webkit_accessible_hyperlink_class_init):
+        (webkitAccessibleHyperlinkGetOrCreate):
+        (core): Deleted.
+        (atkActionInterfaceInit): Deleted.
+        (getRangeLengthForObject): Deleted.
+        (webkitAccessibleHyperlinkFinalize): Deleted.
+        (webkitAccessibleHyperlinkClassInit): Deleted.
+        (webkitAccessibleHyperlinkInit): Deleted.
+        (webkitAccessibleHyperlinkGetType): Deleted.
+        (webkitAccessibleHyperlinkNew): Deleted.
+        (webkitAccessibleHyperlinkGetAccessibilityObject): Deleted.
+        * accessibility/atk/WebKitAccessibleHyperlink.h:
+        * accessibility/atk/WebKitAccessibleInterfaceHyperlinkImpl.cpp:
+        (webkitAccessibleHyperlinkImplGetHyperlink):
+        (webkitAccessibleHyperlinkImplInterfaceInit):
+
</ins><span class="cx"> 2019-04-08  Simon Fraser  <simon.fraser@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Remove some iOS #ifdefs around sticky-related code
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityatkWebKitAccessibleHyperlinkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/atk/WebKitAccessibleHyperlink.cpp (244071 => 244072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/atk/WebKitAccessibleHyperlink.cpp     2019-04-09 08:41:59 UTC (rev 244071)
+++ trunk/Source/WebCore/accessibility/atk/WebKitAccessibleHyperlink.cpp        2019-04-09 09:01:35 UTC (rev 244072)
</span><span class="lines">@@ -34,13 +34,13 @@
</span><span class="cx"> #include "TextIterator.h"
</span><span class="cx"> #include "WebKitAccessible.h"
</span><span class="cx"> #include "WebKitAccessibleUtil.h"
</span><ins>+#include <wtf/glib/WTFGType.h>
</ins><span class="cx"> #include <wtf/text/CString.h>
</span><span class="cx"> 
</span><del>-#include <atk/atk.h>
-#include <glib.h>
-
</del><span class="cx"> using namespace WebCore;
</span><span class="cx"> 
</span><ins>+static void webkit_accessible_hyperlink_atk_action_interface_init(AtkActionIface*);
+
</ins><span class="cx"> struct _WebKitAccessibleHyperlinkPrivate {
</span><span class="cx">     WebKitAccessible* hyperlinkImpl;
</span><span class="cx"> 
</span><span class="lines">@@ -49,7 +49,9 @@
</span><span class="cx">     CString actionKeyBinding;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-#define WEBKIT_ACCESSIBLE_HYPERLINK_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_ACCESSIBLE_HYPERLINK, WebKitAccessibleHyperlinkPrivate))
</del><ins>+WEBKIT_DEFINE_TYPE_WITH_CODE(
+    WebKitAccessibleHyperlink, webkit_accessible_hyperlink, ATK_TYPE_HYPERLINK,
+    G_IMPLEMENT_INTERFACE(ATK_TYPE_ACTION, webkit_accessible_hyperlink_atk_action_interface_init))
</ins><span class="cx"> 
</span><span class="cx"> enum {
</span><span class="cx">     PROP_0,
</span><span class="lines">@@ -57,73 +59,30 @@
</span><span class="cx">     PROP_HYPERLINK_IMPL
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-static gpointer webkitAccessibleHyperlinkParentClass = 0;
-
-static AccessibilityObject* core(WebKitAccessible* accessible)
</del><ins>+static gboolean webkitAccessibleHyperlinkActionDoAction(AtkAction* action, gint)
</ins><span class="cx"> {
</span><del>-    if (!accessible || !WEBKIT_IS_ACCESSIBLE(accessible))
-        return 0;
</del><ins>+    auto* accessibleHyperlink = WEBKIT_ACCESSIBLE_HYPERLINK(action);
+    returnValIfWebKitAccessibleIsInvalid(accessibleHyperlink->priv->hyperlinkImpl, FALSE);
</ins><span class="cx"> 
</span><del>-    return &webkitAccessibleGetAccessibilityObject(accessible);
-}
-
-static AccessibilityObject* core(WebKitAccessibleHyperlink* link)
-{
-    if (!link)
-        return 0;
-
-    return core(link->priv->hyperlinkImpl);
-}
-
-static AccessibilityObject* core(AtkHyperlink* link)
-{
-    if (!WEBKIT_IS_ACCESSIBLE_HYPERLINK(link))
-        return 0;
-
-    return core(WEBKIT_ACCESSIBLE_HYPERLINK(link));
-}
-
-static AccessibilityObject* core(AtkAction* action)
-{
-    return core(WEBKIT_ACCESSIBLE_HYPERLINK(action));
-}
-
-
-static gboolean webkitAccessibleHyperlinkActionDoAction(AtkAction* action, gint index)
-{
-    g_return_val_if_fail(WEBKIT_IS_ACCESSIBLE_HYPERLINK(action), FALSE);
-    g_return_val_if_fail(WEBKIT_ACCESSIBLE_HYPERLINK(action)->priv->hyperlinkImpl, FALSE);
-    g_return_val_if_fail(!index, FALSE);
-    returnValIfWebKitAccessibleIsInvalid(WEBKIT_ACCESSIBLE_HYPERLINK(action)->priv->hyperlinkImpl, FALSE);
-
-    if (!ATK_IS_ACTION(WEBKIT_ACCESSIBLE_HYPERLINK(action)->priv->hyperlinkImpl))
</del><ins>+    if (!ATK_IS_ACTION(accessibleHyperlink->priv->hyperlinkImpl))
</ins><span class="cx">         return FALSE;
</span><span class="cx"> 
</span><del>-    AccessibilityObject* coreObject = core(action);
-    if (!coreObject)
-        return FALSE;
-
-    return coreObject->performDefaultAction();
</del><ins>+    auto& coreObject = webkitAccessibleGetAccessibilityObject(accessibleHyperlink->priv->hyperlinkImpl);
+    return coreObject.performDefaultAction();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static gint webkitAccessibleHyperlinkActionGetNActions(AtkAction* action)
</span><span class="cx"> {
</span><del>-    g_return_val_if_fail(WEBKIT_IS_ACCESSIBLE_HYPERLINK(action), 0);
-    g_return_val_if_fail(WEBKIT_ACCESSIBLE_HYPERLINK(action)->priv->hyperlinkImpl, 0);
-    returnValIfWebKitAccessibleIsInvalid(WEBKIT_ACCESSIBLE_HYPERLINK(action)->priv->hyperlinkImpl, 0);
</del><ins>+    auto* accessibleHyperlink = WEBKIT_ACCESSIBLE_HYPERLINK(action);
+    returnValIfWebKitAccessibleIsInvalid(accessibleHyperlink->priv->hyperlinkImpl, 0);
</ins><span class="cx"> 
</span><del>-    if (!ATK_IS_ACTION(WEBKIT_ACCESSIBLE_HYPERLINK(action)->priv->hyperlinkImpl))
-        return 0;
-
-    return 1;
</del><ins>+    return ATK_IS_ACTION(accessibleHyperlink->priv->hyperlinkImpl) ? 1 : 0;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static const gchar* webkitAccessibleHyperlinkActionGetDescription(AtkAction* action, gint index)
</del><ins>+static const gchar* webkitAccessibleHyperlinkActionGetDescription(AtkAction* action, gint)
</ins><span class="cx"> {
</span><del>-    g_return_val_if_fail(WEBKIT_IS_ACCESSIBLE_HYPERLINK(action), 0);
-    g_return_val_if_fail(WEBKIT_ACCESSIBLE_HYPERLINK(action)->priv->hyperlinkImpl, 0);
-    g_return_val_if_fail(!index, 0);
-    returnValIfWebKitAccessibleIsInvalid(WEBKIT_ACCESSIBLE_HYPERLINK(action)->priv->hyperlinkImpl, 0);
</del><ins>+    auto* accessibleHyperlink = WEBKIT_ACCESSIBLE_HYPERLINK(action);
+    returnValIfWebKitAccessibleIsInvalid(accessibleHyperlink->priv->hyperlinkImpl, nullptr);
</ins><span class="cx"> 
</span><span class="cx">     // TODO: Need a way to provide/localize action descriptions.
</span><span class="cx">     notImplemented();
</span><span class="lines">@@ -130,47 +89,33 @@
</span><span class="cx">     return "";
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static const gchar* webkitAccessibleHyperlinkActionGetKeybinding(AtkAction* action, gint index)
</del><ins>+static const gchar* webkitAccessibleHyperlinkActionGetKeybinding(AtkAction* action, gint)
</ins><span class="cx"> {
</span><del>-    g_return_val_if_fail(WEBKIT_IS_ACCESSIBLE_HYPERLINK(action), 0);
-    g_return_val_if_fail(WEBKIT_ACCESSIBLE_HYPERLINK(action)->priv->hyperlinkImpl, 0);
-    g_return_val_if_fail(!index, 0);
</del><ins>+    auto* accessibleHyperlink = WEBKIT_ACCESSIBLE_HYPERLINK(action);
+    returnValIfWebKitAccessibleIsInvalid(accessibleHyperlink->priv->hyperlinkImpl, nullptr);
</ins><span class="cx"> 
</span><del>-    WebKitAccessibleHyperlinkPrivate* priv = WEBKIT_ACCESSIBLE_HYPERLINK(action)->priv;
-    returnValIfWebKitAccessibleIsInvalid(priv->hyperlinkImpl, 0);
</del><ins>+    if (!ATK_IS_ACTION(accessibleHyperlink->priv->hyperlinkImpl))
+        return nullptr;
</ins><span class="cx"> 
</span><del>-    if (!ATK_IS_ACTION(priv->hyperlinkImpl))
-        return 0;
-
-    AccessibilityObject* coreObject = core(action);
-    if (!coreObject)
-        return 0;
-
-    priv->actionKeyBinding = coreObject->accessKey().string().utf8();
-    return priv->actionKeyBinding.data();
</del><ins>+    auto& coreObject = webkitAccessibleGetAccessibilityObject(accessibleHyperlink->priv->hyperlinkImpl);
+    accessibleHyperlink->priv->actionKeyBinding = coreObject.accessKey().string().utf8();
+    return accessibleHyperlink->priv->actionKeyBinding.data();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static const gchar* webkitAccessibleHyperlinkActionGetName(AtkAction* action, gint index)
</del><ins>+static const gchar* webkitAccessibleHyperlinkActionGetName(AtkAction* action, gint)
</ins><span class="cx"> {
</span><del>-    g_return_val_if_fail(WEBKIT_IS_ACCESSIBLE_HYPERLINK(action), 0);
-    g_return_val_if_fail(WEBKIT_ACCESSIBLE_HYPERLINK(action)->priv->hyperlinkImpl, 0);
-    g_return_val_if_fail(!index, 0);
</del><ins>+    auto* accessibleHyperlink = WEBKIT_ACCESSIBLE_HYPERLINK(action);
+    returnValIfWebKitAccessibleIsInvalid(accessibleHyperlink->priv->hyperlinkImpl, nullptr);
</ins><span class="cx"> 
</span><del>-    WebKitAccessibleHyperlinkPrivate* priv = WEBKIT_ACCESSIBLE_HYPERLINK(action)->priv;
-    returnValIfWebKitAccessibleIsInvalid(priv->hyperlinkImpl, 0);
</del><ins>+    if (!ATK_IS_ACTION(accessibleHyperlink->priv->hyperlinkImpl))
+        return nullptr;
</ins><span class="cx"> 
</span><del>-    if (!ATK_IS_ACTION(priv->hyperlinkImpl))
-        return 0;
-
-    AccessibilityObject* coreObject = core(action);
-    if (!coreObject)
-        return 0;
-
-    priv->actionName = coreObject->actionVerb().utf8();
-    return priv->actionName.data();
</del><ins>+    auto& coreObject = webkitAccessibleGetAccessibilityObject(accessibleHyperlink->priv->hyperlinkImpl);
+    accessibleHyperlink->priv->actionName = coreObject.actionVerb().utf8();
+    return accessibleHyperlink->priv->actionName.data();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void atkActionInterfaceInit(AtkActionIface* iface)
</del><ins>+static void webkit_accessible_hyperlink_atk_action_interface_init(AtkActionIface* iface)
</ins><span class="cx"> {
</span><span class="cx">     iface->do_action = webkitAccessibleHyperlinkActionDoAction;
</span><span class="cx">     iface->get_n_actions = webkitAccessibleHyperlinkActionGetNActions;
</span><span class="lines">@@ -181,37 +126,32 @@
</span><span class="cx"> 
</span><span class="cx"> static gchar* webkitAccessibleHyperlinkGetURI(AtkHyperlink* link, gint index)
</span><span class="cx"> {
</span><del>-    g_return_val_if_fail(WEBKIT_IS_ACCESSIBLE_HYPERLINK(link), 0);
-    g_return_val_if_fail(WEBKIT_ACCESSIBLE_HYPERLINK(link)->priv->hyperlinkImpl, 0);
-
</del><span class="cx">     // FIXME: Do NOT support more than one instance of an AtkObject
</span><span class="cx">     // implementing AtkHyperlinkImpl in every instance of AtkHyperLink
</span><del>-    g_return_val_if_fail(!index, 0);
</del><ins>+    if (index)
+        return nullptr;
</ins><span class="cx"> 
</span><del>-    returnValIfWebKitAccessibleIsInvalid(WEBKIT_ACCESSIBLE_HYPERLINK(link)->priv->hyperlinkImpl, 0);
</del><ins>+    auto* accessibleHyperlink = WEBKIT_ACCESSIBLE_HYPERLINK(link);
+    returnValIfWebKitAccessibleIsInvalid(accessibleHyperlink->priv->hyperlinkImpl, nullptr);
</ins><span class="cx"> 
</span><del>-    AccessibilityObject* coreObject = core(link);
-    if (!coreObject || coreObject->url().isNull())
-        return 0;
-
-    return g_strdup(coreObject->url().string().utf8().data());
</del><ins>+    auto& coreObject = webkitAccessibleGetAccessibilityObject(accessibleHyperlink->priv->hyperlinkImpl);
+    return !coreObject.url().isNull() ? g_strdup(coreObject.url().string().utf8().data()) : nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static AtkObject* webkitAccessibleHyperlinkGetObject(AtkHyperlink* link, gint index)
</span><span class="cx"> {
</span><del>-    g_return_val_if_fail(WEBKIT_IS_ACCESSIBLE_HYPERLINK(link), 0);
-    g_return_val_if_fail(WEBKIT_ACCESSIBLE_HYPERLINK(link)->priv->hyperlinkImpl, 0);
-
</del><span class="cx">     // FIXME: Do NOT support more than one instance of an AtkObject
</span><span class="cx">     // implementing AtkHyperlinkImpl in every instance of AtkHyperLink
</span><del>-    g_return_val_if_fail(!index, 0);
</del><ins>+    if (index)
+        return nullptr;
</ins><span class="cx"> 
</span><del>-    returnValIfWebKitAccessibleIsInvalid(WEBKIT_ACCESSIBLE_HYPERLINK(link)->priv->hyperlinkImpl, 0);
</del><ins>+    auto* accessibleHyperlink = WEBKIT_ACCESSIBLE_HYPERLINK(link);
+    returnValIfWebKitAccessibleIsInvalid(accessibleHyperlink->priv->hyperlinkImpl, 0);
</ins><span class="cx"> 
</span><del>-    return ATK_OBJECT(WEBKIT_ACCESSIBLE_HYPERLINK(link)->priv->hyperlinkImpl);
</del><ins>+    return ATK_OBJECT(accessibleHyperlink->priv->hyperlinkImpl);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static gint getRangeLengthForObject(AccessibilityObject* obj, Range* range)
</del><ins>+static gint rangeLengthForObject(AccessibilityObject& obj, Range* range)
</ins><span class="cx"> {
</span><span class="cx">     // This is going to be the actual length in most of the cases
</span><span class="cx">     int baseLength = TextIterator::rangeLength(range, true);
</span><span class="lines">@@ -218,7 +158,7 @@
</span><span class="cx"> 
</span><span class="cx">     // Check whether the current hyperlink belongs to a list item.
</span><span class="cx">     // If so, we need to consider the length of the item's marker
</span><del>-    AccessibilityObject* parent = obj->parentObjectUnignored();
</del><ins>+    AccessibilityObject* parent = obj.parentObjectUnignored();
</ins><span class="cx">     if (!parent || !parent->isAccessibilityRenderObject() || !parent->isListItem())
</span><span class="cx">         return baseLength;
</span><span class="cx"> 
</span><span class="lines">@@ -240,19 +180,15 @@
</span><span class="cx"> 
</span><span class="cx"> static gint webkitAccessibleHyperlinkGetStartIndex(AtkHyperlink* link)
</span><span class="cx"> {
</span><del>-    g_return_val_if_fail(WEBKIT_IS_ACCESSIBLE_HYPERLINK(link), 0);
-    g_return_val_if_fail(WEBKIT_ACCESSIBLE_HYPERLINK(link)->priv->hyperlinkImpl, 0);
-    returnValIfWebKitAccessibleIsInvalid(WEBKIT_ACCESSIBLE_HYPERLINK(link)->priv->hyperlinkImpl, 0);
</del><ins>+    auto* accessibleHyperlink = WEBKIT_ACCESSIBLE_HYPERLINK(link);
+    returnValIfWebKitAccessibleIsInvalid(accessibleHyperlink->priv->hyperlinkImpl, 0);
</ins><span class="cx"> 
</span><del>-    AccessibilityObject* coreObject = core(link);
-    if (!coreObject)
-        return 0;
-
-    AccessibilityObject* parentUnignored = coreObject->parentObjectUnignored();
</del><ins>+    auto& coreObject = webkitAccessibleGetAccessibilityObject(accessibleHyperlink->priv->hyperlinkImpl);
+    AccessibilityObject* parentUnignored = coreObject.parentObjectUnignored();
</ins><span class="cx">     if (!parentUnignored)
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><del>-    Node* node = coreObject->node();
</del><ins>+    Node* node = coreObject.node();
</ins><span class="cx">     if (!node)
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><span class="lines">@@ -261,24 +197,20 @@
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><span class="cx">     auto range = Range::create(node->document(), firstPositionInOrBeforeNode(parentNode), firstPositionInOrBeforeNode(node));
</span><del>-    return getRangeLengthForObject(coreObject, range.ptr());
</del><ins>+    return rangeLengthForObject(coreObject, range.ptr());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static gint webkitAccessibleHyperlinkGetEndIndex(AtkHyperlink* link)
</span><span class="cx"> {
</span><del>-    g_return_val_if_fail(WEBKIT_IS_ACCESSIBLE_HYPERLINK(link), 0);
-    g_return_val_if_fail(WEBKIT_ACCESSIBLE_HYPERLINK(link)->priv->hyperlinkImpl, 0);
-    returnValIfWebKitAccessibleIsInvalid(WEBKIT_ACCESSIBLE_HYPERLINK(link)->priv->hyperlinkImpl, 0);
</del><ins>+    auto* accessibleHyperlink = WEBKIT_ACCESSIBLE_HYPERLINK(link);
+    returnValIfWebKitAccessibleIsInvalid(accessibleHyperlink->priv->hyperlinkImpl, 0);
</ins><span class="cx"> 
</span><del>-    AccessibilityObject* coreObject = core(link);
-    if (!coreObject)
-        return 0;
-
-    AccessibilityObject* parentUnignored = coreObject->parentObjectUnignored();
</del><ins>+    auto& coreObject = webkitAccessibleGetAccessibilityObject(accessibleHyperlink->priv->hyperlinkImpl);
+    AccessibilityObject* parentUnignored = coreObject.parentObjectUnignored();
</ins><span class="cx">     if (!parentUnignored)
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><del>-    Node* node = coreObject->node();
</del><ins>+    Node* node = coreObject.node();
</ins><span class="cx">     if (!node)
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><span class="lines">@@ -287,14 +219,13 @@
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><span class="cx">     auto range = Range::create(node->document(), firstPositionInOrBeforeNode(parentNode), lastPositionInOrAfterNode(node));
</span><del>-    return getRangeLengthForObject(coreObject, range.ptr());
</del><ins>+    return rangeLengthForObject(coreObject, range.ptr());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static gboolean webkitAccessibleHyperlinkIsValid(AtkHyperlink* link)
</span><span class="cx"> {
</span><del>-    g_return_val_if_fail(WEBKIT_IS_ACCESSIBLE_HYPERLINK(link), FALSE);
-    g_return_val_if_fail(WEBKIT_ACCESSIBLE_HYPERLINK(link)->priv->hyperlinkImpl, FALSE);
-    returnValIfWebKitAccessibleIsInvalid(WEBKIT_ACCESSIBLE_HYPERLINK(link)->priv->hyperlinkImpl, FALSE);
</del><ins>+    auto* accessibleHyperlink = WEBKIT_ACCESSIBLE_HYPERLINK(link);
+    returnValIfWebKitAccessibleIsInvalid(accessibleHyperlink->priv->hyperlinkImpl, FALSE);
</ins><span class="cx"> 
</span><span class="cx">     // Link is valid for the whole object's lifetime
</span><span class="cx">     return TRUE;
</span><span class="lines">@@ -304,9 +235,8 @@
</span><span class="cx"> {
</span><span class="cx">     // FIXME Do NOT support more than one instance of an AtkObject
</span><span class="cx">     // implementing AtkHyperlinkImpl in every instance of AtkHyperLink
</span><del>-    g_return_val_if_fail(WEBKIT_IS_ACCESSIBLE_HYPERLINK(link), 0);
-    g_return_val_if_fail(WEBKIT_ACCESSIBLE_HYPERLINK(link)->priv->hyperlinkImpl, 0);
-    returnValIfWebKitAccessibleIsInvalid(WEBKIT_ACCESSIBLE_HYPERLINK(link)->priv->hyperlinkImpl, 0);
</del><ins>+    auto* accessibleHyperlink = WEBKIT_ACCESSIBLE_HYPERLINK(link);
+    returnValIfWebKitAccessibleIsInvalid(accessibleHyperlink->priv->hyperlinkImpl, 0);
</ins><span class="cx"> 
</span><span class="cx">     return 1;
</span><span class="cx"> }
</span><span class="lines">@@ -313,9 +243,8 @@
</span><span class="cx"> 
</span><span class="cx"> static gboolean webkitAccessibleHyperlinkIsSelectedLink(AtkHyperlink* link)
</span><span class="cx"> {
</span><del>-    g_return_val_if_fail(WEBKIT_IS_ACCESSIBLE_HYPERLINK(link), FALSE);
-    g_return_val_if_fail(WEBKIT_ACCESSIBLE_HYPERLINK(link)->priv->hyperlinkImpl, FALSE);
-    returnValIfWebKitAccessibleIsInvalid(WEBKIT_ACCESSIBLE_HYPERLINK(link)->priv->hyperlinkImpl, FALSE);
</del><ins>+    auto* accessibleHyperlink = WEBKIT_ACCESSIBLE_HYPERLINK(link);
+    returnValIfWebKitAccessibleIsInvalid(accessibleHyperlink->priv->hyperlinkImpl, FALSE);
</ins><span class="cx"> 
</span><span class="cx">     // Not implemented: this function is deprecated in ATK now
</span><span class="cx">     notImplemented();
</span><span class="lines">@@ -324,9 +253,11 @@
</span><span class="cx"> 
</span><span class="cx"> static void webkitAccessibleHyperlinkGetProperty(GObject* object, guint propId, GValue* value, GParamSpec* pspec)
</span><span class="cx"> {
</span><ins>+    auto* accessibleHyperlink = WEBKIT_ACCESSIBLE_HYPERLINK(object);
+
</ins><span class="cx">     switch (propId) {
</span><span class="cx">     case PROP_HYPERLINK_IMPL:
</span><del>-        g_value_set_object(value, WEBKIT_ACCESSIBLE_HYPERLINK(object)->priv->hyperlinkImpl);
</del><ins>+        g_value_set_object(value, accessibleHyperlink->priv->hyperlinkImpl);
</ins><span class="cx">         break;
</span><span class="cx">     default:
</span><span class="cx">         G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propId, pspec);
</span><span class="lines">@@ -335,14 +266,11 @@
</span><span class="cx"> 
</span><span class="cx"> static void webkitAccessibleHyperlinkSetProperty(GObject* object, guint propId, const GValue* value, GParamSpec* pspec)
</span><span class="cx"> {
</span><del>-    WebKitAccessibleHyperlinkPrivate* priv = WEBKIT_ACCESSIBLE_HYPERLINK(object)->priv;
</del><ins>+    auto* accessibleHyperlink = WEBKIT_ACCESSIBLE_HYPERLINK(object);
</ins><span class="cx"> 
</span><span class="cx">     switch (propId) {
</span><span class="cx">     case PROP_HYPERLINK_IMPL:
</span><del>-        // No need to check and unref previous values of
-        // priv->hyperlinkImpl as this is a CONSTRUCT ONLY property
-        priv->hyperlinkImpl = WEBKIT_ACCESSIBLE(g_value_get_object(value));
-        g_object_weak_ref(G_OBJECT(priv->hyperlinkImpl), (GWeakNotify)(GCallback)g_object_unref, object);
</del><ins>+        accessibleHyperlink->priv->hyperlinkImpl = WEBKIT_ACCESSIBLE(g_value_get_object(value));
</ins><span class="cx">         break;
</span><span class="cx">     default:
</span><span class="cx">         G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propId, pspec);
</span><span class="lines">@@ -349,28 +277,20 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void webkitAccessibleHyperlinkFinalize(GObject* object)
</del><ins>+static void webkit_accessible_hyperlink_class_init(WebKitAccessibleHyperlinkClass* klass)
</ins><span class="cx"> {
</span><del>-    G_OBJECT_CLASS(webkitAccessibleHyperlinkParentClass)->finalize(object);
-}
-
-static void webkitAccessibleHyperlinkClassInit(AtkHyperlinkClass* klass)
-{
</del><span class="cx">     GObjectClass* gobjectClass = G_OBJECT_CLASS(klass);
</span><del>-
-    webkitAccessibleHyperlinkParentClass = g_type_class_peek_parent(klass);
-
-    gobjectClass->finalize = webkitAccessibleHyperlinkFinalize;
</del><span class="cx">     gobjectClass->set_property = webkitAccessibleHyperlinkSetProperty;
</span><span class="cx">     gobjectClass->get_property = webkitAccessibleHyperlinkGetProperty;
</span><span class="cx"> 
</span><del>-    klass->get_uri = webkitAccessibleHyperlinkGetURI;
-    klass->get_object = webkitAccessibleHyperlinkGetObject;
-    klass->get_start_index = webkitAccessibleHyperlinkGetStartIndex;
-    klass->get_end_index = webkitAccessibleHyperlinkGetEndIndex;
-    klass->is_valid = webkitAccessibleHyperlinkIsValid;
-    klass->get_n_anchors = webkitAccessibleHyperlinkGetNAnchors;
-    klass->is_selected_link = webkitAccessibleHyperlinkIsSelectedLink;
</del><ins>+    AtkHyperlinkClass* atkHyperlinkClass = ATK_HYPERLINK_CLASS(klass);
+    atkHyperlinkClass->get_uri = webkitAccessibleHyperlinkGetURI;
+    atkHyperlinkClass->get_object = webkitAccessibleHyperlinkGetObject;
+    atkHyperlinkClass->get_start_index = webkitAccessibleHyperlinkGetStartIndex;
+    atkHyperlinkClass->get_end_index = webkitAccessibleHyperlinkGetEndIndex;
+    atkHyperlinkClass->is_valid = webkitAccessibleHyperlinkIsValid;
+    atkHyperlinkClass->get_n_anchors = webkitAccessibleHyperlinkGetNAnchors;
+    atkHyperlinkClass->is_selected_link = webkitAccessibleHyperlinkIsSelectedLink;
</ins><span class="cx"> 
</span><span class="cx">     g_object_class_install_property(gobjectClass, PROP_HYPERLINK_IMPL,
</span><span class="cx">         g_param_spec_object("hyperlink-impl",
</span><span class="lines">@@ -377,59 +297,20 @@
</span><span class="cx">             "Hyperlink implementation",
</span><span class="cx">             "The associated WebKitAccessible instance.",
</span><span class="cx">             WEBKIT_TYPE_ACCESSIBLE,
</span><del>-            (GParamFlags)(G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)));
-
-    g_type_class_add_private(gobjectClass, sizeof(WebKitAccessibleHyperlinkPrivate));
</del><ins>+            static_cast<GParamFlags>(WEBKIT_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void webkitAccessibleHyperlinkInit(AtkHyperlink* link)
</del><ins>+WebKitAccessibleHyperlink* webkitAccessibleHyperlinkGetOrCreate(AtkHyperlinkImpl* hyperlinkImpl)
</ins><span class="cx"> {
</span><del>-    WEBKIT_ACCESSIBLE_HYPERLINK(link)->priv = WEBKIT_ACCESSIBLE_HYPERLINK_GET_PRIVATE(link);
-    WEBKIT_ACCESSIBLE_HYPERLINK(link)->priv->hyperlinkImpl = nullptr;
-}
</del><ins>+    g_return_val_if_fail(ATK_IS_HYPERLINK_IMPL(hyperlinkImpl), nullptr);
+    g_return_val_if_fail(WEBKIT_IS_ACCESSIBLE(hyperlinkImpl), nullptr);
</ins><span class="cx"> 
</span><del>-GType webkitAccessibleHyperlinkGetType()
-{
-    static volatile gsize typeVolatile = 0;
</del><ins>+    if (auto* currentHyperLink = g_object_get_data(G_OBJECT(hyperlinkImpl), "webkit-accessible-hyperlink-object"))
+        return WEBKIT_ACCESSIBLE_HYPERLINK(g_object_ref(currentHyperLink));
</ins><span class="cx"> 
</span><del>-    if (g_once_init_enter(&typeVolatile)) {
-        static const GTypeInfo tinfo = {
-            sizeof(WebKitAccessibleHyperlinkClass),
-            (GBaseInitFunc) 0,
-            (GBaseFinalizeFunc) 0,
-            (GClassInitFunc)(GCallback) webkitAccessibleHyperlinkClassInit,
-            (GClassFinalizeFunc) 0,
-            0, /* class data */
-            sizeof(WebKitAccessibleHyperlink), /* instance size */
-            0, /* nb preallocs */
-            (GInstanceInitFunc)(GCallback) webkitAccessibleHyperlinkInit,
-            0 /* value table */
-        };
-
-        static const GInterfaceInfo actionInfo = {
-            (GInterfaceInitFunc)(GCallback)atkActionInterfaceInit,
-            (GInterfaceFinalizeFunc) 0, 0
-        };
-
-        GType type = g_type_register_static(ATK_TYPE_HYPERLINK, "WebKitAccessibleHyperlink", &tinfo, GTypeFlags(0));
-        g_type_add_interface_static(type, ATK_TYPE_ACTION, &actionInfo);
-
-        g_once_init_leave(&typeVolatile, type);
-    }
-
-    return typeVolatile;
</del><ins>+    auto* hyperlink = WEBKIT_ACCESSIBLE_HYPERLINK(g_object_new(WEBKIT_TYPE_ACCESSIBLE_HYPERLINK, "hyperlink-impl", hyperlinkImpl, nullptr));
+    g_object_set_data_full(G_OBJECT(hyperlinkImpl), "webkit-accessible-hyperlink-object", hyperlink, g_object_unref);
+    return hyperlink;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebKitAccessibleHyperlink* webkitAccessibleHyperlinkNew(AtkHyperlinkImpl* hyperlinkImpl)
-{
-    g_return_val_if_fail(ATK_IS_HYPERLINK_IMPL(hyperlinkImpl), 0);
-    return WEBKIT_ACCESSIBLE_HYPERLINK(g_object_new(WEBKIT_TYPE_ACCESSIBLE_HYPERLINK, "hyperlink-impl", hyperlinkImpl, 0));
-}
-
-WebCore::AccessibilityObject* webkitAccessibleHyperlinkGetAccessibilityObject(WebKitAccessibleHyperlink* link)
-{
-    g_return_val_if_fail(WEBKIT_IS_ACCESSIBLE_HYPERLINK(link), 0);
-    return core(link);
-}
-
</del><span class="cx"> #endif // HAVE(ACCESSIBILITY)
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityatkWebKitAccessibleHyperlinkh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/atk/WebKitAccessibleHyperlink.h (244071 => 244072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/atk/WebKitAccessibleHyperlink.h       2019-04-09 08:41:59 UTC (rev 244071)
+++ trunk/Source/WebCore/accessibility/atk/WebKitAccessibleHyperlink.h  2019-04-09 09:01:35 UTC (rev 244072)
</span><span class="lines">@@ -23,27 +23,22 @@
</span><span class="cx"> 
</span><span class="cx"> #include <atk/atk.h>
</span><span class="cx"> 
</span><del>-namespace WebCore {
-class AccessibilityObject;
-}
-
</del><span class="cx"> G_BEGIN_DECLS
</span><span class="cx"> 
</span><del>-#define WEBKIT_TYPE_ACCESSIBLE_HYPERLINK                  (webkitAccessibleHyperlinkGetType ())
-#define WEBKIT_ACCESSIBLE_HYPERLINK(obj)                  (G_TYPE_CHECK_INSTANCE_CAST ((obj), WEBKIT_TYPE_ACCESSIBLE_HYPERLINK, WebKitAccessibleHyperlink))
-#define WEBKIT_ACCESSIBLE_HYPERLINK_CLASS(klass)          (G_TYPE_CHECK_CLASS_CAST ((klass), WEBKIT_TYPE_ACCESSIBLE_HYPERLINK, WebKitAccessibleHyperlinkClass))
-#define WEBKIT_IS_ACCESSIBLE_HYPERLINK(obj)               (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WEBKIT_TYPE_ACCESSIBLE_HYPERLINK))
-#define WEBKIT_IS_ACCESSIBLE_HYPERLINK_CLASS(klass)       (G_TYPE_CHECK_CLASS_TYPE ((klass), WEBKIT_TYPE_ACCESSIBLE_HYPERLINK))
-#define WEBKIT_ACCESSIBLE_HYPERLINK_GET_CLASS(obj)        (G_TYPE_INSTANCE_GET_CLASS ((obj), WEBKIT_TYPE_ACCESSIBLE_HYPERLINK, WebKitAccessibleHyperlinkClass))
</del><ins>+#define WEBKIT_TYPE_ACCESSIBLE_HYPERLINK             (webkit_accessible_hyperlink_get_type())
+#define WEBKIT_ACCESSIBLE_HYPERLINK(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_ACCESSIBLE_HYPERLINK, WebKitAccessibleHyperlink))
+#define WEBKIT_ACCESSIBLE_HYPERLINK_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass), WEBKIT_TYPE_ACCESSIBLE_HYPERLINK, WebKitAccessibleHyperlinkClass))
+#define WEBKIT_IS_ACCESSIBLE_HYPERLINK(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_TYPE_ACCESSIBLE_HYPERLINK))
+#define WEBKIT_IS_ACCESSIBLE_HYPERLINK_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass), WEBKIT_TYPE_ACCESSIBLE_HYPERLINK))
+#define WEBKIT_ACCESSIBLE_HYPERLINK_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj), WEBKIT_TYPE_ACCESSIBLE_HYPERLINK, WebKitAccessibleHyperlinkClass))
</ins><span class="cx"> 
</span><del>-typedef struct _WebKitAccessibleHyperlink                WebKitAccessibleHyperlink;
-typedef struct _WebKitAccessibleHyperlinkClass           WebKitAccessibleHyperlinkClass;
-typedef struct _WebKitAccessibleHyperlinkPrivate         WebKitAccessibleHyperlinkPrivate;
</del><ins>+typedef struct _WebKitAccessibleHyperlink        WebKitAccessibleHyperlink;
+typedef struct _WebKitAccessibleHyperlinkClass   WebKitAccessibleHyperlinkClass;
+typedef struct _WebKitAccessibleHyperlinkPrivate WebKitAccessibleHyperlinkPrivate;
</ins><span class="cx"> 
</span><span class="cx"> struct _WebKitAccessibleHyperlink {
</span><span class="cx">     AtkHyperlink parent;
</span><span class="cx"> 
</span><del>-    // private
</del><span class="cx">     WebKitAccessibleHyperlinkPrivate *priv;
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="lines">@@ -51,12 +46,10 @@
</span><span class="cx">     AtkHyperlinkClass parentClass;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-GType webkitAccessibleHyperlinkGetType(void) G_GNUC_CONST;
</del><ins>+GType webkit_accessible_hyperlink_get_type(void);
</ins><span class="cx"> 
</span><del>-WebKitAccessibleHyperlink* webkitAccessibleHyperlinkNew(AtkHyperlinkImpl*);
</del><ins>+WebKitAccessibleHyperlink* webkitAccessibleHyperlinkGetOrCreate(AtkHyperlinkImpl*);
</ins><span class="cx"> 
</span><del>-WebCore::AccessibilityObject* webkitAccessibleHyperlinkGetAccessibilityObject(WebKitAccessibleHyperlink*);
-
</del><span class="cx"> G_END_DECLS
</span><span class="cx"> 
</span><span class="cx"> #endif // HAVE(ACCESSIBILITY)
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityatkWebKitAccessibleInterfaceHyperlinkImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceHyperlinkImpl.cpp (244071 => 244072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceHyperlinkImpl.cpp        2019-04-09 08:41:59 UTC (rev 244071)
+++ trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceHyperlinkImpl.cpp   2019-04-09 09:01:35 UTC (rev 244072)
</span><span class="lines">@@ -24,24 +24,14 @@
</span><span class="cx"> 
</span><span class="cx"> #include "WebKitAccessibleHyperlink.h"
</span><span class="cx"> 
</span><del>-using namespace WebCore;
-
-static GQuark hyperlinkObjectQuark = 0;
-
</del><span class="cx"> static AtkHyperlink* webkitAccessibleHyperlinkImplGetHyperlink(AtkHyperlinkImpl* hyperlink)
</span><span class="cx"> {
</span><del>-    AtkHyperlink* hyperlinkObject = ATK_HYPERLINK(g_object_get_qdata(G_OBJECT(hyperlink), hyperlinkObjectQuark));
-    if (!hyperlinkObject) {
-        hyperlinkObject = ATK_HYPERLINK(webkitAccessibleHyperlinkNew(hyperlink));
-        g_object_set_qdata(G_OBJECT(hyperlink), hyperlinkObjectQuark, hyperlinkObject);
-    }
-    return hyperlinkObject;
</del><ins>+    return ATK_HYPERLINK(webkitAccessibleHyperlinkGetOrCreate(hyperlink));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void webkitAccessibleHyperlinkImplInterfaceInit(AtkHyperlinkImplIface* iface)
</span><span class="cx"> {
</span><span class="cx">     iface->get_hyperlink = webkitAccessibleHyperlinkImplGetHyperlink;
</span><del>-    hyperlinkObjectQuark = g_quark_from_static_string("webkit-accessible-hyperlink-object");
</del><span class="cx"> }
</span><span class="cx"> 
</span><del>-#endif
</del><ins>+#endif // HAVE(ACCESSIBILITY)
</ins></span></pre>
</div>
</div>

</body>
</html>