Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: third_party/WebKit/LayoutTests/fast/selectors/dir-pseudo-class.html

Issue 1614343002: Implement CSS4 pseudo-class :dir() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated layout tests Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/fast/selectors/dir-pseudo-class.html
diff --git a/third_party/WebKit/LayoutTests/fast/selectors/dir-pseudo-class.html b/third_party/WebKit/LayoutTests/fast/selectors/dir-pseudo-class.html
new file mode 100644
index 0000000000000000000000000000000000000000..6a4badb446dae4fadea80817e85475d963335478
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/selectors/dir-pseudo-class.html
@@ -0,0 +1,39 @@
+<html>
+<head>
+<script src="../../resources/js-test.js"></script>
+<style>
+ :dir(RTL) {
+ color: red;
+ }
+ :dir(ltr) {
+ color: green;
+ }
+ :dir( abc) {
+ color: yellow;
+ }
+ :dir(a,b) {
+ color: blue;
+ }
+</style>
+</head>
+<body>
+<div dir="auto">
+ <label id="label1">one</label>
+</div>
+<div>
+ <label id="label2">two</label>
+</div>
+<div dir="rtl">
+ <label id="label3">three</label>
+</div>
+<script>
+debug('Checks total number of valid rules');
+shouldBe('document.styleSheets[0].cssRules.length', '3');
+
+debug('Checks direction styles are applied correctly based on the computed direction value for each element');
+shouldBeEqualToString('getComputedStyle(document.getElementById("label1")).color', 'rgb(0, 128, 0)');
+shouldBeEqualToString('getComputedStyle(document.getElementById("label2")).color', 'rgb(0, 128, 0)');
+shouldBeEqualToString('getComputedStyle(document.getElementById("label3")).color', 'rgb(255, 0, 0)');
+</script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698