-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added 2 tests to cover for issue 3066
- Loading branch information
Showing
2 changed files
with
118 additions
and
0 deletions.
There are no files selected for viewing
59 changes: 59 additions & 0 deletions
59
css/css-writing-modes/wm-propagation-body-computed-direction-001.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<!DOCTYPE html> | ||
|
||
<meta charset="UTF-8"> | ||
|
||
<title>CSS Writing Modes Test: computed 'direction' of root element when 'writing-mode' for <body> propagates to viewport</title> | ||
|
||
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> | ||
<link rel="help" href="https://www.w3.org/TR/css-writing-modes-3/#principal-flow"> | ||
<!-- | ||
Issue 3066: [css-writing-modes] Does vertical writing mode of an HTML body | ||
element cause an orthogonal flow? | ||
https://github.com/w3c/csswg-drafts/issues/3066 | ||
--> | ||
|
||
<meta name="flags" content=""> | ||
<meta name="assert" content="When the root element has a <body> child element, then the principal writing mode is instead taken from the values of 'writing-mode' and 'direction' on such first child element instead of taken from the root element. In this test, a small script verifies that the computed value of 'direction' of the root element itself is not affected by such propagation."> | ||
|
||
<!-- | ||
This test *only* verifies the computed value of 'direction' of the | ||
root element. | ||
This test does *not* verify if the 'writing-mode' value of | ||
the body element propagates to the root element. | ||
--> | ||
|
||
<script src="/resources/testharness.js"></script> | ||
|
||
<script src="/resources/testharnessreport.js"></script> | ||
|
||
<style> | ||
html | ||
{ | ||
direction: rtl; | ||
writing-mode: vertical-lr; | ||
} | ||
|
||
body | ||
{ | ||
direction: ltr; | ||
writing-mode: vertical-rl; | ||
} | ||
</style> | ||
|
||
<script> | ||
function startTesting() | ||
{ | ||
|
||
test(function() | ||
{ | ||
|
||
assert_equals(getComputedStyle(document.documentElement).direction, "rtl" ); | ||
|
||
}, "First test on computed value of 'direction' of root element."); | ||
|
||
} | ||
|
||
startTesting(); | ||
|
||
</script> |
59 changes: 59 additions & 0 deletions
59
css/css-writing-modes/wm-propagation-body-computed-direction-002.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<!DOCTYPE html> | ||
|
||
<meta charset="UTF-8"> | ||
|
||
<title>CSS Writing Modes Test: computed 'direction' of root element when 'writing-mode' for <body> propagates to viewport</title> | ||
|
||
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> | ||
<link rel="help" href="https://www.w3.org/TR/css-writing-modes-3/#principal-flow"> | ||
<!-- | ||
Issue 3066: [css-writing-modes] Does vertical writing mode of an HTML body | ||
element cause an orthogonal flow? | ||
https://github.com/w3c/csswg-drafts/issues/3066 | ||
--> | ||
|
||
<meta name="flags" content=""> | ||
<meta name="assert" content="When the root element has a <body> child element, then the principal writing mode is instead taken from the values of 'writing-mode' and 'direction' on such first child element instead of taken from the root element. In this test, a small script verifies that the computed value of 'direction' of the root element itself is not affected by such propagation."> | ||
|
||
<!-- | ||
This test *only* verifies the computed value of 'direction' of the | ||
root element. | ||
This test does *not* verify if the 'writing-mode' value of | ||
the body element propagates to the root element. | ||
--> | ||
|
||
<script src="/resources/testharness.js"></script> | ||
|
||
<script src="/resources/testharnessreport.js"></script> | ||
|
||
<style> | ||
html | ||
{ | ||
direction: ltr; | ||
writing-mode: vertical-rl; | ||
} | ||
|
||
body | ||
{ | ||
direction: rtl; | ||
writing-mode: vertical-lr; | ||
} | ||
</style> | ||
|
||
<script> | ||
function startTesting() | ||
{ | ||
|
||
test(function() | ||
{ | ||
|
||
assert_equals(getComputedStyle(document.documentElement).direction, "ltr" ); | ||
|
||
}, "Second test on computed value of 'direction' of root element."); | ||
|
||
} | ||
|
||
startTesting(); | ||
|
||
</script> |