Backout changeset b48ebf9695bb for causing failures in layout/generic/test/test_selection_expanding.html .

This commit is contained in:
L. David Baron 2011-04-12 00:11:58 -07:00
Родитель 15e066c18a
Коммит 0677a8097e
6 изменённых файлов: 3 добавлений и 52 удалений

Просмотреть файл

@ -82,13 +82,11 @@ struct SelectionState {
class RestoreSelectionState : public nsRunnable { class RestoreSelectionState : public nsRunnable {
public: public:
RestoreSelectionState(nsTextEditorState *aState, nsTextControlFrame *aFrame, RestoreSelectionState(nsTextControlFrame *aFrame, PRInt32 aStart, PRInt32 aEnd)
PRInt32 aStart, PRInt32 aEnd)
: mFrame(aFrame), : mFrame(aFrame),
mWeakFrame(aFrame), mWeakFrame(aFrame),
mStart(aStart), mStart(aStart),
mEnd(aEnd), mEnd(aEnd)
mTextEditorState(aState)
{ {
} }
@ -98,7 +96,6 @@ public:
// need to block script to avoid nested PrepareEditor calls (bug 642800). // need to block script to avoid nested PrepareEditor calls (bug 642800).
nsAutoScriptBlocker scriptBlocker; nsAutoScriptBlocker scriptBlocker;
mFrame->SetSelectionRange(mStart, mEnd); mFrame->SetSelectionRange(mStart, mEnd);
mTextEditorState->HideSelectionIfBlurred();
} }
return NS_OK; return NS_OK;
} }
@ -108,7 +105,6 @@ private:
nsWeakFrame mWeakFrame; nsWeakFrame mWeakFrame;
PRInt32 mStart; PRInt32 mStart;
PRInt32 mEnd; PRInt32 mEnd;
nsTextEditorState* mTextEditorState;
}; };
/*static*/ /*static*/
@ -1389,7 +1385,7 @@ nsTextEditorState::PrepareEditor(const nsAString *aValue)
// Restore our selection after being bound to a new frame // Restore our selection after being bound to a new frame
if (mSelState) { if (mSelState) {
nsContentUtils::AddScriptRunner(new RestoreSelectionState(this, mBoundFrame, mSelState->mStart, mSelState->mEnd)); nsContentUtils::AddScriptRunner(new RestoreSelectionState(mBoundFrame, mSelState->mStart, mSelState->mEnd));
mSelState = nsnull; mSelState = nsnull;
} }
@ -2015,16 +2011,6 @@ nsTextEditorState::SetPlaceholderClass(PRBool aVisible,
classValue, aNotify); classValue, aNotify);
} }
void
nsTextEditorState::HideSelectionIfBlurred()
{
NS_ABORT_IF_FALSE(mSelCon, "Should have a selection controller if we have a frame!");
nsCOMPtr<nsIContent> content = do_QueryInterface(mTextCtrlElement);
if (!nsContentUtils::IsFocusedContent(content)) {
mSelCon->SetDisplaySelection(nsISelectionController::SELECTION_OFF);
}
}
NS_IMPL_ISUPPORTS1(nsAnonDivObserver, nsIMutationObserver) NS_IMPL_ISUPPORTS1(nsAnonDivObserver, nsIMutationObserver)
void void

Просмотреть файл

@ -210,8 +210,6 @@ public:
void ClearValueCache() { mCachedValue.Truncate(); } void ClearValueCache() { mCachedValue.Truncate(); }
void HideSelectionIfBlurred();
private: private:
// not copy constructible // not copy constructible
nsTextEditorState(const nsTextEditorState&); nsTextEditorState(const nsTextEditorState&);

Просмотреть файл

@ -60,5 +60,3 @@ fails-if(Android) != spellcheck-hyphen-multiple-invalid.html spellcheck-hyphen-m
== caret_on_presshell_reinit.html caret_on_presshell_reinit-ref.html == caret_on_presshell_reinit.html caret_on_presshell_reinit-ref.html
== caret_on_presshell_reinit-2.html caret_on_presshell_reinit-ref.html == caret_on_presshell_reinit-2.html caret_on_presshell_reinit-ref.html
== 642800.html 642800-ref.html == 642800.html 642800-ref.html
== selection_visibility_after_reframe.html selection_visibility_after_reframe-ref.html
!= selection_visibility_after_reframe-2.html selection_visibility_after_reframe-ref.html

Просмотреть файл

@ -1,11 +0,0 @@
<!DOCTYPE html>
<html>
<body>
<input value="foo">
<script>
var i = document.querySelector("input");
i.selectionStart = 1;
i.selectionEnd = 2;
</script>
</body>
</html>

Просмотреть файл

@ -1,6 +0,0 @@
<!DOCTYPE html>
<html>
<body>
<input value="foo">
</body>
</html>

Просмотреть файл

@ -1,14 +0,0 @@
<!DOCTYPE html>
<html>
<body>
<input value="foo">
<script>
var i = document.querySelector("input");
i.selectionStart = 1;
i.selectionEnd = 2;
i.style.display = "none";
document.body.clientHeight;
i.style.display = "";
</script>
</body>
</html>