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

Side by Side Diff: third_party/WebKit/LayoutTests/external/csswg-test/vendor-imports/mozilla/mozilla-central-reftests/selectors4/dir-style-01b.html

Issue 2783663002: [selectors-4] Import more tests from W3C repository (Closed)
Patch Set: Created 3 years, 8 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html class="reftest-wait">
3 <head>
4 <meta charset="UTF-8">
5 <title>CSS Test: :dir() selector</title>
6 <link rel="author" title="Astley Chen" href="mailto:aschen@mozilla.com">
7 <link rel="author" title="Mozilla" href="https://www.mozilla.org">
8 <link rel="help" href="https://drafts.csswg.org/selectors-4/#the-dir-pseudo" >
9 <meta name="assert" content="Test checks :dir() basic functions after dynami c directionality change on elements.">
10 <link rel="match" href="dir-style-01-ref.html">
11 <style>
12 div { text-align: left; }
13 :dir(ltr) { color: blue }
14 :dir(rtl) { color: lime }
15 :dir(foopy) { color: red }
16 </style>
17 <script>
18 function switchDir()
19 {
20 divs = document.getElementsByTagName("div");
21 divs[0].offsetWidth; // ensure it's a dynamic change
22 for (var i = 0; i < divs.length; ++i) {
23 theDiv = divs[i];
24 if (theDiv.dir == "ltr") {
25 theDiv.dir = "rtl";
26 } else if (theDiv.dir == "rtl") {
27 theDiv.dir = "ltr";
28 }
29 }
30
31 document.documentElement.removeAttribute("class");
32 }
33 </script>
34 </head>
35 <body onload="switchDir()">
36 <div>This element has default direction.</div>
37 <div dir="rtl">This element is ltr.</div>
38 <div dir="ltr">This element is rtl.</div>
39 <div dir="rtl">
40 <div>This element should inherit ltr.</div>
41 <div dir="rtl">This element is ltr.</div>
42 <div dir="ltr">This element is rtl.</div>
43 <div><span>Every <span>word <span>in <span>this <span>element <span>should <span>inherit <span>ltr</span></span></span></span></span></span></span></span> .</div>
44 </div>
45 <div dir="ltr">
46 <div>This element should inherit rtl.</div>
47 <div dir="rtl">This element is ltr.</div>
48 <div dir="ltr">This element is rtl.</div>
49 <div><span>Every <span>word <span>in <span>this <span>element <span>should <span>inherit <span>rtl</span></span></span></span></span></span></span></span> .</div>
50 </div>
51 <div dir="foopy">This element has an invalid dir attribute and
52 should have default direction.</div>
53 </body>
54 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698