mirror of
https://github.com/servo/servo.git
synced 2025-10-13 23:10:20 +01:00
- Update CSS tests to revision e05bfd5e30ed662c2f8a353577003f8eed230180. - Update web-platform-tests to revision a052787dd5c069a340031011196b73affbd68cd9.
34 lines
No EOL
1.2 KiB
HTML
34 lines
No EOL
1.2 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 if :dir() can work with other selectors correctly after a dynamic directionality change on specified divs." name="assert">
|
|
<link href="reference/dir-style-03-ref.htm" rel="match">
|
|
<style>
|
|
div { color: lime; text-align: left; }
|
|
:not(:dir(ltr)) + div { color: blue }
|
|
</style>
|
|
<script>
|
|
function switchDir()
|
|
{
|
|
theDiv = document.getElementById("div");
|
|
theDiv.offsetWidth; // ensure it's a dynamic change
|
|
if (theDiv.dir == "ltr") {
|
|
theDiv.dir = "rtl";
|
|
} else if (theDiv.dir == "rtl") {
|
|
theDiv.dir = "ltr";
|
|
}
|
|
|
|
document.documentElement.removeAttribute("class");
|
|
}
|
|
</script>
|
|
</head>
|
|
<body onload="switchDir()">
|
|
<div id="div" dir="ltr">This element is rtl.</div>
|
|
<div>This element has default direction.</div>
|
|
|
|
|
|
</body></html> |