[Webkit-unassigned] [Bug 94198] fast/dom/HTMLImageElement/image-alt-text.html and fast/dom/HTMLInputElement/input-image-alt-text.html are failing

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Aug 16 01:51:26 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=94198





--- Comment #3 from Christophe Dumez <christophe.dumez at intel.com>  2012-08-16 01:51:59 PST ---
The following happens:

1. setImageSizeForAltText() and intrinsic size is calculated like this:
IntSize textSize(min(font.width(RenderBlock::constructTextRun(this, font, m_altText, style())), maxAltTextWidth), min(font.fontMetrics().height(), maxAltTextHeight));

// setImageSizeForAltText(): new size: (65, 19)

2. RenderImage::paintReplaced() is called:
// cWidth: 65, cHeight: 19

Then an outline rect is drawn where the image should be and the following is done:
// When calculating the usable dimensions, exclude the pixels of
// the ouline rect so the error image/alt text doesn't draw on it.
LayoutUnit usableWidth = cWidth - 2;
LayoutUnit usableHeight = cHeight - 2;

Then, we check if the usableWidth / cHeight is sufficient to print the alt text:
if (usableWidth >= textWidth && cHeight >= fontMetrics.height())
    context->drawText(font, textRun, altTextOffset);

For some reason we use usableWidth instead of cWidth although we use cHeight instead of usableHeight. As a consequence, the check fails and the text is not drawn:
// usableWidth: 63, textWidth: 65, cHeight: 19, fontMetrics.height(): 19

usableWidth is not enough to fit 65 because of the outline border width.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list