Bug 104573
Summary: | [EFL][WK2] Layers are shifted vertically by 1-2 pixels in compositing/geometry tests. | ||
---|---|---|---|
Product: | WebKit | Reporter: | Viatcheslav Ostapenko <ostap73> |
Component: | Layout and Rendering | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED DUPLICATE | ||
Severity: | Normal | CC: | cdumez, d-r, laszlo.gombos, pnormand, zimmermann |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Viatcheslav Ostapenko
This bug is to keep track and summarize my findings about compositing/geometry tests on EFL port.
Currently it doesn't apply to EFL/wk1 because accelerated compositing is disabled.
Probably GTK port has the same problem, but they do not support AC now.
The easiest way problem reproduced on compositing/geometry/composited-in-columns.html tests. Other geometry tests also may fail or flaky.
Problem appears when RenderBoxes are positioned during layout. Layout is based on line height + line gap. For SimpleFontDataFreeType line hight is calculated like ascender + descender (FontMetrics.h) . Line gap is calculated like font_extents.height - font_extents.ascent - font_extents.descent (SimpleFontData::platformInit()).
When I run this test font_extents.height is less than font_extents.ascent + font_extents.descent and line gap becomes negative (-1) and this affects page layout.
font_extents are received from cairo_scaled_font_extents call and internally cairo gets it from freetype font library.
Freetype loads LiberationSerif-Regular.ttf font and it seems if this font is loaded 1st it gets wrong metric in face->size->metrics .
I tried loading this test into Minibrowser. In this case font is loaded with correct metrics and page layouts correctly.
The problem looks very similar to this bug in freetype library: http://savannah.nongnu.org/bugs/?34156
EFL currently uses 2.4.2. I tried upgrading to 2.4.10 and it didn't help.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Viatcheslav Ostapenko
r101343 removed this code with comment:
- // There seems to be some rounding error in cairo (or in how we
- // use cairo) with some fonts, like DejaVu Sans Mono, which makes
- // cairo report a height smaller than ascent + descent, which is
- // wrong and confuses WebCore's layout system. Workaround this
- // while we figure out what's going on.
- float lineSpacing = font_extents.height;
- if (lineSpacing < font_extents.ascent + font_extents.descent)
- lineSpacing = font_extents.ascent + font_extents.descent;
It seems this exactly what happens here. Shouldn't we check that lineGap (in new code) is non-negative?
Viatcheslav Ostapenko
*** This bug has been marked as a duplicate of bug 102374 ***