[Webkit-unassigned] [Bug 79435] New: incorrect line-height for styled menulist (select tag) in windows theme (wincairo port)
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Feb 23 20:34:47 PST 2012
https://bugs.webkit.org/show_bug.cgi?id=79435
Summary: incorrect line-height for styled menulist (select tag)
in windows theme (wincairo port)
Product: WebKit
Version: 528+ (Nightly build)
Platform: PC
OS/Version: Windows 7
Status: UNCONFIRMED
Severity: Normal
Priority: P2
Component: Layout and Rendering
AssignedTo: webkit-unassigned at lists.webkit.org
ReportedBy: lynn.neir at skype.net
According to Layout test: fast/forms/menulist-restrict-line-height.html, the line-height should not be honored for styled popup buttons. Currently, on wincairo port, this test clips the styled popup button.
Looking at the Safari theme in method: RenderThemeSafari::adjustMenuListButtonStyle, they have extra line: style->setLineHeight(RenderStyle::initialLineHeight());. This code is not present in windows theme code. So, I add this line and the resulting code is shown below. I ran tests, it fixes the test noted above and doesn't break any other tests.
void RenderThemeWin::adjustMenuListButtonStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const
{
// These are the paddings needed to place the text correctly in the <select> box
const int dropDownBoxPaddingTop = 2;
const int dropDownBoxPaddingRight = style->direction() == LTR ? 4 + dropDownButtonWidth : 4;
const int dropDownBoxPaddingBottom = 2;
const int dropDownBoxPaddingLeft = style->direction() == LTR ? 4 : 4 + dropDownButtonWidth;
// The <select> box must be at least 12px high for the button to render nicely on Windows
const int dropDownBoxMinHeight = 12;
// Position the text correctly within the select box and make the box wide enough to fit the dropdown button
style->setPaddingTop(Length(dropDownBoxPaddingTop, Fixed));
style->setPaddingRight(Length(dropDownBoxPaddingRight, Fixed));
style->setPaddingBottom(Length(dropDownBoxPaddingBottom, Fixed));
style->setPaddingLeft(Length(dropDownBoxPaddingLeft, Fixed));
// Height is locked to auto
style->setHeight(Length(Auto));
// Calculate our min-height
int minHeight = style->fontMetrics().height();
minHeight = max(minHeight, dropDownBoxMinHeight);
style->setMinHeight(Length(minHeight, Fixed));
style->setLineHeight(RenderStyle::initialLineHeight());
// White-space is locked to pre
style->setWhiteSpace(PRE);
}
--
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