Skip to content
Permalink
Browse files
Import text-indent tests from WPT
https://bugs.webkit.org/show_bug.cgi?id=240835

Patch by Kiet Ho <tho22@apple.com> on 2022-05-24
Reviewed by Tim Nguyen.

Imported directory css/css-text/text-indent from WPT commit
2afc2f61703755c91daaf1a7ddf9ddf868c76699. This includes tests migrated from WebKit
to WPT in PR web-platform-tests/wpt#34153.

* LayoutTests/TestExpectations:
* LayoutTests/fast/css3-text/css3-text-indent/text-indent-each-line-hanging.html: Removed.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-indent/anonymous-flex-item-001-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-indent/anonymous-flex-item-001.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-indent/anonymous-grid-item-001-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-indent/anonymous-grid-item-001.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-indent/text-indent-each-line-hanging-expected.html: Renamed from LayoutTests/fast/css3-text/css3-text-indent/text-indent-each-line-hanging-expected.html.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-indent/text-indent-each-line-hanging.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-indent/text-indent-percentage-002.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-indent/text-indent-percentage-003.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-indent/text-indent-percentage-004.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-indent/text-indent-with-absolute-pos-child-expected.html: Renamed from LayoutTests/fast/css3-text/css3-text-indent/text-indent-with-absolute-pos-child-expected.html.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-indent/text-indent-with-absolute-pos-child.html: Renamed from LayoutTests/fast/css3-text/css3-text-indent/text-indent-with-absolute-pos-child.html.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/text-indent/w3c-import.log:

Canonical link: https://commits.webkit.org/250924@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@294756 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
tuankiet65 authored and webkit-commit-queue committed May 24, 2022
1 parent c3e23da commit 0e3a57a9f32f8eeccdec641ffb5d51ed03fe6e0c
Showing 14 changed files with 235 additions and 90 deletions.
@@ -2648,6 +2648,9 @@ webkit.org/b/214290 imported/w3c/web-platform-tests/css/css-text/text-encoding/s
webkit.org/b/214290 imported/w3c/web-platform-tests/css/css-text/text-encoding/shaping-tatweel-002.html [ ImageOnlyFailure ]
webkit.org/b/214290 imported/w3c/web-platform-tests/css/css-text/text-encoding/shaping-tatweel-003.html [ ImageOnlyFailure ]
webkit.org/b/214290 imported/w3c/web-platform-tests/css/css-text/text-indent/text-indent-tab-positions-001.html [ ImageOnlyFailure ]
webkit.org/b/240837 imported/w3c/web-platform-tests/css/css-text/text-indent/anonymous-flex-item-001.html [ ImageOnlyFailure ]
webkit.org/b/240837 imported/w3c/web-platform-tests/css/css-text/text-indent/anonymous-grid-item-001.html [ ImageOnlyFailure ]
webkit.org/b/240731 imported/w3c/web-platform-tests/css/css-text/text-indent/text-indent-each-line-hanging.html [ ImageOnlyFailure ]
webkit.org/b/183258 imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-001.html [ ImageOnlyFailure ]
webkit.org/b/214290 imported/w3c/web-platform-tests/css/css-text/text-justify/text-justify-006.html [ ImageOnlyFailure ]
webkit.org/b/183258 imported/w3c/web-platform-tests/css/css-text/text-transform/text-transform-capitalize-018.html [ ImageOnlyFailure Pass ]
@@ -2911,7 +2914,6 @@ imported/w3c/web-platform-tests/secure-contexts/basic-popup-and-iframe-tests.htt
# CSS3 Text support is not yet enabled (needs ENABLE_CSS3_TEXT).
webkit.org/b/76173 fast/css3-text/css3-text-align-last [ Skip ]
webkit.org/b/99945 fast/css3-text/css3-text-justify [ Skip ]
webkit.org/b/112755 fast/css3-text/css3-text-indent/text-indent-each-line-hanging.html [ Skip ]

# Link prefetch is disabled by default (needs ENABLE_LINK_PREFETCH)
webkit.org/b/3652 fast/dom/HTMLLinkElement/link-and-subresource-test.html [ Skip ]

This file was deleted.

@@ -0,0 +1,26 @@
<!DOCTYPE html>
<title>text-indent in anonymous flex and grid items</title>
<meta name="flags" content="ahem">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
<style>
main {
font: 10px/1 Ahem;
color: orange;
}
</style>

<p>
Pass conditions:
<ul>
<li>The top left quadrant of the black-bordered rectangle is white.
<li>Only the top left quadrant of the black-bordered rectangle is white.
<li>The rest of the black-bordered rectangle is orange.
<li>No orange is outside the black-bordered rectangle.
</ul>
</p>

<main>
<div style="text-indent: 50px; border: 3px solid black; width: 100px;">
ABCDE ABCDEABCDE
</div>
</main>
@@ -0,0 +1,33 @@
<!DOCTYPE html>
<title>text-indent in anonymous flex and grid items</title>
<link rel="author" title="David Grogan" href="mailto:dgrogan@chromium.org">
<link rel="match" href="reference/anonymous-flex-grid-item-001-ref.html">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#text-indent-property" title="Anonymous flex/grid items aren't anonymous block boxes.">
<link rel="help" href="https://crbug.com/1159311">
<meta name="flags" content="ahem">
<meta name="assert" content="text-indent applies to the first line of an anonymous flex item that is not the first item in the flex/grid container.">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
<style>
main {
font: 10px/1 Ahem;
color: orange;
}
</style>

<p>
Pass conditions:
<ul>
<li>The top left quadrant of the black-bordered rectangle is white.
<li>Only the top left quadrant of the black-bordered rectangle is white.
<li>The rest of the black-bordered rectangle is orange.
<li>No orange is outside the black-bordered rectangle.
</ul>
</p>

<main>
<div style="text-indent: 50px; border: 3px solid black; width: 100px; display: flex;">
<div style="width: 0px;"></div>
ABCDE
ABCDEABCDE
</div>
</main>
@@ -0,0 +1,26 @@
<!DOCTYPE html>
<title>text-indent in anonymous flex and grid items</title>
<meta name="flags" content="ahem">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
<style>
main {
font: 10px/1 Ahem;
color: orange;
}
</style>

<p>
Pass conditions:
<ul>
<li>The top left quadrant of the black-bordered rectangle is white.
<li>Only the top left quadrant of the black-bordered rectangle is white.
<li>The rest of the black-bordered rectangle is orange.
<li>No orange is outside the black-bordered rectangle.
</ul>
</p>

<main>
<div style="text-indent: 50px; border: 3px solid black; width: 100px;">
ABCDE ABCDEABCDE
</div>
</main>
@@ -0,0 +1,33 @@
<!DOCTYPE html>
<title>text-indent in anonymous flex and grid items</title>
<link rel="author" title="David Grogan" href="mailto:dgrogan@chromium.org">
<link rel="match" href="reference/anonymous-flex-grid-item-001-ref.html">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#text-indent-property" title="Anonymous flex/grid items aren't anonymous block boxes.">
<link rel="help" href="https://crbug.com/1159311">
<meta name="flags" content="ahem">
<meta name="assert" content="text-indent applies to the first line of an anonymous grid item that is not the first item in the flex/grid container.">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
<style>
main {
font: 10px/1 Ahem;
color: orange;
}
</style>

<p>
Pass conditions:
<ul>
<li>The top left quadrant of the black-bordered rectangle is white.
<li>Only the top left quadrant of the black-bordered rectangle is white.
<li>The rest of the black-bordered rectangle is orange.
<li>No orange is outside the black-bordered rectangle.
</ul>
</p>

<main>
<div style="text-indent: 50px; border: 3px solid black; width: 100px; display: grid; grid-template-columns: auto auto;">
<div style="width: 0px;"></div>
ABCDE
ABCDEABCDE
</div>
</main>
@@ -1,12 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<title>[css3-text] text-indent</title>
<meta charset="utf-8">
<title>text-indent 'each-line' and 'hanging' modifiers</title>

<link rel="stylesheet" href="/fonts/ahem.css" />
<style>
div { width:80px; font: 10px Ahem; background-color:lightgray; }
.indent { color: blue; padding-left:4em; }
</style>
</head>
<body>
All black boxes should be left-aligned. All blue boxes should be right-aligned.

<div>
<span class="indent">xxxx</span><br>xxxx<br>xxxx
</div>
@@ -0,0 +1,64 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>text-indent 'each-line' and 'hanging' modifiers</title>
<link rel="author" title="Jaehun Lim" href="mailto:ljaehun.lim@samsung.com">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#text-indent-property">
<link rel="match" href="reference/text-indent-each-line-hanging-ref.html">
<meta name="assert" content="'each-line' and 'hanging' properly works">

<link rel="stylesheet" href="/fonts/ahem.css" />
<style>
div { width:80px; font: 10px Ahem; background-color:lightgray; }
.normal { text-indent: 4em; }
.eachline { text-indent: 4em each-line; }
.hanging { text-indent: 4em hanging; }
.eachlinehanging { text-indent: 4em each-line hanging; }
.indent { color: blue; }
</style>
</head>
<body>
All black boxes should be left-aligned. All blue boxes should be right-aligned.

<!-- normal text-indent -->
<div class="normal">
<span class="indent">xxxx</span> xxxx<br>xxxx
</div>
<br>
<!-- each-line with a soft wrap break -->
<div class="eachline">
<span class="indent">xxxx</span> xxxx xxxx
</div>
<br>
<!-- each-line with a forced line break -->
<div class="eachline">
<span class="indent">xxxx</span><br><span class="indent">xxxx</span><br><span class="indent">xxxx</span>
</div>
<br>
<!-- each-line with a soft wrap break and a forced line break -->
<div class="eachline">
<span class="indent">xxxx</span> xxxx<br><span class="indent">xxxx</span>
</div>
<br>
<!-- normal text-indent with hanging -->
<div class="hanging">
xxxx <span class="indent">xxxx</span><br><span class="indent">xxxx</span>
</div>
<br>
<!-- each-line and hanging with a soft wrap break -->
<div class="eachlinehanging">
xxxx <span class="indent">xxxx</span> <span class="indent">xxxx</span>
</div>
<br>
<!-- each-line and hanging with a forced line break -->
<div class="eachlinehanging">
xxxx<br>xxxx<br>xxxx
</div>
<br>
<!-- each-line and hanging with a soft wrap break and a forced line break -->
<div class="eachlinehanging">
xxxx <span class="indent">xxxx</span><br>xxxx
</div>
</body>
</html>
@@ -4,7 +4,6 @@
<title>CSS Text Test: text-indent percentage resolution basis</title>
<link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#text-indent-property">
<meta name="flags" content="">
<link rel="match" href="reference/text-indent-percentage-002-ref.html">
<meta name="assert" content="Percentages in text-indent refer to width of the element's content box">
<style>
@@ -4,7 +4,6 @@
<title>CSS Text Test: text-indent percentage resolution basis</title>
<link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#text-indent-property">
<meta name="flags" content="">
<link rel="match" href="reference/text-indent-percentage-002-ref.html">
<meta name="assert" content="Percentages in text-indent refer to width of the element's content box">
<style>
@@ -4,7 +4,6 @@
<title>CSS Text Test: text-indent percentage resolution basis, in a calc expressiong</title>
<link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#text-indent-property">
<meta name="flags" content="">
<link rel="match" href="reference/text-indent-percentage-002-ref.html">
<meta name="assert" content="Percentages in text-indent refer to width of the element's content box, when used in a calc expression">
<style>
@@ -1,12 +1,15 @@
<!DOCTYPE HTML>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>This tests that first line text-indent is applied properly when the child is a statically positioned out-of-flow renderer.</title>

<link rel="stylesheet" href="/fonts/ahem.css" />
<style>
body {
margin: 40px;
margin: 40px;
}

.container {
display: block;
background-color: green;
@@ -55,4 +58,4 @@
</div>

</body>
</html>
</html>
@@ -1,29 +1,35 @@
<!DOCTYPE HTML>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>This tests that first line text-indent is applied properly when the child is a statically positioned out-of-flow renderer.</title>
<link rel="help" href="https://drafts.csswg.org/css-text-3/#text-indent-property">
<link rel="match" href="reference/text-indent-with-absolute-pos-child-ref.html">
<meta name="assert" content="First line text-indent is applied properly when the child is a statically positioned out-of-flow renderer.">

<link rel="stylesheet" href="/fonts/ahem.css" />
<style>
body {
margin: 40px;
}
.container {
display: block;
background-color: green;
width: 100px;
height: 20px;
color: green;
font-family: Ahem;
font-size: 10px;
}
body {
margin: 40px;
}

.container {
display: block;
background-color: green;
width: 100px;
height: 20px;
color: green;
font-family: Ahem;
font-size: 10px;
}

.inner {
display: inline;
position: absolute;
background-color: blue;
width: 20px;
height: 20px;
}
.inner {
display: inline;
position: absolute;
background-color: blue;
width: 20px;
height: 20px;
}
</style>
</head>
<body>
@@ -56,4 +62,4 @@
</div>

</body>
</html>
</html>

0 comments on commit 0e3a57a

Please sign in to comment.