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

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>10301</bug_id>
          
          <creation_ts>2010-08-05 23:10:30 +0000</creation_ts>
          <short_desc>HTMLOptionElement.text should not be identical to .textContent - causes interop issues with web content</short_desc>
          <delta_ts>2010-10-21 18:35:02 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML WG</product>
          <component>pre-LC1 HTML5 spec (editor: Ian Hickson)</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://dev.w3.org/html5/spec/Overview.html#dom-option-text</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>NE</keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Adrian Bateman [MSFT]">adrianba</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>annevk</cc>
    
    <cc>ian</cc>
    
    <cc>mike</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>37261</commentid>
    <comment_count>0</comment_count>
      <attachid>906</attachid>
    <who name="Adrian Bateman [MSFT]">adrianba</who>
    <bug_when>2010-08-05 23:10:30 +0000</bug_when>
    <thetext>Created attachment 906
Test case

The spec says:

  The text IDL attribute, on getting, must return the same value
  as the textContent IDL attribute on the element, and on setting,
  must act as if the textContent IDL attribute on the element had
  been set to the new value.

In IE9 Preview 4 we have implemented support for HTMLOptionElement.text by following this requirement. We have discovered that it causes interop issues related to whitespace on existing content on the web. Other browsers do not follow this behaviour.

We propose that &quot;The text IDL attribute, on getting, must return the same value as the textContent IDL attribute on the element&quot; be replaced as follows:

  The text IDL attribute, on getting, must run the following
  algorithm:

  1. Let value be a concatenation of the data of all the
     descendant text nodes of the option element, in tree
     order

  2. Replace any sequence of one or more consecutive space
     characters in value with a single U+0020 SPACE character.

  3. Remove any leading or trailing space characters in value.

  4. Return value.

This change appears to be compatible with current browser implementations.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>38857</commentid>
    <comment_count>1</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2010-09-10 22:39:02 +0000</bug_when>
    <thetext>EDITOR&apos;S RESPONSE: This is an Editor&apos;s Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Accepted
Change Description: see diff given below
Rationale: Good catch, thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>38858</commentid>
    <comment_count>2</comment_count>
    <who name="">contributor</who>
    <bug_when>2010-09-10 22:39:27 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r5466.
Check-in comment: HTMLOptionElement.text collapses spaces.
http://html5.org/tools/web-apps-tracker?from=5465&amp;to=5466</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>906</attachid>
            <date>2010-08-05 23:10:30 +0000</date>
            <delta_ts>2010-08-05 23:10:30 +0000</delta_ts>
            <desc>Test case</desc>
            <filename>htmloptionelement_text.htm</filename>
            <type>text/html</type>
            <size>1317</size>
            <attacher name="Adrian Bateman [MSFT]">adrianba</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9XM0MvL0RURCBIVE1MIDQuMDEvL0VOIiAiaHR0cDov
L3d3dy53My5vcmcvVFIvaHRtbDQvc3RyaWN0LmR0ZCI+CjxodG1sPgoJPGhlYWQ+CgkJPG1ldGEg
aHR0cC1lcXVpdj0iQ29udGVudC1UeXBlIiBjb250ZW50PSJ0ZXh0L2h0bWw7IGNoYXJzZXQ9aXNv
LTg4NTktMSI+CgkJPHRpdGxlPlVudGl0bGVkIERvY3VtZW50PC90aXRsZT4KCTwvaGVhZD4KCTxi
b2R5PgoJCTxzZWxlY3Q+CgkJCTxvcHRpb24+ICAgc2FtcGxlICAgdGV4dCAgPC9vcHRpb24+CgkJ
PC9zZWxlY3Q+CgkJPHNjcmlwdCB0eXBlPSJ0ZXh0L2phdmFzY3JpcHQiPgoJCQlkb2N1bWVudC5n
ZXRFbGVtZW50c0J5VGFnTmFtZSgnb3B0aW9uJylbMF0uYXBwZW5kQ2hpbGQoZG9jdW1lbnQuY3Jl
YXRlRWxlbWVudCgnc3BhbicpKTsKCQkJZG9jdW1lbnQuZ2V0RWxlbWVudHNCeVRhZ05hbWUoJ29w
dGlvbicpWzBdLmxhc3RDaGlsZC5hcHBlbmRDaGlsZChkb2N1bWVudC5jcmVhdGVUZXh0Tm9kZSgn
ICBpbiAgIHNwYW4gICAgZWxlbWVudCAgJykpOwoJCTwvc2NyaXB0PgoJCTxkaXY+CgkJCUludGVy
bmFsIHJlcHJlc2VudGF0aW9uIG9mIEhUTUxPcHRpb25FbGVtZW50LnRleHQgKHVuZGVyc2NvcmUg
PT0gc3BhY2UpOgoJCQk8c2NyaXB0IHR5cGU9InRleHQvamF2YXNjcmlwdCI+CgkJCQl2YXIgdGV4
dCA9IGRvY3VtZW50LmdldEVsZW1lbnRzQnlUYWdOYW1lKCdvcHRpb24nKVswXS50ZXh0OwoJCQkJ
CgkJCQlmb3IgKHZhciBpIGluIHRleHQpCgkJCQl7CgkJCQkJaWYgKHRleHRbaV0gPT0gIiAiKSBk
b2N1bWVudC53cml0ZSgiXyIpOwoJCQkJCWVsc2UgZG9jdW1lbnQud3JpdGUodGV4dFtpXSk7CgkJ
CQl9CgkJCTwvc2NyaXB0PgoJCTwvZGl2PgoJCTxkaXY+CgkJCUludGVybmFsIHJlcHJlc2VudGF0
aW9uIG9mIEhUTUxPcHRpb25FbGVtZW50LnRleHRDb250ZW50ICh1bmRlcnNjb3JlID09IHNwYWNl
KToKCQkJPHNjcmlwdCB0eXBlPSJ0ZXh0L2phdmFzY3JpcHQiPgoJICAgICAgICAgICAgdmFyIHRl
eHQgPSBkb2N1bWVudC5nZXRFbGVtZW50c0J5VGFnTmFtZSgnb3B0aW9uJylbMF0udGV4dENvbnRl
bnQ7CgkgICAgICAgICAgICAKCSAgICAgICAgICAgIGZvciAodmFyIGkgaW4gdGV4dCkKCSAgICAg
ICAgICAgIHsKCSAgICAgICAgICAgICAgICBpZiAodGV4dFtpXSA9PSAiICIpIGRvY3VtZW50Lndy
aXRlKCJfIik7CgkgICAgICAgICAgICAgICAgZWxzZSBkb2N1bWVudC53cml0ZSh0ZXh0W2ldKTsK
CSAgICAgICAgICAgIH0KICAgICAgICAgICAgPC9zY3JpcHQ+CgkJPC9kaXY+Cgk8L2JvZHk+Cjwv
aHRtbD4K
</data>

          </attachment>
      

    </bug>

</bugzilla>