iBooks text can overlap, sometimes columns are shifted splitting words.
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 29 Apr 2017 21:16:44 +0000 (21:16 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 29 Apr 2017 21:16:44 +0000 (21:16 +0000)
commit507266011a7b5e1da9336f302f3f01806f0fc2e3
tree6e4bfd8b878902572be84ff4b6622ef1e62aa0f7
parentb7163fa44dc3f8f87252c5f122eef8ddb7c9c516
iBooks text can overlap, sometimes columns are shifted splitting words.
https://bugs.webkit.org/show_bug.cgi?id=171472
<rdar://problem/31096037>

Reviewed by Antti Koivisto.

Source/WebCore:

Instead of just checking if the glyph is taller than the line, we need to ensure that both the
ascent and the descent have enough space (this is for -webkit-line-box-contain: glyph).

Test: fast/text/simple-line-layout-glyph-overflows-line.html

* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForText): compute the available space for the ascent/descent
and check them against the ceil-ed(see FontCascade::floatWidthForSimpleText) glyph min/max y.

LayoutTests:

* fast/text/simple-line-layout-glyph-overflows-line-expected.html: Added.
* fast/text/simple-line-layout-glyph-overflows-line.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215976 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/text/simple-line-layout-glyph-overflows-line-expected.html [new file with mode: 0644]
LayoutTests/fast/text/simple-line-layout-glyph-overflows-line.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/SimpleLineLayout.cpp