W3C home > Mailing lists > Public > whatwg@whatwg.org > December 2006

[whatwg] textContent and bidi

From: fantasai <fantasai.lists@inkedblade.net>
Date: Fri, 01 Dec 2006 05:20:40 -0500
Message-ID: <457001F8.2080207@inkedblade.net>
Ian Hickson wrote:
> On Sun, 26 Nov 2006, fantasai wrote:
>> Ran across this comment:
>>
>> http://www.whatwg.org/specs/web-apps/current-work/#features
>>
>>   # Should textContent be defined differently for dir="" and <bdo>?
>>
>> What would it mean to define textContent differently for dir="" and <bdo>?
> 
> The question is really whether we want an attribute that, when it 
> serialises the DOM, serialises things like <img alt=""> to the element's 
> alt text, serialises things like dir="" to embed the requisite bidi 
> formatting characters, etc. (Obviously we can't redefine textContent 
> itself, and innerText is subtly different as well.)

Yeah, I can see how that would be interesting.

Note, that for <bdo> in a CSS browser, the equivalent bidi formatting
codes will depend on the display value of the element and its descendants.
   http://www.w3.org/TR/CSS21/visuren.html#propdef-unicode-bidi
If you did that, you'd have to define the codes independently of CSS.

BTW, for 'dir', I think the inheritance behavior should be a little more
clearly specified:

# If the attribute is omitted or has another value, then the directionality
# is unchanged.

Unchanged from what?

You should specify that the initial value (i.e. what <html> gets in the
absence of any other declarations) is ltr.

You should also somehow make a reference (either directly or indirectly)
to UAX 9. Your text doesn't anywhere specify what "directionality" means.
The closest we get is an example referencing CSS2.1's sample style sheet.
Saying only that the processing layer is responsible for handling the 'dir'
attribute not only doesn't give enough information about what is expected,
it also doesn't normatively require use of the Unicode bidi algorithm rather
than some other bidi algorithm. (Other bidi algorithms do exist.)

# For example, CSS 2.1 defines a mapping from this attribute to the CSS
# 'direction' and 'unicode-bidi' properties

s/defines/suggests/
The sample style sheet is informative. THe only normative text about handling
'dir' in CSS2.1 is a sentence that says bidi behavior in HTML is defined by
the HTML 4 specification.

~fantasai
Received on Friday, 1 December 2006 02:20:40 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:30 UTC