W3C home > Mailing lists > Public > whatwg@whatwg.org > July 2013

Re: [whatwg] HTML: A DOM attribute that returns the language of a node

From: Peter Occil <poccil14@gmail.com>
Date: Fri, 12 Jul 2013 20:19:17 -0400
Message-ID: <771E4287303644F88F4C46B69DE613B8@PeterPC>
To: "Ian Hickson" <ian@hixie.ch>
Cc: WHATWG <whatwg@whatwg.org>
Well, my true hope is that such a DOM attribute like "language" will be 
specified in the HTML or DOM spec.  Especially since it's not currently 
possible to get the language of a node through JavaScript methods alone. 
See [1] and its replies.

--Peter

[1]: http://lists.w3.org/Archives/Public/public-rdfa-wg/2013May/0064.html

-----Original Message----- 
From: Ian Hickson
Sent: Friday, July 12, 2013 3:48 PM
To: Peter Occil
Cc: WHATWG
Subject: Re: [whatwg] HTML: A DOM attribute that returns the language of a 
node

On Wed, 24 Apr 2013, Peter Occil wrote:
>
> Well in my case, I have written an HTML parser in Java and C# [1][2],
> which parses HTML documents and returns an object that implements a
> subset of the DOM, so far.  As far as possible, I included only methods
> and attributes that were specified in the DOM or HTML specification,
> such as the characterSet attribute (which is called getCharacterSet on
> my DOM's IDocument interface), and more recently the innerHTML attribute
> (which is called getInnerHTML on my DOM's IElement interface)
>
> However, when I decided to implement an RDFa processor based on my HTML
> parser, I had need to include a method that returns the language of a
> node (see, for example, section 3.3 of reference [3]). As a result, I
> included a method called getLanguage on my DOM's INode interface (which
> may correspond to a possible--future--DOM attribute called "language" on
> the Node interface).  I feel uneasy having to include this extension to
> what ought to be a subset of the HTML DOM.

Implementations of HTML and the DOM are allowed to have internal methods
to do things like this. There's no reason to limit yourself to the API
visible to JavaScript.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.' 
Received on Saturday, 13 July 2013 00:20:25 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:03 UTC