mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Update the caret after creating a new frame, if the node has focus. b=536421 r=ehsan a=blocking2.0:final
This commit is contained in:
parent
d0a2a35c8c
commit
d000a22403
@ -311,7 +311,7 @@ nsEditor::PostCreate()
|
||||
NotifyDocumentListeners(eDocumentCreated);
|
||||
NotifyDocumentListeners(eDocumentStateChanged);
|
||||
|
||||
// update nsTextStateManager if we have focus
|
||||
// update nsTextStateManager and caret if we have focus
|
||||
if (HasFocus()) {
|
||||
nsFocusManager* fm = nsFocusManager::GetFocusManager();
|
||||
NS_ASSERTION(fm, "no focus manager?");
|
||||
@ -324,6 +324,11 @@ nsEditor::PostCreate()
|
||||
|
||||
nsIMEStateManager::OnTextStateBlur(pc, nsnull);
|
||||
nsIMEStateManager::OnTextStateFocus(pc, focusedContent);
|
||||
|
||||
nsCOMPtr<nsIDOMEventTarget> target = do_QueryInterface(focusedContent);
|
||||
if (target) {
|
||||
InitializeSelection(target);
|
||||
}
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
|
@ -0,0 +1,28 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html class="reftest-wait">
|
||||
<head>
|
||||
<title>bug 536421</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<style>
|
||||
input { border:1px solid blue; }
|
||||
</style>
|
||||
</head>
|
||||
<body onload="doTest()">
|
||||
<input value="test" id="textbox" onfocus="triggerBug();" type="text">
|
||||
<script type="text/javascript">
|
||||
function finishTest()
|
||||
{
|
||||
document.documentElement.removeAttribute("class");
|
||||
}
|
||||
function triggerBug()
|
||||
{
|
||||
finishTest();
|
||||
}
|
||||
function doTest()
|
||||
{
|
||||
var t = document.getElementById("textbox");
|
||||
t.focus();
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,32 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html class="reftest-wait">
|
||||
<head>
|
||||
<title>bug 536421</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<style>
|
||||
input { border:1px solid blue; }
|
||||
</style>
|
||||
</head>
|
||||
<body onload="doTest()">
|
||||
<input value="test" id="textbox" onfocus="triggerBug();" type="text">
|
||||
<script type="text/javascript">
|
||||
function finishTest()
|
||||
{
|
||||
document.documentElement.removeAttribute("class");
|
||||
}
|
||||
function triggerBug()
|
||||
{
|
||||
var t = document.getElementById("textbox");
|
||||
t.style.display = "none";
|
||||
document.body.offsetWidth;
|
||||
t.style.display = "";
|
||||
finishTest();
|
||||
}
|
||||
function doTest()
|
||||
{
|
||||
var t = document.getElementById("textbox");
|
||||
t.focus();
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
25
layout/reftests/editor/input-text-onfocus-reframe-ref.html
Normal file
25
layout/reftests/editor/input-text-onfocus-reframe-ref.html
Normal file
@ -0,0 +1,25 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html class="reftest-wait">
|
||||
<head>
|
||||
<title>bug 536421</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
</head>
|
||||
<body onload="doTest()">
|
||||
<input value="test" id="textbox" onfocus="triggerBug();" type="text">
|
||||
<script type="text/javascript">
|
||||
function finishTest()
|
||||
{
|
||||
document.documentElement.removeAttribute("class");
|
||||
}
|
||||
function triggerBug()
|
||||
{
|
||||
finishTest();
|
||||
}
|
||||
function doTest()
|
||||
{
|
||||
var t = document.getElementById("textbox");
|
||||
t.focus();
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
29
layout/reftests/editor/input-text-onfocus-reframe.html
Normal file
29
layout/reftests/editor/input-text-onfocus-reframe.html
Normal file
@ -0,0 +1,29 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html class="reftest-wait">
|
||||
<head>
|
||||
<title>bug 536421</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
</head>
|
||||
<body onload="doTest()">
|
||||
<input value="test" id="textbox" onfocus="triggerBug();" type="text">
|
||||
<script type="text/javascript">
|
||||
function finishTest()
|
||||
{
|
||||
document.documentElement.removeAttribute("class");
|
||||
}
|
||||
function triggerBug()
|
||||
{
|
||||
var t = document.getElementById("textbox");
|
||||
t.style.display = "none";
|
||||
document.body.offsetWidth;
|
||||
t.style.display = "";
|
||||
finishTest();
|
||||
}
|
||||
function doTest()
|
||||
{
|
||||
var t = document.getElementById("textbox");
|
||||
t.focus();
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -19,3 +19,5 @@ include xul/reftest.list
|
||||
== caret_on_positioned.html caret_on_positioned-ref.html
|
||||
== spellcheck-1.html spellcheck-ref.html
|
||||
!= caret_on_textarea_lastline.html caret_on_textarea_lastline-ref.html
|
||||
== input-text-onfocus-reframe.html input-text-onfocus-reframe-ref.html
|
||||
== input-text-notheme-onfocus-reframe.html input-text-notheme-onfocus-reframe-ref.html
|
||||
|
Loading…
Reference in New Issue
Block a user