зеркало из https://github.com/mozilla/gecko-dev.git
Bug 646382 - Position the caret correctly for empty BR frames; r=roc
This commit is contained in:
Родитель
56bb77b76d
Коммит
1ae18aafb2
|
@ -140,6 +140,10 @@ _TEST_FILES = \
|
|||
bug633044-1-ref.html \
|
||||
bug644428-1.html \
|
||||
bug644428-1-ref.html \
|
||||
bug646382-1.html \
|
||||
bug646382-1-ref.html \
|
||||
bug646382-2.html \
|
||||
bug646382-2-ref.html \
|
||||
test_bug514127.html \
|
||||
test_bug518777.html \
|
||||
test_bug548545.xhtml \
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
<html class="reftest-wait">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
</head>
|
||||
<body onload="start()">
|
||||
<textarea onfocus="done()">س</textarea>
|
||||
<script>
|
||||
var textarea = document.querySelector("textarea");
|
||||
function start() {
|
||||
textarea.focus();
|
||||
}
|
||||
function done() {
|
||||
textarea.selectionStart = textarea.selectionEnd = 0;
|
||||
document.documentElement.removeAttribute("class");
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,21 @@
|
|||
<html class="reftest-wait">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<script type="text/javascript" src="/MochiKit/packed.js"></script>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
|
||||
</head>
|
||||
<body onload="start()">
|
||||
<textarea onfocus="typeIntoMe()"></textarea>
|
||||
<script>
|
||||
function start() {
|
||||
document.querySelector("textarea").focus();
|
||||
}
|
||||
function typeIntoMe() {
|
||||
setTimeout(function() {
|
||||
synthesizeKey("س", {});
|
||||
document.documentElement.removeAttribute("class");
|
||||
}, 0);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,15 @@
|
|||
<html class="reftest-wait">
|
||||
<body onload="start()">
|
||||
<textarea dir="rtl" onfocus="done()">s</textarea>
|
||||
<script>
|
||||
var textarea = document.querySelector("textarea");
|
||||
function start() {
|
||||
textarea.focus();
|
||||
}
|
||||
function done() {
|
||||
textarea.selectionStart = textarea.selectionEnd = 0;
|
||||
document.documentElement.removeAttribute("class");
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,20 @@
|
|||
<html class="reftest-wait">
|
||||
<head>
|
||||
<script type="text/javascript" src="/MochiKit/packed.js"></script>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
|
||||
</head>
|
||||
<body onload="start()">
|
||||
<textarea dir="rtl" onfocus="typeIntoMe()"></textarea>
|
||||
<script>
|
||||
function start() {
|
||||
document.querySelector("textarea").focus();
|
||||
}
|
||||
function typeIntoMe() {
|
||||
setTimeout(function() {
|
||||
synthesizeKey("s", {});
|
||||
document.documentElement.removeAttribute("class");
|
||||
}, 0);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -122,13 +122,26 @@ var tests = [
|
|||
[ 'bug632215-1.html' , 'bug632215-ref.html' ] ,
|
||||
[ 'bug632215-2.html' , 'bug632215-ref.html' ] ,
|
||||
[ 'bug633044-1.html' , 'bug633044-1-ref.html' ] ,
|
||||
[ 'bug644428-1.html' , 'bug644428-1-ref.html' ]
|
||||
[ 'bug644428-1.html' , 'bug644428-1-ref.html' ] ,
|
||||
function() {
|
||||
SpecialPowers.setBoolPref("bidi.browser.ui", true);
|
||||
},
|
||||
[ 'bug646382-1.html' , 'bug646382-1-ref.html' ] ,
|
||||
[ 'bug646382-2.html' , 'bug646382-2-ref.html' ] ,
|
||||
function() {
|
||||
SpecialPowers.clearUserPref("bidi.browser.ui");
|
||||
},
|
||||
];
|
||||
var testIndex = 0;
|
||||
|
||||
function nextTest() {
|
||||
if (testIndex < tests.length) {
|
||||
refTest(tests[testIndex][0],tests[testIndex][1]);
|
||||
if (typeof(tests[testIndex]) == 'function') {
|
||||
tests[testIndex]();
|
||||
SimpleTest.executeSoon(nextTest);
|
||||
} else {
|
||||
refTest(tests[testIndex][0],tests[testIndex][1]);
|
||||
}
|
||||
++testIndex;
|
||||
} else {
|
||||
endTest();
|
||||
|
|
|
@ -245,7 +245,7 @@ BRFrame::GetBaseline() const
|
|||
ascent += GetUsedBorderAndPadding().top;
|
||||
}
|
||||
}
|
||||
return ascent;
|
||||
return NS_MIN(mRect.height, ascent);
|
||||
}
|
||||
|
||||
nsIFrame::ContentOffsets BRFrame::CalcContentOffsetsFromFramePoint(nsPoint aPoint)
|
||||
|
|
Загрузка…
Ссылка в новой задаче