Skip to content

Commit

Permalink
Merge inbound to m-c a=merge
Browse files Browse the repository at this point in the history
  • Loading branch information
KWierso committed Sep 2, 2016
2 parents 0751152 + 2c2a553 commit c28fdd5
Show file tree
Hide file tree
Showing 61 changed files with 1,445 additions and 904 deletions.
30 changes: 15 additions & 15 deletions accessible/atk/UtilInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,23 +251,23 @@ mai_key_snooper(GtkWidget *the_widget, GdkEventKey *event, gpointer func_data)
static guint sKey_snooper_id = 0;

static guint
mai_util_add_key_event_listener (AtkKeySnoopFunc listener,
gpointer data)
mai_util_add_key_event_listener(AtkKeySnoopFunc listener, gpointer data)
{
if (MOZ_UNLIKELY(!listener))
if (MOZ_UNLIKELY(!listener)) {
return 0;

static guint key=0;

if (!sKey_listener_list) {
sKey_listener_list = g_hash_table_new(nullptr, nullptr);
sKey_snooper_id = gtk_key_snooper_install(mai_key_snooper, data);
}
AtkKeySnoopFuncPointer atkKeySnoop;
atkKeySnoop.func_ptr = listener;
g_hash_table_insert(sKey_listener_list, GUINT_TO_POINTER (key++),
atkKeySnoop.data);
return key;
}

static guint key = 0;

if (!sKey_listener_list) {
sKey_listener_list = g_hash_table_new(nullptr, nullptr);
sKey_snooper_id = gtk_key_snooper_install(mai_key_snooper, data);
}
AtkKeySnoopFuncPointer atkKeySnoop;
atkKeySnoop.func_ptr = listener;
g_hash_table_insert(sKey_listener_list, GUINT_TO_POINTER(key++),
atkKeySnoop.data);
return key;
}

static void
Expand Down
17 changes: 9 additions & 8 deletions accessible/atk/nsMaiHyperlink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,18 +188,19 @@ AtkObject *
getObjectCB(AtkHyperlink *aLink, gint aLinkIndex)
{
MaiHyperlink* maiLink = GetMaiHyperlink(aLink);
if (!maiLink)
if (!maiLink) {
return nullptr;
}

if (Accessible* hyperlink = maiLink->GetAccHyperlink()) {
Accessible* anchor = hyperlink->AnchorAt(aLinkIndex);
NS_ENSURE_TRUE(anchor, nullptr);
if (Accessible* hyperlink = maiLink->GetAccHyperlink()) {
Accessible* anchor = hyperlink->AnchorAt(aLinkIndex);
NS_ENSURE_TRUE(anchor, nullptr);

return AccessibleWrap::GetAtkObject(anchor);
}
return AccessibleWrap::GetAtkObject(anchor);
}

ProxyAccessible* anchor = maiLink->Proxy()->AnchorAt(aLinkIndex);
return anchor ? GetWrapperFor(anchor) : nullptr;
ProxyAccessible* anchor = maiLink->Proxy()->AnchorAt(aLinkIndex);
return anchor ? GetWrapperFor(anchor) : nullptr;
}

gint
Expand Down
13 changes: 7 additions & 6 deletions accessible/atk/nsMaiInterfaceDocument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,15 @@ getDocumentLocaleCB(AtkDocument *aDocument)
static inline GSList *
prependToList(GSList *aList, const char *const aName, const nsAutoString &aValue)
{
if (aValue.IsEmpty())
if (aValue.IsEmpty()) {
return aList;
}

// libspi will free these
AtkAttribute *atkAttr = (AtkAttribute *)g_malloc(sizeof(AtkAttribute));
atkAttr->name = g_strdup(aName);
atkAttr->value = g_strdup(NS_ConvertUTF16toUTF8(aValue).get());
return g_slist_prepend(aList, atkAttr);
// libspi will free these
AtkAttribute *atkAttr = (AtkAttribute *)g_malloc(sizeof(AtkAttribute));
atkAttr->name = g_strdup(aName);
atkAttr->value = g_strdup(NS_ConvertUTF16toUTF8(aValue).get());
return g_slist_prepend(aList, atkAttr);
}

AtkAttributeSet *
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,18 @@ add_task(function* test() {
}));
});

is(browser1.contentDocument.title, '?old', "Tab1 title must be 'old'");
is(browser1.contentDocument.nodePrincipal.userContextId, 1, "Tab1 UCI must be 1");
is(browser1.contentTitle, '?old', "Tab1 title must be 'old'");
is(browser1.contentPrincipal.userContextId, 1, "Tab1 UCI must be 1");

is(browser2.contentDocument.title, '?old', "Tab2 title must be 'old'");
is(browser2.contentDocument.nodePrincipal.userContextId, 2, "Tab2 UCI must be 2");
is(browser2.contentTitle, '?old', "Tab2 title must be 'old'");
is(browser2.contentPrincipal.userContextId, 2, "Tab2 UCI must be 2");

let found = false;
for (let i = 0; i < gBrowser.tabContainer.childNodes.length; ++i) {
let tab = gBrowser.tabContainer.childNodes[i];
let browser = gBrowser.getBrowserForTab(tab);
if (browser.contentDocument.title == '?new') {
is(browser.contentDocument.nodePrincipal.userContextId, 1, "Tab3 UCI must be 1");
if (browser.contentTitle == '?new') {
is(browser.contentPrincipal.userContextId, 1, "Tab3 UCI must be 1");
isnot(browser, browser1, "Tab3 is not browser 1");
isnot(browser, browser2, "Tab3 is not browser 2");
gBrowser.removeTab(tab);
Expand Down
Loading

0 comments on commit c28fdd5

Please sign in to comment.