- From: Alex Milowski <alex@milowski.com>
- Date: Thu, 6 Jun 2013 15:50:54 -0700
- To: RDFa WG <public-rdfa-wg@w3.org>
- Message-ID: <CABp3FNLyJWuhP27NaDu1sVzr0dk9=9y2UBDUdU4ZQ4ERktnbgg@mail.gmail.com>
I agree that following the HTML5 specification is the right thing to do. That just means that browser-based implementations can't conform in this situation. There is a bit of an inconsistency between 3.1 "Additional RDFa Processing Rules" and 3.3 "Specifying the Language for a Literal" as the RDFa Core 1.1 says the language is undefined [1] in the evaluation context when you start but for this to work, the language would be retrieved from the "environment" somehow once it was available. To really handle what the HTML5 says, 3.1 should really say that the language in the evaluation context is set to the fallback language as determined per HTML5. These are all "should" at this point. [1] http://www.w3.org/TR/rdfa-core/#evaluation-context On Thu, Jun 6, 2013 at 9:15 AM, Manu Sporny <msporny@digitalbazaar.com>wrote: > On 05/31/2013 01:10 PM, Alex Milowski wrote: > > I dug into this a bit and essentially, as Peter points out, the > > "lang" property on any element node in the DOM is mostly useless for > > determining the language of a node. The language is defined in > > HTML5 as the nearest ancestor with an lang/xml:lang attribute [1]. If > > there is no such ancestor, the "pragma-set default language" is used > > (i.e. the "meta" element with http-equiv="content-language"). > > I had a chat with the guys working on the HTML5 spec and DOM spec about > this particular topic. The answer is a bit more complicated than we'd > like it to be, but I think the logic on it is clear. Here's a link to > the discussion: > > http://krijnhoetmer.nl/irc-logs/whatwg/20130606#l-554 > > and a link to the DOM bug on this particular issue: > > https://www.w3.org/Bugs/Public/show_bug.cgi?id=16489 > > Just to be clear, this issue occurs when a Content-Language is set via > an HTTP header and the document does not contain any language > information. When processing an HTML5+RDFa document, a Javascript-based > processor would think there was no language and a processor that has > access to the HTTP response would set the language correctly. > > We have a couple of options moving forward: > > 1. Create a language discovery mechanism unique to HTML+RDFa. > 2. Ignore Content-Language. > 3. Follow the HTML5 spec wrt. language discovery. > > Doing #1 and #2 basically equate to the same thing. We end up creating > our own language discovery mechanism in RDFa and it's incompatible with > all of the host languages. The editors of the HTML5 and DOM specs > thought that this would be a bad direction and I agree with them. > > The third option seems to be the most logical approach forward. The > specification would stay as it is right now. Implementations must follow > the HTML5 processing rules wrt. setting an element's language. The > downside with this approach is that until the DOM bug above is fixed, > Javascript-based processors will be non-conforming in this particular > edge case (when the document's language is only set using > Content-Language). The HTML5 and DOM spec authors agreed that this is > the correct approach forward. > > To mitigate this issue, we can make a minor editorial change to the > specification that states that authors SHOULD specify the language of > their document in the document if they want to ensure that all RDFa > processors will be capable of discovering the correct language for the > document. > > The premise is that there are not a large percentage of documents out > there that are served in this way (it's a corner case), and addressing > the issue is fairly trivial (specify the document language in the > document itself). > > Peter, Alex - does that solution work for each of you? > > -- manu > > -- > Manu Sporny (skype: msporny, twitter: manusporny, G+: +Manu Sporny) > Founder/CEO - Digital Bazaar, Inc. > blog: Meritora - Web payments commercial launch > http://blog.meritora.com/launch/ > -- --Alex Milowski "The excellence of grammar as a guide is proportional to the paucity of the inflexions, i.e. to the degree of analysis effected by the language considered." Bertrand Russell in a footnote of Principles of Mathematics
Received on Thursday, 6 June 2013 22:51:23 UTC