Bug 53373 - [Qt] Button Element is rendered w/ text off-center.
Summary: [Qt] Button Element is rendered w/ text off-center.
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 420+
Hardware: PC Linux
: P2 Normal
Assignee: Caio Marcelo de Oliveira Filho
Keywords: Qt, QtTriaged
Depends on:
Reported: 2011-01-29 01:18 PST by lindem
Modified: 2011-02-21 01:59 PST (History)
4 users (show)

See Also:

html that exhibits the behaviour. (318 bytes, text/html)
2011-01-29 01:18 PST, lindem
no flags Details
Screenshot. (3.51 KB, image/png)
2011-01-29 11:53 PST, lindem
no flags Details
proposed fix... (1.15 KB, patch)
2011-02-18 14:47 PST, Dawit A.
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description lindem 2011-01-29 01:18:11 PST
Created attachment 80555 [details]
html that exhibits the behaviour. 

The example form is visible on http://buntebytes.de/~lindem/button-element.png (screenshot, comparison w/ input element, which is rendered correctly). The revision I am experiencing this with is qt 4.7.1 on Arch Linux. That'd be QtWebKit 2.0, but I don't really know which version to choose in the report form. 

The html is attached. 

Testing on windows, if I get around doing it today.
Comment 1 lindem 2011-01-29 11:53:50 PST
Created attachment 80569 [details]
Comment 2 Benjamin Poulain 2011-01-29 12:29:59 PST
Looks related to #50521
Comment 3 lindem 2011-01-30 05:07:24 PST
Just wanted to comment that yasterday evening, on a suggestion from benjaminp in #qtwekbit, it's been revealed that html like


causes the erroneous behaviour, while 


(note the absence of newlines inside the button element) does not.
Comment 4 Caio Marcelo de Oliveira Filho 2011-02-18 12:24:41 PST
It seems that in RenderThemeQt::adjustButtonStyle() there's a call to style->setWhiteSpace(PRE) that shouldn't be there.

I can't see the reason why Button should have special treatment for whitespaces.

This layout test agrees with me

Comment 5 Dawit A. 2011-02-18 14:47:35 PST
Created attachment 83013 [details]
proposed fix...

Patch based on comment #4 where it is correctly pointed out that setting a button's whitespace handling to PRE does not make sense and most definitely causes this bug in addition to violating the button with white-space layout test.
Comment 6 Andreas Kling 2011-02-18 19:47:47 PST
Comment on attachment 83013 [details]
proposed fix...

Comment 7 WebKit Commit Bot 2011-02-18 23:21:15 PST
The commit-queue encountered the following flaky tests while processing attachment 83013 [details]:

http/tests/websocket/tests/handshake-challenge-randomness.html bug 53738 (author: abarth@webkit.org)
The commit-queue is continuing to process your patch.
Comment 8 WebKit Commit Bot 2011-02-18 23:23:10 PST
Comment on attachment 83013 [details]
proposed fix...

Clearing flags on attachment: 83013

Committed r79103: <http://trac.webkit.org/changeset/79103>
Comment 9 WebKit Commit Bot 2011-02-18 23:23:13 PST
All reviewed patches have been landed.  Closing bug.
Comment 10 Csaba Osztrogonác 2011-02-21 01:59:53 PST
This patch fixed 3 tests on Qt. See http://trac.webkit.org/changeset/79198 for details.