Commit a212c946 authored by Koji Ishii's avatar Koji Ishii Committed by Commit Bot

[LayoutNG] Exclude U+FFFC from zero-width tests

This patch removes U+FFFC from characters to have zero-width.

LayoutNG does not have this specialization, and Edge and Gecko
do not make U+FFFC zero-width either.

As part of the investigation, zero-width-characters.html was
changed to testharness.js.

Bug: 636993
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng
Change-Id: I278778bd030d87f6691de0e217b53e5cd62287a1
Reviewed-on: https://chromium-review.googlesource.com/1110182Reviewed-by: default avatarEmil A Eklund <eae@chromium.org>
Commit-Queue: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#570080}
parent 3737c14b
......@@ -550,8 +550,6 @@ crbug.com/591099 fast/text/whitespace/018.html [ Failure ]
crbug.com/591099 fast/text/whitespace/inline-whitespace-wrapping-3.html [ Failure ]
crbug.com/591099 fast/text/whitespace/inline-whitespace-wrapping-4.html [ Failure ]
crbug.com/591099 fast/text/whitespace/inline-whitespace-wrapping-5.html [ Failure ]
crbug.com/591099 fast/text/zero-width-characters-complex-script.html [ Failure ]
crbug.com/591099 fast/text/zero-width-characters.html [ Failure ]
crbug.com/591099 fast/writing-mode/auto-sizing-orthogonal-flows.html [ Failure ]
crbug.com/714962 fast/writing-mode/background-vertical-lr.html [ Failure ]
crbug.com/591099 fast/writing-mode/background-vertical-rl.html [ Failure ]
......
......@@ -35,7 +35,6 @@ function testWithZeroWidthSpace(a, b) {
failedCount += testChar(a, b, 0x202D);
failedCount += testChar(a, b, 0x202E);
failedCount += testChar(a, b, 0xFEFF);
failedCount += testChar(a, b, 0xFFFC);
return failedCount;
}
......
This test checks various characters that should always be zero width to ensure that they are. The WebKit text system ensures this in a way that's independent of the fonts installed on the system.
PASS: All the characters had zero width.
<head>
<!DOCTYPE html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<body>
<p>This test checks various characters that should always be zero width to ensure that they are.
The WebKit text system ensures this in a way that's independent of the fonts installed on the system.</p>
<p id="testArea"><span id="characters">ab</span></p>
<script>
function test()
{
if (window.testRunner)
testRunner.dumpAsText();
var testString = "";
testString += String.fromCharCode(0x200B);
testString += String.fromCharCode(0x200C);
testString += String.fromCharCode(0x200D);
testString += String.fromCharCode(0x200E);
testString += String.fromCharCode(0x200F);
testString += String.fromCharCode(0xFEFF);
testString += String.fromCharCode(0xFFFC);
var span = document.getElementById("characters");
var abWidth = span.offsetWidth;
run();
function run() {
var span = document.getElementById("characters");
var abWidth = span.offsetWidth;
test(() => {
span.firstChild.data = "a";
var aWidth = span.offsetWidth;
span.firstChild.data = "a" + testString + "b";
var abWithCharactersWidth = span.offsetWidth;
var testArea = document.getElementById("testArea");
testArea.parentNode.removeChild(testArea);
assert_greater_than(abWidth, aWidth, "Check width measurement");
}, "Check width measurement");
if (abWithCharactersWidth > abWidth)
result = "FAIL: One or more of the characters had a non-zero width.";
else if (abWidth > aWidth)
result = "PASS: All the characters had zero width.";
else
result = "FAIL: Width measurement seems to have failed.";
document.getElementById("result").firstChild.data = result;
const testCharacters = [
0x200B,
0x200C,
0x200D,
0x200E,
0x200F,
0xFEFF
];
for (let testCharacter of testCharacters) {
test(() => {
span.firstChild.data = "a" + String.fromCharCode(testCharacter) + "b";
var abWithCharactersWidth = span.offsetWidth;
assert_equals(abWithCharactersWidth, abWidth);
}, `U+${testCharacter.toString(16).toUpperCase()} should be zero-width`);
}
}
</script>
</head>
<body onload="test()">
<p>This test checks various characters that should always be zero width to ensure that they are.
The WebKit text system ensures this in a way that's independent of the fonts installed on the system.</p>
<p id="result">FAIL: Script did not run to completion.</p>
<p id="testArea"><span id="characters">ab</span></p>
</body>
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