Commit d30e48a5 authored by Yoshifumi Inoue's avatar Yoshifumi Inoue Committed by Commit Bot

Add a new test case for Element#innerText in Web Platform Test

This patch introduces a new test case for Element#innerText to verify that
result has a collapsed whitespace due by soft line break.

In the test case, the layout object associated to space character between
<span> elements, doesn't have neither InlineTextBox and NGPhysicalTextFragment.
Thus, Element#innerText implementation should detect this and handle it.

Bug: 651764
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng
Change-Id: Ia25d06a2a3fe993f2e966188b81f9e9c1d0fe982
Reviewed-on: https://chromium-review.googlesource.com/1124264Reviewed-by: default avatarKent Tamura <tkent@chromium.org>
Commit-Queue: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#572164}
parent 5b68db8c
This is a testharness.js-based test. This is a testharness.js-based test.
Found 213 tests; 135 PASS, 78 FAIL, 0 TIMEOUT, 0 NOTRUN. Found 214 tests; 136 PASS, 78 FAIL, 0 TIMEOUT, 0 NOTRUN.
PASS Simplest possible test ("<div>abc") PASS Simplest possible test ("<div>abc")
PASS Leading whitespace removed ("<div> abc") PASS Leading whitespace removed ("<div> abc")
PASS Trailing whitespace removed ("<div>abc ") PASS Trailing whitespace removed ("<div>abc ")
...@@ -37,6 +37,7 @@ PASS Whitespace collapses across element boundaries ("<div><span>abc </span> def ...@@ -37,6 +37,7 @@ PASS Whitespace collapses across element boundaries ("<div><span>abc </span> def
PASS Whitespace collapses across element boundaries ("<div><span>abc </span><span></span> def") PASS Whitespace collapses across element boundaries ("<div><span>abc </span><span></span> def")
FAIL Whitespace collapses across element boundaries ("<div><span>abc </span><span style='white-space:pre'></span> def") assert_equals: expected "abc def" but got "abc def" FAIL Whitespace collapses across element boundaries ("<div><span>abc </span><span style='white-space:pre'></span> def") assert_equals: expected "abc def" but got "abc def"
PASS Soft line breaks ignored ("<div style='width:0'>abc def") PASS Soft line breaks ignored ("<div style='width:0'>abc def")
PASS Whitespace text node preserved ("<div style='width:0'><span>abc</span> <span>def</span>")
FAIL ::first-line styles applied ("<div class='first-line-uppercase' style='width:0'>abc def") assert_equals: expected "ABC def" but got "abc def" FAIL ::first-line styles applied ("<div class='first-line-uppercase' style='width:0'>abc def") assert_equals: expected "ABC def" but got "abc def"
PASS ::first-letter styles applied ("<div class='first-letter-uppercase' style='width:0'>abc def") PASS ::first-letter styles applied ("<div class='first-letter-uppercase' style='width:0'>abc def")
PASS ::first-letter float ignored ("<div class='first-letter-float' style='width:0'>abc def") PASS ::first-letter float ignored ("<div class='first-letter-float' style='width:0'>abc def")
......
...@@ -56,6 +56,7 @@ testText("<div><span>abc </span><span style='white-space:pre'></span> def", "abc ...@@ -56,6 +56,7 @@ testText("<div><span>abc </span><span style='white-space:pre'></span> def", "abc
/**** Soft line breaks ****/ /**** Soft line breaks ****/
testText("<div style='width:0'>abc def", "abc def", "Soft line breaks ignored"); testText("<div style='width:0'>abc def", "abc def", "Soft line breaks ignored");
testText("<div style='width:0'><span>abc</span> <span>def</span>", "abc def", "Whitespace text node preserved");
/**** first-line/first-letter ****/ /**** first-line/first-letter ****/
......
This is a testharness.js-based test. This is a testharness.js-based test.
Found 213 tests; 140 PASS, 73 FAIL, 0 TIMEOUT, 0 NOTRUN. Found 214 tests; 141 PASS, 73 FAIL, 0 TIMEOUT, 0 NOTRUN.
PASS Simplest possible test ("<div>abc") PASS Simplest possible test ("<div>abc")
PASS Leading whitespace removed ("<div> abc") PASS Leading whitespace removed ("<div> abc")
PASS Trailing whitespace removed ("<div>abc ") PASS Trailing whitespace removed ("<div>abc ")
...@@ -37,6 +37,7 @@ PASS Whitespace collapses across element boundaries ("<div><span>abc </span> def ...@@ -37,6 +37,7 @@ PASS Whitespace collapses across element boundaries ("<div><span>abc </span> def
PASS Whitespace collapses across element boundaries ("<div><span>abc </span><span></span> def") PASS Whitespace collapses across element boundaries ("<div><span>abc </span><span></span> def")
PASS Whitespace collapses across element boundaries ("<div><span>abc </span><span style='white-space:pre'></span> def") PASS Whitespace collapses across element boundaries ("<div><span>abc </span><span style='white-space:pre'></span> def")
PASS Soft line breaks ignored ("<div style='width:0'>abc def") PASS Soft line breaks ignored ("<div style='width:0'>abc def")
PASS Whitespace text node preserved ("<div style='width:0'><span>abc</span> <span>def</span>")
FAIL ::first-line styles applied ("<div class='first-line-uppercase' style='width:0'>abc def") assert_equals: expected "ABC def" but got "abc def" FAIL ::first-line styles applied ("<div class='first-line-uppercase' style='width:0'>abc def") assert_equals: expected "ABC def" but got "abc def"
PASS ::first-letter styles applied ("<div class='first-letter-uppercase' style='width:0'>abc def") PASS ::first-letter styles applied ("<div class='first-letter-uppercase' style='width:0'>abc def")
PASS ::first-letter float ignored ("<div class='first-letter-float' style='width:0'>abc def") PASS ::first-letter float ignored ("<div class='first-letter-float' style='width:0'>abc def")
......
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