Bug 116804

Summary: HTML Form Controls Rendered as if they are disabled in QT5 with Windows Vista application Style
Product: WebKit Reporter: Stephen <sfcheng>
Component: WebKit QtAssignee: Simon Hausmann <hausmann>
Status: RESOLVED DUPLICATE    
Severity: Major CC: allan.jensen, hausmann, kent, sfcheng
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Windows 7   
Attachments:
Description Flags
Test page
none
Screenshot none

Stephen
Reported 2013-05-26 21:21:33 PDT
Created attachment 202947 [details] Test page In QT5, when the defualt Windows vista application style is used, basically all the html controls (text inputs, text areas, check boxes, radio buttons, drop down selects, etc) are rendered as if they are in a disabled state. I've attached a test html page and a screenshot.
Attachments
Test page (1.56 KB, text/html)
2013-05-26 21:21 PDT, Stephen
no flags
Screenshot (21.31 KB, image/jpeg)
2013-05-26 21:23 PDT, Stephen
no flags
Stephen
Comment 1 2013-05-26 21:23:58 PDT
Created attachment 202949 [details] Screenshot
Stephen
Comment 2 2013-05-28 17:29:40 PDT
After some digging, I found the cause of the problem inside the file RenderThemeQStyle.cpp near the following code: ControlPart RenderThemeQStyle::initializeCommonQStyleOptions(QStyleFacadeOption &option, RenderObject* o) const { // Default bits: no focus, no mouse over option.state &= ~(QStyleFacade::State_HasFocus | QStyleFacade::State_MouseOver); if (isReadOnlyControl(o)) // Readonly is supported on textfields. option.state |= QStyleFacade::State_ReadOnly; option.direction = Qt::LeftToRight; if (isHovered(o)) option.state |= QStyleFacade::State_MouseOver; setPaletteFromPageClientIfExists(option.palette); if (!isEnabled(o)) { option.palette.setCurrentColorGroup(QPalette::Disabled); option.state &= ~QStyleFacade::State_Enabled; } ... } During the initialization of the style options, the State_Enabled bit is removed if the control is disabled. However, in the constructor of the option, the state is initialized as State_None, which means disabled. We need either initialize the state as State_Enabled or add a "else" clause after the last "if" as shown below: if (!isEnabled(o)) { option.palette.setCurrentColorGroup(QPalette::Disabled); option.state &= ~QStyleFacade::State_Enabled; } else { option.state |= QStyleFacade::State_Enabled; }
Stephen
Comment 3 2013-07-08 19:04:05 PDT
This still exists in QT 5.1.
Simon Hausmann
Comment 4 2013-07-09 00:39:43 PDT
That looks rather plausible and is probably a regression I introduced. Looking into it. Great analysis, btw!
Simon Hausmann
Comment 5 2013-07-09 01:17:02 PDT
*** This bug has been marked as a duplicate of bug 112688 ***
Note You need to log in before you can comment on or make changes to this bug.