зеркало из https://github.com/mozilla/pjs.git
bug=34896 extra check for null in caret. this can happen sometimes when frame is destroyed in odd order. r=hyatt.
This commit is contained in:
Родитель
98c38f889f
Коммит
4e644bbf60
|
@ -337,7 +337,9 @@ NS_IMETHODIMP nsCaret::NotifySelectionChanged(nsIDOMDocument *, nsIDOMSelection
|
||||||
{
|
{
|
||||||
if (mVisible)
|
if (mVisible)
|
||||||
StopBlinking();
|
StopBlinking();
|
||||||
mDomSelectionWeak = getter_AddRefs( NS_GetWeakReference(aDomSel) ); // weak reference to pres shell
|
nsCOMPtr<nsIDOMSelection> domSel(do_QueryReferent(mDomSelectionWeak));
|
||||||
|
if (domSel.get() != aDomSel)
|
||||||
|
return NS_OK; //ignore this then.
|
||||||
if (mVisible)
|
if (mVisible)
|
||||||
StartBlinking();
|
StartBlinking();
|
||||||
|
|
||||||
|
@ -556,6 +558,8 @@ PRBool nsCaret::MustDrawCaret()
|
||||||
return PR_TRUE;
|
return PR_TRUE;
|
||||||
|
|
||||||
nsCOMPtr<nsIDOMSelection> domSelection = do_QueryReferent(mDomSelectionWeak);
|
nsCOMPtr<nsIDOMSelection> domSelection = do_QueryReferent(mDomSelectionWeak);
|
||||||
|
if (!domSelection)
|
||||||
|
return PR_FALSE;
|
||||||
PRBool isCollapsed;
|
PRBool isCollapsed;
|
||||||
|
|
||||||
if (NS_FAILED(domSelection->GetIsCollapsed(&isCollapsed)))
|
if (NS_FAILED(domSelection->GetIsCollapsed(&isCollapsed)))
|
||||||
|
|
|
@ -337,7 +337,9 @@ NS_IMETHODIMP nsCaret::NotifySelectionChanged(nsIDOMDocument *, nsIDOMSelection
|
||||||
{
|
{
|
||||||
if (mVisible)
|
if (mVisible)
|
||||||
StopBlinking();
|
StopBlinking();
|
||||||
mDomSelectionWeak = getter_AddRefs( NS_GetWeakReference(aDomSel) ); // weak reference to pres shell
|
nsCOMPtr<nsIDOMSelection> domSel(do_QueryReferent(mDomSelectionWeak));
|
||||||
|
if (domSel.get() != aDomSel)
|
||||||
|
return NS_OK; //ignore this then.
|
||||||
if (mVisible)
|
if (mVisible)
|
||||||
StartBlinking();
|
StartBlinking();
|
||||||
|
|
||||||
|
@ -556,6 +558,8 @@ PRBool nsCaret::MustDrawCaret()
|
||||||
return PR_TRUE;
|
return PR_TRUE;
|
||||||
|
|
||||||
nsCOMPtr<nsIDOMSelection> domSelection = do_QueryReferent(mDomSelectionWeak);
|
nsCOMPtr<nsIDOMSelection> domSelection = do_QueryReferent(mDomSelectionWeak);
|
||||||
|
if (!domSelection)
|
||||||
|
return PR_FALSE;
|
||||||
PRBool isCollapsed;
|
PRBool isCollapsed;
|
||||||
|
|
||||||
if (NS_FAILED(domSelection->GetIsCollapsed(&isCollapsed)))
|
if (NS_FAILED(domSelection->GetIsCollapsed(&isCollapsed)))
|
||||||
|
|
Загрузка…
Ссылка в новой задаче