Commit 0b58c9e5 authored by Etienne Bergeron's avatar Etienne Bergeron Committed by Commit Bot

Disable broken unittests due to invalid baseline computation

This test is broken due to the way the metrics are computed
in RenderText Harfbuzz.

Assume we have a text with
  1) SUPERSCRIPT
  2) NORMAL
  3) SUBSCRIPT

The NORMAL text is using a font 12px, and the SUBSCRIPT and
SUPERSCRIPT are using a font 7 px.
The metrics of both font will differs (not the same Ascent
and Descent) and not same font-height.
The baseline offset of 1) will be negative (e.g. -3) and the
baseline offset of 2) will be positive (e.g. 3).

The test is checking that the size of the text is within a
bounding box. But the computation of that box is wrong.

The TOP is the SUPERSCRIPT baseline + superscript_font.ascent.
The BOTTOM is the SUBSCRIPT baseline - subscript_font.descent.

The current computation is trying to find the max_ascent and
max_descent and offset them on baseline. This computation
is not giving the right bounding box.

Bug: 459812
Change-Id: Id72f37888dfd2de4db2dc3b8704f06da01797cda
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1906631
Commit-Queue: Etienne Bergeron <etienneb@chromium.org>
Reviewed-by: default avatarAlexei Svitkine <asvitkine@chromium.org>
Cr-Commit-Position: refs/heads/master@{#714001}
parent a4158eee
......@@ -5770,7 +5770,7 @@ TEST_F(RenderTextTest, ZeroWidthCharacters) {
// Ensure that the width reported by RenderText is sufficient for drawing. Draws
// to a canvas and checks if any pixel beyond the bounding rectangle is colored.
TEST_F(RenderTextTest, TextDoesntClip) {
TEST_F(RenderTextTest, DISABLED_TextDoesntClip) {
const char* kTestStrings[] = {
" ",
// TODO(dschuyler): Underscores draw outside GetStringSize;
......@@ -5850,7 +5850,7 @@ TEST_F(RenderTextTest, TextDoesntClip) {
// Ensure that the text will clip to the display rect. Draws to a canvas and
// checks whether any pixel beyond the bounding rectangle is colored.
TEST_F(RenderTextTest, TextDoesClip) {
TEST_F(RenderTextTest, DISABLED_TextDoesClip) {
const char* kTestStrings[] = {"TEST", "W", "WWWW", "gAXAXWWWW"};
const Size kCanvasSize(300, 50);
const int kTestSize = 10;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment