Bug 27814 - Qt Port does not obey color style in button tag with default background
Summary: Qt Port does not obey color style in button tag with default background
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-29 13:21 PDT by Mike Fenton
Modified: 2009-07-31 21:53 PDT (History)
2 users (show)

See Also:


Attachments
Code patch as described in bug report. (1.04 KB, patch)
2009-07-30 13:23 PDT, Mike Fenton
manyoso: review+
Details | Formatted Diff | Diff
Test patch associated with bug. (6.19 KB, patch)
2009-07-30 13:57 PDT, Mike Fenton
manyoso: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.