Skip to content

Commit 270b595

Browse files
Layout: Fix incorrect annotation space computation for atomic-inlines
ComputeAnnotationOverflow() should take into account of atomic inline boxes. Bug: 336592423 Change-Id: Ia6343f13ecb59b44c26bc00f19476479013a34aa Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5480273 Reviewed-by: Koji Ishii <[email protected]> Commit-Queue: Kent Tamura <[email protected]> Cr-Commit-Position: refs/heads/main@{#1291724}
1 parent 55cb997 commit 270b595

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

css/css-ruby/line-spacing.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,5 +149,16 @@
149149
assert_greater_than_equal(thirdLine.top - rubyLine.top,
150150
rubyLine.top - firstLine.top + RUBY_EMPHASIS_SIZE);
151151
}, 'Don\'t Consume half-leading of the next line with text-emphasis');
152+
153+
// crbug.com/336592423
154+
test(() => {
155+
const {container, ruby, rt} = renderRuby(
156+
'<div style="line-height:1;">' +
157+
'<span style="display:inline-block; width:1em; height:4em; vertical-align:top"></span><br>' +
158+
'<ruby>base<rt>annotation</rt></ruby></div>');
159+
const firstLine = container.querySelector('span').getBoundingClientRect();
160+
const rtBox = rt.getBoundingClientRect();
161+
assert_greater_than_equal(rtBox.top, firstLine.bottom);
162+
}, 'An atomic-inline should not overlap with an annotation in the next line');
152163
</script>
153164
</body>

0 commit comments

Comments
 (0)