зеркало из https://github.com/mozilla/gecko-dev.git
Back out patch for bug 144000 (backout patch by jst@mozilla.org, r=uriber, sr=peterv, a=beltzner)
This commit is contained in:
Родитель
01e42dc4e8
Коммит
47d32a6cc7
|
@ -1181,8 +1181,6 @@ protected:
|
|||
ReflowCountMgr * mReflowCountMgr;
|
||||
#endif
|
||||
|
||||
nsresult CompleteMoveInner(PRBool aForward, PRBool aExtend, PRBool sScrollIntoView);
|
||||
|
||||
private:
|
||||
|
||||
PRBool InZombieDocument(nsIContent *aContent);
|
||||
|
@ -2898,12 +2896,7 @@ PresShell::CompleteMove(PRBool aForward, PRBool aExtend)
|
|||
{
|
||||
// Beware! This may flush notifications via synchronous
|
||||
// ScrollSelectionIntoView.
|
||||
return CompleteMoveInner(aForward, aExtend, PR_TRUE);
|
||||
}
|
||||
|
||||
nsresult
|
||||
PresShell::CompleteMoveInner(PRBool aForward, PRBool aExtend, PRBool aScrollIntoView)
|
||||
{
|
||||
nsIContent* root = mSelection->GetAncestorLimiter();
|
||||
nsIDocument* doc;
|
||||
if (root && (doc = root->GetOwnerDoc()) && doc->GetRootContent() != root) {
|
||||
|
@ -2934,7 +2927,6 @@ PresShell::CompleteMoveInner(PRBool aForward, PRBool aExtend, PRBool aScrollInto
|
|||
// HandleClick resets ancestorLimiter, so set it again.
|
||||
mSelection->SetAncestorLimiter(root);
|
||||
|
||||
if (aScrollIntoView) {
|
||||
// After ScrollSelectionIntoView(), the pending notifications might be
|
||||
// flushed and PresShell/PresContext/Frames may be dead. See bug 418470.
|
||||
return
|
||||
|
@ -2943,9 +2935,6 @@ PresShell::CompleteMoveInner(PRBool aForward, PRBool aExtend, PRBool aScrollInto
|
|||
PR_TRUE);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsIScrollableView *scrollableView;
|
||||
if (!mViewManager)
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
|
@ -2980,15 +2969,11 @@ 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))
|
||||
return result;
|
||||
}
|
||||
return NS_OK;
|
||||
return ScrollSelectionIntoView(nsISelectionController::SELECTION_NORMAL,
|
||||
nsISelectionController::SELECTION_FOCUS_REGION,
|
||||
PR_TRUE);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -4356,18 +4341,6 @@ PresShell::UnsuppressAndInvalidate()
|
|||
|
||||
if (mViewManager)
|
||||
mViewManager->SynthesizeMouseMove(PR_FALSE);
|
||||
|
||||
// If there is no selection, create a collapsed selection at the top of the document.
|
||||
if (mSelection) {
|
||||
nsISelection* domSelection = mSelection->
|
||||
GetSelection(nsISelectionController::SELECTION_NORMAL);
|
||||
if (domSelection) {
|
||||
PRInt32 rangeCount;
|
||||
domSelection->GetRangeCount(&rangeCount);
|
||||
if (rangeCount == 0)
|
||||
CompleteMoveInner(PR_FALSE, PR_FALSE, PR_FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
Загрузка…
Ссылка в новой задаче