mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
Update web-platform-tests to revision 84e71a84b79199bc307866bbe0edcbcc7c4752ce
This commit is contained in:
parent
6d9b2eef29
commit
ea69dac266
93 changed files with 1056 additions and 202 deletions
|
@ -5,9 +5,24 @@
|
|||
body {
|
||||
font: 16px/1 Ahem;
|
||||
}
|
||||
|
||||
body > div {
|
||||
border: 1px solid lime;
|
||||
}
|
||||
|
||||
.over_emp {
|
||||
-webkit-text-emphasis: 'x';
|
||||
-webkit-text-emphasis-position: over left;
|
||||
text-emphasis: 'x';
|
||||
text-emphasis-position: over left;
|
||||
}
|
||||
|
||||
.under_emp {
|
||||
-webkit-text-emphasis: 'x';
|
||||
-webkit-text-emphasis-position: under left;
|
||||
text-emphasis: 'x';
|
||||
text-emphasis-position: under left;
|
||||
}
|
||||
</style>
|
||||
<body>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
|
@ -61,6 +76,15 @@ test(() => {
|
|||
assert_true(rt.bottom > ruby.bottom);
|
||||
}, 'Under ruby + vertical-align doesn\'t overflow the block');
|
||||
|
||||
test(() => {
|
||||
const {container, ruby, rt} = renderRuby(
|
||||
'<div><ruby style="ruby-position:under">base<rt>annotation</rt></ruby>' +
|
||||
'<div>n</div></div>');
|
||||
const nextBlockBox = container.querySelector('div').getBoundingClientRect();
|
||||
const rtBox = rt.getBoundingClientRect();
|
||||
assert_greater_than_equal(nextBlockBox.top, rtBox.bottom);
|
||||
}, 'Under ruby doesn\'t overwrap with the next block');
|
||||
|
||||
test(() => {
|
||||
const {container, ruby, rt} = renderRuby(
|
||||
'<div><span>before</span><br><ruby>base<rt style="font-size:16px"' +
|
||||
|
@ -68,5 +92,62 @@ test(() => {
|
|||
const firstLine = container.querySelector('span').getBoundingClientRect();
|
||||
assert_true(ruby.getBoundingClientRect().top - firstLine.bottom > 1);
|
||||
}, 'Expand inter-lines spacing');
|
||||
|
||||
test(() => {
|
||||
const {container, ruby, rt} = renderRuby(
|
||||
'<div style="line-height:1.5;">' +
|
||||
'<span>First line</span><br>' +
|
||||
'<span>Second line</span><br>' +
|
||||
'<ruby>base<rt style="font-size:50%">' +
|
||||
'annotation</rt></ruby></div>');
|
||||
const firstLine = container.querySelector('span').getBoundingClientRect();
|
||||
const secondLine = container.querySelectorAll('span')[1].getBoundingClientRect();
|
||||
const rubyLine = ruby.getBoundingClientRect();
|
||||
assert_approx_equals(secondLine.top - firstLine.top, rubyLine.top - secondLine.top, 1);
|
||||
}, 'Consume half-leading of the previous line');
|
||||
|
||||
test(() => {
|
||||
const {container, ruby, rt} = renderRuby(
|
||||
'<div style="line-height:1.5;">' +
|
||||
'<span>First line</span><br>' +
|
||||
'<span class="under_emp">Second line</span><br>' +
|
||||
'<ruby>base<rt style="font-size:50%">' +
|
||||
'annotation</rt></ruby></div>');
|
||||
const firstLine = container.querySelector('span').getBoundingClientRect();
|
||||
const secondLine = container.querySelectorAll('span')[1].getBoundingClientRect();
|
||||
const rubyLine = ruby.getBoundingClientRect();
|
||||
const RUBY_EMPHASIS_SIZE = 8;
|
||||
assert_greater_than_equal(rubyLine.top - secondLine.top,
|
||||
secondLine.top - firstLine.top + RUBY_EMPHASIS_SIZE);
|
||||
}, 'Don\'t Consume half-leading of the previous line with text-emphasis');
|
||||
|
||||
test(() => {
|
||||
const {container, ruby, rt} = renderRuby(
|
||||
'<div style="line-height:1.5;">' +
|
||||
'<span>First line</span><br>' +
|
||||
'<ruby style="ruby-position:under">base<rt style="font-size:50%">' +
|
||||
'annotation</rt></ruby><br>' +
|
||||
'<span>Third line</span></div>');
|
||||
const firstLine = container.querySelector('span').getBoundingClientRect();
|
||||
const rubyLine = ruby.getBoundingClientRect();
|
||||
const thirdLine = container.querySelectorAll('span')[1].getBoundingClientRect();
|
||||
assert_approx_equals(rubyLine.top - firstLine.top, thirdLine.top - rubyLine.top, 1);
|
||||
}, 'Consume half-leading of the next line');
|
||||
|
||||
test(() => {
|
||||
const {container, ruby, rt} = renderRuby(
|
||||
'<div style="line-height:1.5;">' +
|
||||
'<span>First line</span><br>' +
|
||||
'<ruby style="ruby-position:under">base<rt style="font-size:50%">' +
|
||||
'annotation</rt></ruby><br>' +
|
||||
'<span class="over_emp">Third line</span>' +
|
||||
'</div>');
|
||||
const firstLine = container.querySelector('span').getBoundingClientRect();
|
||||
const rubyLine = ruby.getBoundingClientRect();
|
||||
const thirdLine = container.querySelectorAll('span')[1].getBoundingClientRect();
|
||||
const RUBY_EMPHASIS_SIZE = 8;
|
||||
assert_greater_than_equal(thirdLine.top - rubyLine.top,
|
||||
rubyLine.top - firstLine.top + RUBY_EMPHASIS_SIZE);
|
||||
}, 'Don\'t Consume half-leading of the next line with text-emphasis');
|
||||
</script>
|
||||
</body>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue