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

3565 Коммитов

Автор SHA1 Сообщение Дата
James Teh 220f6dfece Bug 1832228 part 1: Remove ARIAGridAccessible, ARIARowAccessible and most of ARIAGridCellAccessible. r=nlapre
We now use CachedTableAccessible for ARIA tables and grids, so most of the code in the ARIA table classes was unused.

1. Remove ARIAGridAccessible and ARIARowAccessible completely.
2. ARIAGridCellAccessible no longer derives from TableCellAccessible.
3. Remove most of ARIAGridCellAccessible.
4. We still use ARIAGridCellAccessible to differentiate between valid and invalid cells. Valid cells create an ARIAGridCellAccessible and ARIAGridCellAccessible::IsTableCell() returns true due to mGenericTypes. Invalid cells don't get an ARIAGridCellAccessible, so IsTableCell() returns false on those.
5. We also keep the code in ARIAGridCellAccessible to expose some states and attributes.
6. The code for creating ARIAGridCellAccessible in CreateAccessible has been refactored, both for simplification and to fix bugs. display: contents tables now properly get the table and table cell interfaces; i.e. IsTable() and IsTableCell() return true when appropriate. Walking non-generic ancestors should fix ARIA tables with intervening generics, though this will be dealt with fully in a separate bug.

Differential Revision: https://phabricator.services.mozilla.com/D179801
2023-06-08 09:50:28 +00:00
James Teh 9ecdad92e8 Bug 1832261: Remove most of HTMLTable*Accessible. r=nlapre
We now use CachedTableAccessible for HTML tables, so much of the code in the HTMLTable*Accessible classes was unused.
However, we still depend on these classes for some data needed to build the cached table.

1. HTMLTableAccessible and HTMLTableCellAccessible no longer derive from TableAccessible and TableCellAccessible, respectively. Instead, callers which need specific access to HTML table data use the HTMLTable*Accessible class directly.
2. All table specific methods have been removed except those that provide data required to build a CachedTableAccessible. The remaining methods are those for querying the row/column span (which depends on layout) and getting the caption (which depends on DOM).
3. HTMLTable*Accessible are now used for all <table>, <td>, <th> and <tr> elements and MathML equivalents. ARIA*Accessible are never used for these elements. This improves consistency, simplifies the code and means that behavior specific to these HTML elements is handled in these classes, rather than in the ARIA classes as well.
4. The table and row roles are now specified in HTMLMarkupMap and MathMLMarkupMap, rather than overriding NativeRole.  Cell roles are still handled in a NativeRole override; see the code comments for details.
5. IsProbablyLayoutTable has been moved from TableAccessible to HTMLTableAccessible, as it is only relevant for HTML tables, not for ARIA tables.
6. HTMLTableHeaderCellAccessible::NativeRole has been rewritten such that it no longer depends on querying table coordinates, as that would now require building a CachedTableAccessible, which would be very wasteful here. This replaces TableCellAccessible::HeaderCellRole, which has been removed.

Differential Revision: https://phabricator.services.mozilla.com/D179799
2023-06-08 09:50:28 +00:00
Anna Yeddi 3ae23f78be Bug 1796178 - Revise mapping for <s> element to role=deletion. r=Jamie
Updated HTMLMarkupMap to expose `<s>` element with an implicit `roles::CONTENT_DELETION`, updated `accessible/tests/mochitest/elm/test_HTMLSpec.html` Mochitest and expected results for `testing/web-platform/tests/html-aam/roles.html` wpt test

Differential Revision: https://phabricator.services.mozilla.com/D179842
2023-06-08 00:28:38 +00:00
Nathan LaPre bb0eac529c Bug 1789235: Fire a scrolling start event for anchor jump if focus in doc, r=Jamie
This revision modifies NotifyOfAnchorJump in order to ensure that we fire a
scrolling start event for AT clients. Without this, clients might miss anchor
jump updates, since anchor jumps can arrive after getting focus. This revision
also adds a test to verify that the scrolling start event is now being sent.

Differential Revision: https://phabricator.services.mozilla.com/D177419
2023-06-08 00:06:39 +00:00
James Teh bd9bd8733b Bug 1835967: Remove TableAccessibleBase::Select/UnselectCol/Row. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D179513
2023-06-07 01:40:25 +00:00
Hunseop Jeong bc6e2d89d2 Bug 1826904 - Add the AXSubrole for role="meter". r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D179884
2023-06-06 20:42:24 +00:00
Nathan LaPre 9dc4cae6ba Bug 1455416: Relocate aria-owned accessibles on (aria) parent removal, r=Jamie
This revision modifies UncacheChildrenInSubtree such that removed but relocated
accessibles that are aria-owned are actually relocated to their proper parent
after the removal of the formerly-aria-owning parent. It also contains some
fixes for issues that allowing this relocation unleashes. In particular:
- Logic in PutChildrenBack is reworked in order to better handle different
  reparenting situations, such as unacceptable parents or original containers
  (or ancestors thereof) that are no longer in the document. These changes help
  us avoid failure modes related to events on defunct accessibles, or bad
  coalescence due to partially-shut-down trees.
- ShutdownOrPrepareForMove has been updated to handle moving children. We now
  recurse through children and move them rather than just shutting them down.
This revision adds tests which verify that the functionality works as intended.

Differential Revision: https://phabricator.services.mozilla.com/D176204
2023-06-06 18:43:40 +00:00
Norisz Fay 63fa83129d Backed out changeset 1d562ee8729b (bug 1796178) for causing mochitest failures on test_general.html CLOSED TREE 2023-06-06 22:22:18 +03:00
Norisz Fay 357f177c83 Backed out changeset dbe49d0e5b60 (bug 1834931) for causing mochitest failures on browser_caching_text_bounds.js 2023-06-06 22:21:09 +03:00
Anna Yeddi efb3216a37 Bug 1796178 - Revise mapping for <s> element to role=deletion. r=Jamie
Updated HTMLMarkupMap to expose `<s>` element with an implicit `roles::CONTENT_DELETION`, updated `accessible/tests/mochitest/elm/test_HTMLSpec.html` Mochitest and expected results for `testing/web-platform/tests/html-aam/roles.html` wpt test

Differential Revision: https://phabricator.services.mozilla.com/D179842
2023-06-06 15:17:26 +00:00
Anna Yeddi 578616014d Bug 1834931 - Map HTML <code> to roles::CODE. r=Jamie
Mapping HTML `<code>` and updating its corresponding test and meta files.

Differential Revision: https://phabricator.services.mozilla.com/D179602
2023-06-06 15:15:20 +00:00
Morgan Rae Reschenberg c3544381e4 Bug 1835194: Add Use System Colors telemtry probe r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D179180
2023-05-31 22:18:03 +00:00
Gregory Pappas 941d7766f8 Bug 1822864 - Remove browser.download.improvements_to_download_panel pref r=Gijs,settings-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D179300
2023-05-31 10:29:37 +00:00
James Teh 6f49fe6b0c Bug 1828295 part 3: Add tests for GetCaretRect. r=morgan
This required exposing GetCaretRect via XPCOM.

Differential Revision: https://phabricator.services.mozilla.com/D179346
2023-05-31 10:04:18 +00:00
Natalia Csoregi 6f5c0c586c Backed out 3 changesets (bug 1828295) for causing failures on browser_caret_rect.js. CLOSED TREE
Backed out changeset 52b9bf7e6344 (bug 1828295)
Backed out changeset 6e6ee5fe337f (bug 1828295)
Backed out changeset 4e8ff9c439ef (bug 1828295)
2023-05-31 08:44:34 +03:00
James Teh c342e57201 Bug 1828295 part 3: Add tests for GetCaretRect. r=morgan
This required exposing GetCaretRect via XPCOM.

Differential Revision: https://phabricator.services.mozilla.com/D179346
2023-05-31 03:43:29 +00:00
James Teh 09d623679d Bug 1818404: Use HTMLLinkAccessible for SVG <a> elements. r=nlapre
This ensures that these are HyperTextAccessibles if they contain text, which prevents assertions and exposes formatting information.
It also gives these the correct role.

Differential Revision: https://phabricator.services.mozilla.com/D179409
2023-05-31 02:33:57 +00:00
Morgan Rae Reschenberg 9d0d6d2840 Bug 1832686: Fuzzy-match text leaves contained within generics when hittesting r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D178578
2023-05-31 02:12:00 +00:00
Sandor Molnar c013058f4f Backed out changeset f688d9dff006 (bug 1835194) for causing mochitest failures in accessible/tests/browser/telemetry/browser_HCM_telemetry.js 2023-05-27 03:24:23 +03:00
Morgan Rae Reschenberg 17bcd7d1b8 Bug 1835194: Add Use System Colors telemetry probe r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D179180
2023-05-26 23:03:17 +00:00
Eitan Isaacson 4b8822a071 Bug 1826869 - Cache doc mime type and make available via DocAccessibleParent. r=morgan,ipc-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D178887
2023-05-26 22:17:13 +00:00
Eitan Isaacson b23c3d0657 Bug 1821965 - P3: Merge diverging text test results. r=morgan.
We had some different results in non-caching mode. We can now unify the results and not worry about that.

Depends on D178718

Differential Revision: https://phabricator.services.mozilla.com/D178719
2023-05-26 22:17:13 +00:00
Eitan Isaacson 832b5bfb9a Bug 1832353 - P2: Convert editable text tests to browser tests. r=Jamie
Depends on D178714

Differential Revision: https://phabricator.services.mozilla.com/D178715
2023-05-26 22:17:12 +00:00
Eitan Isaacson 1daec2903b Bug 1832353 - P1: Move all text related browser tests into text subdir. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D178714
2023-05-26 22:17:12 +00:00
Noemi Erli ab21b0f95b Backed out 6 changesets (bug 1832353, bug 1821965) for causing build bustages in GeckoTextMarker.mm
Backed out changeset 6df0877f288a (bug 1821965)
Backed out changeset e663ccc0334e (bug 1821965)
Backed out changeset 36b250225e50 (bug 1821965)
Backed out changeset 6df5d07bf19f (bug 1832353)
Backed out changeset 409966c76f0f (bug 1832353)
Backed out changeset 3be446e44436 (bug 1832353)
2023-05-26 02:48:29 +03:00
Noemi Erli e56011d5e2 Backed out changeset 22203924d7b7 (bug 1832686) for causing failures in browser_test_general.js 2023-05-26 02:10:49 +03:00
Morgan Rae Reschenberg 628ffa8efe Bug 1832686: Fuzzy-match text leaves contained within generics when hittesting r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D178578
2023-05-25 22:20:59 +00:00
Eitan Isaacson c5a24689b5 Bug 1821965 - P3: Merge diverging text test results. r=morgan.
We had some different results in non-caching mode. We can now unify the results and not worry about that.

Depends on D178718

Differential Revision: https://phabricator.services.mozilla.com/D178719
2023-05-25 20:38:30 +00:00
Eitan Isaacson 6d1721c180 Bug 1832353 - P2: Convert editable text tests to browser tests. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D178715
2023-05-25 20:38:29 +00:00
Eitan Isaacson e90263d66f Bug 1832353 - P1: Move all text related browser tests into text subdir. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D178714
2023-05-25 20:38:29 +00:00
James Teh 6cf954e1ce Bug 1821969 part 1: Remove Mac table layout guess cache. r=morgan
Now that we always have the core parent process cache, this is no longer necessary.
This also removes EVENT_TABLE_STYLING_CHANGED, which was only used to keep the Mac cache up to date.

Differential Revision: https://phabricator.services.mozilla.com/D178425
2023-05-24 10:50:45 +00:00
Iulian Moraru 18534f1d12 Backed out changeset 492778e5c97b (bug 1832686) for causing browser-a11y failures on browser_test_general.js. CLOSED TREE 2023-05-24 06:39:16 +03:00
Morgan Rae Reschenberg 0c2a147456 Bug 1832686: Fuzzy-match text leaves contained within generics when hittesting r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D178578
2023-05-23 21:13:17 +00:00
Mark Banner 130a655906 Bug 1826062 - Automatic fixes for upgrading Prettier to 2.8.8. r=mossop,perftest-reviewers,webcompat-reviewers,geckoview-reviewers,denschub,devtools-reviewers,sparky,calu
Differential Revision: https://phabricator.services.mozilla.com/D177027
2023-05-20 12:26:53 +00:00
Mark Banner 8219a5c503 Bug 1826062 - Automatic fixes for Prettier 2.0.5 upgrade. r=mossop,perftest-reviewers,webcompat-reviewers,geckoview-reviewers,denschub,devtools-reviewers,sparky,owlish
Differential Revision: https://phabricator.services.mozilla.com/D177025
2023-05-20 12:26:49 +00:00
James Teh 5590870312 Bug 1821955 part 3: Remove CtW pref checks from tests. r=eeejay,taskgraph-reviewers,bhearsum
Differential Revision: https://phabricator.services.mozilla.com/D177720
2023-05-19 02:56:48 +00:00
James Teh ff0d0a5f86 Bug 1821955 part 2: Remove isWinNoCache variable from browser tests. r=eeejay,taskgraph-reviewers,bhearsum
Differential Revision: https://phabricator.services.mozilla.com/D177719
2023-05-19 02:56:48 +00:00
James Teh 6c26a79a58 Bug 1833079: When notified about a dom::ElementState::INVALID change, let AccStateChangeEvent calculate whether the state is enabled. r=morgan
Previously, we passed true for aIsEnabled, indicating that the state was only ever enabled, never disabled.
We could get the actual enabled value here using dom::ElementState::HasState(), but that wouldn't take aria-invalid into account if present.
Instead, we let AccStateChangeEvent calculate it by calling Accessible::State().

Differential Revision: https://phabricator.services.mozilla.com/D178039
2023-05-17 03:36:10 +00:00
Noemi Erli ce43b5ee97 Backed out changeset edbaacc4f3d6 (bug 1455416) for ContentCache crashes a=backout 2023-05-16 00:55:24 +03:00
James Teh a5344cdc1b Bug 1830466: Mac a11y: Don't try to search forward for a line end boundary on a blank line. r=eeejay
1. CachedTextMarker::LineRange: If the line starts with a line feed, it's a blank line and the end boundary is the same as the start boundary, so just return the start for both.
2. TextLeafRange::FindLineEnd: If the origin is the empty last line of a textarea, we actually do want the line starting at the next character, so don't skip forward a character. Also don't skip back to the line feed after the search, since that would be the end of the previous line.

Differential Revision: https://phabricator.services.mozilla.com/D177366
2023-05-10 06:53:33 +00:00
Nathan LaPre 4acbf6e7fb Bug 1455416: Relocate aria-owned accessibles on (aria) parent removal, r=Jamie
This revision modifies UncacheChildrenInSubtree such that removed but relocated
accessibles that are aria-owned are actually relocated to their proper parent
after the removal of the formerly-aria-owning parent. On the way to
accomplishing that goal, this revision adds PutChildBack, a method called by
PutChildrenBack and now also called by UncacheChildrenInSubtree. We don't always
want to put all the children back - this function lets us manage it one at a time.
Finally, this revision adds tests which verify that the functionality works
as intended.

Differential Revision: https://phabricator.services.mozilla.com/D176204
2023-05-08 20:52:38 +00:00
Morgan Rae Reschenberg ea8048f332 Bug 1825411: Cache scroll position for unscrolled scroll frames r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D176093
2023-05-08 20:51:12 +00:00
Morgan Rae Reschenberg 1e4964b8dc Bug 1828373: Create accs for elements with overflow:scroll and overflow:auto styling r=nlapre,Jamie
Differential Revision: https://phabricator.services.mozilla.com/D176202
2023-05-08 20:51:12 +00:00
Morgan Rae Reschenberg fdfa154a20 Bug 1825611: Add test for overflow:hidden hittesting and acc creation r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D175196
2023-05-08 20:51:12 +00:00
Eitan Isaacson 56d18f7b03 Bug 1826853 - Add a caching version of CaretLineNumber and fix sync version. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D177190
2023-05-08 16:53:01 +00:00
Eitan Isaacson e108daa52d 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
2023-05-08 16:52:34 +00:00
Natalia Csoregi 65cdd6c4cf Backed out 6 changesets (bug 1825611, bug 1825411, bug 1828373) for failures on /browser_general.js. CLOSED TREE
Backed out changeset fa9772a45927 (bug 1825411)
Backed out changeset 51f495933300 (bug 1828373)
Backed out changeset 74462e3c7265 (bug 1825611)
Backed out changeset 683910281b5d (bug 1825611)
Backed out changeset 7e2ffdd02a98 (bug 1825611)
Backed out changeset 920bae37ff3e (bug 1825611)
2023-05-04 02:31:02 +03:00
Morgan Rae Reschenberg 4ccb6b400c Bug 1825411: Cache scroll position for unscrolled scroll frames r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D176093
2023-05-03 22:26:40 +00:00
Morgan Rae Reschenberg 6fe923354f Bug 1828373: Create accs for elements with overflow:scroll and overflow:auto styling r=nlapre,Jamie
Differential Revision: https://phabricator.services.mozilla.com/D176202
2023-05-03 22:26:40 +00:00
Morgan Rae Reschenberg ea504b344c Bug 1825611: Add test for overflow:hidden hittesting and acc creation r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D175196
2023-05-03 22:26:40 +00:00
James Teh 87e2c0219d Bug 1829603 part 2: Include the src of images without names in the parent process a11y cache. r=morgan
This is used by some clients to help remediate inaccessible images.

Differential Revision: https://phabricator.services.mozilla.com/D176905
2023-05-03 09:02:53 +00:00
James Teh d1c3206f01 Bug 1829603 part 1: Include the class attribute in the parent process a11y cache. r=morgan
This is used by the Web Access NVDA add-on to identify and remediate some inaccessible elements on websites with accessibility problems.
It is also useful for developers using screen readers when trying to identify specific elements in the absence of semantics.

Differential Revision: https://phabricator.services.mozilla.com/D176896
2023-05-03 09:02:53 +00:00
Eitan Isaacson 822e591e8a Bug 1826865 - Make SetCurValue asynchronous. r=Jamie,ipc-reviewers,jld
Differential Revision: https://phabricator.services.mozilla.com/D176562
2023-04-28 15:59:01 +00:00
James Teh 81d78e645f Bug 1827557 part 2: CachedTextMarker: Differentiate between LeftLine and Line. r=eeejay
Line should return the current line when the start of the line is queried.
Otherwise, VoiceOver reports the previous line if you're on the first character of a line and you move by line with down or up arrow.

LegacyTextMarker behaves inconsistently when you use Line/LeftLine depending on whether you fetched the marker via index or from a selection range.
browser_text_basics.js treated the index behaviour as correct, but it isn't.
The tests have been updated accordingly with expected failures for non-cached.

Differential Revision: https://phabricator.services.mozilla.com/D176608
2023-04-27 08:27:24 +00:00
James Teh a431ef8f27 Bug 1827557 part 1: When constructing a CachedTextMarker from a HyperText, allow an offset equal to the character count. r=morgan
CachedTextMarker uses TextLeafPoint.
Because caret and selection events currently use HyperText offsets, we construct text markers using a HyperTextAccessible.
The constructor detects that it was provided with a HyperText and converts to a TextLeafPoint appropriately.
However, this was previously conditional on the provided offset being less than the character count.
When the caret is at the insertion point at the end of a text box, the caret offset will be the character count itself.
This meant that we didn't convert to TextLeafPoint in this case, resulting in an incorrect text marker.
This was causing VoiceOver to report the first character, word, etc. when cursoring through text boxes instead of the last.

Differential Revision: https://phabricator.services.mozilla.com/D176522
2023-04-27 08:27:24 +00:00
Eitan Isaacson 6b7c34dbea Bug 1826856 - Remove sync AnchorURIAt method. r=Jamie
We can get the URI using the Value method that is already cached when
caching is enabled.

Differential Revision: https://phabricator.services.mozilla.com/D176067
2023-04-25 16:34:12 +00:00
James Teh 888f2eec3d Bug 1824935 part 3: Add Accessible::ComputedARIARole. r=eeejay
This also exposes this via XPCOM.
This will be used by WebDriver and Dev Tools.

Differential Revision: https://phabricator.services.mozilla.com/D175583
2023-04-25 07:06:35 +00:00
Stanca Serban 041c4044bd Backed out 8 changesets (bug 1828816, bug 1822112, bug 1572512, bug 1824935) for causing multiple failures. CLOSED TREE
Backed out changeset 8886f7011919 (bug 1822112)
Backed out changeset df566bce405d (bug 1828816)
Backed out changeset 5857e8ef63e1 (bug 1828816)
Backed out changeset 50324d39e9c1 (bug 1822112)
Backed out changeset 7f6bee1959fb (bug 1572512)
Backed out changeset 4effd0bdc4db (bug 1824935)
Backed out changeset a8faf17fcce8 (bug 1824935)
Backed out changeset 0370b0032eb6 (bug 1824935)
2023-04-25 07:45:58 +03:00
James Teh 3fb1357e3e Bug 1824935 part 3: Add Accessible::ComputedARIARole. r=eeejay
This also exposes this via XPCOM.
This will be used by WebDriver and Dev Tools.

Differential Revision: https://phabricator.services.mozilla.com/D175583
2023-04-24 23:35:51 +00:00
Emilio Cobos Álvarez 3ce1c08d5b Bug 1828413 - Fix a11y tests so that they don't hover over the rounded corner.
MANUAL PUSH: Trivial fix CLOSED TREE
2023-04-20 15:28:50 +02:00
Stanca Serban c25ebc211a Backed out 4 changesets (bug 1825611) for causing mochitests failures in accessible/tests. CLOSED TREE
Backed out changeset 169c3f65e1ce (bug 1825611)
Backed out changeset c2d6231e9361 (bug 1825611)
Backed out changeset 9152cb7808c2 (bug 1825611)
Backed out changeset e74c388d1a4e (bug 1825611)
2023-04-20 03:03:25 +03:00
Morgan Rae Reschenberg 623f4ac2d3 Bug 1825611: Add test for overflow:hidden hittesting and acc creation r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D175196
2023-04-19 22:55:39 +00:00
Iulian Moraru 0b022d176d Backed out 4 changesets (bug 1825611) for causing multiple mochitest failures. CLOSED TREE
Backed out changeset a30a125f2aea (bug 1825611)
Backed out changeset ee5e3b614f91 (bug 1825611)
Backed out changeset c79ad1ee1e32 (bug 1825611)
Backed out changeset db2d550a788b (bug 1825611)
2023-04-19 02:24:25 +03:00
Morgan Rae Reschenberg 80cb6ab5df Bug 1825611: Add test for overflow:hidden hittesting and acc creation r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D175196
2023-04-18 21:06:11 +00:00
Eitan Isaacson 489d1d11a0 Bug 1826857 - Move AnchorAt to Accessible and remove sync IPC. r=Jamie
Because the implementation only needs the accessible type and tree, we
don't need to make an IPC call here.

Differential Revision: https://phabricator.services.mozilla.com/D175288
2023-04-17 17:54:35 +00:00
Eitan Isaacson d70f1224fa Bug 1826264 - P2: Add range TextLeafRange::ScrollIntoView. r=Jamie
Use it when caching is enabled.

Differential Revision: https://phabricator.services.mozilla.com/D174977
2023-04-13 20:40:19 +00:00
Robert Longson 03d9d7fa3d Bug 1825718 - map SVG elements to a role if they have an aria-label attribute r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D174465
2023-04-04 07:07:22 +00:00
James Teh 1f31893d00 Bug 1825523: Check IsHyperText before expecting AsHyperTextBase to work in Pivot::PrevText. r=eeejay
The code previously checked !childAtOffset->IsText(), but this isn't sufficient to be certain that childAtOffset->AsHyperTextBase() will work.
For example, childAtOffset could be an image which can't be descended into.

Differential Revision: https://phabricator.services.mozilla.com/D174213
2023-04-04 05:37:36 +00:00
Nathan LaPre 50ae57a7d9 Bug 1819741: Constrain acc bounds to that of scroll areas for hit testing, r=morgan
This revision adds logic to BoundsWithOffset to ensure that bounds, when
calculated for hit testing, are constrained to the scroll areas that contain
them. This ensures that we don't return an Accessible that's covered by another
element when hit testing due to overflow: scroll situations.

This revision also contains a fix for transforms and scroll: we now apply
scroll before any transform, since transforms operate on scrolled content.

This revision contains tests for both of the above changes.

Differential Revision: https://phabricator.services.mozilla.com/D173392
2023-03-30 00:11:14 +00:00
Eitan Isaacson 545741bece Bug 1825054 - Don't get stuck in endless loop when getting bounds. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D173864
2023-03-29 22:31:00 +00:00
Emilio Cobos Álvarez 2d0e69f4a1 Bug 1824957 - Remove a bunch of now completely dead XUL layout code. r=layout-reviewers,desktop-theme-reviewers,devtools-reviewers,dao,TYLin
And some related tests.

A bunch of -moz-box* properties are web exposed, so I'll file a
follow-up for hiding them.

Differential Revision: https://phabricator.services.mozilla.com/D173819
2023-03-29 21:23:55 +00:00
Morgan Rae Reschenberg df1f70a647 Bug 1809761: Introduce text bounds test for interleaving block- and inline-frame accessibles r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D171918
2023-03-28 19:23:05 +00:00
Morgan Rae Reschenberg 7d7067fe49 Bug 1804699: Assign date fields an AXGroup role, spoof actual role via AXTitle r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D172177
2023-03-24 19:06:35 +00:00
James Teh f390c076e8 Bug 1823294: Make PushNameOrDescriptionChange fire a name change event on the target itself if appropriate. r=eeejay
Previously, PushNameOrDescriptionChange wouldn't consider the target itself as a candidate for a name change event.
If the text of a text leaf changes without replacing the leaf, the only event we will get is text inserted on its parent.
If that parent calculated its name from its subtree, this meant that we wouldn't fire a name change in this case.
We address this by allowing this function to fire on the target itself in this case.

Differential Revision: https://phabricator.services.mozilla.com/D172953
2023-03-24 00:37:34 +00:00
James Teh 7f417a6fa1 Bug 1776049: Ignore visibility when checking focusability to determine whether to create an Accessible. r=morgan
This is an extension of the fix in bug 1775684.
In that fix, I tweaked NativeInteractiveState to ignore visibility when calling nsIFrame::IsFocusable, since otherwise, an invisible document would report that nothing was focused.
That works well if an Accessible would be created for other reasons; e.g. because it has a meaningful role.
However, if an element has no semantic value except for its focusability (e.g. <span tabindex="-1">), we were failing to create an Accessible for it altogether.
Now, we also ignore visibility when checking focusability in nsAccessibilityService::MustBeAccessible.
This means that we do create an Accessible in this case.
We don't need a caching check here because we should always create an Accessible in this case, even if the document is initially invisible.

Differential Revision: https://phabricator.services.mozilla.com/D173245
2023-03-23 04:07:04 +00:00
James Teh ba7744a7e8 Bug 1822340 part 2: When hit testing using the cache, only match a TextLeafAccessible if one of its lines includes the requested point. r=morgan
Previously, we always used the Accessible's rect.
However, if the text wraps across lines, its rect might cover a wider area than the actual text.
That meant we were matching a wrapped text leaf when we shouldn't in some cases.
Now, we restrict text leaf matches to the rects occupied by text.

Differential Revision: https://phabricator.services.mozilla.com/D173097
2023-03-23 00:38:13 +00:00
James Teh 3151b74de4 Bug 1822340 part 1: Fix cached text bounds for wrapped text which starts part way through a line or where the primary text frame is empty. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D173096
2023-03-23 00:38:13 +00:00
Eitan Isaacson d9e084d17d Bug 1822170 - Handle any kind of NSRanges provided to AXAttributedStringForRange. r=Jamie
This patch remedies 4 things:
1. Fix conversion from NSRange to GeckoTextMarkerRange. We were adding the start offset twice. Oops.
2. Clamp given range to actual text size. Since we are messing with the offset fields directly we need to do our own checks here.
3. Don't allow an infinite loop in CachedTextMarkerRange::AttributedText
4. Fix legacy Crop method to be able to take a text leaf.

Differential Revision: https://phabricator.services.mozilla.com/D172594
2023-03-20 22:01:27 +00:00
Cristian Tuns b3e8485c79 Backed out changeset 30b7d9c22176 (bug 1822170) for causing mochitest failures on CachedTextMarker.mm CLOSED TREE 2023-03-16 14:21:39 -04:00
Eitan Isaacson c25e3e319a Bug 1822170 - Handle any kind of NSRanges provided to AXAttributedStringForRange. r=Jamie
This patch remedies 4 things:
1. Fix conversion from NSRange to GeckoTextMarkerRange. We were adding the start offset twice. Oops.
2. Clamp given range to actual text size. Since we are messing with the offset fields directly we need to do our own checks here.
3. Don't allow an infinite loop in CachedTextMarkerRange::AttributedText
4. Fix legacy Crop method to be able to take a text leaf.

Differential Revision: https://phabricator.services.mozilla.com/D172594
2023-03-16 15:54:20 +00:00
Marian-Vasile Laza 5df0512bdd Backed out changeset 1b67ef7bd374 (bug 1822170) for assertion failures on Accessible.cpp. CLOSED TREE 2023-03-15 20:46:00 +02:00
Eitan Isaacson 9408df1789 Bug 1822170 - Handle any kind of NSRanges provided to AXAttributedStringForRange. r=Jamie
This patch remedies 3 things:
1. Fix conversion from NSRange to GeckoTextMarkerRange. We were adding the start offset twice. Oops.
2. Clamp given range to actual text size. Since we are messing with the offset fields directly we need to do our own checks here.
3. Don't allow an infinite loop in CachedTextMarkerRange::AttributedText

Differential Revision: https://phabricator.services.mozilla.com/D172594
2023-03-15 16:56:58 +00:00
Iulian Moraru 3684b2dc4a Backed out changeset e3ea9faf7c95 (bug 1822170) for causing multiple browser-a11y failures. CLOSED TREE 2023-03-15 06:29:09 +02:00
Eitan Isaacson 648164ceda Bug 1822170 - Handle any kind of NSRanges provided to AXAttributedStringForRange. r=Jamie
This patch remedies 3 things:
1. Fix conversion from NSRange to GeckoTextMarkerRange. We were adding the start offset twice. Oops.
2. Clamp given range to actual text size. Since we are messing with the offset fields directly we need to do our own checks here.
3. Don't allow an infinite loop in CachedTextMarkerRange::AttributedText

Differential Revision: https://phabricator.services.mozilla.com/D172594
2023-03-15 02:38:59 +00:00
James Teh 21d4739a57 Bug 1783178: Wait for the caret event in browser_caching_text_bounds.js instead of the focus event. r=eeejay
The caret event might fire after focus, in which case the cached caret would be incorrect.

Differential Revision: https://phabricator.services.mozilla.com/D172538
2023-03-15 01:00:37 +00:00
James Teh 4fa337dc47 Bug 1822225: Always produce async JS stacks in a11y browser tests. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D172527
2023-03-14 06:41:45 +00:00
James Teh 427da13d9e Bug 1819799: In a11y browser tests, treat a timeout in untilCacheCondition as a failure. r=eeejay
Otherwise, tests can take a very long time to run due to a bug without us realising that this is due to cache condition timeouts.
This patch also notifies observers of a cache update when state change events are received, as those do update the cache but aren't handled by RecvCache.
Some Mac tests depend on cache notifications for these instead of state change events, so these were hitting cache condition timeouts.

Differential Revision: https://phabricator.services.mozilla.com/D171417
2023-03-10 03:49:04 +00:00
James Teh 5ec432103b Bug 1821223: TextLeafPoint: Don't treat an entire table as a paragraph. r=eeejay
Table rows and cells are now treated as paragraph boundaries.
Whether a cell should be a paragraph boundary is debatable, but currently, a cell is treated as a line boundary, so this is consistent; a line shouldn't expand beyond a paragraph.

Differential Revision: https://phabricator.services.mozilla.com/D172079
2023-03-10 03:48:34 +00:00
James Teh 89dc63126c Bug 1808195: Try to make accessible/tests/browser/states/browser_test_link.js more reliable. r=eeejay
1. Open the link in a new tab instead of a new window. I originally did this to make debugging easier with a screenshot, but it seems to actually make the test more reliable. I don't know why.
2. Suffix the URL so we can be sure it will not have been visited before the test.

Differential Revision: https://phabricator.services.mozilla.com/D171948
2023-03-10 03:46:17 +00:00
Cristina Horotan 72f5765338 Backed out changeset db31cf17952c (bug 1819799) for causing ba failures at browser_caching_table.js 2023-03-07 09:25:35 +02:00
James Teh 12b8683d00 Bug 1819799: In a11y browser tests, treat a timeout in untilCacheCondition as a failure. r=eeejay
Otherwise, tests can take a very long time to run due to a bug without us realising that this is due to cache condition timeouts.
This patch also notifies observers of a cache update when state change events are received, as those do update the cache but aren't handled by RecvCache.
Some Mac tests depend on cache notifications for these instead of state change events, so these were hitting cache condition timeouts.

Differential Revision: https://phabricator.services.mozilla.com/D171417
2023-03-07 05:09:15 +00:00
James Teh 57869687c5 Bug 1820069: Fix handling of magic offsets in HyperTextAccessible*::Char/TextBounds. r=morgan
1. HyperTextAccessibleBase::CharBounds didn't have code to support magic offsets (like TEXT_OFFSET_CARET) at all, resulting in a crash.
2. HyperTextAccessibleBase::TextBounds handled the end offset being a magic offset, but not the start offset.
3. HyperTextAccessible::CharBounds assumed it could just add 1 to the start offset to pass to TextBounds, which resulted in returning the rect from the caret to the end of the container, since length (-1) is caret (-2) + 1.

This patch addresses all three of these issues.

Differential Revision: https://phabricator.services.mozilla.com/D171545
2023-03-06 08:58:42 +00:00
Morgan Rae Reschenberg 7a080d4df8 Bug 1778441: Call into HyperTextAccessible::CharBounds when computing char bounds for local-acc TextLeafPoint's r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D171285
2023-03-02 18:08:15 +00:00
Eitan Isaacson 66cf5a32ef Bug 1818450 - Support getting attributed text with empty inputs. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D170939
2023-03-01 19:00:08 +00:00
Nathan LaPre f7edb0b474 Bug 1494196: Create Accessible for elements with ARIA role, attributes and display: contents, r=Jamie
This revision modifies the logic in CreateAccessible such that we create
Accessibles for elements that have ARIA roles (other than presentation, none) or
other ARIA attributes, even if those elements have the display: contents style.
This revision also adds tests to verify the above.

Differential Revision: https://phabricator.services.mozilla.com/D170718
2023-03-01 05:53:30 +00:00
James Teh 5ba97b5396 Bug 1818720: Skip inert attribute a11y tests if inert is preffed off. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D171044
2023-02-27 21:15:25 +00:00
Ryan VanderMeulen 8924fd2459 Bug 1818997 - Re-enable some passing browser-a11y tests and cleanup test manifests. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D171040
2023-02-27 04:45:27 +00:00
James Teh 4b8d5d446d Bug 1784752 part 2: Disable A11YLOG for accessible/tests/browser/events. r=eeejay
This was only ever meant to be temporary, but I forgot to remove it.

Differential Revision: https://phabricator.services.mozilla.com/D170557
2023-02-25 01:12:05 +00:00
James Teh 621d06d8bd Bug 1781848: Split accessible/tests/browser/e10s/browser_obj_group.js into two files to avoid exceeding the timeout threshold. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D170562
2023-02-24 23:56:36 +00:00
James Teh 2b84971d26 Bug 1767561 part 2: Add a11y tests for inert, dialog and fullscreen. r=emilio,morgan
Differential Revision: https://phabricator.services.mozilla.com/D170789
2023-02-23 21:01:41 +00:00
Morgan Rae Reschenberg 9363d07cc1 Bug 1809695: Make DOM coords screen relative before comparing in testTextRange r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D170691
2023-02-23 18:54:14 +00:00
Morgan Rae Reschenberg 06c234d803 Bug 1800586: Refactor IsARIAControls to work with untilCacheIs r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D170541
2023-02-23 00:02:21 +00:00
Eitan Isaacson cd1cd3c259 Bug 1730095 - P6: Introduce CachedTextMarker on MacOS. r=morgan
These text marker and marker range classes use our text cache and don't rely on any sync calls.

There are some edge cases where the range for boundary type code diverges from the non-caching one. The tests have amended exceptions for that in cases where the caching code is more correct, or at least not more wrong :)

Differential Revision: https://phabricator.services.mozilla.com/D168451
2023-02-22 04:53:01 +00:00
Eitan Isaacson 31c0b1e98c Bug 1730095 - P1: Refactor text Mac marker tests. r=morgan
This change gives a bit more flexibility for isolating issues and seeing which specific marker offset is giving trouble when a test fails.

Depends on D168445

Differential Revision: https://phabricator.services.mozilla.com/D168446
2023-02-22 04:52:59 +00:00
James Teh f826326f5f Bug 1816346 part 2: If we force an Accessible to be created due to transform/fixed/sticky despite it being presentational, make it a generic Accessible. r=nlapre
Otherwise, semantics are exposed (e.g. for a table), which completely defeats the author's intent that this be treated as presentational.

Differential Revision: https://phabricator.services.mozilla.com/D170165
2023-02-22 04:46:50 +00:00
James Teh 75092d8fb0 Bug 1816346 part 1: Fix the transform tree creation test in browser_test_simple_transform.js. r=nlapre
Previously, the test was retrieving an Accessible with a non-existent id and calling testAccessibleTree on it.
That meant we were calling testAccessibleTree with null, which is a no-op.
Now, we get the intended Accessible so that the test actually tests what it was supposed to test.
This is important to test a potential bug in the next patch.

Differential Revision: https://phabricator.services.mozilla.com/D170306
2023-02-22 04:46:50 +00:00
Eitan Isaacson 8bf95c7d17 Bug 1814220 - Allow ignoring list item markers in TextLeafPoint::FindBoundary. r=Jamie
Refactor in FindBoundary to allow easier skipping of leaves in the loop.

Differential Revision: https://phabricator.services.mozilla.com/D168445
2023-02-22 04:17:31 +00:00
Butkovits Atila d45ed2897d Backed out 2 changesets (bug 1816346) for causing failures at test_table.html. CLOSED TREE
Backed out changeset eeb78c17513c (bug 1816346)
Backed out changeset 22b32e106152 (bug 1816346)
2023-02-22 04:45:07 +02:00
James Teh 4f47e992e7 Bug 1816346 part 2: If we force an Accessible to be created due to transform/fixed/sticky despite it being presentational, make it a generic Accessible. r=nlapre
Otherwise, semantics are exposed (e.g. for a table), which completely defeats the author's intent that this be treated as presentational.

Differential Revision: https://phabricator.services.mozilla.com/D170165
2023-02-22 02:17:56 +00:00
James Teh 193890e062 Bug 1816346 part 1: Fix the transform tree creation test in browser_test_simple_transform.js. r=nlapre
Previously, the test was retrieving an Accessible with a non-existent id and calling testAccessibleTree on it.
That meant we were calling testAccessibleTree with null, which is a no-op.
Now, we get the intended Accessible so that the test actually tests what it was supposed to test.
This is important to test a potential bug in the next patch.

Differential Revision: https://phabricator.services.mozilla.com/D170306
2023-02-22 02:17:55 +00:00
Eitan Isaacson 4cdf1e6cc0 Bug 1816536 - Fix document edge issues in FindBounary. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D169726
2023-02-21 16:37:24 +00:00
Florian Quèze 7567717c5e Bug 1817506 - Make accessible/tests/mochitest/tree/test_media.html wait for Fluent to update asynchronously the accessible value of the scrubber, r=Gijs.
Differential Revision: https://phabricator.services.mozilla.com/D170396
2023-02-20 22:16:19 +00:00
James Teh e425f02438 Bug 1816601: HyperTextAccessibleBase::OffsetAtPoint: Return 0 if the point is within the container but before the rect at offset 0. r=nlapre
This perpetuates a bug in (local) HyperTextAccessible that some users have unfortunately come to rely on.

Differential Revision: https://phabricator.services.mozilla.com/D169802
2023-02-16 11:57:14 +00:00
Cosmin Sabou 5878f95ed4 Backed out changeset 95d948d14dfe (bug 1816601) for causing mochiest failures on browser_test_text.js. CLOSED TREE 2023-02-16 02:38:01 +02:00
James Teh e951e20e20 Bug 1816601: HyperTextAccessibleBase::OffsetAtPoint: Return 0 if the point is within the container but before the rect at offset 0. r=nlapre
This perpetuates a bug in (local) HyperTextAccessible that some users have unfortunately come to rely on.

Differential Revision: https://phabricator.services.mozilla.com/D169802
2023-02-15 23:24:28 +00:00
Iulian Moraru 11536128a2 Bug 1782783 - disable browser_test_focus_urlbar.js on linux for frequent failures. patch re-made to solve landing conflicts r=aryx
Differential Revision: https://phabricator.services.mozilla.com/D169883
2023-02-15 10:32:05 +00:00
Joel Maher a62ef05cdb Bug 1816191 - Skip tests in order to keep win7 running @ azure. r=gbrown,necko-reviewers,settings-reviewers,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,nalexander,sgalich,alwu
Differential Revision: https://phabricator.services.mozilla.com/D169523
2023-02-14 23:44:12 +00:00
James Teh e0626af463 Bug 1816022: LocalAccessible::ParentRelativeBounds: If the bounding frame's rect is empty but its union rect is not, offset by its union rect. r=morgan
See the code comment for explanation.

Differential Revision: https://phabricator.services.mozilla.com/D169443
2023-02-14 04:44:18 +00:00
Gijs Kruitbosch 387cf24ca0 Bug 1810141 - fix tests to deal with changes to loadURI, r=mossop,perftest-reviewers,geckoview-reviewers,extension-reviewers,sparky,owlish
Depends on D168396

Differential Revision: https://phabricator.services.mozilla.com/D168397
2023-02-13 23:50:41 +00:00
Eitan Isaacson d5e8f25121 Bug 1815774 - Introduce TextLeafPoint XPCOM bindings and tests. r=Jamie
This uses a bitfield for flags in FindBoundary, the idea is that it
will give some regression coverage if/when we move the native API
to do the same.

Differential Revision: https://phabricator.services.mozilla.com/D169246
2023-02-13 17:56:12 +00:00
Cristina Horotan 5f4356e527 Backed out 9 changesets (bug 1810141) for several test failures on a CLOSED TREE
Backed out changeset 8781a0d1254d (bug 1810141)
Backed out changeset 131037295784 (bug 1810141)
Backed out changeset 3852fbe290f4 (bug 1810141)
Backed out changeset 118f131a524a (bug 1810141)
Backed out changeset ab5d76846e10 (bug 1810141)
Backed out changeset dce3aa683445 (bug 1810141)
Backed out changeset 4dc41d90dbb3 (bug 1810141)
Backed out changeset 50b57ba1a061 (bug 1810141)
Backed out changeset 569de94781e4 (bug 1810141)
2023-02-13 16:05:30 +02:00
Gijs Kruitbosch ff1cc20bd7 Bug 1810141 - fix tests to deal with changes to loadURI, r=mossop,perftest-reviewers,geckoview-reviewers,extension-reviewers,sparky,owlish
Depends on D168396

Differential Revision: https://phabricator.services.mozilla.com/D168397
2023-02-13 12:55:26 +00:00
Emilio Cobos Álvarez d28f1e4d47 Bug 1815255 - Fix tests to deal with flexbox emulation. r=Jamie,Gijs
Mostly changing XUL attributes to CSS properties, though there are a few
tricky ones:

 * test_offsets.xhtml expects the scroller to be full-width, while
   modern flexbox would honor width: 200px (so just remove it).

 * window_intrinsic_size.xhtml was relying on the div imposing a XUL
   min-size (the test is for SetSizeConstraints, bug 1447056). Use
   min-height instead as that's what modern flexbox reads. Confirmed
   that bug doesn't regress in any case.

 * object-fit-contain-png-001.xhtml has a float: left which had no
   effect on -moz-box, but which assert with modern layout[1]. In the
   future I think we could remove that assert but anyways, for now just
   keeping behavior.

 * image-size.xhtml has a couple uninvestigated sizing differences. They
   didn't seem problematic.

 * 579323-1-ref.html changes because the other file has a canvas with
   width=100 height=100 which imposes an aspect ratio (which XUL never
   honored).

 * window_largemenu.xhtml shows a regression, but this never worked on
   some platforms (at least Linux+Wayland) and nobody has noticed it in
   the browser area, so I suspect we're fine.

[1]: https://searchfox.org/mozilla-central/rev/08362489086b10de96e7a199b267ea5504c01583/layout/generic/ReflowInput.cpp#2137

Differential Revision: https://phabricator.services.mozilla.com/D169084
2023-02-09 12:24:53 +00:00
James Teh 8cd27f807a Bug 1775684 part 1: Ignore frame visibility when caching focusable state for a11y. r=morgan,emilio
See the code comment in LocalAccessible::NativeInteractiveState for explanation.

Differential Revision: https://phabricator.services.mozilla.com/D168910
2023-02-09 04:50:53 +00:00
James Teh 98ad175f52 Bug 1814800: Force Accessible creation if an element has position: fixed/sticky. r=nlapre
We need to know about position: fixed in the parent process a11y cache, so we always need an Accessible for such elements.
We don't cache the fact that something is position: sticky, but we need the Accessible so that it can be notified about bounds updates when it moves within its container.
Previously, we calculated bounds incorrectly if a position: fixed/sticky element wasn't included in the a11y tree.

Differential Revision: https://phabricator.services.mozilla.com/D168916
2023-02-09 04:50:52 +00:00
Marian-Vasile Laza 7675a138b5 Backed out 2 changesets (bug 1815255) for causing reftest failures. CLOSED TREE
Backed out changeset b1173e8c7497 (bug 1815255)
Backed out changeset bd09cf2a4abb (bug 1815255)
2023-02-09 04:26:01 +02:00
Emilio Cobos Álvarez 656f11b2a0 Bug 1815255 - Fix tests to deal with flexbox emulation. r=Jamie,Gijs
Mostly changing XUL attributes to CSS properties, though there are a few
tricky ones:

 * test_offsets.xhtml expects the scroller to be full-width, while
   modern flexbox would honor width: 200px (so just remove it).

 * window_intrinsic_size.xhtml was relying on the div imposing a XUL
   min-size (the test is for SetSizeConstraints, bug 1447056). Use
   min-height instead as that's what modern flexbox reads. Confirmed
   that bug doesn't regress in any case.

 * object-fit-contain-png-001.xhtml has a float: left which had no
   effect on -moz-box, but which assert with modern layout[1]. In the
   future I think we could remove that assert but anyways, for now just
   keeping behavior.

 * image-size.xhtml has a couple uninvestigated sizing differences. They
   didn't seem problematic.

 * 579323-1-ref.html changes because the other file has a canvas with
   width=100 height=100 which imposes an aspect ratio (which XUL never
   honored).

 * window_largemenu.xhtml shows a regression, but this never worked on
   some platforms (at least Linux+Wayland) and nobody has noticed it in
   the browser area, so I suspect we're fine.

[1]: https://searchfox.org/mozilla-central/rev/08362489086b10de96e7a199b267ea5504c01583/layout/generic/ReflowInput.cpp#2137

Differential Revision: https://phabricator.services.mozilla.com/D169084
2023-02-09 00:55:13 +00:00
Nathan LaPre dbd808364d Bug 1806356: Create an accessible if the element's frame has a transform, r=Jamie
This revision changes the logic of MustCreateAccessible such that we always create
an accessible if the content's frame has been transformed and it has children.
This ensures that we have accessibles to which we apply transforms when
calculating accessible bounds. This revision also adds tests to verify that the
accessible is created, even when the element has role="none", both initially and
as a result of an on-the-fly style change.

Differential Revision: https://phabricator.services.mozilla.com/D167760
2023-02-08 19:43:35 +00:00
Cristina Horotan fbcc0f66b4 Backed out 2 changesets (bug 1815255) for causing chrome failures at test_focus.xhtml on a CLOSED TREE
Backed out changeset 983fe4e70647 (bug 1815255)
Backed out changeset f8c6426c60f9 (bug 1815255)
2023-02-08 19:50:19 +02:00
Emilio Cobos Álvarez 5db814c383 Bug 1815255 - Fix tests to deal with flexbox emulation. r=Jamie,Gijs
Mostly changing XUL attributes to CSS properties, though there are a few
tricky ones:

 * test_offsets.xhtml expects the scroller to be full-width, while
   modern flexbox would honor width: 200px (so just remove it).

 * window_intrinsic_size.xhtml was relying on the div imposing a XUL
   min-size (the test is for SetSizeConstraints, bug 1447056). Use
   min-height instead as that's what modern flexbox reads. Confirmed
   that bug doesn't regress in any case.

 * object-fit-contain-png-001.xhtml has a float: left which had no
   effect on -moz-box, but which assert with modern layout[1]. In the
   future I think we could remove that assert but anyways, for now just
   keeping behavior.

 * image-size.xhtml has a couple uninvestigated sizing differences. They
   didn't seem problematic.

 * 579323-1-ref.html changes because the other file has a canvas with
   width=100 height=100 which imposes an aspect ratio (which XUL never
   honored).

 * window_largemenu.xhtml shows a regression, but this never worked on
   some platforms (at least Linux+Wayland) and nobody has noticed it in
   the browser area, so I suspect we're fine.

[1]: https://searchfox.org/mozilla-central/rev/08362489086b10de96e7a199b267ea5504c01583/layout/generic/ReflowInput.cpp#2137

Differential Revision: https://phabricator.services.mozilla.com/D169084
2023-02-08 16:52:18 +00:00
James Teh 1dcf0a5946 Bug 1814785: Include the transform only for the frame itself in the a11y cache, rather than calculating it relative to an ancestor. r=morgan
Calculating it relative to an ancestor causes problems when the frame ancestry and the a11y ancestry diverge.
For example, this can happen for a transform which is also position: absolute.
In that case, the parent Accessible's frame is not an ancestor of the child Accessible's frame.
Since the transform is no longer relative to the ancestor, we no longer need to remove our parent-relative bounds before applying it.
However, we do need to ensure that we apply the transform *before* adding parent-relative bounds.

Differential Revision: https://phabricator.services.mozilla.com/D169059
2023-02-08 05:45:55 +00:00
Morgan Rae Reschenberg a5551e25d4 Bug 1815153: Add test to verify position:sticky bounds when scrolling, after dynamic style change r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D169129
2023-02-08 04:19:19 +00:00
Neil Deakin 9c2e7458ba Bug 1776879, replace text/unicode for clipboard and drag and drop and use text/plain directly, r=edgar,mak,stransky,geckoview-reviewers,extension-reviewers,zombie,m_kato
Most usage is a straight replacement but gtk needs extra changes as it transfers plain text in UTF8 natively and needs to be converted into UTF16, and Windows uses single-byte characters for RTF and CF_HTML formats so we preserve this.

Differential Revision: https://phabricator.services.mozilla.com/D158587
2023-02-01 23:30:55 +00:00
James Teh 1278600686 Bug 1813256 follow-up: Add test. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D168331
2023-02-01 04:58:30 +00:00
Morgan Rae Reschenberg e8d1a57763 Bug 1809836: Avoid adding scroll offsets when computing bounds for position:fixed accs r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D166730
2023-02-01 01:23:10 +00:00
Mark Banner 61c8871b31 Bug 1812977 - Remove now unnecessary import-globals-from statements in accessible. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D168069
2023-01-30 19:33:37 +00:00
Eitan Isaacson 80156311b1 Bug 1811092 - P3: Add browser text selection tests and increase coverage. r=Jamie
Added more coverage for generated content too.

Depends on D167202

Differential Revision: https://phabricator.services.mozilla.com/D167203
2023-01-27 20:15:12 +00:00
Sandor Molnar 41b0aaaaac Backed out changeset b27d83c0aa57 (bug 1806356) for causint dt failures in devtools/client/netmonitor/test/browser_net_basic-search.js 2023-01-27 05:23:17 +02:00
James Teh 0c12a12bbd Bug 1811972: When an Accessible is moved in the tree, queue a bounds cache update. r=morgan
When an Accessible is moved, it's possible it is re-parented.
In that case, since our cached bounds are relative to the parent, the bounds are now incorrect.
To fix this, queue a bounds cache update whenever an Accessible is moved.
This will also trigger when an Accessible remains under the same parent.
However, because we cache bounds in LocalAccessible, we won't actually push a cache update unless the bounds really changed.

Differential Revision: https://phabricator.services.mozilla.com/D167866
2023-01-26 23:43:08 +00:00
Nathan LaPre 0f763d9ab4 Bug 1806356: Create an accessible if the element's frame has a transform, r=Jamie
This revision changes the logic of MustCreateAccessible such that we always create
an accessible if the content's frame has been transformed. This ensures that we
have accessibles to which we apply transforms when calculating accessible bounds.
This revision also adds a test to verify that the accessible is created, even
when the element has role="presentation".

Differential Revision: https://phabricator.services.mozilla.com/D167760
2023-01-26 18:40:45 +00:00
James Teh 5bfe8feec7 Bug 1811949: If we use the ink overflow rect for the parent's bounds, take this into account when calculating parent relative bounds for children. r=morgan
If a container has a 0 width/height, we use the ink overflow rect.
A container can overflow beyond the top left of its main rect; e.g. with align-items: flex-end.
Previously, when calculating the parent relative bounds of children, we always calculated relative to the parent's main rect.
If we ended up using the ink overflow rect for the parent, this meant that the parent relative bounds of children were wrong.
To fix this, compensate for the ink overflow offset in this case.

Differential Revision: https://phabricator.services.mozilla.com/D167636
2023-01-25 03:05:27 +00:00
James Teh ed23883a3a Bug 1812208: Push a cache update if bounds change as a result of a frame moving even though it wasn't reflowed. r=morgan,emilio
A frame doesn't have to be reflowed to change its position.
For example, if there is a container c followed by a node outside the container o, inserting a node into c reflows c, but moves o down the page without reflowing o.
In this case, we previously weren't being notified that there was a possible bounds change, which meant we weren't updating the cache.
Now, we get notified about frames moving regardless of reflow.
Since this notification includes changes to CSS left/right/top/bottom, we can also remove the code added in bug 1774705 to explicitly watch for changes to these properties.

Differential Revision: https://phabricator.services.mozilla.com/D167645
2023-01-25 03:03:53 +00:00
Gijs Kruitbosch 129735a58b Bug 1811854 - switch remaining tests to BrowserTestUtils.loadURIString from BrowserTestUtils.loadURI, r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D167558
2023-01-24 13:19:11 +00:00
Dão Gottwald 05e5fefb46 Bug 1810647 - Prepare for enable urlbar result menu in Nightly. r=mak,fluent-reviewers,flod
Differential Revision: https://phabricator.services.mozilla.com/D167004
2023-01-23 15:54:53 +00:00
Emilio Cobos Álvarez a822daf7cf Bug 1793747 - Clean-ups and test fixes on top of the previous patch. r=Jamie
This should be a tad simpler.

Depends on D159879

Differential Revision: https://phabricator.services.mozilla.com/D167446
2023-01-23 09:19:43 +00:00
Jihye Hong 85bfb346b9 Bug 1793747 - Omit the element hidden by 'content-visibility:hidden' from the accessibility tree r=emilio,Jamie
There is an issue that when the element is hidden because its ancestor has 'content-visibility:hidden', it still appears in the accessibility tree.
Depending on CSS Containment Spec (https://www.w3.org/TR/css-contain-2/#cv-a11y),
it should be omitted from the accessibility tree.
This change fixes the issue above.

The approach is not to create the node in accessibility tree if the element has any ancestor specified with 'content-visibility:hidden'.

This patch can be tested such as:
(1) Check if the accessibility tree is created correctly
  ./mach test accessible/tests/browser/tree/browser_css_content_visibility.js
(2) Check if the accessibility tree is updated correctly
  ./mach test accessible/tests/browser/e10s/browser_treeupdate_csscontentvisibility.js

Differential Revision: https://phabricator.services.mozilla.com/D159879
2023-01-23 09:19:43 +00:00
Gijs Kruitbosch 8be066753c Bug 1810995 - update BrowserTestUtils.loadURI consumers to use loadURIString (automated) - other directories - r=Standard8,webdriver-reviewers,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D167154
2023-01-19 20:16:43 +00:00
Dão Gottwald 477eb99f64 Bug 1801298 - Fix down/up arrow behavior with multiple selectable elements per row. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D166803
2023-01-19 10:26:53 +00:00
Sandor Molnar af55a388e5 Backed out changeset 357170b2f52a (bug 1801298) for causing bc failures in browser/components/urlbar/tests/browser-tips/browser_selection.js CLOSED TREE 2023-01-19 12:00:27 +02:00
Dão Gottwald 8881cfae2a Bug 1801298 - Fix down/up arrow behavior with multiple selectable elements per row. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D166803
2023-01-19 08:25:15 +00:00
James Teh 4eeda8a4ad Bug 1774705 part 2: Queue a bounds cache update when the CSS left/right/top/bottom CSS properties change on positioned elements. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D166768
2023-01-18 17:52:57 +00:00
James Teh 8bdfc0d756 Bug 1774705 part 1: Fall back to `this` when hit testing a cached RemoteAccessible if the point is inside `this`. r=morgan
For deepest child, previously, if the requested point was inside a different subtree to the origin Accessible (e.g. out-of-flow), we would return null because the origin wasn't an ancestor of the target.
We still check the ancestry, but if the point is inside the origin, we return the origin.
This is consistent with LocalAccessible (and thus non-cached RemoteAccessible).

For direct child, previously, we would return a child of the origin even if another element in a different subtree was higher in the z-order.
This is because we kept walking the viewport cache until `this`.
Instead, we now stop at the deepest match and walk up to the direct child if the origin is an ancestor.
If it isn't an ancestor, we still fall back to the origin if the point is inside it, just as we do for deepest child.

This change is necessary here because our test for out-of-flow hit testing changes the CSS left property to move an out-of-flow element.
That test passed because the bounds cache for that element was never updated, so we always found the target we expected.
In the next patch, we fix the bounds cache update, which would break this test without this hit testing fix.

In addition, this patch also changes our test for overlapping elements to match this new expectation.
There were also some bugs in the test that had to be fixed; e.g. using y instead of height to get the centre.
Since this is now consistent, we can remove the cache restriction and test LocalAccessible as well.

Differential Revision: https://phabricator.services.mozilla.com/D166849
2023-01-18 17:52:57 +00:00
James Teh 29c03d7779 Bug 1757127 part 2: Use the unified Language method for ATK, IA2 and XPCOM. r=nlapre
Differential Revision: https://phabricator.services.mozilla.com/D166858
2023-01-17 20:35:22 +00:00
Morgan Rae Reschenberg 455f71d2fd Bug 1808828: Compute ancestor transform for continuations that span multiple subtrees r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D166485
2023-01-12 19:10:12 +00:00
James Teh 07b00111a1 Bug 1809379: If a scroll event is fired on inaccessible anonymous content, redirect it to the closest non-anonymous ancestor. r=morgan
textareas contain an anonymous div which fires the scroll event.
We don't have an Accessible for this div, so previously, we were just ignoring the scroll event.
Now, we'll redirect it to the textarea and get its Accessible.
This ensures that we push a cache update so that the scroll position (and thus the bounds) are correct.
This also means that a11y scroll events are fired on textareas where they weren't previously.

Differential Revision: https://phabricator.services.mozilla.com/D166508
2023-01-12 03:48:44 +00:00
Morgan Rae Reschenberg ad2f396003 Bug 1793941: Don't fire EVENT_TABLE_STYLING_CHANGED when the cache is enabled r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D166117
2023-01-11 22:34:04 +00:00
Cosmin Sabou cc3cda2cdc Backed out changeset 9f8d4babe01d (bug 1808828) for causing ancestor related assertion failures. CLOSED TREE 2023-01-12 00:32:06 +02:00
Morgan Rae Reschenberg 49bb2654cb Bug 1808828: Compute ancestor transform for continuations that span multiple subtrees r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D166485
2023-01-11 21:08:17 +00:00
Sandor Molnar cc2d0f07e4 Backed out changeset f5ee2900f8e3 (bug 1793941) for causing mochitest failures in accessible/tests/mochitest/events/test_stylechange.html CLOSED TREE 2023-01-11 20:40:37 +02:00
Morgan Rae Reschenberg d260be60d5 Bug 1793941: Don't fire EVENT_TABLE_STYLING_CHANGED when the cache is enabled r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D166117
2023-01-11 17:06:33 +00:00
Nathan LaPre b690b77391 Bug 995064: Rework group position calculation to allow intervening accs in compound ARIA widgets, r=Jamie
Transition the group position calculation - specifically the code in Update -
to Pivot such that we can handle finding siblings across intervening generic
container accessibles, such as SECTIONs. This fixes issues with finding the
values of "pos in set" and "set size" for descendant owned elements in compound
ARIA widgets. This revision also updates and adds tests for this functionality.

Differential Revision: https://phabricator.services.mozilla.com/D165756
2023-01-10 20:51:50 +00:00
Nathan LaPre f77d2ea214 Bug 1805316: Use generic ARIA accessibles for mtable, mtr with non-table display style, r=Jamie
These MathML table elements may not have a table display style, in which case
they shouldn't be HTML table accessibles. This revision changes the logic of
MathMLMarkupMap such that mtable, mtr elements create generic ARIA accessibles
if the display style for the element is something other than 'table'. This
revision also adds a test to verify that the roles are still reported correctly,
even with this change.

Differential Revision: https://phabricator.services.mozilla.com/D165980
2023-01-09 21:03:46 +00:00
James Teh 52039f92c2 Bug 1808046: Never try to remove the DocAccessible when an element's slot changes. r=nlapre
When an element's slot changes and the element is unslotted, we remove its Accessible.
If the body is moved inside a shadow host at the same time, we will process the slot removal first because moves are processed async.
Previously, this caused us to try to remove the DocAccessible (since it was still associated with the body), causing nastiness and potentially crashes.
We should never try to remove the DocAccessible, so explicitly prevent this when handling slot changes.
An assertion was also added to make sure we never try to remove the DocAccessible in future.

Differential Revision: https://phabricator.services.mozilla.com/D166134
2023-01-09 02:56:13 +00:00
Emilio Cobos Álvarez d86ebe2a1e Bug 1808624 - Partially revert test_focus_menu.xhtml changes from regressing bug.
No review, trivial test change.

Differential Revision: https://phabricator.services.mozilla.com/D166070
2023-01-05 14:00:50 +00:00
Emilio Cobos Álvarez ec017e8f33 Bug 1805414 - Fix test_focus_general.xhtml locally. r=morgan
This test passes on automation, somehow, probably due to timing.
Locally the click rolls up the popup (so you'd need a second click to
show the other popup).

This happens both with and without the patch, and given I debugged and
it is trivial to fix, well, make sure to hide the previously open menu
before clicking on another...

Differential Revision: https://phabricator.services.mozilla.com/D165983
2023-01-05 01:20:08 +00:00
Emilio Cobos Álvarez 4f1f5e7314 Bug 1805414 - Remove nsMenuFrame and nsMenuParent. r=smaug,Jamie,desktop-theme-reviewers,settings-reviewers,dao
Move most the event handling stuff to the DOM. I've left nsMenuBarFrame
for now, but I will be removing that in the future.

The basic set up is:

  * nsMenuParent becomes XULMenuParentElement (menubar or popup, manages
    the current active menu item)

  * nsMenuFrame -> XULButtonElements that return true for IsMenu().
    Can't use XULMenuElement because of <button type=menu>, which
    behaves like a, well, menu.

This makes the a11y events for menus (DOMMenuItem{Active,Inactive}) make
sense (before that we were firing duplicate Inactive events etc, and the
event order was rather suspicious).

Differential Revision: https://phabricator.services.mozilla.com/D164210
2023-01-04 19:01:13 +00:00
Csoregi Natalia 9807a6e6e8 Backed out changeset f11c529b2407 (bug 1805414) for failures on test_submenuClose.xhtml and nsMenuPopupFrame.cpp. CLOSED TREE 2023-01-04 01:48:30 +02:00
Gijs Kruitbosch 3762db01b9 Bug 1475606 - remove loadOneTab and switch its callers over, r=dao,perftest-reviewers,sparky
Depends on D165774

Differential Revision: https://phabricator.services.mozilla.com/D165775
2023-01-03 22:24:44 +00:00
Emilio Cobos Álvarez 3d82727505 Bug 1805414 - Remove nsMenuFrame and nsMenuParent. r=smaug,Jamie,desktop-theme-reviewers,settings-reviewers,dao
Move most the event handling stuff to the DOM. I've left nsMenuBarFrame
for now, but I will be removing that in the future.

The basic set up is:

  * nsMenuParent becomes XULMenuParentElement (menubar or popup, manages
    the current active menu item)

  * nsMenuFrame -> XULButtonElements that return true for IsMenu().
    Can't use XULMenuElement because of <button type=menu>, which
    behaves like a, well, menu.

This makes the a11y events for menus (DOMMenuItem{Active,Inactive}) make
sense (before that we were firing duplicate Inactive events etc, and the
event order was rather suspicious).

Differential Revision: https://phabricator.services.mozilla.com/D164210
2023-01-03 22:06:01 +00:00
Mark Banner 8730eec697 Bug 1806359 - Convert telemetry imports to direct ES imports. r=necko-reviewers,application-update-reviewers,pip-reviewers,credential-management-reviewers,janerik,mconley,sgalich,bytesized,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D165002
2022-12-23 12:37:07 +00:00
Emilio Cobos Álvarez 2c11f3e1cf Bug 1638500 - Wait for actual value change before checking value. r=Jamie
My patch in bug 1805414 makes this fail in a way that's perma, and it
seems it is because we're not waiting for the actual value change to
happen.

Differential Revision: https://phabricator.services.mozilla.com/D165238
2022-12-22 10:10:32 +00:00
James Teh 6fc37030c0 Bug 1806548: When the slot attribute is changed, remove the Accessible if the element is now unslotted. r=nlapre
If the slot attribute is changed to assign the element to a slot which doesn't exist in the shadow DOM, the element is now unslotted and thus shouldn't be rendered.
We have code in PruneOrInsertSubtree to handle changes like this, but that only works if the frame for the shadow host or something inside the shadow DOM gets reconstructed.
In the case of a shadow host with a single child, there might not necessarily be any frame reconstruction.
To handle this, we listen for changes to the slot attribute.
We check if the element is still part of the flat tree (i.e. it is slotted).
If it isn't, we remove its Accessible.

Differential Revision: https://phabricator.services.mozilla.com/D165135
2022-12-22 00:51:27 +00:00
James Teh f133cff3c3 Bug 1806486: If we're forced to create an Accessible for a MathML element which wouldn't normally have one, make it a HyperTextAccessible. r=nlapre
Certain MathML elements such as annotation and annotation-xml don't normally get an Accessible.
However, we force create Accessibles in some cases; e.g. if the element is focusable.
When this happens for these MathML elements (e.g. annotation-xml with a tabindex), we previously created AccessibleWraps which don't support text.
This meant that text formatting information was unavailable and caused assertions when pushing the cache.
To fix this, use HyperTextAccessibleWrap instead.

As a drive-by fix, also use HyperTextAccessibleWrap instead of HyperTextAccessible for content MathML elements.
This was almost certainly a typo when this was implemented.
This wouldn't have been noticeable in tests and some native platforms, but some platforms (e.g. Mac and Windows) do have some overrides in HyperTextAccessibleWrap, so we should use those.

Differential Revision: https://phabricator.services.mozilla.com/D165252
2022-12-21 21:21:11 +00:00
James Teh 433e37a17f Bug 1806026 part 2: Don't include the identity matrix when caching transforms for a11y. r=morgan
See the code comments for details.
This is just a memory optimisation; there is no user visible change.

Differential Revision: https://phabricator.services.mozilla.com/D164996
2022-12-20 03:24:15 +00:00
James Teh 77088bfef9 Bug 1806026 part 1: When applying a transform in RemoteAccessible, remove only the parent relative offset, not the cumulative offset calculated so far. r=morgan
When applying an ancestor transform, ApplyTransform is supplied with the cumulative bounds calculated so far; i.e. from descendants.
When removing the parent relative offset, the code previously set the top left to (0, 0).
This not only removed the parent relative offset, but also the cumulative offset calculated for all descendants!
Instead, we now pass in the cumulative bounds as well as the parent relative bounds.
We only subtract the parent relative bounds.

Differential Revision: https://phabricator.services.mozilla.com/D164995
2022-12-20 03:24:15 +00:00
Stanca Serban b1d0b3a50a Backed out 2 changesets (bug 1806026) for causing mochitests failures in browser_test_simple_transform.js. CLOSED TREE
Backed out changeset e2bbf722e41e (bug 1806026)
Backed out changeset 6eaa7e0e5fe4 (bug 1806026)
2022-12-20 01:07:34 +02:00
James Teh eca010172b Bug 1806026 part 2: Don't include the identity matrix when caching transforms for a11y. r=morgan
See the code comments for details.
This is just a memory optimisation; there is no user visible change.

Differential Revision: https://phabricator.services.mozilla.com/D164996
2022-12-19 22:15:35 +00:00
James Teh 6d4b1bdd63 Bug 1806026 part 1: When applying a transform in RemoteAccessible, remove only the parent relative offset, not the cumulative offset calculated so far. r=morgan
When applying an ancestor transform, ApplyTransform is supplied with the cumulative bounds calculated so far; i.e. from descendants.
When removing the parent relative offset, the code previously set the top left to (0, 0).
This not only removed the parent relative offset, but also the cumulative offset calculated for all descendants!
Instead, we now pass in the cumulative bounds as well as the parent relative bounds.
We only subtract the parent relative bounds.

Differential Revision: https://phabricator.services.mozilla.com/D164995
2022-12-19 22:15:35 +00:00
James Teh 4c3d8e7a36 Bug 1802241: Add a test case for updating cached bounds on an in-process iframe DocAccessible while its OuterDocAccessible is being re-created. r=morgan
Previously, this test case caused an assertion, but that was fixed in bug 1792120.
We also ensure the x and y are the same before an dafter the re-creation.
This verifies that we aren't losing the iframe's border/padding.

Differential Revision: https://phabricator.services.mozilla.com/D164879
2022-12-17 02:09:12 +00:00
James Teh b0e11e12be Bug 1792120: Use the cached offset from GetUsedBorderAndPadding for all OuterDocAccessibles, not just OOP iframes. r=morgan
Aside from making the code consistent for OOP and in-process iframes, this also fixes incorrect bounds in in-process iframe documents when the iframe's padding is changed.
We always pushed a cache update for the iframe when the padding was changed.
However, we previously relied on parent-relative bounds for in-process iframes, which didn't get updated when the iframe's padding changed.

Differential Revision: https://phabricator.services.mozilla.com/D164878
2022-12-17 02:09:12 +00:00
Morgan Rae Reschenberg 160dde8228 Bug 1801234: Queue a relations cache update on dependent accs when DOM ID mutations are observed r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D162895
2022-12-16 23:08:43 +00:00
James Teh c5f38f94f1 Bug 1805545 part 1: Don't query the display style on image map areas when pushing the cache. r=morgan
See the code comments for an explanation.
This fixes assertions and crashes when pushing the cache when a page contains a map which is unslotted in a shadow host.

Differential Revision: https://phabricator.services.mozilla.com/D164783
2022-12-15 23:41:18 +00:00
James Teh 7a085dff19 Bug 1805876 part 2: Use GetAccessible instead of GetAccessibleOrContainer when building the viewport cache. r=morgan
Calling GetAccessibleOrContainer meant that if a particular content node didn't have an Accessible but did have a frame, we'd insert its container in its place.
There might have been other descendants of that container that did have Accessibles, though.
In that case, we would have put the container ahead of some of its descendants!
To fix this, use GetAccessible instead.
We'll still fall back to the container if the user hit tests a point in an inaccessible node, since it will appear later in the viewport cache.

Differential Revision: https://phabricator.services.mozilla.com/D164803
2022-12-15 23:35:51 +00:00
James Teh a970a1087e Bug 1800736: Use HyperTextAccessible for <svg> and <g> elements. r=nlapre
These can contain <foreignobject>, which contains HTML but does not normally create its own Accessible.
This means that these Accessibles could have TextLeafAccessible children.
TextLeafAccessible children must always have a HyperTextAccessible as a parent.
Therefore, we must use HyperTextAccessible for <svg> and <g>.
As well as fixing assertions, this allows text formatting to be queried for <foreignobject> content, which was previously broken.

Differential Revision: https://phabricator.services.mozilla.com/D164636
2022-12-15 02:21:24 +00:00
Norisz Fay 0fa6500691 Backed out 2 changesets (bug 1801234, bug 1804186) for causing assertion failures on DocAccessibleParent.cpp CLOSED TREE
Backed out changeset 949a747693d1 (bug 1804186)
Backed out changeset 51527201739c (bug 1801234)
2022-12-13 23:58:05 +02:00
Morgan Rae Reschenberg 141e01d78f Bug 1801234: Queue a relations cache update on dependent accs when DOM ID mutations are observed r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D162895
2022-12-13 20:16:36 +00:00
lyavor 42556ae145 Bug 1799683 - Add disable next line for all accessible/tests. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D161599
2022-12-12 17:10:02 +00:00
Anna Yeddi 2bc83ec22d Bug 1676068 - Datepicker Pt.3 - Replace Reset button in the DateTimeBox with Calendar one. r=Jamie,fluent-reviewers,mconley,kcochrane
Done:
- Functionality of the button was changed from cleaning the field value to toggling the datepicker dialog.
- Pre-existing issues resolved: Updated datetimebox.js to use `keydown` event instead of the deprecated `keypress` (which does not preventDefault for buttons), added default handling of digits for `keydown`, and added a check to avoid running duplicate cleanup when the picker is closed
- Removed ability to open a date picker from editable elements of the `<input type="date">` field and ensured keyboard and mouse/touch click are working for the Calendar button, while Escape functionality remained
- Updated `onBlur` logic for the button in accordance with its new functionaility
- New Calendar SVG icon was created by Katie Caldwell and optimized by Sam Foster
- Provided HCM support for the Calendar button
- Ensured the Calendar button is not shown on `<input type=time>` to preserve the existent UX
- Added Fluent l10n to the content process and provided `title` to the image button (SVG is marked as `role="none"` to avoid exposure to assistive technology)
- Added functional and markup tests for the Calendar button and its localization, updated Reset button tests to the Calendar one

ToDo (further patch):
1. Pt.4 - Ensure keyboard support when focus moves between processes

ToDo (other dependencies/bugs):
1. Investigations into if we should show a calendar button for read-only fields and if a Reset button would be benefitial to be shown for a `type=time` inputs

Depends on D139981

Differential Revision: https://phabricator.services.mozilla.com/D141175
2022-12-07 00:56:45 +00:00
Drew Willcoxon 43b648c36b Bug 1803873 - Support row buttons in all row types and make changes to tip rows. r=dao
This makes a couple of large changes:

(1) "Generic" buttons (the ones added by `UrlbarView.#addRowButton()`) are now
supported in all row types. The help button that's currently included in some
types of rows when `result.payload.helpUrl` is defined is now supported for all
row types, and two additional button types are now supported too: block buttons
and labeled buttons. A row will get a block button if its
`result.payload.isBlockable` is defined. It will get a labeled button if
`result.payload.buttons` is defined and non-empty. A button can include a `url`
property that is then added as an attribute on the button's element, and
`UrlbarInput.pickResult()` will use this attribute to load the URL when the
button is picked.

(2) The reason I added labeled buttons is because it lets us support tip buttons
without much more effort, which then lets us get rid of the special row type
used for tips. With this patch, tips are now standard rows that use generic
buttons.

This approach should be compatible with the result menu, when we switch over to
it, because we can include the help and block commands in the menu when
`helpUrl` and `isBlockable` are defined, instead of creating buttons for them.
Labeled buttons -- the ones used in tips -- would still be created. The result
menu button itself can continue to be a generic button.

It should also be compatible with including the result menu button inside the
row selection. We'll still add buttons to `.urlbarView-row`, separate from
`.urlbarView-row-inner`, so that the buttons can continue to be on the right
side of the row. We can color the background of the row instead of the
row-inner.

As with D163630, my motivation for this change is to support generic buttons in
dynamic result rows so that help and block buttons can be easily added to
weather suggestions. Here too the larger changes of supporting generic labeled
buttons and removing special rows for tips aren't strictly necessary, but I took
the opportunity to rework things.

Finally, this makes a few other changes:

* It includes some of the more minor improvements to selection that I made in
  D163630.

* It removes the help URL code from quick actions since it was decided not to
  show a help button. Currently, the button is hidden in CSS, but now that a
  generic help button is added for dynamic result rows when
  `result.payload.helpUrl` is defined, `helpUrl` needs to be removed from the
  payload to prevent a button from being added.

* I removed the special tip wrapping behavior, where the tip button and help
  button would wrap below the tip's text. Instead, now the text wraps inside
  row-inner and the buttons always remain on the same horizontal as the text. I
  don't think it's worth the extra complication.

Differential Revision: https://phabricator.services.mozilla.com/D163766
2022-12-06 18:43:49 -05:00
Noemi Erli 42fd111277 Backed out changeset e0eac08ef8bc (bug 1803873) fo causing failures in browser_search_telemetry_sources_navigation CLOSED TREE 2022-12-07 01:24:44 +02:00
Drew Willcoxon b080ee4b3a Bug 1803873 - Support row buttons in all row types and make changes to tip rows. r=dao
This makes a couple of large changes:

(1) "Generic" buttons (the ones added by `UrlbarView.#addRowButton()`) are now
supported in all row types. The help button that's currently included in some
types of rows when `result.payload.helpUrl` is defined is now supported for all
row types, and two additional button types are now supported too: block buttons
and labeled buttons. A row will get a block button if its
`result.payload.isBlockable` is defined. It will get a labeled button if
`result.payload.buttons` is defined and non-empty. A button can include a `url`
property that is then added as an attribute on the button's element, and
`UrlbarInput.pickResult()` will use this attribute to load the URL when the
button is picked.

(2) The reason I added labeled buttons is because it lets us support tip buttons
without much more effort, which then lets us get rid of the special row type
used for tips. With this patch, tips are now standard rows that use generic
buttons.

This approach should be compatible with the result menu, when we switch over to
it, because we can include the help and block commands in the menu when
`helpUrl` and `isBlockable` are defined, instead of creating buttons for them.
Labeled buttons -- the ones used in tips -- would still be created. The result
menu button itself can continue to be a generic button.

It should also be compatible with including the result menu button inside the
row selection. We'll still add buttons to `.urlbarView-row`, separate from
`.urlbarView-row-inner`, so that the buttons can continue to be on the right
side of the row. We can color the background of the row instead of the
row-inner.

As with D163630, my motivation for this change is to support generic buttons in
dynamic result rows so that help and block buttons can be easily added to
weather suggestions. Here too the larger changes of supporting generic labeled
buttons and removing special rows for tips aren't strictly necessary, but I took
the opportunity to rework things.

Finally, this makes a few other changes:

* It includes some of the more minor improvements to selection that I made in
  D163630.

* It removes the help URL code from quick actions since it was decided not to
  show a help button. Currently, the button is hidden in CSS, but now that a
  generic help button is added for dynamic result rows when
  `result.payload.helpUrl` is defined, `helpUrl` needs to be removed from the
  payload to prevent a button from being added.

* I removed the special tip wrapping behavior, where the tip button and help
  button would wrap below the tip's text. Instead, now the text wraps inside
  row-inner and the buttons always remain on the same horizontal as the text. I
  don't think it's worth the extra complication.

Differential Revision: https://phabricator.services.mozilla.com/D163766
2022-12-06 22:28:55 +00:00
Nathan LaPre 391c21b2f8 Bug 1802240: Use generic ARIA grid cell accessible for mtd elements without table style, r=Jamie
This revision changes the logic in MathMLMarkupMap such that mtd elements create
generic ARIA grid accessibles if the display style for the element is something
other than 'table'. This revision also adds a test that verifies that the roles
remain as expected, even with this change.

Differential Revision: https://phabricator.services.mozilla.com/D163898
2022-12-06 20:41:44 +00:00
Marian-Vasile Laza ff26a6d976 Backed out 7 changesets (bug 1676068) for causing geckoview junit failures. CLOSED TREE
Backed out changeset d3c9e777a050 (bug 1676068)
Backed out changeset 639c9661c850 (bug 1676068)
Backed out changeset d06b6aa3b9a3 (bug 1676068)
Backed out changeset 50bb7e9c6bcf (bug 1676068)
Backed out changeset 234acd14548e (bug 1676068)
Backed out changeset 04050cfd5e3f (bug 1676068)
Backed out changeset a06081c85646 (bug 1676068)
2022-12-06 07:20:40 +02:00
Anna Yeddi 70b8f223fc Bug 1676068 - Datepicker Pt.3 - Replace Reset button in the DateTimeBox with Calendar one. r=Jamie,fluent-reviewers,mconley,kcochrane
Done:
- Functionality of the button was changed from cleaning the field value to toggling the datepicker dialog.
- Pre-existing issues resolved: Updated datetimebox.js to use `keydown` event instead of the deprecated `keypress` (which does not preventDefault for buttons), added default handling of digits for `keydown`, and added a check to avoid running duplicate cleanup when the picker is closed
- Removed ability to open a date picker from editable elements of the `<input type="date">` field and ensured keyboard and mouse/touch click are working for the Calendar button, while Escape functionality remained
- Updated `onBlur` logic for the button in accordance with its new functionaility
- New Calendar SVG icon was created by Katie Caldwell and optimized by Sam Foster
- Provided HCM support for the Calendar button
- Ensured the Calendar button is not shown on `<input type=time>` to preserve the existent UX
- Added Fluent l10n to the content process and provided `title` to the image button (SVG is marked as `role="none"` to avoid exposure to assistive technology)
- Added functional and markup tests for the Calendar button and its localization, updated Reset button tests to the Calendar one

ToDo (further patch):
1. Pt.4 - Ensure keyboard support when focus moves between processes

ToDo (other dependencies/bugs):
1. Investigations into if we should show a calendar button for read-only fields and if a Reset button would be benefitial to be shown for a `type=time` inputs

Depends on D139981

Differential Revision: https://phabricator.services.mozilla.com/D141175
2022-12-06 03:18:25 +00:00
James Teh 7cf81f44ff Bug 1793978: Fail gracefully (instead of crashing) when an invalid offset is given to HyperTextAccessibleBase::TextAt/Before/AfterOffset. r=morgan
An invalid aOffset results in an invalid TextLeafPoint, so just return early if that happens.

Differential Revision: https://phabricator.services.mozilla.com/D163807
2022-12-05 23:18:45 +00:00
Butkovits Atila b70ae77aa5 Bug 1778821 - disable browser_text_input.js on Mac for frequent failures. r=intermittent-reviewers,jmaher
Differential Revision: https://phabricator.services.mozilla.com/D163160
2022-12-04 23:29:50 +00:00
Cristian Tuns b5ecdf11a3 Backed out 4 changesets (bug 1676068) for causing geckoview failures CLOSED TREE
Backed out changeset ee747c27b9bc (bug 1676068)
Backed out changeset 0876924c66e8 (bug 1676068)
Backed out changeset 30a8292a37ae (bug 1676068)
Backed out changeset 19a0b7a0987c (bug 1676068)
2022-12-01 19:44:47 -05:00
Anna Yeddi 3614a03fd1 Bug 1676068 - Datepicker Pt.3 - Replace Reset button in the DateTimeBox with Calendar one. r=Jamie,fluent-reviewers,mconley,kcochrane
Done:
- Functionality of the button was changed from cleaning the field value to toggling the datepicker dialog.
- Pre-existing issues resolved: Updated datetimebox.js to use `keydown` event instead of the deprecated `keypress` (which does not preventDefault for buttons), added default handling of digits for `keydown`, and added a check to avoid running duplicate cleanup when the picker is closed
- Removed ability to open a date picker from editable elements of the `<input type="date">` field and ensured keyboard and mouse/touch click are working for the Calendar button, while Escape functionality remained
- Updated `onBlur` logic for the button in accordance with its new functionaility
- New Calendar SVG icon was created by Katie Caldwell and optimized by Sam Foster
- Provided HCM support for the Calendar button
- Ensured the Calendar button is not shown on `<input type=time>` to preserve the existent UX
- Added Fluent l10n to the content process and provided `title` to the image button (SVG is marked as `role="none"` to avoid exposure to assistive technology)
- Added functional and markup tests for the Calendar button and its localization, updated Reset button tests to the Calendar one

ToDo (further patch):
1. Pt.4 - Ensure keyboard support when focus moves between processes

ToDo (other dependencies/bugs):
1. Investigations into if we should show a calendar button for read-only fields and if a Reset button would be benefitial to be shown for a `type=time` inputs

Depends on D139981

Differential Revision: https://phabricator.services.mozilla.com/D141175
2022-12-01 22:35:07 +00:00
Cristian Tuns 5359f6f6d9 Backed out 4 changesets (bug 1676068) for causing mochitest failures CLOSED TREE
Backed out changeset 3e8b24890eb2 (bug 1676068)
Backed out changeset 7ba99b58ac35 (bug 1676068)
Backed out changeset fc1c62ea6542 (bug 1676068)
Backed out changeset ca2fed771557 (bug 1676068)
2022-12-01 15:48:37 -05:00
Nathan LaPre 96461033cd Bug 1711273: Preserve columnheader, rowheader roles with certain CSS displays set, r=Jamie
This revision addresses an issue with th elements within tables that don't have
the table CSS display style. In these cases, where we create an
ARIAGridCellAccessible for a th, we fail to report rowheader and columnheader
properly, since ARIAGridCellAccessible doesn't know how to handle th elements.
This revision fixes the problem by moving the th NativeRole logic into the
TableCellAccessible class, then calling that logic from both the ARIA grid cell
accessible NativeRole and from HTMLTableHeaderCellAccessible, as before. This
revision also updates tests reliant on the old behavior, including beefing up
an existing test aimed at this bug specifically.

Differential Revision: https://phabricator.services.mozilla.com/D163371
2022-12-01 20:17:32 +00:00