Subject: Re: Atom Bidi Draft Update - Informal Last Call

From: "Franklin Tse" <[email-masked]>
Date: Fri, 13 Apr 2007 10:39:51 +0800

Hi,

The "dir" attribute of Atom allows an empty string indicating that no base-direction is specified. However, the one in HTML allows the value of the attribute to be either "ltr" or "rtl", the empty string leads to extra cost in transforming Atom to HTML.

<xsl:if test="@dir='ltr' or @dir='rtl'">
	<xsl:attribute name="dir">
		<xsl:value-of select="@dir" />
	</xsl:attribute>
</xsl:if>

In additional, dir="" can be replaced by not using any "dir" attribute in the element. So, I don't think there is a need to allow dir="".

Regards,
Franklin

----- Original Message -----
From: "James M Snell" <[email-masked]>
To: "Franklin Tse" <[email-masked]>
Cc: "Martin Duerst" <[email-masked]>; "atom-syntax" <[email-masked]>; "atom-protocol" <[email-masked]>
Sent: Wednesday, March 28, 2007 22:29
Subject: Re: Atom Bidi Draft Update - Informal Last Call

> I'd be fine with this also.  There's no immediate rush for this but it
> would be excellent if implementors could start taking a look at it.
> 
> - James
> 
> Franklin Tse wrote:
>> I don't think we are in a hurry to move the draft to an RFC, so, can the draft be held in the "Draft" stage and issue a call for implementations? The future of the draft should be based on the implementation reports received.
>> 
>> Franklin
>> 
>> ----- Original Message -----
>> From: "Martin Duerst" <[email-masked]>
>> To: "James M Snell" <[email-masked]>; "Franklin Tse" <[email-masked]>
>> Cc: "atom-syntax" <[email-masked]>; "atom-protocol" <[email-masked]>
>> Sent: Wednesday, March 28, 2007 15:29
>> Subject: Re: Atom Bidi Draft Update - Informal Last Call
>> 
>>> At 02:25 07/03/23, James M Snell wrote:
>>>> It is not year clear if there has been enough independent implementation
>>>> of the specification to justify publishing it as a proposed standard.
>>> There is no need for implementations when going to Proposed Standard
>>> (of course, they never hurt). There is a well-defined need when going
>>> from Proposed Standard to Draft Standard, but that's way in the future.
>>>
>>> Regards,     Martin.
>>>
>>>
>>> #-#-#  Martin J. Du"rst, Assoc. Professor, Aoyama Gakuin University
>>> #-#-#  http://www.sw.it.aoyama.ac.jp       mailto:[email-masked]     
>>>
>>>
>> 
>

---

From: James M Snell <[email-masked]>
Date: Thu, 12 Apr 2007 20:23:58 -0700

A dir="" cannot be replaced by not using a "dir" at all because the
"dir" attribute is inherited.  The empty string effectively resets the
direction context while a missing dir means use the inherited value.

One of the arguments in favor of the empty string is to allow the
directionality of entry metadata to be set without affecting the default
directionality of the content... e.g.,

  <entry dir="rtl">
    <title>{rtl text}</title>
    ...
    <content type="html" dir="">
      &lt;p&gt;{no base direction}&lt;/p&gt;
    </content>
  </entry>

Here, the HTML content could have come from anywhere and may not
necessarily be under the control of whatever piece of code generated the
entry.  It originally had no explicitly established directionality.
Without the dir="", however, it would automatically inherit the
dir="rtl" from the containing entry, which significantly and wrongly
changes the semantics of the html content.

If folks do not think this really is a problem, then I'd have no problem
pulling the empty string value out.

- James

---

From: <[email-masked]>
Date: Fri, 13 Apr 2007 18:02:27 +0800

From the example, I am not sure what the feed author wants. So far there are only two directionalities allowed, left-to-right and right-to-left. In the example, the directionality of atom:entry is "rtl", there is no reason for the author to reset the directionality with an empty string. He should either change the directionality to "ltr" in atom:content or keep "rtl" by not using any "dir" attribute in atom:content.

On the other hand, I don't think always allowing direction guessing is good since guessing is not allowed in HTML and XHTML content.

For example:

<entry xml:lang="ar">
  <title>مفتاح معايير الويب!</title>
  <content type="xhtml">
    <div xmlns="http://www.w3.org/1999/xhtml"><span xml:lang="ar">مفتاح معايير الويب!</span></div>
  </content>
  <rights xml:lang="en">Copied from http://www.w3.org/International/tests/sec-inline-bidi-1.html</rights>
</entry>

If direction guessing is activated, <title>مفتاح معايير الويب!</title> will be displayed as !مفتاح معايير الويب. However, the direction guessed MUST NOT be inherited to the XHTML content.

So, I think a claficifiation in the Direction Guessing Section is needed.

For example:

The "dir" attribute SHALL be used when directionality is necessary to be changed. However, for compatibility with existing Atom documents that rely on direction guessing, user agents MAY perform direction guessing in Atom documents that do not contain a "dir" attribute but they MUST NOT do so when Atom documents contain a "dir" attribute.

Franklin

---

From: James M Snell <[email-masked]>
Date: Fri, 13 Apr 2007 07:57:44 -0700

>>From the example, I am not sure what the feed author wants. So far there are only two directionalities allowed, left-to-right and right-to-left. In the example, the directionality of atom:entry is…

Fair enough.  Removing dir="" requires that the feed publisher always
explicitly set the direction.  It simplifies processing and helps to
eliminate guessing.  Those are compelling enough reasons.  In the next
iteration I'll remove the blank value.

> [snip]

+1. This is good.

> Franklin

Thanks!

- James

---

From: "Franklin Tse" <[email-masked]>
Date: Fri, 13 Apr 2007 23:43:00 +0800

> Thanks!

You're welcome, James.

However, there are still some issues. What should Atom processors do when they encounter a "dir" attribute with invalid or unknown value? 

For example:

<entry dir="rtl">
  <title dir="invalid">...</title>
  ...
</entry>

Should the directionality of atom:title continue to be right-to-left? In other words, should the dir="invalid" be ignored and keep the directionality inheritance? Or, is the recovery action left to be implementation-dependent?

Franklin

---

From: James M Snell <[email-masked]>
Date: Fri, 13 Apr 2007 08:49:00 -0700

My preference is that invalid values are silently ignored and that the
directionality is inherited.

- James

---

From: "Franklin Tse" <[email-masked]>
Date: Fri, 13 Apr 2007 23:55:01 +0800

I agree. Should this be specify in the next draft?

Franklin

---

From: James M Snell <[email-masked]>
Date: Fri, 13 Apr 2007 09:01:35 -0700

Yes. I'll be sure to add it.

---

From: "James Holderness" <[email-masked]>
Date: Fri, 13 Apr 2007 18:31:29 +0100

James M Snell wrote:
>>>From the example, I am not sure what the feed author wants. So far there 
>>>are only two directionalities allowed, left-to-right and right-to-left. 
>>>In the example, the directionality of atom:entry is "rtl", there is no 
>>>reason for the author to reset the directionality with an empty string. 
>>>He should either change the directionality to "ltr" in atom:content or 
>>>keep "rtl" by not using any "dir" attribute in atom:content.
>

What would a planet feed do when aggregating content from other feeds that 
may not have explicit directionality? If I'm understanding things correctly, 
you would lose the ability to use the dir attribute on the root of the feed, 
because there would be no way of overriding it for feed items whose 
directionality was unknown.

Not that that's the end of the world. I just want to be sure that you 
realise you'd be losing that functionality.

Regards
James

---

From: James M Snell <[email-masked]>
Date: Fri, 13 Apr 2007 11:05:21 -0700

Yep. I'm aware of this side effect.  The question is whether or not this
 is an issue.  It basically is going to come down to defaults; that is,
if no direction is specified, and the direction cannot be determined
from some other means, can I safely assume a default value of "ltr".. in
which case, I can specify dir="rtl" at the feed level, and throw in a
dir="ltr" on entries that otherwise did not have any directionality
specified.  If that is an acceptable behavior (which I think it might
be) then there is no problem dropping the empty string value.  If it is
not an acceptable behavior, then we need the empty string value.

- James

James Holderness wrote:
>>>> From the example, I am not sure what the feed author wants. So far
>>>> there are only two directionalities allowed, left-to-right and
>>>> right-to-left. In the example, the directionality of atom:entry is
>>>> "rtl", there is no reason for the author to reset the directionality
>>>> with an empty string. He should either change the directionality to
>>>> "ltr" in atom:content or keep "rtl" by not using any "dir" attribute
>>>> in atom:content.
>>
> What would a planet feed do when aggregating content from other feeds
> that may not have explicit directionality? If I'm understanding things
> correctly, you would lose the ability to use the dir attribute on the
> root of the feed, because there would be no way of overriding it for
> feed items whose directionality was unknown.
>

---

From: "Franklin Tse" <[email-masked]>
Date: Sat, 14 Apr 2007 02:07:46 +0800

If the other feeds contain any "dir" attribute, the aggregator can simply copy the entries.

If the other feeds do not contain any "dir" attribute, the aggregator may generate "dir" attributes for those entries in the aggregated feed based on direction guessing.

Franklin

---

From: James M Snell <[email-masked]>
Date: Fri, 13 Apr 2007 11:43:14 -0700

Franklin Tse wrote:
> 
> [snip]...based on direction guessing.
> 

Or by applying a reasonable default. X/HTML assumes LTR by default,
there's no reason that cannot also apply to Atom.

- James

---

From: "Franklin Tse" <[email-masked]>
Date: Sat, 14 Apr 2007 11:47:33 +0800

"ltr" is a reasonable default, but it seems that the default value is currently not specified in the draft.

Franklin