зеркало из https://github.com/mozilla/gecko-dev.git
Backout changeset b48ebf9695bb for causing failures in layout/generic/test/test_selection_expanding.html .
This commit is contained in:
Родитель
15e066c18a
Коммит
0677a8097e
|
@ -82,13 +82,11 @@ struct SelectionState {
|
|||
|
||||
class RestoreSelectionState : public nsRunnable {
|
||||
public:
|
||||
RestoreSelectionState(nsTextEditorState *aState, nsTextControlFrame *aFrame,
|
||||
PRInt32 aStart, PRInt32 aEnd)
|
||||
RestoreSelectionState(nsTextControlFrame *aFrame, PRInt32 aStart, PRInt32 aEnd)
|
||||
: mFrame(aFrame),
|
||||
mWeakFrame(aFrame),
|
||||
mStart(aStart),
|
||||
mEnd(aEnd),
|
||||
mTextEditorState(aState)
|
||||
mEnd(aEnd)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -98,7 +96,6 @@ public:
|
|||
// need to block script to avoid nested PrepareEditor calls (bug 642800).
|
||||
nsAutoScriptBlocker scriptBlocker;
|
||||
mFrame->SetSelectionRange(mStart, mEnd);
|
||||
mTextEditorState->HideSelectionIfBlurred();
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -108,7 +105,6 @@ private:
|
|||
nsWeakFrame mWeakFrame;
|
||||
PRInt32 mStart;
|
||||
PRInt32 mEnd;
|
||||
nsTextEditorState* mTextEditorState;
|
||||
};
|
||||
|
||||
/*static*/
|
||||
|
@ -1389,7 +1385,7 @@ nsTextEditorState::PrepareEditor(const nsAString *aValue)
|
|||
|
||||
// Restore our selection after being bound to a new frame
|
||||
if (mSelState) {
|
||||
nsContentUtils::AddScriptRunner(new RestoreSelectionState(this, mBoundFrame, mSelState->mStart, mSelState->mEnd));
|
||||
nsContentUtils::AddScriptRunner(new RestoreSelectionState(mBoundFrame, mSelState->mStart, mSelState->mEnd));
|
||||
mSelState = nsnull;
|
||||
}
|
||||
|
||||
|
@ -2015,16 +2011,6 @@ nsTextEditorState::SetPlaceholderClass(PRBool aVisible,
|
|||
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)
|
||||
|
||||
void
|
||||
|
|
|
@ -210,8 +210,6 @@ public:
|
|||
|
||||
void ClearValueCache() { mCachedValue.Truncate(); }
|
||||
|
||||
void HideSelectionIfBlurred();
|
||||
|
||||
private:
|
||||
// not copy constructible
|
||||
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-2.html caret_on_presshell_reinit-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>
|
Загрузка…
Ссылка в новой задаче