[Webkit-unassigned] [Bug 67093] [Qt] Default window.alert shows HTML entities in certain cases

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon May 21 08:27:45 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=67093


Steffen Imhof <steffen.imhof at basyskom.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #143039|                            |review?
               Flag|                            |




--- Comment #1 from Steffen Imhof <steffen.imhof at basyskom.com>  2012-05-21 08:26:50 PST ---
Created an attachment (id=143039)
 --> (https://bugs.webkit.org/attachment.cgi?id=143039&action=review)
Patch to fix the display of alert(), confirm() and prompt()

The problem is caused by the HTML escaping introduced in https://bugs.webkit.org/show_bug.cgi?id=34429, which in turn was added to make sure HTML tags are shown in the alert boxes. The root cause for me seem to be Qt's text detection automatisms. So the text is sometimes interpreted as plain text and sometimes as rich text (with a few possible HTML tags).
In my opinion the correct solution here is to force plain text. (As far as I can tell, inside the message boxes this should not pose any security risk?!)
The static convenience methods cannot be used anymore in this case, so the code grew a bit.
QInputDialog does not provide an API to access the contained label, so I had to resort to some "less-than-nice" meta object inspection for "prompt()". A possible alternative would be to write our own dialog for this case, but I think this would be overkill.
A somewhat related problem is fixed with this patch, too: QLabel interprets '&' characters as the start of a mnemonic identifier, dropping the '&' and underlining the next character. This is worked around by doubling the '&'s beforehand.
I haven't seen yet, how to test this automatically, but I don't think a test should be necessary for this fix. (If I am wrong here, I'd be glad for some pointers how one would write such a test case.)

-- 
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