W3C home > Mailing lists > Public > public-html-bugzilla@w3.org > August 2010

[Bug 10301] New: HTMLOptionElement.text should not be identical to .textContent - causes interop issues with web content

From: <bugzilla@jessica.w3.org>
Date: Thu, 05 Aug 2010 23:10:32 +0000
To: public-html-bugzilla@w3.org
Message-ID: <bug-10301-2486@http.www.w3.org/Bugs/Public/>
http://www.w3.org/Bugs/Public/show_bug.cgi?id=10301

           Summary: HTMLOptionElement.text should not be identical to
                    .textContent - causes interop issues with web content
           Product: HTML WG
           Version: unspecified
          Platform: All
               URL: http://dev.w3.org/html5/spec/Overview.html#dom-option-
                    text
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P3
         Component: HTML5 spec (editor: Ian Hickson)
        AssignedTo: ian@hixie.ch
        ReportedBy: adrianba@microsoft.com
         QAContact: public-html-bugzilla@w3.org
                CC: mike@w3.org, public-html@w3.org


Created an attachment (id=906)
 --> (http://www.w3.org/Bugs/Public/attachment.cgi?id=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 "The text IDL attribute, on getting, must return the same value
as the textContent IDL attribute on the element" 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.

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
Received on Thursday, 5 August 2010 23:10:33 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 20:01:21 UTC