W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2011

Re: [DOM4] XML lang

From: Marcos Caceres <w3c@marcosc.com>
Date: Wed, 5 Oct 2011 16:51:14 +0200
To: Boris Zbarsky <bzbarsky@mit.edu>
Cc: public-webapps@w3.org
Message-ID: <1F7A1EE1C8164A958958C42710F170DE@marcosc.com>

On Wednesday, October 5, 2011 at 4:36 PM, Boris Zbarsky wrote:

> On 10/5/11 4:14 AM, Marcos Caceres wrote:
> > 1. I need to find elements of a particular type/name that are in a particular language (in tree order), so that I can extract that information to display to a user.
> This use case is handled by querySelectorAll and :lang, no?
Ah, yes. I'll try that. 
> > 2. I need to check what the language of an element is (if any), without walking up the tree to look for an xml:lang attribute. Walking the tree is expensive, specially when XML says that xml:lang value is inherited by default.
> So what you really want is for the UA to do the tree-walk for you 
> instead? I doubt any UA is going to burn memory on storing the language 
> on every element just so they can quickly answer the rare question posed 
> above...
Agreed. My case is fairly unique. Probably would not warrant it. 
> Now a tree-walk in the UA code may be faster than doing it from JS. But 
> it'll still be a treewalk.
> A better reason for doing this would be that there are sources of 
> language information that are not xml:lang. Or do you explicitly not 
> want to take those into account?
I was not planning on any other sources. 
> One other question: "expensive" is a relative term. How often do you 
> expect to perform this operation?
Not very in my case. The document is static. 
Received on Wednesday, 5 October 2011 14:51:48 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:26:36 UTC