2 <script src=
"../../resources/testharness.js"></script>
3 <script src=
"../../resources/testharnessreport.js"></script>
6 -webkit-writing-mode:vertical-rl;
9 border:solid thin black;
15 -webkit-text-combine:horizontal;
19 <div title=
"break after">国<span data-expected=
"1,0" class=
"tcy">123</span>国</div>
20 <div title=
"break before">国国<span data-expected=
"0,1" class=
"tcy">123</span>国</div>
21 <div title=
"after open">国「<span data-expected=
"1,1" class=
"tcy">123</span></div>
22 <div title=
"before close">国<span data-expected=
"0,1" class=
"tcy">123</span>」</div>
23 <div title=
"break after with break inside">国<span data-expected=
"1,0" class=
"tcy">国国</span>国</div>
24 <div title=
"break before with break inside">国国<span data-expected=
"0,1" class=
"tcy">国国</span>国</div>
25 <div title=
"after open with break inside">国「<span data-expected=
"1,1" class=
"tcy">国国</span></div>
26 <div title=
"before close with break inside">国<span data-expected=
"0,1" class=
"tcy">国国</span>」</div>
30 var blocks
= document
.querySelectorAll("div[title]");
31 for (var i
= 0; i
< blocks
.length
; i
++)
32 testColumnAndRow(blocks
[i
]);
34 function testColumnAndRow(block
) {
36 var targets
= block
.querySelectorAll("span[data-expected]");
37 for (var i
= 0; i
< targets
.length
; i
++) {
38 var element
= targets
[i
];
39 var expected
= eval("[" + element
.dataset
.expected
+ "]");
40 var actual
= getColumnAndRow(element
);
41 assert_array_equals(actual
, expected
);
46 function getColumnAndRow(element
) {
47 var rect
= element
.getBoundingClientRect();
48 var block
= element
.parentElement
.getBoundingClientRect()
49 var column
= rect
.top
- block
.top
;
50 var row
= block
.right
- rect
.right
;
51 return [Math
.round(column
/ 20), Math
.round(row
/ 20)];
55 if (window
.testRunner
)
56 container
.style
.display
= "none";