Bug 34429

Summary: [Qt] window.alert fails to display HTML tag
Product: WebKit Reporter: sangeetha.sugavanam
Component: WebKit QtAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, hausmann, kling, laszlo.gombos
Priority: P2 Keywords: Qt
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Linux   
Attachments:
Description Flags
windowtest.html for QtLauncher
none
Patch to escape HTML entities in JS alert/prompt boxes
kenneth: review+, kenneth: commit-queue+
Patch fixed to work with all 3 JS dialogs none

sangeetha.sugavanam
Reported 2010-02-01 07:40:05 PST
Steps to Reproduce: 1) Launch QtLauncher. 2) Save the file windowtest.html. 3) Open the file windowtest.html from QtLauncher. 4) Click on the Display Alert button. Expected Outcome: ----------------- '<p>string in between <tag></p>' is displayed as an alert without HTML formatting (<p> is treated like a string). Actual Outcome: --------------- 'string in between' is displayed as an alert instead. And if '<script>somescript</script>' is put as a n argument instead, nothing will be displayed in the alert box. Mozilla Firefox 3.5.2 displays '<p>string in between <tag></p>' Apple Safari 4.0.1 displays '<p>string in between <tag></p>'
Attachments
windowtest.html for QtLauncher (504 bytes, text/html)
2010-02-01 07:45 PST, sangeetha.sugavanam
no flags
Patch to escape HTML entities in JS alert/prompt boxes (1.80 KB, patch)
2010-02-02 02:01 PST, Andreas Kling
kenneth: review+
kenneth: commit-queue+
Patch fixed to work with all 3 JS dialogs (2.38 KB, patch)
2010-02-02 03:37 PST, Andreas Kling
no flags
sangeetha.sugavanam
Comment 1 2010-02-01 07:45:06 PST
Created attachment 47843 [details] windowtest.html for QtLauncher
Andreas Kling
Comment 2 2010-02-02 02:01:09 PST
Created attachment 47914 [details] Patch to escape HTML entities in JS alert/prompt boxes
Andreas Kling
Comment 3 2010-02-02 02:03:36 PST
And (about the testcase): you can't have </script> inside a JS string literal, that stops the parser in its tracks. See for example: http://www.herongyang.com/JavaScript/Browser-Include-Script-Tag-in-String-Literal.html
Andreas Kling
Comment 4 2010-02-02 03:37:08 PST
Created attachment 47918 [details] Patch fixed to work with all 3 JS dialogs We should do the same for all the JS dialog types. :)
WebKit Commit Bot
Comment 5 2010-02-02 05:00:03 PST
Comment on attachment 47918 [details] Patch fixed to work with all 3 JS dialogs Clearing flags on attachment: 47918 Committed r54228: <http://trac.webkit.org/changeset/54228>
WebKit Commit Bot
Comment 6 2010-02-02 05:00:11 PST
All reviewed patches have been landed. Closing bug.
Simon Hausmann
Comment 7 2010-02-10 07:20:38 PST
I wonder if the escaping should perhaps be done on the ChromeClientQt side, instead of in the default implementation. That way we can unit test this bug fix and not every application that re-implements these handlers has to do the same Qt::escape trick. Unless of course there's a compelling reason to forward the tags to the application...
Note You need to log in before you can comment on or make changes to this bug.