We will soon call LandmarkRole from a new function which returns an nsStaticAtom.
LandmarkRole always returns static atoms anyway, so formalize this.
Differential Revision: https://phabricator.services.mozilla.com/D175582
We will soon call LandmarkRole from a new function which returns an nsStaticAtom.
LandmarkRole always returns static atoms anyway, so formalize this.
Differential Revision: https://phabricator.services.mozilla.com/D175582
GCC bug 109480 describes an issue we're encountering with calling protected
member functions from within protected member functions. The previous workaround,
removed in this revision, is a bit annoying, and must be repeated when we need
to capture the return value of protected functions. Making specializations of
RemoteAccessibleBase friends of other RemoteAccessibleBase specializations, while
maybe a bit heavy-handed, is a cleaner solution here, particularly since we only
specialize with RemoteAccessible itself. This is a workaround suggested by GCC
devs in the referenced bug.
Differential Revision: https://phabricator.services.mozilla.com/D175531
If caching is enabled it will use the cached state, if it isn't it will
do a sync State IPDL call. Also removed the specialized sync IsLinkValid
call because it essentially just did a State() check in the child.
Differential Revision: https://phabricator.services.mozilla.com/D175270
Most of the methods have only one caller that guarantees it has a
primary frame (good!).
But others didn't quite guarantee that.
Differential Revision: https://phabricator.services.mozilla.com/D175042
This revision works around a suspected bug in gcc which was causing
build failures. The compiler would complain that ApplyScrollOffset was
protected, and therefore inaccessible, if we capture the return value
of that function within BoundsWithOffset. I don't think this actually
violates any C++ rules, and other compilers agree. To work around the
problem, this revision wraps the call to ApplyScrollOffset in an
immediately-invoked lambda, which satisfies gcc for some reason.
Differential Revision: https://phabricator.services.mozilla.com/D174697
Make all UA widgets also NAC.
Keep the UA widget flag but break at anonymous subtree boundaries, so
that only nodes inside the UA widget directly (and not NAC from those)
get the flag.
This is important because two callers depend on this difference:
* The style system, since we still want to match content rules from
stylesheets in the UA widget. We also match user rules, which is a
bit sketchy, but that was the previous behavior, will file a
follow-up for that.
* The reflector code, since we want the scope for UA widgets to not
include the NAC nodes inside that UA widget. nsINode::IsInUAWidget
got it wrong.
After this patch, ChromeOnlyAccess is equivalent to
IsInNativeAnonymousSubtree, so we should probably unify the naming.
That's left for a follow-up patch because I don't have a strong
preference.
Differential Revision: https://phabricator.services.mozilla.com/D174310
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
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
I was trying to anticipate all the conditions that would bring us
to a non-text leaf text point in a text selection. But it is hard to
account for other "correct" cases so this assertion should probably just
go away.
Differential Revision: https://phabricator.services.mozilla.com/D173760
Use a MiddleCroppingBlockFrame subclass that looks at the value attribute
instead. We don't need accesskey etc for these so we can just reuse it as is.
Differential Revision: https://phabricator.services.mozilla.com/D173669
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
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
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
This is consistent with other HyperTextAccessible methods such as TextAtOffset.
It allows us to test the new implementation with LocalAccessible.
This is especially useful because we have better test coverage in our HyperText tests than we do in our TextLeafPoint tests.
In fact, running the tests with this change uncovered some bugs which I had to fix here.
First, TextLeafPoint::ComputeBoundsFromFrame was preferring to stick to the end of the first frame when on a boundary, rather than using the next frame.
For example, if we had the text "a\nb" where "b" is split into a continuation, offset 2 "b" was previously using the primary frame instead of the continuation.
This isn't a problem in HyperTextAccessible::GetBoundsInFrame because it walks to the next continuation if needed, since it is dealing with a range of offsets.
This is fixed by preferring the beginning of the next frame instead.
Second, passing the text length as the offset (i.e. one past the last character) should return a 0 rect.
TextLeafPoint::CharBounds needed to be tweaked accordingly.
Third, if TextLeafPoint returns a 0 rect (e.g. because a RemoteAccessible doesn't have a cache yet), HyperTextAccessibleBase needs to respect that and return it untouched.
Differential Revision: https://phabricator.services.mozilla.com/D172533
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
Manual changes to make all refcounted types be marked as `nullable` after the
changes in part 1a. This was done without any investigation into whether the
actual types want to be nullable, in order to avoid code changes.
Differential Revision: https://phabricator.services.mozilla.com/D168889
This will be useful after part 3 where it will be used as part of implementing
Read based on Maybe for IPDL structs. Without this change, we'd need to copy to
construct an IPDL struct containing a non-default-constructable type.
Differential Revision: https://phabricator.services.mozilla.com/D169268
This combines the multiple fields or variants which were previously used to
track sided types like protocol types into a single field wrapped with a
SideVariant.
This will be used in the next part to avoid the need for default constructors
for actor types allowing the proper types to be used.
Differential Revision: https://phabricator.services.mozilla.com/D168879
The a11y module wants to traverse frames in native anonymous subtrees.
Therefore, this patch adds new option for allowing it, makes
`nsIFrame::GetFrameFromDirection` check it before comparing native anonymous
subtree root nodes, and makes `HyperTextAccessible::FindOffset` use the
option.
Differential Revision: https://phabricator.services.mozilla.com/D172759
The constructor of `nsPeekOffsetStruct` and `nsIFrame::GetFrameFromDirection`
take too many `bool` arguments. Therefore, adding new `bool` arguments does
not make sense. Now, we have a useful `mozilla:EnumSet` class to treat them
with an `enum class`. Therefore, let's change `nsPeekOffsetStruct` with it.
Differential Revision: https://phabricator.services.mozilla.com/D172758
The a11y module wants to traverse frames in native anonymous subtrees.
Therefore, this patch adds new option for allowing it, makes
`nsIFrame::GetFrameFromDirection` check it before comparing native anonymous
subtree root nodes, and makes `HyperTextAccessible::FindOffset` use the
option.
Differential Revision: https://phabricator.services.mozilla.com/D172759
The constructor of `nsPeekOffsetStruct` and `nsIFrame::GetFrameFromDirection`
take too many `bool` arguments. Therefore, adding new `bool` arguments does
not make sense. Now, we have a useful `mozilla:EnumSet` class to treat them
with an `enum class`. Therefore, let's change `nsPeekOffsetStruct` with it.
Differential Revision: https://phabricator.services.mozilla.com/D172758
The a11y module wants to traverse frames in native anonymous subtrees.
Therefore, this patch adds new option for allowing it, makes
`nsIFrame::GetFrameFromDirection` check it before comparing native anonymous
subtree root nodes, and makes `HyperTextAccessible::FindOffset` use the
option.
Depends on D172758
Differential Revision: https://phabricator.services.mozilla.com/D172759
The constructor of `nsPeekOffsetStruct` and `nsIFrame::GetFrameFromDirection`
take too many `bool` arguments. Therefore, adding new `bool` arguments does
not make sense. Now, we have a useful `mozilla:EnumSet` class to treat them
with an `enum class`. Therefore, let's change `nsPeekOffsetStruct` with it.
Differential Revision: https://phabricator.services.mozilla.com/D172758
This should fully eliminate the case where remote accessibles fail to
unregister because of the outer PresShell's lifecycle.
Differential Revision: https://phabricator.services.mozilla.com/D172473
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
We are not promised a valid range from an external-facing API.
We already check if the range is valid for other operations.
Differential Revision: https://phabricator.services.mozilla.com/D172710
We did this to give more semantic information when swiping through
read-only list items. This doesn't work when there are actionable
children in the list item. Chrome never navigates by list items, so we
shouldn't bother to either.
Differential Revision: https://phabricator.services.mozilla.com/D172503
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
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
With caching we can directly filter accessible names with the search text in the parent process since the names are cached.
This patch also moves OutlineRule outside of RotorRules because the implementation
diverges (and it isn't rotor related!)
Differential Revision: https://phabricator.services.mozilla.com/D171917
Manual changes to make all refcounted types be marked as `nullable` after the
changes in part 1a. This was done without any investigation into whether the
actual types want to be nullable, in order to avoid code changes.
Differential Revision: https://phabricator.services.mozilla.com/D168889
This will be useful after part 3 where it will be used as part of implementing
Read based on Maybe for IPDL structs. Without this change, we'd need to copy to
construct an IPDL struct containing a non-default-constructable type.
Differential Revision: https://phabricator.services.mozilla.com/D169268
This combines the multiple fields or variants which were previously used to
track sided types like protocol types into a single field wrapped with a
SideVariant.
This will be used in the next part to avoid the need for default constructors
for actor types allowing the proper types to be used.
Differential Revision: https://phabricator.services.mozilla.com/D168879
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
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
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
Given Bug 1815913 made the initialization of ImageMap earlier,
calling HTMLImageMapAccessible::UpdateChildAreas along with that
can lead to some null pointer crashes when reading mContent.
This patch adds some null pointer checks to fix this.
Differential Revision: https://phabricator.services.mozilla.com/D171889
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
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
There is a potential null dereference if currentRun is first assigned
using a point in an empty input because the attributes will be null.
Differential Revision: https://phabricator.services.mozilla.com/D171596
This change is necessary to support the [CSS Highlight API](https://drafts.csswg.org/css-highlight-api-1/),
which uses `Selection` internally.
To replace `nsRange` with `AbstractRange`, some sections needed to be
adapted since `nsRange`-specific features were used.
Therefore, some methods (such as `GetRangeAt()`) may only be called if
the `Selection` is *not* of type `SelectionType::eHighlight`,
as it (per spec) returns an `nsRange`.
These methods will now `MOZ_ASSERT` if called for a highlight selection.
Additional methods are implemented which return `AbstractRange`
instead and are safe to be called for every selection type.
This commit also improves support of highlight features:
- Invalidation of highlight ranges: adding/removing Ranges in-place instead of
removing and re-adding the Selection object associated with the highlight.
- Ranges are only associated with the Selection that shares the same Document
- Fixed minor IDL issue
Differential Revision: https://phabricator.services.mozilla.com/D170582
For the viewport cache and character rects, we have at least a reasonable estimate of the number of elements that will be required.
Pre-allocating these saves on potentially costly re-allocation as we append elements.
Differential Revision: https://phabricator.services.mozilla.com/D171420
When hit testing, we retrieve the bounds for every character in a text leaf in a separate call.
Because we need to convert from an array of flat ints to rects, this previously meant we built the entire array for every character.
For a large text leaf, building this rect array is relatively expensive.
We only need a single rect at a time.
Therefore, RemoteAccessibleBase now returns the rect for a single requested character instead of building an array of rects.
Differential Revision: https://phabricator.services.mozilla.com/D171419
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
Previously, the cache was sent in a separate IPDL call.
Even though we delayed the show event, there was a chance that a client would walk the subtree and find a lot of Accessibles with no data.
Because no event is fired for those changes inside the subtree, the client might not know it needs to update them.
This resulted in missing information in NVDA browse mode in some cases.
Now, the tree is always in sync with its cached data.
Differential Revision: https://phabricator.services.mozilla.com/D171046
Previously, the cache was sent in a separate IPDL call.
Even though we delayed the show event, there was a chance that a client would walk the subtree and find a lot of Accessibles with no data.
Because no event is fired for those changes inside the subtree, the client might not know it needs to update them.
This resulted in missing information in NVDA browse mode in some cases.
Now, the tree is always in sync with its cached data.
Differential Revision: https://phabricator.services.mozilla.com/D171046
Bug 1763214 unified the Accessible image interface, including support in ia2AccessibleImage.
However, MsaaAccessible::Create wasn't updated accordingly and would only create an ia2AccessibleImage for a LocalAccessible.
The only thing we need to do here is to drop the Local requirement.
I also did some other drive-by cleanup in this function, converting LocalAccessible if checks to assertions for things that can only ever be Local.
Differential Revision: https://phabricator.services.mozilla.com/D170589
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
Abstracting the text marker will allow us to have a drop-in caching version in the next patch.
In this change I moved the (de)serializing code to the proxy class and changed it from being a constructor to a static method. I also added standalone get-range-for methods instead of the enum because the caching version will transition away from it. It was useful in the non-caching version because it allowed us to have one sync message with an enum and a switch statement in the recieving end.
Differential Revision: https://phabricator.services.mozilla.com/D168450
Done here in a standalone patch to keep things simpler. Includes a typedef to bridge the
gap for the next patch where we will reintroduce `GeckoTextMarker` as an abstracting
wrapper class.
Differential Revision: https://phabricator.services.mozilla.com/D168449
When files shift around into other unified build files things go wrong.
This puts an identically named enum in a header do it doesn't get redefined.
Differential Revision: https://phabricator.services.mozilla.com/D168447
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
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
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
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
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
nsImageFrame has support for displaying style URIs / an owned image
request, so use it.
The main behavior difference is that we don't fire `load` / `error`
events for those images anymore, but I don't see any event listener for
those around, so I think they can go.
Differential Revision: https://phabricator.services.mozilla.com/D168958
Previously, we retrieved an ancestor frame and various rects and used a transform to make continuation char rects relative to their primary frame.
Since all we need is an offset, we can just use nsIFrame::GetOffsetTo, which does all of this for us.
Differential Revision: https://phabricator.services.mozilla.com/D169446
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
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
We only use these notifications from layout to push cache updates or insert Accessibles that were skipped during the initial build.
If the DocAccessible doesn't exist yet, creating it is pointless since we can't do this update until the tree is built.
The correct data will be included in the initial tree and cache push anyway.
Aside from pointless refresh ticks, this really shouldn't make any difference, since we don't build the initial tree until layout is ready anyway.
However, the only remotely relevant thing I can think of that's changed in the a11y code lately that might have caused a spike in these test failures is that bounds notifications might get fired earlier/more often from layout, potentially causing earlier creation of DocAccessibles.
Any change to timing might cause a shift in intermittent failures, and since this is wasteful anyway, we may as well fix it.
Differential Revision: https://phabricator.services.mozilla.com/D168911
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
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
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
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
This ended up being a lot more straight-forward than the menu changes.
TLDR:
* nsMenuBarFrame -> XULMenuBarElement
* nsMenuBarListener -> MenuBarListener
Rest should be rather straight-forward.
Depends on D168649
Differential Revision: https://phabricator.services.mozilla.com/D167809
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
This ended up being a lot more straight-forward than the menu changes.
TLDR:
* nsMenuBarFrame -> XULMenuBarElement
* nsMenuBarListener -> MenuBarListener
Rest should be rather straight-forward.
Depends on D168649
Differential Revision: https://phabricator.services.mozilla.com/D167809
No implementation of nsIDOMXULMenuListElement returns an input field
(this is menulist.js and autocomplete-input.js).
It seems autocomplete-input used to do this, but it got refactored to
extend HTMLInputElement instead, so this code can all go.
Differential Revision: https://phabricator.services.mozilla.com/D169066
The accessibility service and our COM objects can only be used on the main thread.
COM rules should mean that we never get direct calls on a background thread, but apparently, someone isn't following the rules.
Differential Revision: https://phabricator.services.mozilla.com/D168914
RetrieveCachedBounds returns Nothing() if mCachedFields is null.
Since we already have a large block which is only executed if RetrieveCachedBounds returned something, just move the call to IsFixedPos inside that block.
Differential Revision: https://phabricator.services.mozilla.com/D168642
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
We call this function on every ancestor when calculating bounds.
RemoteParent() currently requires a hash lookup, so it's more efficient to early return for !IsDoc() first.
This is a micro-optimisation, but it might have some impact given that we call this on every ancestor, especially when hit testing, where we call Bounds() a lot.
As a bit of drive-by cleanup, use RemoteParent() rather than calling Parent() and IsRemote/AsRemote().
Differential Revision: https://phabricator.services.mozilla.com/D168346
The set of moved LocalAccessibles on a document should only include Accessibles within that document.
Previously, we were descending into iframe documents.
This resulted in notifying the parent process about incorrect ids being moved and potentially pushing the cache in an invalid state.
Differential Revision: https://phabricator.services.mozilla.com/D168310
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