Commit fbe7f75e authored by rniwa@webkit.org's avatar rniwa@webkit.org

2010-11-30 Ryosuke Niwa <rniwa@webkit.org>

        Reviewed by Ojan Vafai.

        REGRESSION(r72861): editing/selection/click-left-of-rtl-wrapping-text.html and
        modify-up-on-rtl-wrapping-text.html fail on all but Mac platform
        https://bugs.webkit.org/show_bug.cgi?id=50204

        Fixed the tests. Instead of using "ex" to specify the width of the container div,
        the tests now auto-detect the correct width by comparing the computed height to
        the expected height deduced from the height of one line and the expected number of lines.

        * editing/selection/click-left-of-rtl-wrapping-text-expected.txt:
        * editing/selection/click-left-of-rtl-wrapping-text.html:
        * editing/selection/modify-up-on-rtl-wrapping-text.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72977 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 4920c931
2010-11-30 Ryosuke Niwa <rniwa@webkit.org>
Reviewed by Ojan Vafai.
REGRESSION(r72861): editing/selection/click-left-of-rtl-wrapping-text.html and
modify-up-on-rtl-wrapping-text.html fail on all but Mac platform
https://bugs.webkit.org/show_bug.cgi?id=50204
Fixed the tests. Instead of using "ex" to specify the width of the container div,
the tests now auto-detect the correct width by comparing the computed height to
the expected height deduced from the height of one line and the expected number of lines.
* editing/selection/click-left-of-rtl-wrapping-text-expected.txt:
* editing/selection/click-left-of-rtl-wrapping-text.html:
* editing/selection/modify-up-on-rtl-wrapping-text.html:
2010-11-30 Yael Aharon <yael.aharon@nokia.com>
Reviewed by Darin Adler.
......@@ -2,9 +2,9 @@ This tests clicking on the left of RTL text puts the caret at the end of the lin
PASS: clicking on the left of the 1st line of ך לכ put the caret at 2
PASS: clicking on the left of the 2nd line of ך לכ put the caret at 4
PASS: clicking on the left of the 1st line of גכ יגכע ג put the caret at 3
PASS: clicking on the left of the 2nd line of גכ יגכע ג put the caret at 8
FAIL: clicking on the left of the 3rd line of גכ יגכע ג put the caret at 9 but expected at 10
PASS: clicking on the left of the 1st line of ככ ככככ כככ put the caret at 3
PASS: clicking on the left of the 2nd line of ככ ככככ כככ put the caret at 8
PASS: clicking on the left of the 3rd line of ככ ככככ כככ put the caret at 11
PASS: clicking on the left of the 1st line of גכ יגכ יגכ יגכ יגכ put the caret at 3
PASS: clicking on the left of the 2nd line of גכ יגכ יגכ יגכ יגכ put the caret at 7
PASS: clicking on the left of the 3rd line of גכ יגכ יגכ יגכ יגכ put the caret at 11
......
......@@ -9,8 +9,8 @@ if (window.layoutTestController)
layoutTestController.dumpAsText();
var tests = [
{content: "&#1498; &#1500;&#1499;", width: "2.5ex", expected: [2, 4]},
{content: "&#1490;&#1499; &#1497;&#1490;&#1499;&#1506; &#1490;", width: "5ex", expected: [3, 8, 10]},
{content: "&#1498; &#1500;&#1499;", expected: [2, 4]},
{content: "&#1499;&#1499; &#1499;&#1499;&#1499;&#1499; &#1499;&#1499;&#1499;", expected: [3, 8, 11]},
{content: "&#1490;&#1499; &#1497;&#1490;&#1499; &#1497;&#1490;&#1499; &#1497;&#1490;&#1499; &#1497;&#1490;&#1499;", width: "5ex",
expected: [3, 7, 11, 15, 18]},
];
......@@ -24,19 +24,33 @@ function passed(message) {
}
function runTest(container, test) {
container.style.width = '100%';
container.innerHTML = test.content;
container.style.width = test.width;
var x = 2;
var y = 2;
// Starting from 5px, slowly increase the width until each word fits in one line.
var heightOfLine = container.offsetHeight;
var width = 5;
do {
container.style.width = width + 'px';
width++;
} while (container.offsetHeight > heightOfLine * test.expected.length);
container.style.width = (width + 1) + 'px';
var x = 0;
var y = heightOfLine / 2;
var yIncrement = container.offsetHeight / test.expected.length;
var lines = ['st', 'nd', 'rd', 'th'];
if (!window.eventSender)
return;
for (var i = 0; i < test.expected.length; i++) {
eventSender.mouseMoveTo(container.offsetLeft + x, container.offsetTop + y);
eventSender.mouseDown();
eventSender.leapForward(500);
eventSender.leapForward(100);
eventSender.mouseUp();
eventSender.leapForward(1000);
var line = (i + 1) + lines[Math.min(i, lines.length - 1)];
var action = 'clicking on the left of the ' + line + ' line of ' + test.content;
......
......@@ -2,9 +2,9 @@ This tests clicking on the left of RTL text puts the caret at the end of the lin
PASS: on ך לכ, caret is at 4 initially
PASS: on ך לכ, caret is at 2 after moving upwards once
PASS: on ג גכ כעי, caret is at 8 initially
PASS: on ג גכ כעי, caret is at 5 after moving upwards once
PASS: on ג גכ כעי, caret is at 2 after moving upwards twice
PASS: on כ ככ כככ, caret is at 8 initially
PASS: on כ ככ כככ, caret is at 5 after moving upwards once
PASS: on כ ככ כככ, caret is at 2 after moving upwards twice
PASS: on גכ יגכ יגכ יגכ יגכ, caret is at 18 initially
PASS: on גכ יגכ יגכ יגכ יגכ, caret is at 14 after moving upwards once
PASS: on גכ יגכ יגכ יגכ יגכ, caret is at 10 after moving upwards twice
......
......@@ -9,9 +9,9 @@ if (window.layoutTestController)
layoutTestController.dumpAsText();
var tests = [
{content: "&#1498; &#1500;&#1499;", width: "2.5ex", expected: [2, 4]},
{content: "&#1490; &#1490;&#1499; &#1499;&#1506;&#1497;", width: "3.5ex", expected: [2, 5, 8]},
{content: "&#1490;&#1499; &#1497;&#1490;&#1499; &#1497;&#1490;&#1499; &#1497;&#1490;&#1499; &#1497;&#1490;&#1499;", width: "5ex",
{content: "&#1498; &#1500;&#1499;", expected: [2, 4]},
{content: "&#1499; &#1499;&#1499; &#1499;&#1499;&#1499;", expected: [2, 5, 8]},
{content: "&#1490;&#1499; &#1497;&#1490;&#1499; &#1497;&#1490;&#1499; &#1497;&#1490;&#1499; &#1497;&#1490;&#1499;",
expected: [3, 6, 10, 14, 18]},
];
......@@ -24,11 +24,20 @@ function passed(message) {
}
function runTest(container, test) {
container.style.width = '100%';
container.innerHTML = test.content;
container.style.width = test.width;
// Starting from 5px, slowly increase the width until each word fits in one line.
var heightOfLine = container.offsetHeight;
var width = 5;
do {
container.style.width = width + 'px';
width++;
} while (container.offsetHeight > heightOfLine * test.expected.length);
container.style.width = (width + 1) + 'px';
var lines = ['st', 'nd', 'rd', 'th'];
window.getSelection().setPosition(container.firstChild, test.content.length);
window.getSelection().setPosition(container.lastChild, container.lastChild.length);
for (var i = 0; i < test.expected.length; i++) {
if (!window.getSelection().isCollapsed)
......
......@@ -3191,9 +3191,6 @@ BUGCR64695 : fast/dom/StyleSheet/gc-parent-rule.html = TEXT
BUGCR64695 : fast/dom/StyleSheet/gc-parent-stylesheet.html = TEXT
BUGCR64695 : fast/dom/StyleSheet/gc-declaration-parent-rule.html = TEXT
BUGWK50204 : editing/selection/click-left-of-rtl-wrapping-text.html = TEXT
BUGWK50204 WIN LINUX : editing/selection/modify-up-on-rtl-wrapping-text.html = TEXT
BUGWK50272 MAC : fast/filesystem/async-operations.html = CRASH PASS
BUGCR64733 : editing/text-iterator/findString.html = TEXT
......
......@@ -5572,8 +5572,3 @@ fast/canvas/canvas-strokePath-shadow.html
# https://bugs.webkit.org/show_bug.cgi?id=47727
mathml/presentation
# REGRESSION(r72861): editing/selection/click-left-of-rtl-wrapping-text.html and modify-up-on-rtl-wrapping-text.html fail on all but Mac platform
# https://bugs.webkit.org/show_bug.cgi?id=50204
editing/selection/click-left-of-rtl-wrapping-text.html
editing/selection/modify-up-on-rtl-wrapping-text.html
......@@ -1069,10 +1069,5 @@ plugins/iframe-shims.html
# Requires WebP support.
fast/images/webp-image-decoding.html
# REGRESSION(r72861): editing/selection/click-left-of-rtl-wrapping-text.html and modify-up-on-rtl-wrapping-text.html fail on all but Mac platform
# https://bugs.webkit.org/show_bug.cgi?id=50204
editing/selection/click-left-of-rtl-wrapping-text.html
editing/selection/modify-up-on-rtl-wrapping-text.html
# Missing layoutTestController.findString() http://webkit.org/b/50234
editing/text-iterator/findString.html
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment