Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move :dir()/:lang() pseudo-class tests to WPT
https://bugs.webkit.org/show_bug.cgi?id=250602 rdar://104245215 Reviewed by Simon Fraser. They're useful tests, and it would be nice to have for Interop 2023. - Renamed the tests to match naming in respective folders - Use the common ref-filled-green-100px-square.xht upstream file in <link rel="match"> to avoid duplication - Used testharness.js for some :lang() tests. - Also moved 2 :lang() tests that were in css/css-pseudo into css/selectors * LayoutTests/fast/css/dir-pseudo-container-query-expected.html: Removed. * LayoutTests/fast/css/dir-pseudo-container-query-invalidation-expected.html: Removed. * LayoutTests/fast/css/lang-pseudo-container-query-document-element-invalidation-expected.html: Removed. * LayoutTests/fast/css/lang-pseudo-container-query-invalidation-expected.html: Removed. * LayoutTests/fast/css/lang-pseudo-container-query-invalidation-xhtml-expected.html: Removed. * LayoutTests/fast/css/lang-pseudo-container-query-multiple-document-elements-invalidation-expected.html: Removed. * LayoutTests/fast/css/lang-pseudo-disconnected-expected.txt: Removed. * LayoutTests/fast/css/lang-pseudo-disconnected.html: Removed. * LayoutTests/fast/css/lang-selector-empty-attribute-expected.txt: Removed. * LayoutTests/fast/css/lang-selector-empty-attribute.xhtml: Removed. * LayoutTests/imported/w3c/web-platform-tests/css/selectors/dir-pseudo-in-has-expected.xht: Added. * LayoutTests/imported/w3c/web-platform-tests/css/selectors/dir-pseudo-in-has.html: Renamed from LayoutTests/fast/css/dir-pseudo-container-query.html. * LayoutTests/imported/w3c/web-platform-tests/css/selectors/i18n/lang-pseudo-class-across-shadow-boundaries-expected.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/lang-pseudo-class-across-shadow-boundaries-expected.html. * LayoutTests/imported/w3c/web-platform-tests/css/selectors/i18n/lang-pseudo-class-across-shadow-boundaries-ref.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/lang-pseudo-class-across-shadow-boundaries-ref.html. * LayoutTests/imported/w3c/web-platform-tests/css/selectors/i18n/lang-pseudo-class-across-shadow-boundaries.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/lang-pseudo-class-across-shadow-boundaries.html. * LayoutTests/imported/w3c/web-platform-tests/css/selectors/i18n/lang-pseudo-class-disconnected-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/css/selectors/i18n/lang-pseudo-class-disconnected.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/selectors/i18n/lang-pseudo-class-empty-attribute-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/css/selectors/i18n/lang-pseudo-class-empty-attribute.xhtml: Added. * LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/dir-pseudo-class-in-has-expected.xht: Added. * LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/dir-pseudo-class-in-has.html: Renamed from LayoutTests/fast/css/dir-pseudo-container-query-invalidation.html. * LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/lang-pseudo-class-in-has-document-element-expected.xht: Added. * LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/lang-pseudo-class-in-has-document-element.html: Renamed from LayoutTests/fast/css/lang-pseudo-container-query-document-element-invalidation.html. * LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/lang-pseudo-class-in-has-expected.xht: Added. * LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/lang-pseudo-class-in-has-multiple-document-elements-expected.xht: Added. * LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/lang-pseudo-class-in-has-multiple-document-elements.html: Renamed from LayoutTests/fast/css/lang-pseudo-container-query-multiple-document-elements-invalidation.html. * LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/lang-pseudo-class-in-has-xhtml-expected.xht: Added. * LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/lang-pseudo-class-in-has-xhtml.xhtml: Renamed from LayoutTests/fast/css/lang-pseudo-container-query-invalidation-xhtml.xhtml. * LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/lang-pseudo-class-in-has.html: Renamed from LayoutTests/fast/css/lang-pseudo-container-query-invalidation.html. Canonical link: https://commits.webkit.org/258903@main
- Loading branch information
Showing
29 changed files
with
217 additions
and
121 deletions.
There are no files selected for viewing
6 changes: 0 additions & 6 deletions
6
LayoutTests/fast/css/dir-pseudo-container-query-expected.html
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
LayoutTests/fast/css/dir-pseudo-container-query-invalidation-expected.html
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
LayoutTests/fast/css/lang-pseudo-container-query-document-element-invalidation-expected.html
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
LayoutTests/fast/css/lang-pseudo-container-query-invalidation-expected.html
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
LayoutTests/fast/css/lang-pseudo-container-query-invalidation-xhtml-expected.html
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
...ast/css/lang-pseudo-container-query-multiple-document-elements-invalidation-expected.html
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
LayoutTests/fast/css/lang-pseudo-disconnected-expected.txt
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
LayoutTests/fast/css/lang-selector-empty-attribute-expected.txt
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
LayoutTests/imported/w3c/web-platform-tests/css/selectors/dir-pseudo-in-has-expected.xht
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
<html xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
<title>CSS Reftest Reference</title> | ||
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> | ||
<style type="text/css"><![CDATA[ | ||
div | ||
{ | ||
background-color: green; | ||
height: 100px; | ||
width: 100px; | ||
} | ||
]]></style> | ||
</head> | ||
<body> | ||
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p> | ||
<div></div> | ||
</body> | ||
</html> |
7 changes: 7 additions & 0 deletions
7
.../fast/css/dir-pseudo-container-query.html → ...ests/css/selectors/dir-pseudo-in-has.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions
3
...ted/w3c/web-platform-tests/css/selectors/i18n/lang-pseudo-class-disconnected-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
PASS :lang pseudo class should work in a disconnected subtree | ||
|
24 changes: 24 additions & 0 deletions
24
...ts/imported/w3c/web-platform-tests/css/selectors/i18n/lang-pseudo-class-disconnected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<link rel="help" href="https://drafts.csswg.org/selectors/#lang-pseudo"/> | ||
<body> | ||
<div id="container" lang="zh"><span></span></div> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script> | ||
test(() => { | ||
let target = container.querySelector('span'); | ||
assert_true(target.matches(":lang(zh)")); | ||
target.parentNode.remove(); | ||
assert_true(target.matches(":lang(zh)")); | ||
|
||
const anotherContainer = document.createElement('div'); | ||
anotherContainer.innerHTML = '<div lang="fr"><span></span></div>'; | ||
target = anotherContainer.querySelector('span'); | ||
assert_true(target.matches(":lang(fr)")); | ||
document.body.append(target.parentNode); | ||
assert_true(target.matches(":lang(fr)")); | ||
}, ":lang pseudo class should work in a disconnected subtree"); | ||
</script> | ||
</body> | ||
</html> |
5 changes: 5 additions & 0 deletions
5
.../w3c/web-platform-tests/css/selectors/i18n/lang-pseudo-class-empty-attribute-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Tests if empty language declarations are supported | ||
|
||
|
||
PASS Test if empty language attributes are supported | ||
|
26 changes: 26 additions & 0 deletions
26
...mported/w3c/web-platform-tests/css/selectors/i18n/lang-pseudo-class-empty-attribute.xhtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<html xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
<link rel="help" href="https://drafts.csswg.org/selectors/#lang-pseudo"/> | ||
<style type="text/css"> | ||
span {background: white;display:none} | ||
span:lang(de) {background: red} | ||
</style> | ||
</head> | ||
<body> | ||
<p>Tests if empty language declarations are supported</p> | ||
<p xml:lang="de"> | ||
<span lang="" id="emptyLang"/> | ||
<span xml:lang="" id="emptyXmlLang"/> | ||
<span id="noLang"/> | ||
</p> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script> | ||
test(() => { | ||
assert_equals(getComputedStyle(document.getElementById("emptyLang")).backgroundColor, "rgb(255, 255, 255)"); | ||
assert_equals(getComputedStyle(document.getElementById("emptyXmlLang")).backgroundColor, "rgb(255, 255, 255)"); | ||
assert_equals(getComputedStyle(document.getElementById("noLang")).backgroundColor, "rgb(255, 0, 0)"); | ||
}, "Test if empty language attributes are supported"); | ||
</script> | ||
</body> | ||
</html> |
19 changes: 19 additions & 0 deletions
19
...ed/w3c/web-platform-tests/css/selectors/invalidation/dir-pseudo-class-in-has-expected.xht
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
<html xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
<title>CSS Reftest Reference</title> | ||
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> | ||
<style type="text/css"><![CDATA[ | ||
div | ||
{ | ||
background-color: green; | ||
height: 100px; | ||
width: 100px; | ||
} | ||
]]></style> | ||
</head> | ||
<body> | ||
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p> | ||
<div></div> | ||
</body> | ||
</html> |
7 changes: 7 additions & 0 deletions
7
...-pseudo-container-query-invalidation.html → ...invalidation/dir-pseudo-class-in-has.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...m-tests/css/selectors/invalidation/lang-pseudo-class-in-has-document-element-expected.xht
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
<html xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
<title>CSS Reftest Reference</title> | ||
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> | ||
<style type="text/css"><![CDATA[ | ||
div | ||
{ | ||
background-color: green; | ||
height: 100px; | ||
width: 100px; | ||
} | ||
]]></style> | ||
</head> | ||
<body> | ||
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p> | ||
<div></div> | ||
</body> | ||
</html> |
7 changes: 6 additions & 1 deletion
7
...-query-document-element-invalidation.html → ...pseudo-class-in-has-document-element.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...d/w3c/web-platform-tests/css/selectors/invalidation/lang-pseudo-class-in-has-expected.xht
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
<html xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
<title>CSS Reftest Reference</title> | ||
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> | ||
<style type="text/css"><![CDATA[ | ||
div | ||
{ | ||
background-color: green; | ||
height: 100px; | ||
width: 100px; | ||
} | ||
]]></style> | ||
</head> | ||
<body> | ||
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p> | ||
<div></div> | ||
</body> | ||
</html> |
19 changes: 19 additions & 0 deletions
19
...s/selectors/invalidation/lang-pseudo-class-in-has-multiple-document-elements-expected.xht
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
<html xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
<title>CSS Reftest Reference</title> | ||
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> | ||
<style type="text/css"><![CDATA[ | ||
div | ||
{ | ||
background-color: green; | ||
height: 100px; | ||
width: 100px; | ||
} | ||
]]></style> | ||
</head> | ||
<body> | ||
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p> | ||
<div></div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...web-platform-tests/css/selectors/invalidation/lang-pseudo-class-in-has-xhtml-expected.xht
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
<html xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
<title>CSS Reftest Reference</title> | ||
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> | ||
<style type="text/css"><![CDATA[ | ||
div | ||
{ | ||
background-color: green; | ||
height: 100px; | ||
width: 100px; | ||
} | ||
]]></style> | ||
</head> | ||
<body> | ||
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p> | ||
<div></div> | ||
</body> | ||
</html> |
Oops, something went wrong.