mirror of
https://github.com/servo/servo.git
synced 2025-06-23 16:44:33 +01:00
- Update CSS tests to revision e05bfd5e30ed662c2f8a353577003f8eed230180. - Update web-platform-tests to revision a052787dd5c069a340031011196b73affbd68cd9.
41 lines
No EOL
1.4 KiB
HTML
41 lines
No EOL
1.4 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 on runtime added elements." name="assert">
|
|
<link href="reference/dir-style-04-ref.htm" rel="match">
|
|
<style>
|
|
:dir(ltr) { color: blue }
|
|
:dir(rtl) { color: lime }
|
|
div { text-align: left; }
|
|
</style>
|
|
<script>
|
|
function appendChildren(e)
|
|
{
|
|
// ensure it's a dynamic change
|
|
document.documentElement.getBoundingClientRect();
|
|
|
|
var x = document.createElement("span");
|
|
x.innerHTML = "This span should inherit dir from the parent. ";
|
|
|
|
var y = document.createElement("span");
|
|
y.innerHTML = "This span should inherit dir from the grandparent.";
|
|
|
|
var div = document.getElementById(e);
|
|
|
|
x.appendChild(y);
|
|
div.appendChild(x);
|
|
|
|
document.documentElement.removeAttribute("class");
|
|
}
|
|
</script>
|
|
</head>
|
|
<body onload="appendChildren('d1');appendChildren('d2');">
|
|
<div id="d1" dir="ltr">This element is ltr. </div>
|
|
<div id="d2" dir="rtl">This element is rtl. </div>
|
|
|
|
|
|
</body></html> |