mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 597519 - Attempting to add characters to a textarea filled to its maxlength with a trailing newline results in the caret to jump to the previous line; r=roc a=blocking-final+
This commit is contained in:
parent
c05196072c
commit
133d6d5182
@ -658,8 +658,14 @@ nsTextEditRules::WillInsertText(PRInt32 aAction,
|
||||
|
||||
// handle docs with a max length
|
||||
// NOTE, this function copies inString into outString for us.
|
||||
nsresult res = TruncateInsertionIfNeeded(aSelection, inString, outString, aMaxLength, nsnull);
|
||||
PRBool truncated = PR_FALSE;
|
||||
nsresult res = TruncateInsertionIfNeeded(aSelection, inString, outString,
|
||||
aMaxLength, &truncated);
|
||||
NS_ENSURE_SUCCESS(res, res);
|
||||
if (truncated) {
|
||||
*aCancel = PR_TRUE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PRUint32 start = 0;
|
||||
PRUint32 end = 0;
|
||||
|
@ -104,6 +104,8 @@ _TEST_FILES = \
|
||||
bug512295-2-ref.html \
|
||||
bug585922.html \
|
||||
bug585922-ref.html \
|
||||
bug597519-1.html \
|
||||
bug597519-1-ref.html \
|
||||
test_bug514127.html \
|
||||
test_bug518777.html \
|
||||
test_bug548545.xhtml \
|
||||
|
11
layout/base/tests/bug597519-1-ref.html
Normal file
11
layout/base/tests/bug597519-1-ref.html
Normal file
@ -0,0 +1,11 @@
|
||||
<!DOCTYPE HTML><html><head>
|
||||
</head>
|
||||
<body>
|
||||
<textarea>ab
|
||||
</textarea>
|
||||
<script>
|
||||
var t = document.querySelector("textarea");
|
||||
t.focus();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
17
layout/base/tests/bug597519-1.html
Normal file
17
layout/base/tests/bug597519-1.html
Normal file
@ -0,0 +1,17 @@
|
||||
<!DOCTYPE HTML><html><head>
|
||||
<script type="text/javascript" src="/MochiKit/packed.js"></script>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<textarea maxlength="3"></textarea>
|
||||
<script>
|
||||
var t = document.querySelector("textarea");
|
||||
t.focus();
|
||||
|
||||
synthesizeKey("a", {});
|
||||
synthesizeKey("b", {});
|
||||
synthesizeKey("VK_ENTER", {});
|
||||
synthesizeKey("c", {});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -93,7 +93,8 @@ var tests = [
|
||||
[ 'bug482484.html' , 'bug482484-ref.html' ] ,
|
||||
[ 'bug512295-1.html' , 'bug512295-1-ref.html' ] ,
|
||||
[ 'bug512295-2.html' , 'bug512295-2-ref.html' ] ,
|
||||
[ 'bug585922.html' , 'bug585922-ref.html' ]
|
||||
[ 'bug585922.html' , 'bug585922-ref.html' ] ,
|
||||
[ 'bug597519-1.html' , 'bug597519-1-ref.html' ]
|
||||
];
|
||||
var testIndex = 0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user