Bug 1221256: Implement IAccessible::put_accValue for editable text. r=MarcoZ

Differential Revision: https://phabricator.services.mozilla.com/D53378

--HG--
extra : moz-landing-system : lando
This commit is contained in:
James Teh 2019-11-18 05:38:35 +00:00
Родитель 78545b8343
Коммит 2ed860b51f
2 изменённых файлов: 24 добавлений и 3 удалений

Просмотреть файл

@ -914,8 +914,11 @@ AccessibleHandler::put_accName(VARIANT varChild, BSTR szName) {
HRESULT
AccessibleHandler::put_accValue(VARIANT varChild, BSTR szValue) {
// This matches AccessibleWrap
return E_NOTIMPL;
HRESULT hr = ResolveIA2();
if (FAILED(hr)) {
return hr;
}
return mIA2PassThru->put_accValue(varChild, szValue);
}
/*** IAccessible2 ***/

Просмотреть файл

@ -1016,7 +1016,25 @@ STDMETHODIMP
AccessibleWrap::put_accValue(
/* [optional][in] */ VARIANT varChild,
/* [in] */ BSTR szValue) {
return E_NOTIMPL;
RefPtr<IAccessible> accessible;
HRESULT hr = ResolveChild(varChild, getter_AddRefs(accessible));
if (FAILED(hr)) {
return hr;
}
if (accessible) {
return accessible->put_accValue(kVarChildIdSelf, szValue);
}
HyperTextAccessible* ht = AsHyperText();
if (!ht) {
return E_NOTIMPL;
}
uint32_t length = ::SysStringLen(szValue);
nsAutoString text(szValue, length);
ht->ReplaceText(text);
return S_OK;
}
////////////////////////////////////////////////////////////////////////////////