forked from WebKit/WebKit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoverwrite-self-alignment.html
44 lines (41 loc) · 1.58 KB
/
overwrite-self-alignment.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<!DOCTYPE html>
<style>
.parent {
display: -webkit-flex;
justify-items: unsafe flex-end;
align-items: safe flex-start;
}
.parent .child {
display: -webkit-flex;
justify-self: unsafe flex-end;
align-self: safe flex-start;
}
#parentId {
justify-items: center;
align-items: stretch;
}
#parentId .child {
justify-self: center;
align-self: stretch;
}
</style>
<script src="../resources/js-test.js"></script>
<div class="parent">
<div id="childOfDefaultParent" class="child"></div>
</div>
<div id="parentId" class="parent">
<div id="childOfParentId" class="child"></div>
</div>
<script src="resources/alignment-parsing-utils.js"></script>
<script>
description('Test overwriting justify-self and align-self works as expected');
var parent = document.getElementById("parentId");
shouldBeEqualToString("getComputedStyle(parent, '').getPropertyValue('justify-items')", "center");
shouldBeEqualToString("getComputedStyle(parent, '').getPropertyValue('align-items')", "stretch");
var childOfDefaultParent = document.getElementById("childOfDefaultParent");
shouldBeEqualToString("getComputedStyle(childOfDefaultParent, '').getPropertyValue('justify-self')", "unsafe flex-end");
shouldBeEqualToString("getComputedStyle(childOfDefaultParent, '').getPropertyValue('align-self')", "safe flex-start");
var childOfParentId = document.getElementById("childOfParentId");
shouldBeEqualToString("getComputedStyle(childOfParentId, '').getPropertyValue('justify-self')", "center");
shouldBeEqualToString("getComputedStyle(childOfParentId, '').getPropertyValue('align-self')", "stretch");
</script>