mirror of
https://github.com/servo/servo.git
synced 2025-06-24 17:14:33 +01:00
- Update CSS tests to revision e05bfd5e30ed662c2f8a353577003f8eed230180. - Update web-platform-tests to revision a052787dd5c069a340031011196b73affbd68cd9.
46 lines
No EOL
1.6 KiB
HTML
46 lines
No EOL
1.6 KiB
HTML
<!DOCTYPE html>
|
|
<html class="reftest-wait"><head>
|
|
<meta charset="UTF-8">
|
|
<title>CSS Test: :dir() selector</title>
|
|
<link href="mailto:aschen@mozilla.com" rel="author" title="Astley Chen">
|
|
<link href="https://www.mozilla.org" rel="author" title="Mozilla">
|
|
<link href="https://drafts.csswg.org/selectors-4/#the-dir-pseudo" rel="help">
|
|
<meta content="Test checks :dir() basic functions when document directionality is dynamically changed from ltr to rtl." name="assert">
|
|
<link href="reference/dir-style-02-ref.htm" rel="match">
|
|
<style>
|
|
div { text-align: left; }
|
|
:dir(ltr) { color: blue }
|
|
:dir(rtl) { color: lime }
|
|
:dir(foopy) { color: red }
|
|
</style>
|
|
<script>
|
|
function switchDir()
|
|
{
|
|
// ensure it's a dynamic change
|
|
document.documentElement.getBoundingClientRect();
|
|
|
|
document.dir = "rtl";
|
|
|
|
document.documentElement.removeAttribute("class");
|
|
}
|
|
</script>
|
|
</head>
|
|
<body onload="switchDir()">
|
|
<div>This element has default direction.</div>
|
|
<div dir="ltr">This element is ltr.</div>
|
|
<div dir="rtl">This element is rtl.</div>
|
|
<div dir="ltr">
|
|
<div>This element should inherit ltr.</div>
|
|
<div dir="ltr">This element is ltr.</div>
|
|
<div dir="rtl">This element is rtl.</div>
|
|
</div>
|
|
<div dir="rtl">
|
|
<div>This element should inherit rtl.</div>
|
|
<div dir="ltr">This element is ltr.</div>
|
|
<div dir="rtl">This element is rtl.</div>
|
|
</div>
|
|
<div dir="foopy">This element has an invalid dir attribute and
|
|
should have default direction.</div>
|
|
|
|
|
|
</body></html> |