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

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

From: Ian Hickson <ian@hixie.ch>
Date: Fri, 12 Jul 2013 19:48:39 +0000 (UTC)
To: Peter Occil <poccil14@gmail.com>
Message-ID: <alpine.DEB.2.00.1307121947450.15729@ps20323.dreamhostps.com>
Cc: WHATWG <whatwg@whatwg.org>
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 Friday, 12 July 2013 19:49:02 UTC

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