Skip to content

Commit

Permalink
Backed out changeset a5ff95602119 (bug 1905021) as requested for caus…
Browse files Browse the repository at this point in the history
…ing accessibility crashes related to selection a=backout

UltraBlame original commit: 48a7ce6fe0888f9be96810dcf74829c995f29764
  • Loading branch information
marco-c committed Jul 1, 2024
1 parent 6c1e80a commit 2929679
Show file tree
Hide file tree
Showing 5 changed files with 124 additions and 422 deletions.
20 changes: 6 additions & 14 deletions accessible/base/SelectionManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1228,17 +1228,6 @@ mCaretOffset
1
)
{
TextLeafPoint
caret
=
TextLeafPoint
:
:
GetCaret
(
caretCntr
)
;
RefPtr
<
AccCaretMoveEvent
Expand All @@ -1256,9 +1245,12 @@ selection
IsCollapsed
(
)
caret
.
mIsEndOfLineInsertionPoint
caretCntr
-
>
IsCaretAtEndOfLine
(
)
event
-
>
Expand Down
278 changes: 58 additions & 220 deletions accessible/base/TextLeafRange.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7285,6 +7285,16 @@ Accessible
aAcc
)
{
HyperTextAccessibleBase
*
ht
;
int32_t
htOffset
;
bool
isEndOfLine
;
if
(
LocalAccessible
Expand Down Expand Up @@ -7337,8 +7347,6 @@ caret
events
)
.
HyperTextAccessible
*
ht
=
HyperTextFor
Expand All @@ -7358,7 +7366,6 @@ TextLeafPoint
)
;
}
int32_t
htOffset
=
ht
Expand All @@ -7383,198 +7390,55 @@ TextLeafPoint
)
;
}
TextLeafPoint
point
=
ht
-
>
ToTextLeafPoint
(
htOffset
)
;
nsIFrame
*
frame
=
ht
-
>
GetFrame
(
)
;
RefPtr
<
nsFrameSelection
>
sel
=
frame
?
frame
-
>
GetFrameSelection
(
)
:
nullptr
;
if
(
sel
&
&
sel
-
>
GetHint
(
)
=
=
CaretAssociationHint
:
:
Before
)
{
/
/
CaretAssociationHint
Use
HyperTextAccessible
:
:
Before
can
mean
that
the
caret
is
at
the
end
of
IsCaretAtEndOfLine
.
Eventually
we
'
ll
want
to
/
/
a
line
.
However
it
can
also
mean
move
that
the
caret
is
before
the
start
code
into
TextLeafPoint
but
existing
code
depends
on
it
living
/
/
of
a
node
in
the
middle
of
a
line
.
This
happens
when
moving
the
cursor
/
/
forward
to
a
new
node
.
if
HyperTextAccessible
(
point
.
mOffset
=
=
0
)
{
/
/
The
caret
is
before
the
start
of
a
node
.
The
including
caret
is
at
the
end
of
a
/
/
line
if
the
node
is
at
the
start
of
a
line
but
not
at
the
start
of
a
/
/
paragraph
.
point
events
)
.
mIsEndOfLineInsertionPoint
isEndOfLine
=
IsLocalAccAtLineStart
(
point
.
mAcc
localAcc
-
>
AsLocal
AsHyperText
(
)
)
&
&
!
point
.
IsParagraphStart
-
>
IsCaretAtEndOfLine
(
)
;
Expand All @@ -7583,40 +7447,6 @@ else
{
/
/
This
isn
'
t
the
start
of
a
node
so
we
must
be
at
the
end
of
a
line
.
point
.
mIsEndOfLineInsertionPoint
=
true
;
}
}
return
point
;
}
/
/
Ideally
we
'
Expand Down Expand Up @@ -7655,11 +7485,14 @@ Document
(
)
;
auto
[
std
:
:
tie
(
ht
htOffset
]
)
=
remoteDoc
-
Expand All @@ -7680,6 +7513,16 @@ TextLeafPoint
)
;
}
isEndOfLine
=
remoteDoc
-
>
IsCaretAtEndOfLine
(
)
;
}
TextLeafPoint
point
=
Expand All @@ -7695,12 +7538,7 @@ point
.
mIsEndOfLineInsertionPoint
=
remoteDoc
-
>
IsCaretAtEndOfLine
(
)
isEndOfLine
;
return
point
Expand Down
Loading

0 comments on commit 2929679

Please sign in to comment.