<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>38226</bug_id>
          
          <creation_ts>2010-04-27 16:08:03 -0700</creation_ts>
          <short_desc>Full width spaces are collapsed in option element</short_desc>
          <delta_ts>2011-10-11 02:24:09 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Text</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>57746</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Xianzhu Wang">phnixwxz</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>dglazkov</cc>
    
    <cc>just2contribute</cc>
    
    <cc>tkent</cc>
    
    <cc>wangxianzhu</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>218020</commentid>
    <comment_count>0</comment_count>
    <who name="Xianzhu Wang">phnixwxz</who>
    <bug_when>2010-04-27 16:08:03 -0700</bug_when>
    <thetext>URLs (if applicable) : 
Other browsers tested:
  Add OK or FAIL after other browsers where you have tested this issue:
     Chrome 5: FAIL
  Firefox 3.x: OK
         IE 8: OK

What steps will reproduce the problem?
1. Open the attached test case

What is the expected result?
The text in the selection box should be like this:
======================
    full-width spaces
  non-breakable-spaces
normal-spaces
======================

What happens instead?
Full width spaces are incorrectly collapsed:
======================
full-width spaces
  non-breakable-spaces
normal-spaces
======================</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>218486</commentid>
    <comment_count>1</comment_count>
      <attachid>54585</attachid>
    <who name="Xianzhu Wang">phnixwxz</who>
    <bug_when>2010-04-28 10:57:48 -0700</bug_when>
    <thetext>Created attachment 54585
testcase</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>221417</commentid>
    <comment_count>2</comment_count>
    <who name="Xianzhu Wang">phnixwxz</who>
    <bug_when>2010-05-05 18:22:52 -0700</bug_when>
    <thetext>The reason that full-width spaces are collapsed is that the option element uses String::stripWhiteSpace() and String::simplifyWhiteSpace() which handle the set of white spaces different from the set of collapsable white spaces defined in HTML/CSS spec.

I think there are two ways of solutions:

1. Add String::stringHTMLWhiteSpace() and String::simplifyHTMLWhiteSpace() and call them from OptionElement. In this way, the code change is small, but we can&apos;t share the same code with existing HTML/CSS white space handling.

2. Refactor rendering of select element and option element, let option elements be rendered as text blocks, thus take advantage of existing HTML/CSS white space handling. In this way, we can also allow the style of select/option to be controlled by CSS, such as text wrapping, word breaking, hover color, margin and padding, etc. Some hard-coded features, such as optgroup indentation, can also be implemented with CSS.

I&apos;d like to hear more opinions.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>481432</commentid>
    <comment_count>3</comment_count>
    <who name="">just2contribute</who>
    <bug_when>2011-10-10 21:45:27 -0700</bug_when>
    <thetext>Can we directly modify the WTF::String function;


static inline bool isSpaceOrNewline(UChar c) 

like; this is checking whether it is an ASCII space or a Unicode space (using the ICU function for directionality information) in the conditional statement.

Hence can we just have a check for this full-width charatcter before this conditional statement as follows;
 
if (c == 0x3000)
return false;
 
which will basically return false from there itself, interpreting it as non-white space character, which is the way I feel bcoz U+3000 (full-width space) should not be considered for any whitespace/newline procerssing as per its properties I guess. 
 
Does this impact any thing else, bcoz I could see this function being used in a number of places, especially in rendering, loader etc?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>481527</commentid>
    <comment_count>4</comment_count>
    <who name="Kent Tamura">tkent</who>
    <bug_when>2011-10-11 02:24:09 -0700</bug_when>
    <thetext>I think this was fixed in another bug.

*** This bug has been marked as a duplicate of bug 57746 ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>54585</attachid>
            <date>2010-04-28 10:57:48 -0700</date>
            <delta_ts>2010-04-28 10:57:48 -0700</delta_ts>
            <desc>testcase</desc>
            <filename>testselect.html</filename>
            <type>text/html</type>
            <size>177</size>
            <attacher name="Xianzhu Wang">phnixwxz</attacher>
            
              <data encoding="base64">PGZvcm0+CjxzZWxlY3Qgc2l6ZT0iMyI+CjxvcHRpb24+JiMxMjI4ODsmIzEyMjg4O2Z1bGwtd2lk
dGgtc3BhY2VzPC9vcHRpb24+CjxvcHRpb24+Jm5ic3A7Jm5ic3A7bm9uLWJyZWFrYWJsZS1zcGFj
ZXM8L29wdGlvbj4KPG9wdGlvbj4gIG5vcm1hbC1zcGFjZXM8L29wdGlvbj4KPC9zZWxlY3Q+Cjwv
Zm9ybT4K
</data>

          </attachment>
      

    </bug>

</bugzilla>