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
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
DocAccessibleChildBase::RecvSetTextSelection and RecvScrollTextLeafRangeIntoView constructs TextLeafPoints without null checking the retrieved Accessible.
This can be null if the Accessible was destroyed in the content process but the parent process didn't know about this yet when it sent the request.
TextLeafPoint currently crashes if constructed with a null Accessible.
These DocAccessibleChildBase methods do check the validity of the range, which will be invalid if the TextLeafPoints are invalid.
Therefore, just construct an invalid TextLeafPoint if a null Accessible is given.
Differential Revision: https://phabricator.services.mozilla.com/D176494
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