Граф коммитов

579 Коммитов

Автор SHA1 Сообщение Дата
James Teh ba7d805a62 Bug 1650590: A11y COM handler: Use CoTaskMemAlloc/Free for row/column header ids arrays when returned by IGeckoBackChannel::Refresh. r=MarcoZ
DynamicIA2Data can be built to be transmitted in two different ways:

1. As part of the payload included in the stream when an accessible is marshaled; or
2. As an out parameter returned by IGeckoBackChannel::Refresh().

DynamicIA2Data includes arrays for row/column header ids.
Normally, such arrays would be allocated by CoTaskMemAlloc and freed by CoTaskMemFree.
However, in the first case, the struct is actually marshaled by RPC encoding functions, not by COM itself.
This means we must use midl_user_allocate/free, lest we crash.
We previously used midl_user_allocate/free for the second case as well.
Unfortunately, it turns out that this too causes crashes.

To fix this, we now use different memory allocation functions depending on how the struct is transmitted.

This patch also cleans up the old DynamicIA2Data in the client before calling IGeckoBackChannel::Refresh.
Previously, we didn't do this, which would have resulted in a leak.

Differential Revision: https://phabricator.services.mozilla.com/D82823
2020-07-09 06:56:24 +00:00
Eitan Isaacson 8b130be2bb Bug 1226473 - Support AXSelectedTextMarkerRange. r=morgan
To do this well we need to cache the text selection in the top level process.

Differential Revision: https://phabricator.services.mozilla.com/D82111
2020-07-06 17:32:45 +00:00
Sylvestre Ledru caf785c695 Bug 1519636 - Reformat recent changes to the Google coding style r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D82178
2020-07-04 09:38:43 +00:00
Eitan Isaacson 970939c823 Bug 1649217 - Part 3: Support isSelectionCollapsed in caret moved xpcom iface. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D81913
2020-07-02 17:43:21 +00:00
Eitan Isaacson 9abbad9091 Bug 1649217 - Part 2: Send isSelectionCollapsed for caret move in IPC. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D81912
2020-07-02 18:08:52 +00:00
James Teh a14ee5ceec Bug 1631276 part 3: Don't return a descendant document in DocAccessibleChild::RecvChildAtPoint unless we're certain that document has been constructed in the parent process. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D81010
2020-06-25 16:11:07 +00:00
James Teh 06946181ec Bug 1631276 part 2: On non-Windows, have the parent process notify the content process when the DocAccessibleParent is constructed. r=eeejay
This is already handled in a different way on Windows.
For documents at the top level of their process (including OOP iframes), we can just set the flag rather than waiting for a message, since we can never get queries for such documents or descendants before parent process construction is complete.

Differential Revision: https://phabricator.services.mozilla.com/D81009
2020-06-29 18:12:44 +00:00
James Teh feb712c112 Bug 1631276 part 1: Move Set/GetIsConstructedInParentProcess into DocAccessibleChildBase. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D81008
2020-06-25 16:07:20 +00:00
Eitan Isaacson ccdf272301 Bug 1647483 - Add a TextRange getter to text selection change events. r=Jamie
This includes 3 changes:
1. Add a lazy ranges getter to AccTextSelChangeEvent.
2. Create an XPCOM interface for testing purposes.
3. Add IPDL bindings for passing ranges in e10s.

Differential Revision: https://phabricator.services.mozilla.com/D80556
2020-06-23 18:52:42 +00:00
James Teh 6a5821c667 Bug 1630208 part 2: Drop events for DocAccessibleParents which are already shut down. r=yzen
We can receive IPC events after a DocAccessibleParent is shut down if the BrowserParent is in the process of being destroyed (probably the tab closed) but there are still events in the IPC queue.
Most Recv*Event methods in BrowserParent check mShutdown, but a few don't.
For the events that don't, if the event is for a document, we'll successfully fire the platform event, and then successfully get and cache an xpcAccessibleDocument.
However, that xpcAccessibleDocument will never be removed from the cache because it's already shut down, so NotifyOfRemoteDocShutdown (which would normally remove it from the XPC cache) won't get called.
This results in a leaked object.
Thus, it's important that all Recv*Event methods drop the event if mShutdown is true.
This patch adds that check to the methods which didn't have it already.

Differential Revision: https://phabricator.services.mozilla.com/D79780
2020-06-17 18:40:42 +00:00
James Teh c384807ed4 Bug 1645067: Set the top level DocAccessibleChild as early as possible. r=MarcoZ
Otherwise, if we're replacing a previous top level doc, we might refer to the old top level doc during initialization.

Differential Revision: https://phabricator.services.mozilla.com/D79398
2020-06-12 07:11:02 +00:00
James Teh 0b42799e46 Bug 1644323: For in-process iframes in content processes, use the emulated window set on the top level DocAccessibleChild (if any). r=MarcoZ
When window emulation is enabled, the emulated window is set on the top level DocAccessibleChild.
However, it isn't set on child documents (in-process iframes).
Therefore, when querying the window handle, we need to check for an emulated window handle on the top level document and return that if present.
This fixes the window handle returned by IAccessible2::get_windowHandle.

Note that the window handle used when firing events was already correct, as that is determined in the parent process.
In the parent process, the emulated window was already being propagated down to child DocAccessibleParents by BrowserParent::RecvPDocAccessibleConstructor.

Differential Revision: https://phabricator.services.mozilla.com/D79035
2020-06-10 07:11:31 +00:00
James Teh 8da3be47f5 Bug 1642141: When clearing the AccessibleHandlerControl Accessible cache, swap it into a temporary map first to avoid re-entry into the main map while clearing. r=MarcoZ
Differential Revision: https://phabricator.services.mozilla.com/D77623
2020-06-01 05:45:44 +00:00
James Teh 5abc128c45 Bug 1640553 part 3: AccessibleHandler: Use the row/column header ids in the payload to avoid cross-process calls. r=eeejay
1. When we unmarshal a row/column header, cache it so we can get it by id later.
2. get_rowHeaderCells and get_columnHeaderCells use the header ids in the payload.
    If the headers are in the cache (as per 1), return them to the client.
    Otherwise, fall back to a cross-process call, which might happen if we haven't encountered the header yet.

Differential Revision: https://phabricator.services.mozilla.com/D76667
2020-05-26 01:10:22 +00:00
James Teh fe12e1e987 Bug 1640553 part 2: Include row/column header cell ids in the payload for AccessibleHandler. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D76666
2020-05-26 03:20:07 +00:00
James Teh 61ed1074ea Bug 1640553 part 1: Add the ability for AccessibleHandler to cache accessibles by id. r=eeejay
This cache is cleared when other AccessibleHandler caches are invalidated; i.e. when an event is fired.

Differential Revision: https://phabricator.services.mozilla.com/D76665
2020-05-26 01:10:26 +00:00
Noemi Erli fe1f281e9e Backed out 3 changesets (bug 1640553) for causing Windows build bustages CLOSED TREE
Backed out changeset 25dd5eeb676f (bug 1640553)
Backed out changeset 4e0cd8a3d83c (bug 1640553)
Backed out changeset 6658e0ae7e35 (bug 1640553)
2020-05-26 03:50:11 +03:00
James Teh f3893a240b Bug 1640553 part 3: AccessibleHandler: Use the row/column header ids in the payload to avoid cross-process calls. r=eeejay
1. When we unmarshal a row/column header, cache it so we can get it by id later.
2. get_rowHeaderCells and get_columnHeaderCells use the header ids in the payload.
    If the headers are in the cache (as per 1), return them to the client.
    Otherwise, fall back to a cross-process call, which might happen if we haven't encountered the header yet.

Differential Revision: https://phabricator.services.mozilla.com/D76667
2020-05-25 14:43:06 +00:00
James Teh c664bdb2f9 Bug 1640553 part 2: Include row/column header cell ids in the payload for AccessibleHandler. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D76666
2020-05-25 14:41:42 +00:00
James Teh 32802da1f1 Bug 1640553 part 1: Add the ability for AccessibleHandler to cache accessibles by id. r=eeejay
This cache is cleared when other AccessibleHandler caches are invalidated; i.e. when an event is fired.

Differential Revision: https://phabricator.services.mozilla.com/D76665
2020-05-25 14:35:09 +00:00
James Teh d24d857a51 Bug 1628582: Set DocAccessibleParent::mDocProxyStream on the child document, not the parent document. r=yzen
DocAccessibleParent::AddChildDoc sends a COM proxy for the embedded document to the embedder process hosting the iframe.
This gets returned as the child of the embedder OuterDocAccessible.
Whenever we send a proxy to a content process, we must hold a PreservedStreamPtr in the parent process.
Previously, we set mDocProxyStream on the parent (embedder) document.
However, if a document had multiple OOP iframes, this meant we  ended up losing the PreservedStreamPtr for all but the last added child OOP document.
We now set mDocProxyStream on the child document instead, since there can only be one embedder OuterDocAccessible per child document.

Differential Revision: https://phabricator.services.mozilla.com/D74584
2020-05-11 14:41:57 +00:00
Jonathan Watt 2d1fc3c186 Bug 1634217. Make `accessible/` buildable outside of `unified-build` environment. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D73176
2020-05-01 04:28:35 +00:00
James Teh 28686996c0 Bug 1627084 part 4: Tidy up functions which clean up IA2 payload data. r=MarcoZ
1. CleanupStaticIA2Data just called ReleaseStaticIA2DataInterfaces and zeroed memory.
  We don't need it to zero memory, since we're going to delete the data anyway.
  So, just call ReleaseStaticIA2DataInterfaces directly and get rid of CleanupStaticIA2Data.
2. CleanupDynamicIA2Data had a aZeroMemory argument, but no caller ever set it to true.
  Therefore, get rid of the argument.

Differential Revision: https://phabricator.services.mozilla.com/D70297
2020-04-09 05:00:54 +00:00
James Teh fc518436e7 Bug 1627084 part 3: Build handler payloads in HandlerProvider::ToWrappedObject. r=aklotz,MarcoZ
This avoids separate cross-thread calls when marshaling each object returned from an IGeckoBackChannel bulk fetch method.

Differential Revision: https://phabricator.services.mozilla.com/D69485
2020-04-24 20:31:22 +00:00
Yura Zenevich a9bdb68e38 Bug 1595979 - add zoom text hittest b-c test. Implement OffsetAtPoint for XPCOM on Windows with e10s. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D69824

--HG--
extra : moz-landing-system : lando
2020-04-14 23:57:42 +00:00
Yura Zenevich fa747c2765 Bug 1595979 - add hittest b-c tests (general, shadowroot, zoom). Fix an e10s bug where must prune check was done on the parent side instead of deferring to childAtPoint method. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D69823

--HG--
extra : moz-landing-system : lando
2020-04-14 23:57:34 +00:00
Yura Zenevich bf4f49a410 Bug 1595979 - migtate browser and canvas hittest tests to b-c that test e10s and fission. Fix a bug with incorrect ID returned for document accessibles when getting a child at point over IPC. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D69822

--HG--
extra : moz-landing-system : lando
2020-04-14 23:57:26 +00:00
Chris Peterson 086922958e Bug 1629316 - Replace MOZ_MUST_USE with [[nodiscard]] in accessible. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D70630

--HG--
extra : moz-landing-system : lando
2020-04-14 03:09:06 +00:00
James Teh fa30324c84 Bug 1619506 part 1: Implement QueryService to SID_IAccessibleContentDocument for OOP iframes. r=yzen
For OOP iframes, the top level document lives in a different process.
Previously, we incorrectly returned the top level document in the same process.
This was causing JAWS to incorrectly identify OOP iframe documents as separate tab documents.
To fix this, we must send the real top level document down from the parent process and return that when requested in the content process.

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

--HG--
extra : moz-landing-system : lando
2020-04-08 18:28:08 +00:00
James Teh 5d7440007c Bug 1626802 part 2: Implement HandlerProvider::IsInterfaceMaybeSupported for a11y. r=aklotz,MarcoZ
Differential Revision: https://phabricator.services.mozilla.com/D69286

--HG--
extra : moz-landing-system : lando
2020-04-02 04:09:20 +00:00
James Teh c48bee7775 Bug 1598299 part 2: Remove ProxyAccessible::AccessibleAtPoint. r=yzen,nika
This wasn't useful cross-platform.
ATK was the only consumer of this and it now uses ProxyAccessible::ChildAtPoint.
This also means the related aNeedsScreenCoords functionality in PDocAccessible::AccessibleAtPoint is no longer needed and has thus been removed.
Finally, this renames PDocAccessible::AccessibleAtPoint to PDocAccessible::ChildAtPoint for consistency with Accessible::ChildAtPoint now that the functionality is mirrored.

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

--HG--
extra : moz-landing-system : lando
2020-03-29 23:08:44 +00:00
James Teh 6e3cde7338 Bug 1622751: Teach IPDL that PDocAccessible::AccessibleAtPoint can return a null result doc. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D67081

--HG--
extra : moz-landing-system : lando
2020-03-17 22:13:55 +00:00
James Teh de55f7895d Bug 1614871 part 2: Make non-Windows ProxyAccessible::ChildAtPoint cross into OOP iframes. r=eeejay
When we hit an OOP iframe, we must walk into the child document and continue the search from there.

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

--HG--
extra : moz-landing-system : lando
2020-03-13 06:14:38 +00:00
James Teh 05f1674b2d Bug 1614871 part 1: Make non-Windows ProxyAccessible::ChildAtPoint cross into in-process iframes. r=eeejay
Accessible::ChildAtPoint can return an Accessible in a descendant document.
Thus, we must return the result PDocAccessible via IPC, not just the id.
Previously, we only returned the id, but we'd fail when we tried to look it up if it belonged to a descendant document.

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

--HG--
extra : moz-landing-system : lando
2020-03-13 06:14:30 +00:00
James Teh 73a8260a74 Bug 1621517: Make nsIAccessible child retrieval work for OuterDocAccessibles with remote documents. r=yzen
This code (and an upcoming dependent patch) is currently behind a pref which is disabled by default, as there is uncertainty as to how it might impact the Dev Tools A11y Panel.
The A11y Panel is currently a moving target due to ongoing refactor for Fission.
This pref should be removed once that groundwork is complete and the impact has been verified.

This patch also includes fixes to some ProxyAccessible methods which previously crashed when there was no parent, as is the case for top level documents.
Without these fixes, the Dev Tools A11y Panel would crash the parent process.

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

--HG--
extra : moz-landing-system : lando
2020-03-13 01:37:14 +00:00
James Teh 7b7c684070 Bug 1621519: Implement xpcAccessible::GetDeepestChildAtPoint for ProxyAccessibles on Windows. r=yzen
Differential Revision: https://phabricator.services.mozilla.com/D66359

--HG--
extra : moz-landing-system : lando
2020-03-11 23:26:18 +00:00
Eitan Isaacson 9e27b2cdde Bug 1618712 - Use GroupPosition for heading levels in mac. r=morgan,nika
We were using the wrong Accessible method to get the level. We also need to swap IPDL methods to use the right one.

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

--HG--
extra : moz-landing-system : lando
2020-03-10 18:32:38 +00:00
James Teh 193e22639f Bug 1555228: When window emulation is enabled, use the root accessible to answer IAccessible::accChild queries for ids in OOP iframes. r=yzen
When window emulation is enabled, each tab document gets its own HWND.
OOP iframes get the same HWND as their tab document and fire events with that HWND.
However, the root accessible for the HWND (the tab document) can't return accessibles for OOP iframes.
Therefore, we must get the root accessible from the main HWND and call accChild on that instead.

We must do this in the parent process, but the tab document accessible is in the content process.
Although OOP a11y clients talk directly to the content process, the clients that need window emulation are in-process.
All in-process client calls get intercepted by AccessibleHandler, so we can deal with this forwarding in AccessibleHandler.

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

--HG--
extra : moz-landing-system : lando
2020-03-03 15:48:22 +00:00
Mike Hommey d747b65211 Bug 1617794 - Wrap Windows tools with Wine on cross builds. r=dmajor
Windows programs run via Wine don't like Unix absolute paths (they look
like command line arguments), so we need to use relative paths.

Mingw already run fxc2 via wine, but for some reason it doesn't care
about the Unix absolute paths. genshaders does need some adjustements to
run properly with the real fxc.

Now, on actual Windows, because the temporary directory where
tempfile.NamedTemporaryFile creates files by default is not necessarily
on the same drive as where the command runs from, a relative path can't
be constructed. So we also force the temporary file to be created in the
current (obj) directory.

There is no similar concern for other files because we only go from
objdir to srcdir, and the build system already doesn't support both
being on a separate drive.

While here, flush stdout when the genshared script writes to it, so that
the messages are printed out immediately rather than randomly, later,
after output from subprocesses.

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

--HG--
extra : moz-landing-system : lando
2020-02-27 04:42:57 +00:00
Simon Giesecke 9350e6b741 Bug 1613985 - Use MOZ_COUNTED_DEFAULT_CTOR_*/MOZ_COUNTED_DTOR_* macros. r=froydnj
This removes the need for explicit #ifdef NS_BUILD_REFCNT_LOGGING without
introducing user-defined destructors when it is not defined.

Also, some uses of virtual for declaring destructors are replaced by the
appropriate override declaration through these changes.

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

--HG--
extra : moz-landing-system : lando
2020-02-20 11:40:14 +00:00
Dorel Luca d5f9df8ee1 Backed out 2 changesets (bug 1613985) for Build bustage on Windows2012. CLOSED TREE
Backed out changeset fd177b40b561 (bug 1613985)
Backed out changeset fb6d62b7f28d (bug 1613985)
2020-02-19 22:22:41 +02:00
Simon Giesecke 59b23375c0 Bug 1613985 - Use MOZ_COUNTED_DEFAULT_CTOR_*/MOZ_COUNTED_DTOR_* macros. r=froydnj
This removes the need for explicit #ifdef NS_BUILD_REFCNT_LOGGING without
introducing user-defined destructors when it is not defined.

Also, some uses of virtual for declaring destructors are replaced by the
appropriate override declaration through these changes.

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

--HG--
extra : moz-landing-system : lando
2020-02-19 18:05:38 +00:00
Eitan Isaacson 5f6ff669bf Bug 1616146 - Cache accessibility focus boundaries in java. r=Jamie
This allows `performAction` to immediately return false if a boundary is
reached and allow TalkBack to navigate past the web view.

Change viewport cache listener to reorder since it should catch all tree
mutations in the document.

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

--HG--
extra : moz-landing-system : lando
2020-02-18 21:09:06 +00:00
Morgan Reschenberg 7c8049bbaf Bug 1611428: Add accessibilityLabel function to support aria-label on MacOS. r=eeejay,Jamie
Differential Revision: https://phabricator.services.mozilla.com/D62470

--HG--
extra : moz-landing-system : lando
2020-02-14 21:20:27 +00:00
Emilio Cobos Álvarez 256c124f94 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
This was done by:

This was done by applying:

```
diff --git a/python/mozbuild/mozbuild/code-analysis/mach_commands.py b/python/mozbuild/mozbuild/code-analysis/mach_commands.py
index 789affde7bbf..fe33c4c7d4d1 100644
--- a/python/mozbuild/mozbuild/code-analysis/mach_commands.py
+++ b/python/mozbuild/mozbuild/code-analysis/mach_commands.py
@@ -2007,7 +2007,7 @@ class StaticAnalysis(MachCommandBase):
         from subprocess import Popen, PIPE, check_output, CalledProcessError

         diff_process = Popen(self._get_clang_format_diff_command(commit), stdout=PIPE)
-        args = [sys.executable, clang_format_diff, "-p1", "-binary=%s" % clang_format]
+        args = [sys.executable, clang_format_diff, "-p1", "-binary=%s" % clang_format, '-sort-includes']

         if not output_file:
             args.append("-i")
```

Then running `./mach clang-format -c <commit-hash>`

Then undoing that patch.

Then running check_spidermonkey_style.py --fixup

Then running `./mach clang-format`

I had to fix four things:

 * I needed to move <utility> back down in GuardObjects.h because I was hitting
   obscure problems with our system include wrappers like this:

0:03.94 /usr/include/stdlib.h:550:14: error: exception specification in declaration does not match previous declaration
0:03.94 extern void *realloc (void *__ptr, size_t __size)
0:03.94              ^
0:03.94 /home/emilio/src/moz/gecko-2/obj-debug/dist/include/malloc_decls.h:53:1: note: previous declaration is here
0:03.94 MALLOC_DECL(realloc, void*, void*, size_t)
0:03.94 ^
0:03.94 /home/emilio/src/moz/gecko-2/obj-debug/dist/include/mozilla/mozalloc.h:22:32: note: expanded from macro 'MALLOC_DECL'
0:03.94     MOZ_MEMORY_API return_type name##_impl(__VA_ARGS__);
0:03.94                                ^
0:03.94 <scratch space>:178:1: note: expanded from here
0:03.94 realloc_impl
0:03.94 ^
0:03.94 /home/emilio/src/moz/gecko-2/obj-debug/dist/include/mozmemory_wrap.h:142:41: note: expanded from macro 'realloc_impl'
0:03.94 #define realloc_impl mozmem_malloc_impl(realloc)

   Which I really didn't feel like digging into.

 * I had to restore the order of TrustOverrideUtils.h and related files in nss
   because the .inc files depend on TrustOverrideUtils.h being included earlier.

 * I had to add a missing include to RollingNumber.h

 * Also had to partially restore include order in JsepSessionImpl.cpp to avoid
   some -WError issues due to some static inline functions being defined in a
   header but not used in the rest of the compilation unit.

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

--HG--
extra : moz-landing-system : lando
2020-01-20 16:19:48 +00:00
Emilio Cobos Álvarez aa3a695712 Bug 1609996 - Remove mozilla/Move.h. r=froydnj
rg -l 'mozilla/Move.h' | xargs sed -i 's/#include "mozilla\/Move.h"/#include <utility>/g'

Further manual fixups and cleanups to the include order incoming.

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

--HG--
extra : moz-landing-system : lando
2020-01-20 16:18:20 +00:00
James Teh c659d71564 Bug 1606743: Defer calling BrowserBridgeChild::SendSetEmbedderAccessible if a DocAccessibleChild hasn't sent its constructor to the parent process yet. r=eeejay
On Windows, if the top level document hasn't received its parent COM proxy yet, sending constructors for child documents will be deferred.
If an OuterDocAccessible for an OOP iframe is created inside a child document before its constructor is sent, we must also defer the call to BrowserBridgeChild::SendSetEmbedderAccessible.
previously, we tried to send the embedder before the document constructor was sent, causing a crash.

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

--HG--
extra : moz-landing-system : lando
2020-01-17 05:46:25 +00:00
James Teh b2a45adc2b Bug 1594300: Implement xpcAccessible::TakeFocus for ProxyAccessibles on Windows. r=yzen
1. Implement ProxyAccessible::TakeFocus on Windows.
2. Use this implementation in xpcAccessible::TakeFocus like we do on other platforms.
3. Enable accessible/tests/browser/fission/browser_take_focus.js on Windows, since it now works.

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

--HG--
extra : moz-landing-system : lando
2020-01-15 14:52:46 +00:00
David Major 0c76842459 Bug 1608460 - Redefine MIDL names to be unique to work around a clang-cl bug r=froydnj
This is an alternative to carrying a revert of the offending changeset, since the bug doesn't show hope of a fix anytime soon, or maybe ever. This way we don't have to keep rebasing the patch as we pick up new clangs, and developers don't have to remember to apply the patch when building a local compiler.

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

--HG--
extra : moz-landing-system : lando
2020-01-10 17:53:29 +00:00
James Teh 437c05d961 Bug 1601537: Fix text navigation in text leaf Accessibles on Android. ?MarcoZ r=MarcoZ
For paragraphs, divs, spans, etc., a11y focus on Android goes to text leaf Accessibles, rather than to the HyperTextAccessible container.
This does make sense, as these containers frequently embed other content, so the text needs to be reachable as a separate item.
However, previously, performing text navigation on these text leaf Accessibles returned the HyperTextAccessible parent.
This isn't supported by Talkback, and even if it were, it causes other problems; e.g. a11y focus being lost if the user was focused on a child other than the first child of such a container.
Therefore, if text navigation was performed on a text leaf Accessible, we now return a result within the text leaf Accessible if possible, rather than the HyperTextAccessible.

1. Make AccessibleWrap::GetTextContents support text leaf Accessibles (for both local and remote proxied Accessibles).
    This is used when providing text for text traversal events.

2. When navigating text on Android, we use Pivot::Next/PrevText.
    However, this will always return a HyperTextAccessible, even when starting on a text leaf.
    Therefore, if the result from Pivot::Next/prevText resides entirely within the same text leaf, translate the offsets from the HyperTextAccessible so they're relative to the text leaf and return the text leaf.

3. Pivot::Next/PrevText already supported starting from a text leaf Accessible.
    However, they ignored the offsets, which meant that navigating from a text leaf would always navigate to the start/end of the text leaf.
    Now, if a text leaf is passed to Pivot::Next/PrevText, the offsets (if specified) are translated to the HyperTextAccessible parent first.

4. Adjust the existing character/word/line tests so they ensure that navigation returns the node that has a11y focus; i.e. the text leaf.

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

--HG--
extra : moz-landing-system : lando
2019-12-16 06:25:54 +00:00