Bug 27814

Summary: Qt Port does not obey color style in button tag with default background
Product: WebKit Reporter: Mike Fenton <mifenton>
Component: New BugsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, manyoso
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: All   
Attachments:
Description Flags
Code patch as described in bug report.
manyoso: review+
Test patch associated with bug. manyoso: review+

Description Mike Fenton 2009-07-29 13:21:07 PDT
In the Qt Port, anytime the theme paints a button object, the buttons style color property is ignored.

Ie.

<button style="color:red">  Does not draw a button with red text.
<button style="color:red;background-color:blue> Does draw a button with red text and blue background.

This is happening because in adjustButtonStyle of RenderThemeQt, in addition to setting expected values, there is the following line

style->setColor(QApplication::palette().text().color());

which resets the theme color to the default text color.

By removing this line the Qt Port correctly draws the text color including effects for the button.

Note:  This was discovered while investigating the failure of fast/dom/HTMLTableColElement/resize-table-using-col-width.html which was failing due to a color mismatch in the expected vs actual results.

With no style provided default values were expected but the follow response occurs.

-        RenderButton {BUTTON} at (2,2) size 393x28 [color=#1A1A1A] [bgcolor=#C0C0C0]
+        RenderButton {BUTTON} at (2,2) size 393x28 [color=#141312] [bgcolor=#C0C0C0]

With the fix the output is

         RenderButton {BUTTON} at (2,2) size 393x28 [bgcolor=#C0C0C0]

denoting that the color was not overridden.
Comment 1 Mike Fenton 2009-07-30 13:23:14 PDT
Created attachment 33822 [details]
Code patch as described in bug report.

This patch is strictly the code change as described in the initial bug report.  Test updates to follow.
Comment 2 Mike Fenton 2009-07-30 13:57:07 PDT
Created attachment 33833 [details]
Test patch associated with bug.

This patch is for the tests associated with the bug and include the following changes to tests.

Add new test fast/forms/button-style-color.html and results in platform/qt/fast/forms/button-style-color-expected.txt
Enable previously skipped test tables/mozilla/bugs/bug92647-2.html
Update expected result for qt in test fast/dom/HTMLTableColElement/resize-table-using-col-width-expected

All tests denoted above pass correctly.
Comment 3 Adam Treat 2009-07-30 14:04:41 PDT
Comment on attachment 33833 [details]
Test patch associated with bug.

Next time you can combine these two.  A bug fix and the associated tests should land together.  I'll do so when landing.
Comment 4 Adam Treat 2009-07-30 14:16:29 PDT
Landed with r46600.
Comment 5 Adam Barth 2009-07-31 21:53:12 PDT
Claims to already be landed.  Please re-open if that's not the case.