mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1057256 - Part 2 - Add null pointer check for touch and selection carets. r=roc
TouchCaret::IsDisplayable() contains more null pointer check. It covers what's original there in TouchCaret::HandleEvent().
This commit is contained in:
parent
9b08fc1098
commit
75ae3bce11
@ -539,6 +539,10 @@ SelectionCarets::SelectWord()
|
||||
nsLayoutUtils::TransformPoint(canvasFrame, ptFrame, ptInFrame);
|
||||
|
||||
nsIFrame* caretFocusFrame = GetCaretFocusFrame();
|
||||
if (!caretFocusFrame) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
SetSelectionDragState(true);
|
||||
nsFrame* frame = static_cast<nsFrame*>(ptFrame);
|
||||
nsresult rs = frame->SelectByTypeAtPoint(mPresShell->GetPresContext(), ptInFrame,
|
||||
@ -637,6 +641,10 @@ SelectionCarets::DragSelection(const nsPoint &movePoint)
|
||||
}
|
||||
|
||||
nsIFrame* caretFocusFrame = GetCaretFocusFrame();
|
||||
if (!caretFocusFrame) {
|
||||
return nsEventStatus_eConsumeNoDefault;
|
||||
}
|
||||
|
||||
nsRefPtr<nsFrameSelection> fs = caretFocusFrame->GetFrameSelection();
|
||||
|
||||
nsresult result;
|
||||
@ -735,6 +743,10 @@ void
|
||||
SelectionCarets::SetSelectionDragState(bool aState)
|
||||
{
|
||||
nsIFrame* caretFocusFrame = GetCaretFocusFrame();
|
||||
if (!caretFocusFrame) {
|
||||
return;
|
||||
}
|
||||
|
||||
nsRefPtr<nsFrameSelection> fs = caretFocusFrame->GetFrameSelection();
|
||||
fs->SetDragState(aState);
|
||||
}
|
||||
|
@ -543,13 +543,7 @@ nsEventStatus
|
||||
TouchCaret::HandleEvent(WidgetEvent* aEvent)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
nsCOMPtr<nsIPresShell> presShell = do_QueryReferent(mPresShell);
|
||||
if (!presShell) {
|
||||
return nsEventStatus_eIgnore;
|
||||
}
|
||||
|
||||
mozilla::dom::Element* touchCaretElement = presShell->GetTouchCaretElement();
|
||||
if (!touchCaretElement) {
|
||||
if (!IsDisplayable()) {
|
||||
return nsEventStatus_eIgnore;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user