Closed
Bug 1286322
Opened 7 years ago
Closed 7 years ago
Make xpcAccessibleHyperLink work with proxied accessibles.
Categories
(Core :: Disability Access APIs, defect)
Core
Disability Access APIs
Tracking
()
RESOLVED
FIXED
mozilla50
Tracking | Status | |
---|---|---|
firefox50 | --- | fixed |
People
(Reporter: michael.li11702, Assigned: michael.li11702)
Details
Attachments
(1 file, 3 obsolete files)
5.95 KB,
patch
|
michael.li11702
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Assignee | ||
Comment 1•7 years ago
|
||
Attachment #8770236 -
Flags: review?(tbsaunde+mozbugs)
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → mili
Comment 2•7 years ago
|
||
Comment on attachment 8770236 [details] [diff] [review] Make xpcAccessibleHyperLink work with proxied accessibles. r?tbsaunde > xpcAccessibleHyperLink::GetURI(int32_t aIndex, nsIURI** aURI) > { > NS_ENSURE_ARG_POINTER(aURI); > >- if (!Intl()) >+ if (Intl().IsNull()) > return NS_ERROR_FAILURE; > >- if (aIndex < 0 || aIndex >= static_cast<int32_t>(Intl()->AnchorCount())) >+ if (aIndex < 0) > return NS_ERROR_INVALID_ARG; > >- RefPtr<nsIURI>(Intl()->AnchorURIAt(aIndex)).forget(aURI); >+ if (Intl().IsAccessible()) { >+ if (aIndex >= static_cast<int32_t>(Intl().AsAccessible()->AnchorCount())) >+ return NS_ERROR_INVALID_ARG; >+ >+ RefPtr<nsIURI>(Intl().AsAccessible()->AnchorURIAt(aIndex)).forget(aURI); >+ } else { >+ bool isCountValid = false; >+ int32_t anchorCount = >+ static_cast<int32_t>(Intl().AsProxy()->AnchorCount(&isCountValid)); >+ if (!isCountValid) >+ return NS_ERROR_FAILURE; I'd rather not make two ipc calls in the same function. I don't think you really need to check the number of links first, and you can just try to get the ith one. >+ nsCString URIStr; naming it spec might be more conventional. >+ bool isURIValid = false; >+ Intl().AsProxy()->AnchorURIAt(aIndex, URIStr, &isURIValid); >+ if (!isURIValid) >+ return NS_ERROR_FAILURE; >+ >+ nsCOMPtr<nsIURI> newURI; i'd name it just uri. >+ nsresult newURIResult = NS_NewURI(getter_AddRefs(newURI), URIStr); just rv. >+ if (NS_FAILED(newURIResult)) >+ return NS_ERROR_FAILURE; >+ >+ newURI.forget(aURI); >+ drop the blank line > xpcAccessibleHyperLink::GetAnchor(int32_t aIndex, nsIAccessible** aAccessible) > { > NS_ENSURE_ARG_POINTER(aAccessible); > *aAccessible = nullptr; > >- if (!Intl()) >+ if (Intl().IsNull()) > return NS_ERROR_FAILURE; >- >- if (aIndex < 0 || aIndex >= static_cast<int32_t>(Intl()->AnchorCount())) >+ >+ if (aIndex < 0) > return NS_ERROR_INVALID_ARG; > >- NS_IF_ADDREF(*aAccessible = ToXPC(Intl()->AnchorAt(aIndex))); >+ if (Intl().IsAccessible()) { >+ if (aIndex >= static_cast<int32_t>(Intl().AsAccessible()->AnchorCount())) >+ return NS_ERROR_INVALID_ARG; >+ >+ NS_IF_ADDREF(*aAccessible = ToXPC(Intl().AsAccessible()->AnchorAt(aIndex))); >+ } else { >+ bool isCountValid = false; >+ int32_t anchorCount = >+ static_cast<int32_t>(Intl().AsProxy()->AnchorCount(&isCountValid)); >+ if (!isCountValid) >+ return NS_ERROR_FAILURE; I think you can skip checking the count here too.
Attachment #8770236 -
Flags: review?(tbsaunde+mozbugs)
Assignee | ||
Comment 3•7 years ago
|
||
Attachment #8770619 -
Flags: review?(tbsaunde+mozbugs)
Assignee | ||
Updated•7 years ago
|
Attachment #8770236 -
Attachment is obsolete: true
Assignee | ||
Comment 4•7 years ago
|
||
This version keeps the extra index checks for GetURI() and GetAnchor() if it's an Accessible.
Attachment #8770680 -
Flags: review?(tbsaunde+mozbugs)
Assignee | ||
Updated•7 years ago
|
Attachment #8770619 -
Attachment is obsolete: true
Attachment #8770619 -
Flags: review?(tbsaunde+mozbugs)
Comment 5•7 years ago
|
||
Comment on attachment 8770680 [details] [diff] [review] Make xpcAccessibleHyperLink work with proxied accessibles. r?tbsaunde > xpcAccessibleHyperLink::GetURI(int32_t aIndex, nsIURI** aURI) > { >+ nsCOMPtr<nsIURI> uri; >+ nsresult rv = NS_NewURI(getter_AddRefs(uri), spec); >+ if (NS_FAILED(rv)) >+ return NS_ERROR_FAILURE; just use NS_ENSURE_SUCCESS(rv, rv);
Attachment #8770680 -
Flags: review?(tbsaunde+mozbugs) → review+
Assignee | ||
Comment 6•7 years ago
|
||
Attachment #8771120 -
Flags: review+
Assignee | ||
Updated•7 years ago
|
Attachment #8770680 -
Attachment is obsolete: true
Assignee | ||
Updated•7 years ago
|
Keywords: checkin-needed
Assignee | ||
Updated•7 years ago
|
Summary: Make xpcAccessibleHyperLink work with proxied accessibles. r?tbsaunde → Make xpcAccessibleHyperLink work with proxied accessibles.
Pushed by ryanvm@gmail.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/3bbf5d4f5e79 Make xpcAccessibleHyperLink work with proxied accessibles. r=tbsaunde
Keywords: checkin-needed
Comment 8•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/3bbf5d4f5e79
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox50:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla50
You need to log in
before you can comment on or make changes to this bug.
Description
•