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 ] ...@@ -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-3.html [ Failure ]
crbug.com/591099 fast/text/whitespace/inline-whitespace-wrapping-4.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/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/591099 fast/writing-mode/auto-sizing-orthogonal-flows.html [ Failure ]
crbug.com/714962 fast/writing-mode/background-vertical-lr.html [ Failure ] crbug.com/714962 fast/writing-mode/background-vertical-lr.html [ Failure ]
crbug.com/591099 fast/writing-mode/background-vertical-rl.html [ Failure ] crbug.com/591099 fast/writing-mode/background-vertical-rl.html [ Failure ]
......
...@@ -35,7 +35,6 @@ function testWithZeroWidthSpace(a, b) { ...@@ -35,7 +35,6 @@ function testWithZeroWidthSpace(a, b) {
failedCount += testChar(a, b, 0x202D); failedCount += testChar(a, b, 0x202D);
failedCount += testChar(a, b, 0x202E); failedCount += testChar(a, b, 0x202E);
failedCount += testChar(a, b, 0xFEFF); failedCount += testChar(a, b, 0xFEFF);
failedCount += testChar(a, b, 0xFFFC);
return failedCount; 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> <script>
function test() run();
{ function run() {
if (window.testRunner) var span = document.getElementById("characters");
testRunner.dumpAsText(); var abWidth = span.offsetWidth;
var testString = ""; test(() => {
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;
span.firstChild.data = "a"; span.firstChild.data = "a";
var aWidth = span.offsetWidth; var aWidth = span.offsetWidth;
span.firstChild.data = "a" + testString + "b"; assert_greater_than(abWidth, aWidth, "Check width measurement");
var abWithCharactersWidth = span.offsetWidth; }, "Check width measurement");
var testArea = document.getElementById("testArea");
testArea.parentNode.removeChild(testArea);
if (abWithCharactersWidth > abWidth) const testCharacters = [
result = "FAIL: One or more of the characters had a non-zero width."; 0x200B,
else if (abWidth > aWidth) 0x200C,
result = "PASS: All the characters had zero width."; 0x200D,
else 0x200E,
result = "FAIL: Width measurement seems to have failed."; 0x200F,
0xFEFF
document.getElementById("result").firstChild.data = result; ];
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> </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> </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