Bug 94321 - [BlackBerry] Select popup shows blank content when its option tags contain '\' characters
Summary: [BlackBerry] Select popup shows blank content when its option tags contain '\...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit BlackBerry (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other Other
: P2 Critical
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-17 02:41 PDT by Sean Wang
Modified: 2012-08-21 00:04 PDT (History)
7 users (show)

See Also:


Attachments
patch (2.48 KB, patch)
2012-08-17 02:55 PDT, Sean Wang
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sean Wang 2012-08-17 02:41:42 PDT
When trigger the selection popup, it shows a blank popup window.

Test case:
<select>
  <option value="1">\</option>
</select>

HOW TO REPRODUCE:
Load the test case and click the select to trigger the popup, see what will happen.

EXPECTED:
A item with the description "\" should be displayed.

ACTUAL:
A blank popup is displayed and there is no cancel button.
Comment 1 Sean Wang 2012-08-17 02:55:12 PDT
Created attachment 159065 [details]
patch

The character in the select options' description should be escaped to avoid it is interpreted as an escape character.
Comment 2 WebKit Review Bot 2012-08-20 20:39:08 PDT
Comment on attachment 159065 [details]
patch

Clearing flags on attachment: 159065

Committed r126128: <http://trac.webkit.org/changeset/126128>
Comment 3 WebKit Review Bot 2012-08-20 20:39:13 PDT
All reviewed patches have been landed.  Closing bug.
Comment 4 Kent Tamura 2012-08-20 23:50:25 PDT
Comment on attachment 159065 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=159065&action=review

> Source/WebKit/blackberry/WebCoreSupport/SelectPopupClient.cpp:86
> -        source.append("'" + String(labels[i].impl()).replace("'", "\\'") + "'");
> +        source.append("'" + String(labels[i].impl()).replace('\\', "\\\\").replace('\'', "\\'") + "'");

You had better use PagePopupClient::addJavaScriptString().
Comment 5 Sean Wang 2012-08-21 00:04:03 PDT
Comment on attachment 159065 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=159065&action=review

>> Source/WebKit/blackberry/WebCoreSupport/SelectPopupClient.cpp:86
>> +        source.append("'" + String(labels[i].impl()).replace('\\', "\\\\").replace('\'', "\\'") + "'");
> 
> You had better use PagePopupClient::addJavaScriptString().

This function has not been merged to our development trunk.