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 3a09af5 commit 63189ae
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 308 deletions.
20 changes: 6 additions & 14 deletions accessible/base/SelectionManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -799,17 +799,6 @@ mCaretOffset
1
)
{
TextLeafPoint
caret
=
TextLeafPoint
:
:
GetCaret
(
caretCntr
)
;
RefPtr
<
AccCaretMoveEvent
Expand All @@ -827,9 +816,12 @@ selection
IsCollapsed
(
)
caret
.
mIsEndOfLineInsertionPoint
caretCntr
-
>
IsCaretAtEndOfLine
(
)
event
-
>
Expand Down
137 changes: 31 additions & 106 deletions accessible/base/TextLeafRange.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4966,6 +4966,16 @@ Accessible
aAcc
)
{
HyperTextAccessibleBase
*
ht
;
int32_t
htOffset
;
bool
isEndOfLine
;
if
(
LocalAccessible
Expand All @@ -4980,8 +4990,6 @@ AsLocal
)
)
{
HyperTextAccessible
*
ht
=
HyperTextFor
Expand All @@ -5001,7 +5009,6 @@ TextLeafPoint
)
;
}
int32_t
htOffset
=
ht
Expand All @@ -5026,113 +5033,23 @@ TextLeafPoint
)
;
}
TextLeafPoint
point
=
ht
-
>
ToTextLeafPoint
(
htOffset
)
;
nsIFrame
*
frame
isEndOfLine
=
ht
-
>
GetFrame
(
)
;
RefPtr
<
nsFrameSelection
>
sel
=
frame
?
frame
-
>
GetFrameSelection
(
)
:
nullptr
;
if
(
sel
&
&
sel
localAcc
-
>
GetHint
(
)
=
=
CaretAssociationHint
:
:
Before
)
{
if
AsHyperText
(
point
.
mOffset
=
=
0
)
{
point
.
mIsEndOfLineInsertionPoint
=
IsLocalAccAtLineStart
(
point
.
mAcc
-
>
AsLocal
(
)
)
&
&
!
point
.
IsParagraphStart
IsCaretAtEndOfLine
(
)
;
}
else
{
point
.
mIsEndOfLineInsertionPoint
=
true
;
}
}
return
point
;
}
DocAccessibleParent
*
remoteDoc
Expand All @@ -5149,11 +5066,14 @@ Document
(
)
;
auto
[
std
:
:
tie
(
ht
htOffset
]
)
=
remoteDoc
-
Expand All @@ -5174,6 +5094,16 @@ TextLeafPoint
)
;
}
isEndOfLine
=
remoteDoc
-
>
IsCaretAtEndOfLine
(
)
;
}
TextLeafPoint
point
=
Expand All @@ -5189,12 +5119,7 @@ point
.
mIsEndOfLineInsertionPoint
=
remoteDoc
-
>
IsCaretAtEndOfLine
(
)
isEndOfLine
;
return
point
Expand Down
38 changes: 38 additions & 0 deletions accessible/generic/HyperTextAccessible-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,44 @@ aOffset
;
}
inline
bool
HyperTextAccessible
:
:
IsCaretAtEndOfLine
(
)
const
{
RefPtr
<
nsFrameSelection
>
frameSelection
=
FrameSelection
(
)
;
return
frameSelection
&
&
frameSelection
-
>
GetHint
(
)
=
=
CaretAssociationHint
:
:
Before
;
}
inline
already_AddRefed
<
nsFrameSelection
Expand Down
6 changes: 6 additions & 0 deletions accessible/generic/HyperTextAccessible.h
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,12 @@ nsIWidget
aWidget
)
;
bool
IsCaretAtEndOfLine
(
)
const
;
virtual
int32_t
SelectionCount
Expand Down
Loading

0 comments on commit 63189ae

Please sign in to comment.