[Webkit-unassigned] [Bug 50521] [Qt] Improper rendering of <button> tag when it contains a <br>

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Feb 18 10:48:40 PST 2011


--- Comment #7 from Dawit A. <adawit at kde.org>  2011-02-18 10:48:40 PST ---
(In reply to comment #6)
> Yes, by  linux machines I mean linux desktops running QtTestBrowser.

I sitll do not understand why this issue is not relevant on the mobile platform because of the use of the qt_mobile_theme... Is that because the particular theme used does haved fixed size for the button height ? IOW, why would this only be issue on Linux machines ? Due the specific styles used on them ?

> RenderThemeQt.cpp .. 
> RenderThemeQt::adjustButtonStyle(..,Element *e) calls the setSizeMethod which in turn calls the computeSizeBasedOnStyle().
> If we can count the number of <br>s in the <button> element, we can set the content size to a string with an equal number of newlines('\n').
> For ..
> <Button>
> line1 <br>
> line2 </Button>
> We can set 
> QSize contentSize = fm.size(Qt::TextShowMnemonic,QString::fromLatin1("X \n X")); 

> But if the button element contains <b> or <i> tags the actual size may be a little 
> bigger than the computedSize. Will a solution along these lines be acceptable ?

Hmm... Well that is not really a solution, but a hack then. Also simply counting the number of new lines will breakdown if the html is <button><br>Test<br></button> which should be translated into "\nTest\n" and not "Test\n\n".

I think the real resolution is fixing the issue at the source. If this problem does not occur with the use of qt_mobile_theme, then we need to find out exactly what is being done in that theme that allows it to properly render buttons with multi line text. Is this platform specific styling issue, i.e. the style used in KDE (oxygen) has effect on how the button gets rendered ?

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