зеркало из https://github.com/mozilla/pjs.git
backing out the previous patch, becaused qm-centos5-01 dep unit test is orange
This commit is contained in:
Родитель
8db813dfa0
Коммит
7963138fd7
|
@ -1480,10 +1480,8 @@ nsresult nsHyperTextAccessible::SetSelectionRange(PRInt32 aStartPos, PRInt32 aEn
|
|||
}
|
||||
|
||||
if (selCon) {
|
||||
// XXX I'm not sure this can do synchronous scrolling. If the last param is
|
||||
// set to true, this calling might flush the pending reflow. See bug 418470.
|
||||
selCon->ScrollSelectionIntoView(nsISelectionController::SELECTION_NORMAL,
|
||||
nsISelectionController::SELECTION_FOCUS_REGION, PR_FALSE);
|
||||
nsISelectionController::SELECTION_FOCUS_REGION, PR_FALSE);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
|
|
@ -102,9 +102,6 @@ interface nsISelectionController : nsISelectionDisplay
|
|||
* @param aIsSynchronous when true, scrolls the selection into view
|
||||
* before returning. If false, posts a request which is processed
|
||||
* at some point after the method returns.
|
||||
*
|
||||
* Note that if isSynchronous is true, then this might flush the pending
|
||||
* reflow. It's dangerous for some objects. See bug 418470 comment 12.
|
||||
*/
|
||||
void scrollSelectionIntoView(in short type, in short region, in boolean isSynchronous);
|
||||
/**
|
||||
|
|
|
@ -1118,8 +1118,6 @@ nsEventListenerManager::HandleEvent(nsPresContext* aPresContext,
|
|||
}
|
||||
PRUint16 currentGroup = aFlags & NS_EVENT_FLAG_SYSTEM_EVENT;
|
||||
|
||||
// Beware! This may flush notifications via synchronous
|
||||
// ScrollSelectionIntoView.
|
||||
if (aEvent->message == NS_CONTEXTMENU &&
|
||||
NS_FAILED(FixContextMenuEvent(aPresContext, aCurrentTarget, aEvent,
|
||||
aDOMEvent))) {
|
||||
|
@ -1382,8 +1380,6 @@ nsEventListenerManager::FixContextMenuEvent(nsPresContext* aPresContext,
|
|||
// see if we should use the caret position for the popup
|
||||
if (contextMenuKey) {
|
||||
nsPoint caretPoint;
|
||||
// Beware! This may flush notifications via synchronous
|
||||
// ScrollSelectionIntoView.
|
||||
if (PrepareToUseCaretPosition(((nsGUIEvent*)aEvent)->widget,
|
||||
shell, caretPoint)) {
|
||||
// caret position is good
|
||||
|
@ -1511,8 +1507,6 @@ nsEventListenerManager::PrepareToUseCaretPosition(nsIWidget* aEventWidget,
|
|||
else
|
||||
selCon = do_QueryInterface(aShell);
|
||||
if (selCon) {
|
||||
// After ScrollSelectionIntoView(), the pending notifications might be
|
||||
// flushed and PresShell/PresContext/Frames may be dead. See bug 418470.
|
||||
rv = selCon->ScrollSelectionIntoView(nsISelectionController::SELECTION_NORMAL,
|
||||
nsISelectionController::SELECTION_FOCUS_REGION, PR_TRUE);
|
||||
NS_ENSURE_SUCCESS(rv, PR_FALSE);
|
||||
|
|
|
@ -247,8 +247,6 @@ nsEditorSpellCheck::GetNextMisspelledWord(PRUnichar **aNextMisspelledWord)
|
|||
nsAutoString nextMisspelledWord;
|
||||
|
||||
DeleteSuggestedWordList();
|
||||
// Beware! This may flush notifications via synchronous
|
||||
// ScrollSelectionIntoView.
|
||||
nsresult rv = mSpellChecker->NextMisspelledWord(nextMisspelledWord,
|
||||
&mSuggestedWordList);
|
||||
|
||||
|
|
|
@ -991,9 +991,6 @@ nsEditor::EndPlaceHolderTransaction()
|
|||
// time to turn off the batch
|
||||
EndUpdateViewBatch();
|
||||
// make sure selection is in view
|
||||
|
||||
// After ScrollSelectionIntoView(), the pending notifications might be
|
||||
// flushed and PresShell/PresContext/Frames may be dead. See bug 418470.
|
||||
ScrollSelectionIntoView(PR_FALSE);
|
||||
|
||||
// cached for frame offset are Not available now
|
||||
|
@ -2563,8 +2560,6 @@ NS_IMETHODIMP nsEditor::ScrollSelectionIntoView(PRBool aScrollToAnchor)
|
|||
syncScroll = !(flags & nsIPlaintextEditor::eEditorUseAsyncUpdatesMask);
|
||||
}
|
||||
|
||||
// After ScrollSelectionIntoView(), the pending notifications might be
|
||||
// flushed and PresShell/PresContext/Frames may be dead. See bug 418470.
|
||||
selCon->ScrollSelectionIntoView(nsISelectionController::SELECTION_NORMAL,
|
||||
region, syncScroll);
|
||||
}
|
||||
|
|
|
@ -1439,9 +1439,6 @@ NS_IMETHODIMP nsHTMLEditor::InsertFromTransferable(nsITransferable *transferable
|
|||
}
|
||||
|
||||
// Try to scroll the selection into view if the paste/drop succeeded
|
||||
|
||||
// After ScrollSelectionIntoView(), the pending notifications might be
|
||||
// flushed and PresShell/PresContext/Frames may be dead. See bug 418470.
|
||||
if (NS_SUCCEEDED(rv))
|
||||
ScrollSelectionIntoView(PR_FALSE);
|
||||
|
||||
|
@ -1670,8 +1667,6 @@ NS_IMETHODIMP nsHTMLEditor::InsertFromDrop(nsIDOMEvent* aDropEvent)
|
|||
if (!nsEditorHookUtils::DoInsertionHook(domdoc, aDropEvent, trans))
|
||||
return NS_OK;
|
||||
|
||||
// Beware! This may flush notifications via synchronous
|
||||
// ScrollSelectionIntoView.
|
||||
rv = InsertFromTransferable(trans, srcdomdoc, contextStr, infoStr,
|
||||
newSelectionParent,
|
||||
newSelectionOffset, deleteSelection);
|
||||
|
@ -1892,8 +1887,6 @@ NS_IMETHODIMP nsHTMLEditor::Paste(PRInt32 aSelectionType)
|
|||
if (!nsEditorHookUtils::DoInsertionHook(domdoc, nsnull, trans))
|
||||
return NS_OK;
|
||||
|
||||
// Beware! This may flush notifications via synchronous
|
||||
// ScrollSelectionIntoView.
|
||||
rv = InsertFromTransferable(trans, nsnull, contextStr, infoStr,
|
||||
nsnull, 0, PR_TRUE);
|
||||
}
|
||||
|
@ -1925,8 +1918,6 @@ NS_IMETHODIMP nsHTMLEditor::PasteNoFormatting(PRInt32 aSelectionType)
|
|||
if (NS_SUCCEEDED(clipboard->GetData(trans, aSelectionType)) && IsModifiable())
|
||||
{
|
||||
const nsAFlatString& empty = EmptyString();
|
||||
// Beware! This may flush notifications via synchronous
|
||||
// ScrollSelectionIntoView.
|
||||
rv = InsertFromTransferable(trans, nsnull, empty, empty, nsnull, 0,
|
||||
PR_TRUE);
|
||||
}
|
||||
|
|
|
@ -672,8 +672,6 @@ nsTextEditorDragListener::DragDrop(nsIDOMEvent* aMouseEvent)
|
|||
|
||||
aMouseEvent->StopPropagation();
|
||||
aMouseEvent->PreventDefault();
|
||||
// Beware! This may flush notifications via synchronous
|
||||
// ScrollSelectionIntoView.
|
||||
return mEditor->InsertFromDrop(aMouseEvent);
|
||||
}
|
||||
|
||||
|
|
|
@ -136,9 +136,6 @@ NS_IMETHODIMP nsPlaintextEditor::InsertTextFromTransferable(nsITransferable *aTr
|
|||
NS_Free(bestFlavor);
|
||||
|
||||
// Try to scroll the selection into view if the paste/drop succeeded
|
||||
|
||||
// After ScrollSelectionIntoView(), the pending notifications might be flushed
|
||||
// and PresShell/PresContext/Frames may be dead. See bug 418470.
|
||||
if (NS_SUCCEEDED(rv))
|
||||
ScrollSelectionIntoView(PR_FALSE);
|
||||
|
||||
|
@ -304,8 +301,6 @@ NS_IMETHODIMP nsPlaintextEditor::InsertFromDrop(nsIDOMEvent* aDropEvent)
|
|||
if (!nsEditorHookUtils::DoInsertionHook(destdomdoc, aDropEvent, trans))
|
||||
return NS_OK;
|
||||
|
||||
// Beware! This may flush notifications via synchronous
|
||||
// ScrollSelectionIntoView.
|
||||
rv = InsertTextFromTransferable(trans, newSelectionParent, newSelectionOffset, deleteSelection);
|
||||
}
|
||||
|
||||
|
@ -455,8 +450,6 @@ NS_IMETHODIMP nsPlaintextEditor::Paste(PRInt32 aSelectionType)
|
|||
if (!nsEditorHookUtils::DoInsertionHook(domdoc, nsnull, trans))
|
||||
return NS_OK;
|
||||
|
||||
// Beware! This may flush notifications via synchronous
|
||||
// ScrollSelectionIntoView.
|
||||
rv = InsertTextFromTransferable(trans, nsnull, nsnull, PR_TRUE);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1831,8 +1831,6 @@ nsTextServicesDocument::ScrollSelectionIntoView()
|
|||
|
||||
LOCK_DOC(this);
|
||||
|
||||
// After ScrollSelectionIntoView(), the pending notifications might be flushed
|
||||
// and PresShell/PresContext/Frames may be dead. See bug 418470.
|
||||
result = mSelCon->ScrollSelectionIntoView(nsISelectionController::SELECTION_NORMAL, nsISelectionController::SELECTION_FOCUS_REGION, PR_TRUE);
|
||||
|
||||
UNLOCK_DOC(this);
|
||||
|
|
|
@ -151,9 +151,6 @@ NS_IMETHODIMP nsWebBrowserFind::FindNext(PRBool *outDidFind)
|
|||
}
|
||||
|
||||
// next, look in the current frame. If found, return.
|
||||
|
||||
// Beware! This may flush notifications via synchronous
|
||||
// ScrollSelectionIntoView.
|
||||
rv = SearchInFrame(searchFrame, PR_FALSE, outDidFind);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
if (*outDidFind)
|
||||
|
@ -202,8 +199,6 @@ NS_IMETHODIMP nsWebBrowserFind::FindNext(PRBool *outDidFind)
|
|||
|
||||
OnStartSearchFrame(searchFrame);
|
||||
|
||||
// Beware! This may flush notifications via synchronous
|
||||
// ScrollSelectionIntoView.
|
||||
rv = SearchInFrame(searchFrame, PR_FALSE, outDidFind);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
if (*outDidFind)
|
||||
|
@ -244,8 +239,6 @@ NS_IMETHODIMP nsWebBrowserFind::FindNext(PRBool *outDidFind)
|
|||
|
||||
if (curItem.get() == startingItem.get())
|
||||
{
|
||||
// Beware! This may flush notifications via synchronous
|
||||
// ScrollSelectionIntoView.
|
||||
rv = SearchInFrame(searchFrame, PR_TRUE, outDidFind);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
if (*outDidFind)
|
||||
|
@ -258,8 +251,6 @@ NS_IMETHODIMP nsWebBrowserFind::FindNext(PRBool *outDidFind)
|
|||
|
||||
OnStartSearchFrame(searchFrame);
|
||||
|
||||
// Beware! This may flush notifications via synchronous
|
||||
// ScrollSelectionIntoView.
|
||||
rv = SearchInFrame(searchFrame, PR_FALSE, outDidFind);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
if (*outDidFind)
|
||||
|
@ -481,12 +472,9 @@ void nsWebBrowserFind::SetSelectionAndScroll(nsIDOMWindow* aWindow,
|
|||
|
||||
// Scroll if necessary to make the selection visible:
|
||||
// Must be the last thing to do - bug 242056
|
||||
|
||||
// After ScrollSelectionIntoView(), the pending notifications might be
|
||||
// flushed and PresShell/PresContext/Frames may be dead. See bug 418470.
|
||||
selCon->ScrollSelectionIntoView
|
||||
(nsISelectionController::SELECTION_NORMAL,
|
||||
nsISelectionController::SELECTION_FOCUS_REGION, PR_TRUE);
|
||||
nsISelectionController::SELECTION_FOCUS_REGION, PR_FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -833,8 +821,6 @@ nsresult nsWebBrowserFind::SearchInFrame(nsIDOMWindow* aWindow,
|
|||
{
|
||||
*aDidFind = PR_TRUE;
|
||||
sel->RemoveAllRanges();
|
||||
// Beware! This may flush notifications via synchronous
|
||||
// ScrollSelectionIntoView.
|
||||
SetSelectionAndScroll(aWindow, foundRange);
|
||||
}
|
||||
|
||||
|
|
|
@ -112,9 +112,6 @@ mozSpellChecker::NextMisspelledWord(nsAString &aWord, nsStringArray *aSuggestion
|
|||
if(isMisspelled){
|
||||
aWord = currWord;
|
||||
mTsDoc->SetSelection(begin, end-begin);
|
||||
// After ScrollSelectionIntoView(), the pending notifications might
|
||||
// be flushed and PresShell/PresContext/Frames may be dead.
|
||||
// See bug 418470.
|
||||
mTsDoc->ScrollSelectionIntoView();
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -2773,8 +2773,7 @@ PresShell::PageMove(PRBool aForward, PRBool aExtend)
|
|||
nsIView *scrolledView;
|
||||
result = scrollableView->GetScrolledView(scrolledView);
|
||||
mSelection->CommonPageMove(aForward, aExtend, scrollableView);
|
||||
// After ScrollSelectionIntoView(), the pending notifications might be
|
||||
// flushed and PresShell/PresContext/Frames may be dead. See bug 418470.
|
||||
// do ScrollSelectionIntoView()
|
||||
return ScrollSelectionIntoView(nsISelectionController::SELECTION_NORMAL, nsISelectionController::SELECTION_FOCUS_REGION, PR_TRUE);
|
||||
}
|
||||
|
||||
|
@ -2850,8 +2849,6 @@ PresShell::CompleteScroll(PRBool aForward)
|
|||
NS_IMETHODIMP
|
||||
PresShell::CompleteMove(PRBool aForward, PRBool aExtend)
|
||||
{
|
||||
// Beware! This may flush notifications via synchronous
|
||||
// ScrollSelectionIntoView.
|
||||
return CompleteMoveInner(aForward, aExtend, PR_TRUE);
|
||||
}
|
||||
|
||||
|
@ -2889,8 +2886,6 @@ PresShell::CompleteMoveInner(PRBool aForward, PRBool aExtend, PRBool aScrollInto
|
|||
mSelection->SetAncestorLimiter(root);
|
||||
|
||||
if (aScrollIntoView) {
|
||||
// After ScrollSelectionIntoView(), the pending notifications might be
|
||||
// flushed and PresShell/PresContext/Frames may be dead. See bug 418470.
|
||||
return
|
||||
ScrollSelectionIntoView(nsISelectionController::SELECTION_NORMAL,
|
||||
nsISelectionController::SELECTION_FOCUS_REGION,
|
||||
|
@ -2935,8 +2930,6 @@ PresShell::CompleteMoveInner(PRBool aForward, PRBool aExtend, PRBool aScrollInto
|
|||
mSelection->HandleClick(pos.mResultContent ,pos.mContentOffset ,pos.mContentOffset/*End*/ ,aExtend, PR_FALSE, aForward);
|
||||
|
||||
if (aScrollIntoView) {
|
||||
// After ScrollSelectionIntoView(), the pending notifications might be
|
||||
// flushed and PresShell/PresContext/Frames may be dead. See bug 418470.
|
||||
result = ScrollSelectionIntoView(nsISelectionController::SELECTION_NORMAL,
|
||||
nsISelectionController::SELECTION_FOCUS_REGION, PR_TRUE);
|
||||
if (NS_FAILED(result))
|
||||
|
|
|
@ -670,8 +670,6 @@ NS_IMETHODIMP
|
|||
nsTextInputSelectionImpl::ScrollSelectionIntoView(PRInt16 aType, PRInt16 aRegion, PRBool aIsSynchronous)
|
||||
{
|
||||
if (mFrameSelection) {
|
||||
// After ScrollSelectionIntoView(), the pending notifications might be
|
||||
// flushed and PresShell/PresContext/Frames may be dead. See bug 418470.
|
||||
nsresult rv = mFrameSelection->ScrollSelectionIntoView(aType, aRegion, aIsSynchronous);
|
||||
|
||||
nsIScrollableView* scrollableView = mFrameSelection->GetScrollableView();
|
||||
|
@ -861,8 +859,6 @@ nsTextInputSelectionImpl::PageMove(PRBool aForward, PRBool aExtend)
|
|||
if (scrollableView)
|
||||
mFrameSelection->CommonPageMove(aForward, aExtend, scrollableView);
|
||||
}
|
||||
// After ScrollSelectionIntoView(), the pending notifications might be
|
||||
// flushed and PresShell/PresContext/Frames may be dead. See bug 418470.
|
||||
return ScrollSelectionIntoView(nsISelectionController::SELECTION_NORMAL, nsISelectionController::SELECTION_FOCUS_REGION, PR_TRUE);
|
||||
}
|
||||
|
||||
|
|
|
@ -2558,10 +2558,8 @@ nsFrameSelection::ScrollSelectionIntoView(SelectionType aType,
|
|||
if (!mDomSelections[index])
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
// After ScrollSelectionIntoView(), the pending notifications might be
|
||||
// flushed and PresShell/PresContext/Frames may be dead. See bug 418470.
|
||||
return mDomSelections[index]->ScrollIntoView(aRegion, aIsSynchronous,
|
||||
PR_TRUE);
|
||||
PR_FALSE);
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
|
|
@ -575,12 +575,10 @@ nsTypeAheadFind::FindItNow(nsIPresShell *aPresShell, PRBool aIsLinksOnly,
|
|||
// ATTENTION, or when we MoveFocusToCaret() and the selection is not on a
|
||||
// link, we'll blur, which will lose the ATTENTION.
|
||||
if (selectionController) {
|
||||
// Beware! This may flush notifications via synchronous
|
||||
// ScrollSelectionIntoView.
|
||||
SetSelectionModeAndRepaint(nsISelectionController::SELECTION_ATTENTION);
|
||||
selectionController->ScrollSelectionIntoView(
|
||||
nsISelectionController::SELECTION_NORMAL,
|
||||
nsISelectionController::SELECTION_FOCUS_REGION, PR_TRUE);
|
||||
nsISelectionController::SELECTION_FOCUS_REGION, PR_FALSE);
|
||||
}
|
||||
|
||||
mCurrentWindow = window;
|
||||
|
@ -903,8 +901,6 @@ nsTypeAheadFind::FindAgain(PRBool aFindBackwards, PRBool aLinksOnly,
|
|||
|
||||
mLinksOnly = aLinksOnly;
|
||||
if (!mTypeAheadBuffer.IsEmpty())
|
||||
// Beware! This may flush notifications via synchronous
|
||||
// ScrollSelectionIntoView.
|
||||
FindItNow(nsnull, mLinksOnly, PR_FALSE, aFindBackwards, aResult);
|
||||
|
||||
return NS_OK;
|
||||
|
@ -1028,8 +1024,6 @@ nsTypeAheadFind::Find(const nsAString& aSearchString, PRBool aLinksOnly,
|
|||
}
|
||||
|
||||
// ----------- Find the text! ---------------------
|
||||
// Beware! This may flush notifications via synchronous
|
||||
// ScrollSelectionIntoView.
|
||||
nsresult rv = FindItNow(nsnull, mLinksOnly, isFirstVisiblePreferred,
|
||||
PR_FALSE, aResult);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче