summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/object_intrinsic_size_vertical.html
blob: 0dca4c377d2f54bfed33561fdc09ef8a80e72d05 (plain)
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
45
46
47
48
49
50
51
52
53
54
55
56
57
<!doctype html>
<title>Frame width and height attributes as they apply in a vertical writing mode</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
 #horiz
 {
  writing-mode: horizontal-tb;
  display: inline-block;
 }
 #vert
 {
  writing-mode: vertical-rl;
  display: inline-block;
 }
 object
 {
  border: 1px solid red;
  margin: 5px;
 }
</style>
<div id="horiz">
<object data="/images/green.png" width=300></object>
<object data="/images/green.png" height=50></object>
</div>
<div id="vert">
<object data="/images/green.png" width=300></object>
<object data="/images/green.png" height=50></object>
</div>
<script>
let t = async_test("Frame width and height attributes as they apply in a vertical writing mode");
function assert_dimensions(obj, expectedX, expectedY) {
  assert_equals(getComputedStyle(obj).width, expectedX);
  assert_equals(getComputedStyle(obj).height, expectedY);
}
t.step(function() {
  var obj = document.createElement('object');
  obj.width = 133;
  obj.data = '/images/blue.png';
  document.getElementById('horiz').appendChild(obj);

  obj = document.createElement('object');
  obj.width = 133;
  obj.data = '/images/blue.png';
  document.getElementById('vert').appendChild(obj);
});

onload = t.step_func_done(function() {
  let objects = document.querySelectorAll("object");
  assert_dimensions(objects[0], '300px', '150px');
  assert_dimensions(objects[1], '100px', '50px');
  assert_dimensions(objects[2], '133px', '106px');
  assert_dimensions(objects[3], '300px', '150px');
  assert_dimensions(objects[4], '100px', '50px');
  assert_dimensions(objects[5], '133px', '106px');
});
</script>