forked from mirrors/gecko-dev
Bug 1826868 - Remove useless Title IPC sync message. r=morgan,ipc-reviewers,mccr8
The message wasn't doing anything useful on Mac. Took the opportunity to correcty expose the AXTitle/AXDescription of headings. Differential Revision: https://phabricator.services.mozilla.com/D176824
This commit is contained in:
parent
945b662097
commit
e108daa52d
9 changed files with 47 additions and 34 deletions
|
|
@ -176,7 +176,6 @@ virtual nsIntRect BoundsInCSSPixels() const override;
|
|||
|
||||
virtual void Language(nsAString& aLocale) override;
|
||||
void DocType(nsString& aType);
|
||||
void Title(nsString& aTitle);
|
||||
void MimeType(nsString aMime);
|
||||
void URLDocTypeMimeType(nsString& aURL, nsString& aDocType,
|
||||
nsString& aMimeType);
|
||||
|
|
|
|||
|
|
@ -1331,17 +1331,6 @@ mozilla::ipc::IPCResult DocAccessibleChild::RecvDocType(const uint64_t& aID,
|
|||
return IPC_OK();
|
||||
}
|
||||
|
||||
mozilla::ipc::IPCResult DocAccessibleChild::RecvTitle(const uint64_t& aID,
|
||||
nsString* aTitle) {
|
||||
LocalAccessible* acc = IdToAccessible(aID);
|
||||
if (acc) {
|
||||
mozilla::ErrorResult rv;
|
||||
acc->GetContent()->GetTextContent(*aTitle, rv);
|
||||
}
|
||||
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
mozilla::ipc::IPCResult DocAccessibleChild::RecvMimeType(const uint64_t& aID,
|
||||
nsString* aMime) {
|
||||
LocalAccessible* acc = IdToAccessible(aID);
|
||||
|
|
|
|||
|
|
@ -395,8 +395,6 @@ class DocAccessibleChild : public DocAccessibleChildBase {
|
|||
nsString* aLocale) override;
|
||||
virtual mozilla::ipc::IPCResult RecvDocType(const uint64_t& aID,
|
||||
nsString* aType) override;
|
||||
virtual mozilla::ipc::IPCResult RecvTitle(const uint64_t& aID,
|
||||
nsString* aTitle) override;
|
||||
virtual mozilla::ipc::IPCResult RecvMimeType(const uint64_t& aID,
|
||||
nsString* aMime) override;
|
||||
virtual mozilla::ipc::IPCResult RecvURLDocTypeMimeType(
|
||||
|
|
|
|||
|
|
@ -318,7 +318,6 @@ child:
|
|||
|
||||
[Nested=inside_sync] sync Language(uint64_t aID) returns(nsString aLocale);
|
||||
[Nested=inside_sync] sync DocType(uint64_t aID) returns(nsString aType);
|
||||
[Nested=inside_sync] sync Title(uint64_t aID) returns(nsString aTitle);
|
||||
[Nested=inside_sync] sync MimeType(uint64_t aID) returns(nsString aMime);
|
||||
[Nested=inside_sync] sync URLDocTypeMimeType(uint64_t aID) returns(nsString aURL, nsString aDocType, nsString aMimeType);
|
||||
|
||||
|
|
|
|||
|
|
@ -951,10 +951,6 @@ void RemoteAccessible::DocType(nsString& aType) {
|
|||
Unused << mDoc->SendDocType(mID, &aType);
|
||||
}
|
||||
|
||||
void RemoteAccessible::Title(nsString& aTitle) {
|
||||
Unused << mDoc->SendTitle(mID, &aTitle);
|
||||
}
|
||||
|
||||
void RemoteAccessible::MimeType(nsString aMime) {
|
||||
Unused << mDoc->SendMimeType(mID, &aMime);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,16 +18,13 @@ using namespace mozilla::a11y;
|
|||
|
||||
- (NSString*)moxTitle {
|
||||
nsAutoString title;
|
||||
if (LocalAccessible* acc = mGeckoAccessible->AsLocal()) {
|
||||
mozilla::ErrorResult rv;
|
||||
// XXX use the flattening API when there are available
|
||||
// see bug 768298
|
||||
acc->GetContent()->GetTextContent(title, rv);
|
||||
} else if (RemoteAccessible* proxy = mGeckoAccessible->AsRemote()) {
|
||||
proxy->Title(title);
|
||||
}
|
||||
|
||||
title.CompressWhitespace();
|
||||
ENameValueFlag flag = mGeckoAccessible->Name(title);
|
||||
if (flag != eNameFromSubtree) {
|
||||
// If this is a name via relation or attribute (eg. aria-label)
|
||||
// it will be provided via AXDescription.
|
||||
return nil;
|
||||
}
|
||||
|
||||
return nsCocoaUtils::ToNSString(title);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ addAccessibleTask(
|
|||
<h1 id="single-line-content">We’re building a richer search experience</h1>
|
||||
<h1 id="multi-lines-content">
|
||||
We’re building a
|
||||
richer
|
||||
richest
|
||||
search experience
|
||||
</h1>
|
||||
`,
|
||||
|
|
@ -33,7 +33,45 @@ search experience
|
|||
);
|
||||
is(
|
||||
multiLinesContentHeading.getAttributeValue("AXTitle"),
|
||||
"We’re building a richer search experience"
|
||||
"We’re building a richest search experience"
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* Test AXTitle/AXDescription attributes of heading elements
|
||||
*/
|
||||
addAccessibleTask(
|
||||
`
|
||||
<h1 id="a">Hello <a href="#">world</a></h1>
|
||||
<h1 id="b">Hello</h1>
|
||||
<h1 id="c" aria-label="Goodbye">Hello</h1>
|
||||
`,
|
||||
async (browser, accDoc) => {
|
||||
const a = getNativeInterface(accDoc, "a");
|
||||
is(
|
||||
a.getAttributeValue("AXTitle"),
|
||||
"Hello world",
|
||||
"Correct AXTitle for 'a'"
|
||||
);
|
||||
ok(
|
||||
!a.getAttributeValue("AXDescription"),
|
||||
"'a' Should not have AXDescription"
|
||||
);
|
||||
|
||||
const b = getNativeInterface(accDoc, "b");
|
||||
is(b.getAttributeValue("AXTitle"), "Hello", "Correct AXTitle for 'b'");
|
||||
ok(
|
||||
!b.getAttributeValue("AXDescription"),
|
||||
"'b' Should not have AXDescription"
|
||||
);
|
||||
|
||||
const c = getNativeInterface(accDoc, "c");
|
||||
is(
|
||||
c.getAttributeValue("AXDescription"),
|
||||
"Goodbye",
|
||||
"Correct AXDescription for 'c'"
|
||||
);
|
||||
ok(!c.getAttributeValue("AXTitle"), "'c' Should not have AXTitle");
|
||||
}
|
||||
);
|
||||
|
|
|
|||
|
|
@ -200,7 +200,7 @@ addAccessibleTask(
|
|||
link4
|
||||
.getAttributeValue("AXLinkedUIElements")[0]
|
||||
.getAttributeValue("AXTitle"),
|
||||
"",
|
||||
null,
|
||||
"Link 4 is linked to the heading"
|
||||
);
|
||||
is(
|
||||
|
|
|
|||
|
|
@ -341,9 +341,6 @@ platform = notwin
|
|||
[PDocAccessible::DocType]
|
||||
description = Legacy a11y IPC
|
||||
platform = notwin
|
||||
[PDocAccessible::Title]
|
||||
description = Legacy a11y IPC
|
||||
platform = notwin
|
||||
[PDocAccessible::MimeType]
|
||||
description = Legacy a11y IPC
|
||||
platform = notwin
|
||||
|
|
|
|||
Loading…
Reference in a new issue